📄 conceptapl2.java
字号:
return ivjPage1;
}
/**
* Return the Pane2 property value.
* @return javax.swing.JPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getPage2() {
if (ivjPage2 == null) {
try {
ivjPage2 = new javax.swing.JPanel();
ivjPage2.setName("Page2");
ivjPage2.setLayout(getPage2GridLayout());
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjPage2;
}
/**
* Return the Page2GridLayout property value.
* @return java.awt.GridLayout
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.GridLayout getPage2GridLayout() {
java.awt.GridLayout ivjPage2GridLayout = null;
try {
/* Create part */
ivjPage2GridLayout = new java.awt.GridLayout(4, 3);
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
};
return ivjPage2GridLayout;
}
/**
* Return the Page3 property value.
* @return javax.swing.JPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JPanel getPage3() {
if (ivjPage3 == null) {
try {
ivjPage3 = new javax.swing.JPanel();
ivjPage3.setName("Page3");
ivjPage3.setLayout(null);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjPage3;
}
public Conceptnode getroot() {
//the greatgrandparent generation
Conceptnode a1 = new Conceptnode("t1");
Conceptnode a2 = new Conceptnode("t2");
Conceptnode a3 = new Conceptnode("t3");
Conceptnode a4 = new Conceptnode("t4");
Conceptnode a5 = new Conceptnode("t5");
Conceptnode a6 = new Conceptnode("t6");
Conceptnode b1 = new Conceptnode("b1");
Conceptnode b2 = new Conceptnode("b2");
Conceptnode b3 = new Conceptnode("b3");
Conceptnode b4 = new Conceptnode("b4");
Conceptnode b5 = new Conceptnode("b5");
Conceptnode b6 = new Conceptnode("b6");
Conceptnode b7 = new Conceptnode("b7");
Conceptnode b8 = new Conceptnode("b8");
Conceptnode b9 = new Conceptnode("b9");
Conceptnode c1 = new Conceptnode("c1");
Conceptnode c2 = new Conceptnode("C2");
Conceptnode c3 = new Conceptnode("c3");
Conceptnode c4 = new Conceptnode("c4");
Conceptnode c5 = new Conceptnode("c5");
Conceptnode c6 = new Conceptnode("c6");
Conceptnode c7 = new Conceptnode("c7");
Conceptnode c8 = new Conceptnode("c8");
Conceptnode c9 = new Conceptnode("c9");
Conceptnode d1 = new Conceptnode("d1");
Conceptnode d2 = new Conceptnode("d2");
/*Conceptnode.linkFamily(a1,new Conceptnode[] {b1,b2,b3,b4});
Conceptnode.linkFamily(a3,new Conceptnode[] {b5,b6,b7});
Conceptnode.linkFamily(a5,new Conceptnode[] {b8,b9});
Conceptnode.linkFamily(b3,new Conceptnode[] {c1,c2,c3});
Conceptnode.linkFamily(b4,new Conceptnode[] {c4,c5,c6});
Conceptnode.linkFamily(b8,new Conceptnode[] {c7,c8,c9});
Conceptnode.linkFamily(c4,new Conceptnode[] {d1,d2});*/
/*Conceptnode.linkFamily(a1,new Conceptnode[] {b1,b2,b3,b4});
Conceptnode.linkFamily(a2,new Conceptnode[] {b5,b6,b7});
Conceptnode.linkFamily(a1,new Conceptnode[] {a2});
Conceptnode.linkFamily(b3,new Conceptnode[] {c1,c2,c3});
Conceptnode.linkFamily(b4,new Conceptnode[] {c4,c5,c6});
Conceptnode.linkFamily(b5,new Conceptnode[] {c7,c8,c9});
Conceptnode.linkFamily(c7,new Conceptnode[] {d1,d2});*/
return a1;
}
/**
* Return the SaveButton property value.
* @return javax.swing.JButton
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JButton getSaveButton() {
if (ivjSaveButton == null) {
try {
ivjSaveButton = new javax.swing.JButton();
ivjSaveButton.setName("SaveButton");
ivjSaveButton.setToolTipText("save");
ivjSaveButton.setText("");
ivjSaveButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
ivjSaveButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
ivjSaveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Save24.gif")));
ivjSaveButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjSaveButton;
}
/**
* Return the Statustextarea property value.
* @return javax.swing.JTextArea
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JTextArea getstatusTextArea() {
if (statusTextArea == null) {
try {
statusTextArea = new javax.swing.JTextArea();
statusTextArea.setName("Statustextarea");
statusTextArea.setRows(3);
statusTextArea.setBounds(0, -33, 160, 153);
statusTextArea.setColumns(50);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return statusTextArea;
}
public Conceptnode gettreeroot() {
//Vector avector = getConceptList1();
Vector avector = getConceptList();
int size = avector.size();
//Enumeration enum = avector.elements();
ConceptModel aconcept = null;
//String parentid = aparentid;
Conceptnode anode = null;
Conceptnode rootnode = null;
int root = 0;
Vector anodevector = new Vector();
for (Enumeration enum = avector.elements(); enum.hasMoreElements() ;) {
aconcept=(ConceptModel)enum.nextElement();
//change concept tp conceptnode
if (Integer.valueOf(lastID).compareTo(Integer.valueOf(aconcept.getConceptID()))<0)
{
lastID = aconcept.getConceptID();
}
anode = new Conceptnode(aconcept);
anodevector.addElement(anode);
log(aconcept.getConceptID()+" "+aconcept.getName()+" "+aconcept.getDescription());
if (anode.getConceptID().equals(anode.getParentID()))
{
rootnode=anode;
}
}
for (int i=0; i< size;i++) {
Conceptnode anode1 = (Conceptnode)anodevector.elementAt(i);
for (int j=0; j< size;j++)
{
Conceptnode anode2 = (Conceptnode)anodevector.elementAt(j);
//if ((anode2.getParent()==anode1.getConceptID())&&(i!=j))
if ((anode2.getParentID().equals(anode1.getConceptID()))&&(i!=j))
{
Conceptnode.linkFamily((Conceptnode)anodevector.elementAt(i),(Conceptnode)anodevector.elementAt(j));
}
}
}
//return (Conceptnode)anodevector.elementAt(0);
return rootnode;
}
/**
* Called whenever the part throws an exception.
* @param exception java.lang.Throwable
*/
private void handleException(java.lang.Throwable exception) {
/* Uncomment the following lines to print uncaught exceptions to stdout */
System.out.println("--------- UNCAUGHT EXCEPTION ---------");
// exception.printStackTrace(System.out);
}
//***************************************************************************** endofadd
/**
* Initializes the applet.
*/
public void init() {
try {
setName("Conceptapl2");
setSize(700, 450);
setContentPane(getJAppletContentPane());
// user code begin {1}
ivjLoadButton.addActionListener(new ivjLoadButtonActionListener());
ivjNewButton.addActionListener(new ivjNewButtonActionListener());
ivjEditButton.addActionListener(new ivjEditButtonActionListener());
// get the host name and port of the applet's web server
URL hostURL = getCodeBase();
hostName = hostURL.getHost();
port = hostURL.getPort();
if (port == -1)
{
port = 80;
}
log("Web Server host name: " + hostName);
webServerControlStr = "http://" + hostName + ":" + port + servletcontrolPath;
webServerConceptstrStr = "http://" + hostName + ":" + port + servletconceptstrPath;
webServerConceptStr = "http://" + hostName + ":" + port + servletconceptPath;
webServerReadStr = "http://" + hostName + ":" + port + servletreadPath;
//webServerStr = "http://" + hostName + servletPath;
log("Web String Control full = " + webServerControlStr);
//eventgr = new Eventgenerator();
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
/**
* Simple logging method for status message in the text area.
*/
protected void log(String msg)
{
statusTextArea.append(msg + "\n");
}
/**
* main entrypoint - starts the part when it is run as an application
* @param args java.lang.String[]
*/
public static void main(java.lang.String[] args) {
try {
Frame frame = new java.awt.Frame();
Conceptapl2 aConceptapl2;
Class iiCls = Class.forName("org.impact.stars.appclient.concept.Conceptapl2");
ClassLoader iiClsLoader = iiCls.getClassLoader();
aConceptapl2 = (Conceptapl2)java.beans.Beans.instantiate(iiClsLoader,"org.impact.stars.appclient.concept.Conceptapl2");
//aConceptapl2= new Conceptapl2();
frame.add("Center", aConceptapl2);
frame.setSize(aConceptapl2.getSize());
frame.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
};
});
frame.setVisible(true);
} catch (Throwable exception) {
System.err.println("Exception occurred in main() of javax.swing.JApplet");
exception.printStackTrace(System.out);
}
}
/**
* Called when the mouse has been clicked.
* @param e the received event
*/
public void mouseClicked(MouseEvent e) {
System.out.println("mouseClicked");
}
/**
* Called when the mouse has been dragged.
* @param e the received event
*/
public void mouseDragged(MouseEvent e) {
System.out.println("mouseDragged");
}
/**
* Called when the mouse has entered a window.
* @param e the received event
*/
public void mouseEntered(MouseEvent e) {
System.out.println("mouseEntered");
}
/**
* Called when the mouse has exited a window.
* @param e the received event
*/
public void mouseExited(MouseEvent e) {
System.out.println("mouseExited");
}
/**
* Called when the mouse has been moved.
* @param e the received event
*/
public void mouseMoved(MouseEvent e) {
System.out.println("mouseMoved");
}
/**
* Called when a mouse button has been pressed.
* @param e the received event
*/
public void mousePressed(MouseEvent e) {
System.out.println("mousePressed");
}
/**
* Called when a mouse button has been released.
* @param e the received event
*/
public void mouseReleased(MouseEvent e) {
System.out.println("mouseReleased");
}
/**
* Pads a string w/ extra spaces if it is shorter than the COLUMN_WIDTH
*/
protected String padString(String text)
{
StringBuffer result = null;
System.out.println(text.length());
System.out.println("----------");
if (text.length() < COLUMN_WIDTH)
{
int count = COLUMN_WIDTH - text.length();
result = new StringBuffer(text);
for (int i=0; i < count; i++)
{
result.append(" ");
}
}
else
{
result = new StringBuffer(text.substring(0, COLUMN_WIDTH));
}
return result.toString();
}
/**
* Paints the applet.
* If the applet does not need to be painted (e.g. if it is only a container for other
* awt components) then this method can be safely removed.
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -