|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JTree diamondedge.swing.DsTree
public class DsTree
DsTree is a drop-in replacement for JTree. It displays a hierarchical list of DsTreeNode objects, each of which consists of a label and an optional icon. The class extends JTree with more formatting and styles on individual TreeNodes and sorting.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTree |
---|
JTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static short |
CHILD
|
static int |
CLOSED_ICON
|
static short |
FIRST
|
protected IconList |
iconlist
|
static short |
LAST
|
protected DsTreeNode |
lastNodeEdited
|
static int |
LEAF_ICON
|
static short |
NEXT
|
static int |
OPENED_ICON
|
static short |
PREVIOUS
|
static int |
SELECTED_ICON
|
static int |
TOGGLE_ICON
|
static int |
TOGGLE_SEL_ICON
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DsTree()
|
|
DsTree(DsTreeModel model)
|
|
DsTree(DsTreeNode root)
|
Method Summary | |
---|---|
void |
addItemListener(ItemListener l)
Adds an ItemListener to monitor the state of the checkbox . |
void |
editingCanceled(ChangeEvent e)
This tells the listeners the editor has canceled editing |
void |
editingStopped(ChangeEvent e)
This tells the listeners the editor has ended editing |
protected static DsTreeNode |
getDefaultTree()
Creates and returns a sample tree of nodes. |
Icon |
getIcon(int i)
|
IconList |
getIconList()
Returns the IconList control to be used. |
DsTreeNode |
getNode(int index)
Returns a specific DsTreeNode in the tree by position. |
DsTreeNode |
getNode(String key)
Returns a specific DsTreeNode in the tree by key. |
DsTreeModel |
getNodes()
Returns the model which is a collection of DsTreeNode objects. |
String |
getPathSeparator()
Returns the delimiter string used for the path returned by the FullPath property. |
int |
getSelectedIndex()
Returns the index to the currently selected node. |
DsTreeNode |
getSelectedNode()
Returns the currently selected node. |
Object[] |
getSelectedObjects()
Returns an array (length 1) containing the last ListItem edited or null . |
boolean |
isIconVisible()
Returns a value that determines whether an icon is displayed next to each item in the tree. |
boolean |
isShowingCheckBoxes()
Returns a value which determines if the control displays a checkbox next to each item in the tree. |
boolean |
isSorted()
Indicates whether the children of this node are automatically sorted alphabetically. |
void |
removeItemListener(ItemListener l)
Removes an ItemListener from the button. |
void |
setIcon(int i,
Object icon)
|
void |
setIconList(IconList i)
Sets the IconList control to be used. |
void |
setIconVisible(boolean val)
a value that determines whether an icon is displayed next to each item in the tree. |
void |
setModel(TreeModel newModel)
|
void |
setSelectedIndex(int index)
Sets the currently selected node by index. |
void |
setSelectedNode(DsTreeNode n)
Sets the currently selected node. |
void |
setShowingCheckBoxes(boolean val)
Sets a value which determines if the control displays a checkbox next to each item in the tree. |
void |
setSorted(boolean sort)
Indicates whether the children of this node are automatically sorted alphabetically. |
void |
updateUI()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short FIRST
public static final short LAST
public static final short NEXT
public static final short PREVIOUS
public static final short CHILD
public static final int LEAF_ICON
public static final int OPENED_ICON
public static final int CLOSED_ICON
public static final int SELECTED_ICON
public static final int TOGGLE_ICON
public static final int TOGGLE_SEL_ICON
protected IconList iconlist
protected DsTreeNode lastNodeEdited
Constructor Detail |
---|
public DsTree()
public DsTree(DsTreeNode root)
public DsTree(DsTreeModel model)
Method Detail |
---|
public void updateUI()
updateUI
in class JTree
protected static DsTreeNode getDefaultTree()
DsTreeNode
public DsTreeModel getNodes()
public void setModel(TreeModel newModel)
setModel
in class JTree
public DsTreeNode getNode(String key)
public DsTreeNode getNode(int index)
public int getSelectedIndex()
public void setSelectedIndex(int index)
public DsTreeNode getSelectedNode()
public void setSelectedNode(DsTreeNode n)
public boolean isSorted()
public void setSorted(boolean sort)
public String getPathSeparator()
public IconList getIconList()
public void setIconList(IconList i)
public Icon getIcon(int i)
public void setIcon(int i, Object icon)
public boolean isIconVisible()
public void setIconVisible(boolean val)
public boolean isShowingCheckBoxes()
public void setShowingCheckBoxes(boolean val)
public void editingCanceled(ChangeEvent e)
editingCanceled
in interface CellEditorListener
public void editingStopped(ChangeEvent e)
editingStopped
in interface CellEditorListener
public void addItemListener(ItemListener l)
ItemListener
to monitor the state of the checkbox
.
An ItemEvent is sent to the listener when the state of the checkbox has changed.
addItemListener
in interface ItemSelectable
l
- the ItemListener
to be addedpublic void removeItemListener(ItemListener l)
ItemListener
from the button.
removeItemListener
in interface ItemSelectable
l
- the ItemListener
to be removedpublic Object[] getSelectedObjects()
null
.
getSelectedObjects
in interface ItemSelectable
null
|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |