|
||||||||||
| 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.JPanel
|
+--arlut.csd.JTree.treeControl
This component allows the display of a tree structured graph of nodes, each node being a small image and a line of text. Nodes with children can be opened or closed, allowing the child nodes to be made visible or hidden. Each node can be selected and can have a pop-up menu attached. Nodes can be dragged, with both 'drag-tween' and 'drag on' drag supported.
treeCallback,
treeNode,
Serialized Form| Field Summary | |
(package private) static int |
borderSpace
|
(package private) java.awt.Rectangle |
bounding_rect
|
(package private) arlut.csd.JTree.treeCallback |
callback
|
(package private) arlut.csd.JTree.treeCanvas |
canvas
|
(package private) arlut.csd.JTree.treeDragDropCallback |
dCallback
|
(package private) static boolean |
debug
|
static int |
DRAG_ICON
|
static int |
DRAG_LINE
|
static int |
DRAG_NONE
|
(package private) arlut.csd.JTree.treeNode |
dragAboveNode
|
(package private) arlut.csd.JTree.treeNode |
dragBelowNode
|
(package private) int |
dragMode
|
(package private) arlut.csd.JTree.treeNode |
dragNode
|
(package private) arlut.csd.JTree.treeNode |
dragOverNode
|
(package private) javax.swing.JScrollBar |
hbar
|
(package private) boolean |
hbar_visible
|
(package private) int |
maxWidth
|
(package private) arlut.csd.JTree.treeMenu |
menu
|
(package private) arlut.csd.JTree.treeNode |
menuedNode
|
(package private) int |
minWidth
|
(package private) arlut.csd.JTree.treeNode |
oldNode
|
(package private) arlut.csd.JTree.treeNode |
root
|
(package private) int |
row_height
|
(package private) java.util.Vector |
rows
|
(package private) javax.swing.JScrollBar |
vbar
|
(package private) boolean |
vbar_visible
|
| Fields inherited from class javax.swing.JPanel |
|
| 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.Container |
|
| 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 | |
treeControl(java.awt.Font font,
java.awt.Color fgColor,
java.awt.Color bgColor,
arlut.csd.JTree.treeCallback callback,
java.awt.Image[] images)
|
|
treeControl(java.awt.Font font,
java.awt.Color fgColor,
java.awt.Color bgColor,
arlut.csd.JTree.treeCallback callback,
java.awt.Image[] images,
arlut.csd.JTree.treeMenu menu)
|
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handle notification from popupmenus |
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Handles scrollbar events. |
(package private) void |
adjustScrollbars()
Check to see whether we need scrollbars in our current component size, set the min/max/visible parameters This method is intended to be called from reShape(). |
(package private) void |
breakdownTree(arlut.csd.JTree.treeNode node)
Helper function to break down links in a tree to speed GC. |
(package private) void |
clearStacks(arlut.csd.JTree.treeNode node)
Helper method to force recalculation of childStacks. |
void |
clearTree()
Clear out the tree. |
void |
contractNode(arlut.csd.JTree.treeNode node,
boolean repaint)
close the given node |
void |
contractNode(arlut.csd.JTree.treeNode node,
boolean repaint,
boolean doCallback)
close the given node |
void |
deleteNode(arlut.csd.JTree.treeNode node,
boolean repaint)
Removes a node from the tree, along with all its children. |
(package private) void |
doubleClickNode(arlut.csd.JTree.treeNode node)
|
void |
dumpRows()
|
void |
expandNode(arlut.csd.JTree.treeNode node,
boolean repaint)
open the given node |
void |
expandNode(arlut.csd.JTree.treeNode node,
boolean repaint,
boolean doCallback)
open the given node |
arlut.csd.JTree.treeNode |
getRoot()
Get access to the root of the treeCanvas's tree of nodes. |
(package private) void |
getVisibleDescendantRange(arlut.csd.JTree.treeNode node,
arlut.csd.JTree.Range range)
calculates the rows that are visible at and below node, so that contractNode() can remove all nodes in that range from visibility |
void |
insertNode(arlut.csd.JTree.treeNode newNode,
boolean repaint)
Inserts a new node into the tree. |
(package private) int |
makeDescendantsVisible(arlut.csd.JTree.treeNode node,
int row)
recursive routine to make descendant nodes visible. |
arlut.csd.JTree.treeNode |
moveNode(arlut.csd.JTree.treeNode node,
arlut.csd.JTree.treeNode parent,
arlut.csd.JTree.treeNode insertAfter,
boolean repaint)
Moves a node (possibly the root of an extensive subtree) from one location in the tree to another. Note that this method is currently implemented in a fairly simplistic manner, using the deleteNode and insertNode primitives, cloning nodes as they are copied into the new location in the tree. |
void |
refresh()
Recalculate and redraw the tree. |
(package private) void |
refreshTree()
|
void |
removeChildren(arlut.csd.JTree.treeNode node,
boolean repaint)
Removes all children of the specified node from the tree. |
(package private) void |
reShape()
This method recalculates the general parameters of our tree's display. |
void |
resize(int x,
int y,
int width,
int height)
|
(package private) void |
selectNode(arlut.csd.JTree.treeNode node)
Mark a node as selected, issuing a callback to the client reporting the selection. This method does not deselect other nodes. |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setDrag(arlut.csd.JTree.treeDragDropCallback dCallback,
int mode)
This method is used to set the drag behavior of the tree. |
void |
setMinimumWidth(int minWidth)
|
void |
setRoot(arlut.csd.JTree.treeNode root)
Clear the tree and establish a new root node. |
(package private) void |
transientSelectNode(arlut.csd.JTree.treeNode node)
Select a node without issuing a callback to the client. Used to implement highlighting during drag-and-drop. |
(package private) void |
transientUnselectNode(arlut.csd.JTree.treeNode node)
Deselect a node without issuing a callback to the client. Used to implement highlighting during drag-and-drop. |
(package private) void |
unselectAllNodes(boolean anySelected)
Deselect all nodes, issuing a callback to the client reporting the deselection. |
(package private) void |
unselectNode(arlut.csd.JTree.treeNode node,
boolean anySelected)
Deselect a node, issuing a callback to the client reporting the deselection. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
static final boolean debug
static final int borderSpace
public static final int DRAG_NONE
public static final int DRAG_ICON
public static final int DRAG_LINE
arlut.csd.JTree.treeNode root
arlut.csd.JTree.treeCallback callback
arlut.csd.JTree.treeCanvas canvas
arlut.csd.JTree.treeDragDropCallback dCallback
int dragMode
arlut.csd.JTree.treeNode oldNode
arlut.csd.JTree.treeNode dragNode
arlut.csd.JTree.treeNode dragOverNode
arlut.csd.JTree.treeNode dragBelowNode
arlut.csd.JTree.treeNode dragAboveNode
arlut.csd.JTree.treeMenu menu
javax.swing.JScrollBar hbar
javax.swing.JScrollBar vbar
java.awt.Rectangle bounding_rect
boolean hbar_visible
boolean vbar_visible
int minWidth
int maxWidth
int row_height
java.util.Vector rows
arlut.csd.JTree.treeNode menuedNode
| Constructor Detail |
public treeControl(java.awt.Font font,
java.awt.Color fgColor,
java.awt.Color bgColor,
arlut.csd.JTree.treeCallback callback,
java.awt.Image[] images,
arlut.csd.JTree.treeMenu menu)
font - Font for text in the Tree CanvasfgColor - Foreground color for text in the treeCanvascallback - Object to receive notification of eventsimages - Array of images to be used in the canvas; nodes refer to images by indexmenu - Popup menu to attach to the treeControl
public treeControl(java.awt.Font font,
java.awt.Color fgColor,
java.awt.Color bgColor,
arlut.csd.JTree.treeCallback callback,
java.awt.Image[] images)
font - Font for text in the Tree CanvasfgColor - Foreground color for text in the treeCanvascallback - Object to receive notification of eventsimages - Array of images to be used in the canvas; nodes refer to images by index| Method Detail |
public void setDrag(arlut.csd.JTree.treeDragDropCallback dCallback,
int mode)
dCallback - DragDrop manager objectmode - A binary or'ing of of treeControl.DRAG_NONE, treeControl.DRAG_ICON,
and treeControl.DRAG_LINE.treeDragDropCallbackpublic void clearTree()
public void setRoot(arlut.csd.JTree.treeNode root)
public void setMinimumWidth(int minWidth)
public void insertNode(arlut.csd.JTree.treeNode newNode,
boolean repaint)
Inserts a new node into the tree. newNode's prevSibling is checked first. If it is non-null, newNode is inserted after newNode.prevSibling, regardless of what newNode.parent says. If prevSibling is null, newNode is made the first child of its requested parent.
newNode - The node to be inserted. Properties of the node determine where the node is inserted.repaint - If true, immediately re-render and refresh the treeCanvas.
public void deleteNode(arlut.csd.JTree.treeNode node,
boolean repaint)
Removes a node from the tree, along with all its children. Any child nodes attached to the node to be deleted will be unlinked from one another. If you want to be able to re-insert the deleted node elsewhere in the tree, you probably should use moveNode() instead.
node - The node to be removed.repaint - If true, immediately re-render and refresh the treeCanvas.
public arlut.csd.JTree.treeNode moveNode(arlut.csd.JTree.treeNode node,
arlut.csd.JTree.treeNode parent,
arlut.csd.JTree.treeNode insertAfter,
boolean repaint)
node - The node to be moved.parent - Parent node to insert this node under, null if this is a top-level nodeinsertAfter - sibling to insert this node afterrepaint - If true, immediately re-render and refresh the treeCanvas after moving the node.
public void removeChildren(arlut.csd.JTree.treeNode node,
boolean repaint)
Removes all children of the specified node from the tree.
node - The node whose children should be removedrepaint - If true, immediately re-render and refresh the treeCanvas.void breakdownTree(arlut.csd.JTree.treeNode node)
void clearStacks(arlut.csd.JTree.treeNode node)
public arlut.csd.JTree.treeNode getRoot()
public void refresh()
public void dumpRows()
public void expandNode(arlut.csd.JTree.treeNode node,
boolean repaint)
public void expandNode(arlut.csd.JTree.treeNode node,
boolean repaint,
boolean doCallback)
int makeDescendantsVisible(arlut.csd.JTree.treeNode node,
int row)
row - the row to match the node to.
public void contractNode(arlut.csd.JTree.treeNode node,
boolean repaint)
public void contractNode(arlut.csd.JTree.treeNode node,
boolean repaint,
boolean doCallback)
void getVisibleDescendantRange(arlut.csd.JTree.treeNode node,
arlut.csd.JTree.Range range)
void transientSelectNode(arlut.csd.JTree.treeNode node)
void doubleClickNode(arlut.csd.JTree.treeNode node)
void selectNode(arlut.csd.JTree.treeNode node)
void transientUnselectNode(arlut.csd.JTree.treeNode node)
void unselectNode(arlut.csd.JTree.treeNode node,
boolean anySelected)
anySelected - If true, the client will be told
that some node will remain selected after this operation
is completedvoid unselectAllNodes(boolean anySelected)
anySelected - If true, the client will be told
that some node will remain selected after this operation
is completed.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
public void resize(int x,
int y,
int width,
int height)
public void setBounds(int x,
int y,
int width,
int height)
setBounds in class java.awt.Componentvoid reShape()
void adjustScrollbars()
void refreshTree()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||