|
SilverStream Application Server 3.5 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sssw.rt.form.AgoTreeControlNode
A node of an AgcTreeControl. This object is returned after a new item is added to a tree control, enabling the code to add new items after or under it, or to delete it later. AgcTreeControl is also returned when a tree item is selected, the item's text or argument can be retrieved. Associated with each node are a text string and a user data item, the latter being any object, defined by the programmer for any purpose (often to identify the particular node or to store data related to the node).
AgcTreeControl| Constructor Summary | |
AgoTreeControlNode()
|
|
| Method Summary | |
AgoTreeControlNode |
getChildNode()
Gets the first child of this node. |
int |
getFontStyle()
Returns the integer (AgoFontIdentifier constant) value specifying the font style of this node, (e.g. |
Image |
getImage()
Gets the image which is displayed for this node. |
AgoTreeControlNode |
getNextNode()
Gets the next tree node - that is, the sibling after this one. |
AgoTreeControlNode |
getParentNode()
Gets the parent of this node. |
AgoTreeControlNode |
getPreviousNode()
Gets the previous tree node - that is, the sibling before this one. |
String |
getText()
Gets the text associated with this node |
Object |
getUserData()
Gets the user data associated with this node. |
void |
setFontStyle(int style)
Sets the font style of this node. |
void |
setImage(Image image)
Sets the image to be displayed for this node. |
void |
setText(String text)
Sets the text associated with this node |
void |
setUserData(Object userData)
Sets the user data associated with this node. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public AgoTreeControlNode()
| Method Detail |
public String getText()
// extract the text associated with the currently selected node AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); String text = nodeSelected.getText();
public void setText(String text)
text - a String that will be used to set the text for this node
// set the text for the currently selected node to a different value
AgoTreeControlNode nodeSelected = tableTree.getSelectedNode();
nodeSelected.setText("New Value");
public Object getUserData()
// extract the user data associated with the currently selected node AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); Object stuff = nodeSelected.getUserData(); if (stuff instanceof String) System.out.println((String)stuff);
public void setUserData(Object userData)
userData - any programmer-defined Object
// set the user data for the currently selected node to a new value,
// a Vector containing an Integer and a Boolean
AgoTreeControlNode nodeSelected = tableTree.getSelectedNode();
Vector v = {new Integer(3), new Boolean(true)};
nodeSelected.setUserData(v);
public Image getImage()
// extract the image associated with the currently selected node AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); Image img = nodeSelected.getImage();
public void setImage(Image image)
image - an Image object to be associated with this node
// set the image to be displayed for the currently selected node
AgoTreeControlNode nodeSelected = tableTree.getSelectedNode();
Image myImage = getImage("employee.gif");
nodeSelected.setImage(myImage);
public int getFontStyle()
// get the font style for the currently selected node, and apply it to the node below AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); int fontStyle = nodeSelected.getFontStyle(); AgoTreeControlNode nextNode = nodeSelected.getNextNode(); if (nextNode != null) nextNode.setFontStyle(fontStyle);
public void setFontStyle(int style)
style - integer font identifier. Values can be BOLD, ITALIC, BOLDITALICBAND,
BOLDBAND, ITALICBAND, DEFALUTBAND.// get the font style for the currently selected node, and apply it to the node below AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); int fontStyle = nodeSelected.getFontStyle(); AgoTreeControlNode nextNode = nodeSelected.getNextNode(); if (nextNode != null) nextNode.setFontStyle(fontStyle);
public AgoTreeControlNode getNextNode()
// get the font style for the currently selected node, and apply it to the node below AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); int fontStyle = nodeSelected.getFontStyle(); AgoTreeControlNode nextNode = nodeSelected.getNextNode(); if (nextNode != null) nextNode.setFontStyle(fontStyle);
public AgoTreeControlNode getPreviousNode()
// see if the currently selected node has a sibling node preceding it, // and if so, delete the selected node AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); AgoTreeControlNode nodePrevious = nodeSelected.getPreviousNode(); if (nodePrevious != null) tableTree.remove(nodeSelected);
public AgoTreeControlNode getChildNode()
// see if the currently selected node has a child, and if so, delete the child node AgoTreeControlNode nodeSelected = tableTree.getSelectedNode(); AgoTreeControlNode nodeChild = nodeSelected.getChildNode(); if (nodeChild != null) tableTree.remove(nodeChild);
public AgoTreeControlNode getParentNode()
// find the topmost parent of the currently selected node
AgoTreeControlNode nodeSelected = tableTree.getSelectedNode();
AgoTreeControlNode nodeTop = nodeSelected;
AgoTreeControlNode nodeParent;
while ((nodeParent = nodeTop.getParentNode()) != null)
{
nodeTop = nodeParent;
}
System.out.println("Topmost parent is "+nodeTop.getText());
|
SilverStream Application Server 3.5 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||