|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
diamondedge.swing.DsTreeNode
public class DsTreeNode
A DsTreeNode
is a node displayed in a DsTree component. All model
in the tree must be of type DsTreeNode.
For examples of using trees and tree model, see
How to Use Trees
in The Java Tutorial and the documentation on DefaultMutableTreeNode.
A tree node may have at most one parent and 0 or more children.
DsTreeNode
provides operations for examining and modifying a
node's parent and children and also operations for examining the tree that
the node is a part of. A node's tree is the set of all model that can be
reached by starting at the node and following all the possible links to
parents and children. A node with no parent is the root of its tree; a
node with no children is a leaf. A tree may consist of many subtrees,
each node acting as the root for its own subtree.
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
|
DsTreeNode()
|
|
DsTreeNode(Object userObject)
Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object. |
|
DsTreeNode(Object userObject,
boolean allowsChildren)
Creates a tree node with no parent, no children, initialized with the specified user object, and that allows children only if specified. |
|
DsTreeNode(Object userObject,
String key)
Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object. |
protected |
DsTreeNode(Object userObject,
String key,
DsTreeModel model)
|
Method Summary | |
---|---|
boolean |
ensureVisible()
Ensures a DsTreeNode object is visible, scrolling or expanding the control if necessary. |
Color |
getBackground()
Returns the color that the background for a DsTreeNode object is displayed with. |
DsTreeNode |
getChild()
Returns a reference to the first child of a DsTreeNode object. |
Object |
getData()
|
DsTreeNode |
getFirstSibling()
Returns a reference to the first DsTreeNode object in a hierarchy level. |
Font |
getFont()
|
Color |
getForeground()
Returns the color that the text for a DsTreeNode object is displayed with. |
String |
getFullPath()
Returns the fully qualified name of a DsTreeNode object. |
int |
getHeight()
|
Icon |
getIcon(int i)
|
int |
getIndex()
Returns the order that the node was added to the tree. |
String |
getKey()
Returns the unique string of an object in a collection. |
DsTreeNode |
getLastSibling()
Returns a reference to the last DsTreeNode object in a hierarchy level. |
DsTreeModel |
getModel()
|
DsTreeNode |
getNext()
Returns a reference to the next sibling DsTreeNode object in a hierarchy level. |
DsTreeNode |
getParentNode()
Returns a reference to the previous DsTreeNode object in a hierarchy level. |
DsTreeNode |
getPrevious()
Returns a reference to the previous sibling DsTreeNode object in a hierarchy level. |
DsTreeNode |
getRootNode()
Returns a reference to the root DsTreeNode object of a DsTree control. |
int |
getSortOrder()
Returns whether the children will be sorted in ascending or descending order. |
String |
getText()
Returns the text to be displayed in a control. |
TreePath |
getTreePath()
|
void |
insert(MutableTreeNode newChild,
int childIndex)
|
boolean |
isChecked()
Returns a value that determines whether a DsTreeNode object is checked. |
boolean |
isExclusiveButton()
Returns a value that determines whether a DsTreeNode object is displayed as an exclusive button. |
boolean |
isExpanded()
Returns a value which specifies if a DsTreeNode object is expanded. |
boolean |
isFontBold()
Returns a value that determines whether the text for a DsTreeNode object is displayed with a bold font. |
boolean |
isIconVisible()
Returns a value that determines whether an icon is display for this DsTreeNode. |
boolean |
isSelected()
Returns a value which determines if a DsTreeNode object is selected. |
boolean |
isSorted()
Indicates whether the children of this node are automatically sorted alphabetically. |
boolean |
isToggleButton()
Returns a value that determines whether a DsTreeNode object is displayed as a ToggleButton. |
boolean |
isVisible()
|
void |
setBackground(Color c)
Sets the color that the background for a DsTreeNode object is displayed with. |
void |
setChecked(boolean val)
Sets a value that determines whether a DsTreeNode object is checked. |
void |
setData(Object obj)
|
void |
setExclusiveButton(boolean val)
Sets a value that determines whether a DsTreeNode object is displayed as an exclusive button. |
void |
setExpanded(boolean expand)
Sets a value which specifies if a DsTreeNode object is expanded. |
void |
setFont(Font f)
sets the font to be used for the node. |
void |
setFontBold(boolean val)
Sets a value that determines whether the text for a DsTreeNode object is displayed with a bold font. |
void |
setForeground(Color c)
Sets the color that the text for a DsTreeNode object is displayed with. |
void |
setHeight(int h)
sets the row height for the node. |
void |
setIcon(int i,
Object icon)
set the given icon. |
void |
setIconVisible(boolean val)
a value that determines whether an icon is display for this DsTreeNode. |
void |
setKey(String newkey)
Sets the unique string of an object in a collection. |
void |
setModel(DsTreeModel newmodel)
|
void |
setParent(MutableTreeNode newParent)
|
void |
setSelected(boolean select)
Sets a value which determines if a DsTreeNode object is selected. |
void |
setSorted(boolean sort)
Indicates whether the children of this node are automatically sorted alphabetically. |
void |
setSortOrder(int sortOrder)
Sets whether the children of this will be sorted in ascending or descending order. |
void |
setText(String s)
Sets the UserObject to the given string. |
void |
setToggleButton(boolean val)
Sets a value that determines whether a DsTreeNode object is displayed as a ToggleButton. |
void |
sort()
Sorts the children by comparing values for the UserObject property using the SortOrder property. |
void |
sort(int sortOrder)
Sorts the children by comparing values for the UserObject property. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DsTreeNode()
public DsTreeNode(Object userObject)
userObject
- the node's data (userObject.toString() is displayed)public DsTreeNode(Object userObject, boolean allowsChildren)
userObject
- the node's data (userObject.toString() is displayed)allowsChildren
- if true, the node is allowed to have child
nodes -- otherwise, it is always a leaf nodepublic DsTreeNode(Object userObject, String key)
userObject
- the node's data (userObject.toString() is displayed)key
- unique key used to lookup this node in the modelprotected DsTreeNode(Object userObject, String key, DsTreeModel model)
Method Detail |
---|
public DsTreeModel getModel()
public void setModel(DsTreeModel newmodel)
public String getText()
public void setText(String s)
public Icon getIcon(int i)
public void setIcon(int i, Object icon)
i
- one of DsTree.LEAF_ICON, DsTree.OPENED_ICON, DsTree.CLOSED_ICON,
DsTree.SELECTED_ICON, DsTree.TOGGLE_ICON, DsTree.TOGGLE_SEL_ICONicon
- an Integer object that is the index of the icon in the IconList collection
with the DsTree or a String that is the key into the IconList collection or
an Image object or an Icon object.public Font getFont()
public void setFont(Font f)
public Color getForeground()
public void setForeground(Color c)
public Color getBackground()
public void setBackground(Color c)
public Object getData()
public void setData(Object obj)
public String getKey()
public void setKey(String newkey)
public int getHeight()
public void setHeight(int h)
public boolean isSorted()
public void setSorted(boolean sort)
public int getSortOrder()
public void setSortOrder(int sortOrder)
sortOrder
- One of: DsConstants.ASCENDING, DsConstants.DESCENDING, DsConstants.ASCENDING_CASE, DsConstants.DESCENDING_CASEpublic void sort()
setSortOrder(int)
public void sort(int sortOrder)
sortOrder
- One of: DsConstants.ASCENDING, DsConstants.DESCENDING, DsConstants.ASCENDING_CASE, DsConstants.DESCENDING_CASEpublic boolean isFontBold()
public void setFontBold(boolean val)
public boolean isChecked()
public void setChecked(boolean val)
public boolean isToggleButton()
public void setToggleButton(boolean val)
public boolean isExclusiveButton()
public void setExclusiveButton(boolean val)
public boolean isIconVisible()
public void setIconVisible(boolean val)
public boolean isExpanded()
public void setExpanded(boolean expand)
public boolean isSelected()
public void setSelected(boolean select)
public boolean isVisible()
public boolean ensureVisible()
public int getIndex()
public DsTreeNode getFirstSibling()
public DsTreeNode getLastSibling()
public DsTreeNode getChild()
public DsTreeNode getNext()
public DsTreeNode getPrevious()
public DsTreeNode getParentNode()
public DsTreeNode getRootNode()
public String getFullPath()
public TreePath getTreePath()
public void insert(MutableTreeNode newChild, int childIndex)
insert
in interface MutableTreeNode
insert
in class DefaultMutableTreeNode
public void setParent(MutableTreeNode newParent)
setParent
in interface MutableTreeNode
setParent
in class DefaultMutableTreeNode
|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |