public class TTree
extends javax.swing.JTree
implements twaver.base.obfuscate.view.Tree, java.awt.dnd.Autoscroll
TWaver tree extends from Swing JTree and add a lot of new features for telecom OSS application use. The tree is work with a DataBox instance which works as the model and provides data for tree component. A internal Swing tree model instance is created and used, which is driven by the connected data box. In this way, developers can use TWaver tree easily if they know how to operate a data box. Developers do not need to know too much details about Swing JTree, TreeModel, TreeNode etc. All this details has been encapsulated in this TWaver tree component.
Create a tree component is very easy:
TDataBox box = new TDataBox(); TTree tree1 = new TTree(); tree1.setDataBox(box); //or TTree tree2 = new TTree(box);Most of the time, TWaver tree is often used with network component. Network represent network topology and tree represent the hierarchical structure for all databox contained data. Also, it can be used stand alone to replace Swing JTree component. No matter which way is used, a databox instance is needed to store all data for the tree.
In Swing JTree is view of MVC, TreeModel is model for MVC. In TWaver, the TWaver tree and TreeModel works as a bigger view of MVC, connected databox works as the model for MVC.
javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DropLocation, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected TDataBox |
box |
static int |
CHECK_CHILDREN_SELECTION
Define children checkbox selection mode.
|
static int |
CHECK_DESCENDANT_ANCESTOR_SELECTION
Define children checkbox selection mode.
|
static int |
CHECK_DESCENDANT_SELECTION
Define children checkbox selection mode.
|
static int |
CHECK_SELECTION
Define checkbox selection mode.
|
static int |
DEFAULT_SELECTION
Default selection mode.
|
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
TTree()
Create a tree.
|
TTree(TDataBox box)
Create a tree and connect to the given databox.
|
TTree(TDataBox box,
java.util.Comparator sortComparator)
Create a tree and connect to the given databox,
and use the given comparator to sort tree nodes.
|
TTree(TDataBox box,
Element treeRoot)
Create a tree and connect to the given databox,
and the given element is used as the tree root node.
|
TTree(TDataBox box,
Element treeRoot,
java.util.Comparator sortComparator)
Create a tree and connect to the given databox.
|
Modifier and Type | Method and Description |
---|---|
void |
addElementNodeDoubleClickedActionListener(java.awt.event.ActionListener l)
Add an action to listener response to the element tree node
double clicked event
|
void |
addLazyLoaderListener(LazyLoaderListener l) |
void |
addTreeNodeClickedActionListener(java.awt.event.ActionListener l)
Add an action response to node clicked event.
|
void |
addVisibleFilter(VisibleFilter filter)
Add a visible filter into this tree.
|
void |
autoscroll(java.awt.Point cursorLocation)
Call this to start to scroll tree viewport to the
cursor location.
|
void |
collapse(Element element)
Collapse the specified element's tree node itself.
|
void |
collapseAll()
Collapse all tree nodes.
|
void |
collapseAll(Element element)
Collapse the given element located tree node and all its descendant
tree nodes.
|
void |
collapseAll(javax.swing.tree.TreePath parent)
Collapse the specified tree path and all its descendant
tree nodes
|
void |
ensureVisible(java.util.Collection elements)
Scroll tree viewport to try to keep all given elements
are visible.
|
void |
ensureVisible(Element element)
Scrolls the view in such a way that the specified
element becomes visible, as far as possible.
|
void |
expand(Element element)
Expand given element tree node itself.
|
void |
expand(Element element,
int level)
Expand tree nodes from given element tree node to its
descendant until reach the given tree level.
|
void |
expand(int level)
Expand all tree nodes until reach the given tree level.
|
void |
expandAll()
Call this method to expand all tree nodes.
|
void |
expandAll(Element element)
Call this method to expand the
given element tree node and all its descendant.
|
void |
expandRoot()
Expand tree root node
|
java.awt.Insets |
getAutoscrollInsets()
Get autoscroll insets.
|
CheckableFilter |
getCheckableFilter()
Get the tree node checkable filter.
|
ChildrenSortableFilter |
getChildrenSortableFilter()
Gets the children sortable filter for this tree.
|
javax.swing.Icon |
getCollapsedIcon()
Gets the element node's collapsed icon.
|
protected java.awt.Component |
getCursorComponent()
Get mouse cursor parent component
|
TDataBox |
getDataBox()
Get the connected data box.
|
java.lang.String |
getDataBoxIconURL()
Get databox tree icon url.
|
DnDHandler |
getDnDHandler()
Gets the drag-and-drop handler.
|
Generator |
getElementBodyColorGenerator()
Returns the element body color generator for this tree.
|
Element |
getElementByRowIndex(int rowIndex) |
Generator |
getElementIconGenerator()
Get the generator, which used to create element tree icon for each
element.
|
EditableFilter |
getElementLabelEditableFilter()
Get tree installed element label editable filter.
|
ElementLabelEditor |
getElementLabelEditor()
Get installed element label editor.
|
Generator |
getElementLabelGenerator()
Gets generator for displaying the label of element on TView,
for example, the tree node label, the tree node label, etc.
|
java.util.List |
getElementNodeDoubleClickedActionListeners()
Gets all element node double clicked action listeners.
|
Generator |
getElementStateOutlineColorGenerator()
Returns the element state outline color generator for this tree.
|
Generator |
getElementToolTipTextGenerator()
Get element tooltip text generator.
|
javax.swing.Icon |
getExpandedIcon()
Gets the element node's expanded icon.
|
int |
getIconHeight()
Gets the icon height.
|
int |
getIconWidth()
Gets the icon width.
|
java.lang.String |
getLabel(java.lang.Object object)
Get label value for this tree node.
|
LazyLoader |
getLazyLoader()
Get tree node lazy loader.
|
ElementNode |
getLoadedTreeNodeByElement(Element element)
Get loaded tree node by given element.
|
PaintSelectionStateFilter |
getPaintSelectionStateFilter()
Get selection state paint filter.
|
PopupMenuFactory |
getPopupMenuFactory()
Get popup menu factory for tree.
|
PopupMenuGenerator |
getPopupMenuGenerator()
Get popup menu generator for tree.
|
AbstractTTreeNode |
getRootNode()
Get tree root node.
|
java.util.Comparator |
getSortComparator()
Get comparator for tree nodes sorting.
|
PropertyChangeFilter |
getSortPropertyChangeFilter() |
ElementNode |
getTreeNodeByElement(Element element)
Get tree node by given element.
|
javax.swing.tree.TreePath |
getTreePathByElement(Element element)
Gets element located tree path.
|
int |
getTristate(Element element)
Get tristate select value for the given element.
|
int |
getTTreeSelectionMode()
Get selection mode for TWaver tree component.
|
int |
getUncheckableStyle()
Gets the uncheckable style.
|
int |
getUncheckableStyle(Element element) |
java.util.List |
getVisibleFilters()
Gets all the visible filters that added to this tree.
|
protected void |
init()
Initialize tree component
|
protected void |
initDnD() |
boolean |
isAutoSyncSelectionFromDataBoxToView()
Determines whether synchronize selection from data box to this tree automatically.
|
boolean |
isAutoSyncSelectionFromViewToDataBox()
Determines whether synchronize selection from this tree to data box automatically.
|
boolean |
isCheckable(Element element)
Return whether the given element is checkable on tree.
|
boolean |
isCheckedWhenNotSpecified() |
boolean |
isChildrenSortable(Element parentElement)
Checks whether the given parent element's children need to be sorted.
|
boolean |
isClearSelectionOnMarginClicked()
Returns true if clearing selection when tree margin (blank area) is clicked.
|
boolean |
isDataBoxLabelEditable() |
boolean |
isDnDTarget(java.lang.Object target)
Checks the object is drag-and-drop target object.
|
boolean |
isElementDraggable()
Returns true if the tree node is drag-and-drop enabled.
|
boolean |
isElementToolTipDisplayable()
Check whether enable to display element tooltip text on tree.
|
boolean |
isEnableAnimation()
Determines whether to enable animation on tree node icon.
|
boolean |
isEnableRightClickEvent() |
boolean |
isEnableTristateCheckBox()
Check whether this tree component is enable tristate checkbox.
|
boolean |
isEnsureVisibleOnSelected()
Return the flag that used to determine whether scroll viewport to make element
visible on the tree when the element is selected.
|
boolean |
isExpanded(Element element)
Gets whether if the treenode of the specified element is expanded.
|
boolean |
isExpanded(ElementNode elementNode)
Gets whether if the element node is expanded.
|
boolean |
isFireTreeNodeChangedWhenSelectionChanged() |
boolean |
isIconVisible()
Checks whether tree node icon of all nodes are visible.
|
boolean |
isLoaded(Element element)
Check whether the given element is children data loaded
on tree component.
|
boolean |
isPaintSelectedStateWhenChecked()
Determines whether to paint selected state when element is checked.
|
boolean |
isSelectableOnRightClick()
Returns true if element is selectable on right click,
false otherwise.
|
boolean |
isShowPlainIcon()
Checks whether tree node icon of all nodes are visible.
|
boolean |
isUpdateSortOnPropertyChanged() |
boolean |
isVisible(Element element)
Check whether given element is visible on tree.
|
boolean |
makeNodeLoaded(Element element)
to make sure the specified element node is loaded in
the tree, if the element's parent is not in the tree
for the reason of lazy loading, then add the parent
to the tree first.
|
void |
moveTo(int index,
Element element)
Moves the specified element to a new location in the same level.
|
void |
moveToBottom(Element element)
Move the given element to the bottom of its located tree level.
|
void |
moveToDown(Element element)
Move given element to one step lower location.
|
void |
moveToTop(Element element)
Moves the given element to top (index 0) in its tree level.
|
void |
moveToUp(Element element)
Move the element to the one more upper location.
|
void |
prepareRenderer(javax.swing.JLabel renderer,
Element element) |
void |
removeElementNodeDoubleClickedActionListener(java.awt.event.ActionListener l)
Remove an action listener for receiving element tree node
double click event.
|
void |
removelazyLoaderListener(LazyLoaderListener l) |
void |
removeTreeNodeClickedActionListener(java.awt.event.ActionListener l)
Remove the node clicked action listener from tree.
|
void |
removeVisibleFilter(VisibleFilter filter)
Remove a visible filter from this tree.
|
void |
setAutoSyncSelectionFromDataBoxToView(boolean autoSyncSelectionFromDataBoxToTree)
Sets whether synchronize selection from data box to this tree automatically.
|
void |
setAutoSyncSelectionFromViewToDataBox(boolean autoSyncSelectionFromTreeToDataBox)
Sets whether synchronize selection from this tree to data box automatically.
|
void |
setCheckableFilter(CheckableFilter checkableFilter)
Set the tree node checkable filter.
|
void |
setCheckedWhenNotSpecified(boolean checkedWhenNotSpecified) |
void |
setChildrenSortableFilter(ChildrenSortableFilter sortableFilter)
Sets the children sortable filter for this tree.
|
void |
setClearSelectionOnMarginClicked(boolean isClearSelectionOnMarginClicked)
Use this method to determines whether clear selection
when tree blank area is clicked.
|
void |
setCollapsedIcon(javax.swing.Icon collapsedIcon)
Sets the element node's collapsed icon.
|
void |
setDataBox(TDataBox box)
Set the connected data box.
|
void |
setDataBox(TDataBox box,
Element rootElement)
Set the connected databox.
|
void |
setDataBoxIconURL(java.lang.String boxIconURL)
Set databox tree icon url.
|
void |
setDataBoxLabelEditable(boolean dataBoxLabelEditable) |
void |
setDnDHandler(DnDHandler dndHandler)
Sets the drag-and-drop handler.
|
void |
setElementBodyColorGenerator(Generator elementBodyColorGenerator)
Sets a new element body color generator for this tree.
|
void |
setElementDraggable(boolean isElementDraggable)
Set to true if the tree node is drag-and-drop enabled.
|
void |
setElementIconGenerator(Generator elementIconGenerator)
Set the generator, this generator used to create element tree icon
for each element displayed on tree.
|
void |
setElementLabelEditableFilter(EditableFilter elementLabelEditableFilter)
Set tree element label editable filter.
|
void |
setElementLabelEditor(ElementLabelEditor elementLabelEditor)
Set element label editor for this tree.
|
void |
setElementLabelGenerator(Generator elementLabelGenerator)
Sets generator for displaying the label of element on TView,
for example, the tree node label, the tree node label, etc.
|
void |
setElementStateOutlineColorGenerator(Generator elementOutlineColorGenerator)
Sets a new element state outline color generator for this tree.
|
void |
setElementToolTipDisplayable(boolean isElementToolTipDisplayable)
Set whether enable to display element tooltip text on tree.
|
void |
setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
Set element tooltip text generator.
|
void |
setEnableAnimation(boolean enableAnimation)
Sets whether to enable animation on tree node icon.
|
void |
setEnableRightClickEvent(boolean isEnableRightClickEvent) |
void |
setEnableTristateCheckBox(boolean enableTristateCheckBox)
Set whether this tree component is enable tristate checkbox.
|
void |
setEnsureVisibleOnSelected(boolean isEnsureVisibleOnSelected)
This flag used to determine whether scroll viewport to make element
visible on the tree when the element is selected.
|
void |
setExpandedIcon(javax.swing.Icon expandedIcon)
Sets the element node's expanded icon.
|
void |
setFireTreeNodeChangedWhenSelectionChanged(boolean fireTreeNodeChangedWithSelectionChanged) |
void |
setIconHeight(int iconHeight)
Sets the icon height.
|
void |
setIconVisible(boolean isIconVisible)
Determines whether tree icon is visible.
|
void |
setIconWidth(int iconWidth)
Sets the icon width.
|
void |
setLazyLoader(LazyLoader lazyLoader)
Set tree node lazy loader.
|
void |
setPaintSelectedStateWhenChecked(boolean paintSelectedStateWhenChecked)
Sets whether to paint selected state when element is checked.
|
void |
setPaintSelectionStateFilter(PaintSelectionStateFilter paintSelectionStateFilter)
Set selection state paint filter.
|
void |
setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
Set popup menu factory for tree.
|
void |
setPopupMenuGenerator(PopupMenuGenerator popupMenuGenerator)
Set popup menu generator for tree.
|
void |
setRootElement(Element element)
Set root element, if element is null BoxNode will be the root node
|
void |
setRootVisible(boolean rootVisible)
Determine whether the tree root node is visible.
|
void |
setSelectableOnRightClick(boolean isSelectableOnRightClick)
Set whether element is selectable on right click.
|
void |
setSelectionPaths(javax.swing.tree.TreePath[] paths)
Set tree selection paths.
|
void |
setShowPlainIcon(boolean showPlainIcon)
Determines whether tree icon is visible.
|
void |
setSortComparator(java.util.Comparator sortComparator)
Set comparator for tree nodes sorting.
|
void |
setSortPropertyChangeFilter(PropertyChangeFilter sortPropertyChangeFilter) |
void |
setTTreeSelectionMode(int selectionMode)
Set selection mode for TWaver tree component.
|
void |
setUncheckableStyle(int uncheckableStyle)
Sets the uncheckable style.
|
void |
setUpdateSortOnPropertyChanged(boolean updateSortOnPropertyChanged) |
void |
startEditingAtElement(Element element)
Start to edit the specified element.
|
java.util.List |
treeNodeClickedActionListeners()
Gets all tree node clicked action listeners.
|
protected void |
updateSort(Element element,
java.beans.PropertyChangeEvent evt,
ElementNode elementNode) |
void |
updateTViewUI()
Uses this method to update tree UI when any state changed.
|
void |
updateUI() |
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getDropLocation, getDropMode, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int DEFAULT_SELECTION
public static final int CHECK_SELECTION
public static final int CHECK_CHILDREN_SELECTION
public static final int CHECK_DESCENDANT_SELECTION
public static final int CHECK_DESCENDANT_ANCESTOR_SELECTION
protected TDataBox box
public TTree()
public TTree(TDataBox box)
box
- TDataBox databox to be connectedpublic TTree(TDataBox box, Element treeRoot)
Please not the element must contains in the datbox.
box
- TDataBox databox to be connectedtreeRoot
- Element element to be as the tree rootsetDataBox(twaver.TDataBox)
public TTree(TDataBox box, java.util.Comparator sortComparator)
box
- TDataBox databox to be connectedsortComparator
- Comparator comparator used to compare
and sort tree nodes.public TTree(TDataBox box, Element treeRoot, java.util.Comparator sortComparator)
box
- TDataBox databox to be connectedtreeRoot
- Element element displayed as tree root nodesortComparator
- Comparator comparator used to sort and compare
tree nodes.protected void updateSort(Element element, java.beans.PropertyChangeEvent evt, ElementNode elementNode)
public boolean isFireTreeNodeChangedWhenSelectionChanged()
public void setFireTreeNodeChangedWhenSelectionChanged(boolean fireTreeNodeChangedWithSelectionChanged)
public PropertyChangeFilter getSortPropertyChangeFilter()
public void setSortPropertyChangeFilter(PropertyChangeFilter sortPropertyChangeFilter)
public void addLazyLoaderListener(LazyLoaderListener l)
public void removelazyLoaderListener(LazyLoaderListener l)
public Generator getElementBodyColorGenerator()
getElementBodyColorGenerator
in interface twaver.base.obfuscate.view.Tree
setElementBodyColorGenerator(Generator)
,
TUIManager.getElementBodyColorGenerator()
public void setElementBodyColorGenerator(Generator elementBodyColorGenerator)
setElementBodyColorGenerator
in interface twaver.base.obfuscate.view.Tree
elementBodyColorGenerator
- a new element body color generator for this tree.getElementBodyColorGenerator()
,
TUIManager.getElementBodyColorGenerator()
public Generator getElementStateOutlineColorGenerator()
getElementStateOutlineColorGenerator
in interface twaver.base.obfuscate.view.Tree
setElementStateOutlineColorGenerator(Generator)
,
TUIManager.getElementStateOutlineColorGenerator()
public void setElementStateOutlineColorGenerator(Generator elementOutlineColorGenerator)
setElementStateOutlineColorGenerator
in interface twaver.base.obfuscate.view.Tree
elementOutlineColorGenerator
- a new element state outline
color generator for this tree.#getElementSelectColorGenerator()
,
TUIManager.setElementStateOutlineColorGenerator(Generator)
public PaintSelectionStateFilter getPaintSelectionStateFilter()
See PaintSelectionStateFilter
for details.
setPaintSelectionStateFilter(twaver.PaintSelectionStateFilter)
public void setPaintSelectionStateFilter(PaintSelectionStateFilter paintSelectionStateFilter)
See PaintSelectionStateFilter
for details.
paintSelectionStateFilter
- PaintSelectionStateFilter
the selection state paint filter to be usedgetPaintSelectionStateFilter()
public java.awt.Insets getAutoscrollInsets()
getAutoscrollInsets
in interface java.awt.dnd.Autoscroll
public void autoscroll(java.awt.Point cursorLocation)
autoscroll
in interface java.awt.dnd.Autoscroll
cursorLocation
- Point current cursor location.public java.util.List getElementNodeDoubleClickedActionListeners()
public java.util.List treeNodeClickedActionListeners()
public void addElementNodeDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener the action listener response to element
double clicked eventremoveElementNodeDoubleClickedActionListener(java.awt.event.ActionListener)
public void removeElementNodeDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener the listener to be removedaddElementNodeDoubleClickedActionListener(java.awt.event.ActionListener)
public void addTreeNodeClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener listener to be addedremoveTreeNodeClickedActionListener(java.awt.event.ActionListener)
public void removeTreeNodeClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener listener to be removedaddTreeNodeClickedActionListener(java.awt.event.ActionListener)
public boolean isElementToolTipDisplayable()
setElementToolTipDisplayable(boolean)
public void setElementToolTipDisplayable(boolean isElementToolTipDisplayable)
isElementToolTipDisplayable
- boolean true to enable
to display element tooltip text, false otherwise.isElementToolTipDisplayable
public int getTTreeSelectionMode()
setTTreeSelectionMode(int)
public void setTTreeSelectionMode(int selectionMode)
selectionMode
- tree selection modegetTTreeSelectionMode()
public AbstractTTreeNode getRootNode()
public boolean isElementDraggable()
setElementDraggable(boolean)
public void setElementDraggable(boolean isElementDraggable)
isElementDraggable
- boolean true if enable drag-and-drop, false otherwiseisElementDraggable
public boolean isLoaded(Element element)
element
- Element the element to be checkpublic java.util.Comparator getSortComparator()
getSortComparator
in interface twaver.base.obfuscate.view.Tree
setSortComparator(java.util.Comparator)
public void setSortComparator(java.util.Comparator sortComparator)
setSortComparator
in interface twaver.base.obfuscate.view.Tree
sortComparator
- Comparator comparator for sortgetSortComparator()
protected void init()
public boolean isDnDTarget(java.lang.Object target)
target
- the object to be checked.protected void initDnD()
public TDataBox getDataBox()
getDataBox
in interface TView
setDataBox(twaver.TDataBox)
public void setDataBox(TDataBox box)
setDataBox
in interface TView
box
- TDataBox the data box to be connected to the treegetDataBox()
public void setDataBox(TDataBox box, Element rootElement)
This method set the connected databox and use the given element as the tree root node.
box
- TDataBox the databox to be connectedrootElement
- Element the root tree node. Please note that
this element is must contained in the databox.public PopupMenuFactory getPopupMenuFactory()
PopupMenuFactory
for more information.public void setPopupMenuFactory(PopupMenuFactory popupMenuFactory)
PopupMenuFactory
for more information.popupMenuFactory
- PopupMenuFactory the popup menu factory
to be used for this treepublic void ensureVisible(java.util.Collection elements)
elements
- Collection all elements to be scroll to be visible.public void ensureVisible(Element element)
element
- Element the element to be scroll
to be visiblepublic boolean isEnsureVisibleOnSelected()
setEnsureVisibleOnSelected(boolean)
public void setEnsureVisibleOnSelected(boolean isEnsureVisibleOnSelected)
isEnsureVisibleOnSelected
- boolean true if need to ensure visible
when element is selected, false otherwiseisEnsureVisibleOnSelected
public void setRootElement(Element element)
element
- public ElementNode getLoadedTreeNodeByElement(Element element)
element
- Element an elementpublic ElementNode getTreeNodeByElement(Element element)
element
- Element an elementpublic boolean isVisible(Element element)
isVisible
in interface twaver.base.obfuscate.view.Tree
element
- Element an element to be checkedaddVisibleFilter(twaver.VisibleFilter)
public java.util.List getVisibleFilters()
twaver.base.obfuscate.view.Tree
getVisibleFilters
in interface twaver.base.obfuscate.view.Tree
public void addVisibleFilter(VisibleFilter filter)
addVisibleFilter
in interface twaver.base.obfuscate.view.Tree
filter
- VisibleFilter the new visible filter.removeVisibleFilter(twaver.VisibleFilter)
public void removeVisibleFilter(VisibleFilter filter)
removeVisibleFilter
in interface twaver.base.obfuscate.view.Tree
filter
- VisibleFilter the filter will removed.addVisibleFilter(twaver.VisibleFilter)
public boolean makeNodeLoaded(Element element)
element
- Element an element to be loadedpublic void setSelectionPaths(javax.swing.tree.TreePath[] paths)
setSelectionPaths
in class javax.swing.JTree
paths
- TreePath[] the tree paths to be selectedpublic Element getElementByRowIndex(int rowIndex)
public void updateTViewUI()
updateTViewUI
in interface TView
public Generator getElementLabelGenerator()
getElementLabelGenerator
in interface twaver.base.obfuscate.view.Tree
setElementLabelGenerator(twaver.Generator)
public void setElementLabelGenerator(Generator elementLabelGenerator)
setElementLabelGenerator
in interface twaver.base.obfuscate.view.Tree
elementLabelGenerator
- Generator a generator used to
create element label text value for each element.getElementLabelGenerator()
public Generator getElementIconGenerator()
setElementIconGenerator(twaver.Generator)
public void setElementIconGenerator(Generator elementIconGenerator)
elementIconGenerator
- Generator the generator used to create
tree icon for each elementgetElementIconGenerator()
public java.lang.String getDataBoxIconURL()
getDataBoxIconURL
in interface twaver.base.obfuscate.view.Tree
setDataBoxIconURL(String)
public void setDataBoxIconURL(java.lang.String boxIconURL)
setDataBoxIconURL
in interface twaver.base.obfuscate.view.Tree
boxIconURL
- the new databox icon urlgetDataBoxIconURL()
public boolean isDataBoxLabelEditable()
public void setDataBoxLabelEditable(boolean dataBoxLabelEditable)
public CheckableFilter getCheckableFilter()
CheckableFilter
setCheckableFilter(twaver.CheckableFilter)
public void setCheckableFilter(CheckableFilter checkableFilter)
CheckableFilter
checkableFilter
- CheckableFilter the tree node
checkable filter to be usedgetCheckableFilter()
public boolean isCheckable(Element element)
element
- Element an element to be checked.public boolean isEnableTristateCheckBox()
setEnableTristateCheckBox(boolean)
public void setEnableTristateCheckBox(boolean enableTristateCheckBox)
enableTristateCheckBox
- boolean true if tree enable
tristate checkbox, false otherwise.isEnableTristateCheckBox()
public LazyLoader getLazyLoader()
setLazyLoader(twaver.tree.LazyLoader)
public void setLazyLoader(LazyLoader lazyLoader)
lazyLoader
- LazyLoader tree node lazy loader to be usedgetLazyLoader()
protected java.awt.Component getCursorComponent()
public void expandAll()
public void expandAll(Element element)
element
- Element element to be expandedpublic void expand(int level)
level
- int the conditional tree node level.public void expand(Element element, int level)
element
- Element element to be expandlevel
- int deep level to be expandedpublic void expand(Element element)
element
- Element element to be expanedpublic void expandRoot()
public void collapseAll()
public void collapseAll(Element element)
element
- Element element to be collapsedpublic void collapse(Element element)
element
- Element the element to be collapsedpublic void collapseAll(javax.swing.tree.TreePath parent)
parent
- TreePath the tree path to be collapsedpublic void setRootVisible(boolean rootVisible)
setRootVisible
in class javax.swing.JTree
rootVisible
- boolean true if root visible, false otherwiseJTree.isRootVisible()
public void moveTo(int index, Element element)
element
- Element element to be movedindex
- int the new location. This is the tree node index
in it located level.public void moveToUp(Element element)
element
- Element an element to be moved upmoveToDown(twaver.Element)
,
moveToTop(twaver.Element)
public void moveToDown(Element element)
element
- Element an element to be moved downmoveToUp(twaver.Element)
,
moveToBottom(twaver.Element)
public void moveToTop(Element element)
element
- Element the element to be movedmoveToBottom(twaver.Element)
,
moveToUp(twaver.Element)
public void moveToBottom(Element element)
element
- Element the element to be movedmoveToTop(twaver.Element)
,
moveToDown(twaver.Element)
public EditableFilter getElementLabelEditableFilter()
setElementLabelEditableFilter(twaver.EditableFilter)
public void setElementLabelEditableFilter(EditableFilter elementLabelEditableFilter)
elementLabelEditableFilter
- EditableFilter the filter to be used.getElementLabelEditableFilter()
public ElementLabelEditor getElementLabelEditor()
setElementLabelEditor(twaver.ElementLabelEditor)
public void setElementLabelEditor(ElementLabelEditor elementLabelEditor)
elementLabelEditor
- ElementLabelEditor element label editor to be usedgetElementLabelEditor()
public Generator getElementToolTipTextGenerator()
setElementToolTipTextGenerator(twaver.Generator)
public void setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
elementToolTipTextGenerator
- Generator the element
tooltip text generator to be used.getElementToolTipTextGenerator()
public boolean isSelectableOnRightClick()
setSelectableOnRightClick(boolean)
public void setSelectableOnRightClick(boolean isSelectableOnRightClick)
isSelectableOnRightClick
- boolean true if
element is selectable on right click, false otherwise.isSelectableOnRightClick
public boolean isClearSelectionOnMarginClicked()
setClearSelectionOnMarginClicked(boolean)
public void setClearSelectionOnMarginClicked(boolean isClearSelectionOnMarginClicked)
isClearSelectionOnMarginClicked
- boolean true
if clearing selection when tree margin (blank area) is clicked,
false otherwise.isClearSelectionOnMarginClicked
public javax.swing.tree.TreePath getTreePathByElement(Element element)
element
- Element an element to be checkpublic void startEditingAtElement(Element element)
element
- Element the element to be editpublic int getTristate(Element element)
element
- Element the element to be checkpublic boolean isIconVisible()
isIconVisible
in interface twaver.base.obfuscate.view.Tree
setIconVisible(boolean)
public void setIconVisible(boolean isIconVisible)
setIconVisible
in interface twaver.base.obfuscate.view.Tree
isIconVisible
- boolean true if show tree icon,
false otherwise.isIconVisible
public boolean isExpanded(Element element)
element
- the element to be determined.public boolean isExpanded(ElementNode elementNode)
elementNode
- the element node to be determined.public void updateUI()
updateUI
in class javax.swing.JTree
public PopupMenuGenerator getPopupMenuGenerator()
PopupMenuGenerator
for more information.public void setPopupMenuGenerator(PopupMenuGenerator popupMenuGenerator)
PopupMenuGenerator
for more information.popupMenuGenerator
- PopupMenuGenerator the popup menu generator
to be used for this treepublic DnDHandler getDnDHandler()
public void setDnDHandler(DnDHandler dndHandler)
dndHandler
- the drag-and-drop handler.public boolean isShowPlainIcon()
isShowPlainIcon
in interface twaver.base.obfuscate.view.Tree
setIconVisible(boolean)
public void setShowPlainIcon(boolean showPlainIcon)
setShowPlainIcon
in interface twaver.base.obfuscate.view.Tree
isIconVisible
- boolean true if show tree icon,
false otherwise.isIconVisible
public ChildrenSortableFilter getChildrenSortableFilter()
getChildrenSortableFilter
in interface twaver.base.obfuscate.view.Tree
ChildrenSortableFilter
public void setChildrenSortableFilter(ChildrenSortableFilter sortableFilter)
setChildrenSortableFilter
in interface twaver.base.obfuscate.view.Tree
childrenSortableFilter
- the children sortable filter for this tree.ChildrenSortableFilter
public boolean isChildrenSortable(Element parentElement)
parentElement
- the given parent element to be checked.public int getUncheckableStyle(Element element)
public int getUncheckableStyle()
setUncheckableStyle(int)
public void setUncheckableStyle(int uncheckableStyle)
uncheckableStyle
- public javax.swing.Icon getCollapsedIcon()
public void setCollapsedIcon(javax.swing.Icon collapsedIcon)
collapsedIcon
- the element node's collapsed icon.public javax.swing.Icon getExpandedIcon()
public void setExpandedIcon(javax.swing.Icon expandedIcon)
expandedIcon
- the element node's expanded icon.public boolean isAutoSyncSelectionFromDataBoxToView()
public void setAutoSyncSelectionFromDataBoxToView(boolean autoSyncSelectionFromDataBoxToTree)
autoSyncSelectionFromDataBoxToTree
- True to synchronize selection from
data box to this tree automatically. false otherwise.public boolean isAutoSyncSelectionFromViewToDataBox()
public void setAutoSyncSelectionFromViewToDataBox(boolean autoSyncSelectionFromTreeToDataBox)
autoSyncSelectionFromTreeToDataBox
- True to synchronize selection from
this tree to data box automatically. false otherwise.public int getIconWidth()
setIconWidth(int)
then the set value will
be taken in account.public void setIconWidth(int iconWidth)
setIconWidth(int)
then the set value will
be taken in account.iconWidth
- public int getIconHeight()
setIconHeight(int)
then the set value will
be taken in account.public void setIconHeight(int iconHeight)
setIconHeight(int)
then the set value will
be taken in account.iconHeight
- public java.lang.String getLabel(java.lang.Object object)
object
- instance of ElementNode or Elementpublic boolean isPaintSelectedStateWhenChecked()
public void setPaintSelectedStateWhenChecked(boolean paintSelectedStateWhenChecked)
paintSelectedStateWhenChecked
- True to paint selected state, false otherwise.public boolean isCheckedWhenNotSpecified()
public void setCheckedWhenNotSpecified(boolean checkedWhenNotSpecified)
public boolean isEnableAnimation()
public void prepareRenderer(javax.swing.JLabel renderer, Element element)
public boolean isEnableRightClickEvent()
public void setEnableRightClickEvent(boolean isEnableRightClickEvent)
public boolean isUpdateSortOnPropertyChanged()
public void setUpdateSortOnPropertyChanged(boolean updateSortOnPropertyChanged)
public void setEnableAnimation(boolean enableAnimation)
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.