public class InterfaceTree extends WebExTree<InterfaceTreeNode> implements HoverListener<InterfaceTreeNode>, TreeSelectionListener, Filter<Component>
WebExTree
representing Swing components structure.
It displays and dynamically updates Swing components strcuture for the specified root Component
.
This component should never be used with a non-Web UIs as it might cause an unexpected behavior.
You could still use that component even if WebLaF is not your application LaF as this component will use Web-UI in any case.InterfaceInspector
,
WebExTree
,
Serialized FormJTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected ComponentHighlighter |
hoverHighlighter
Highlighter for hovered tree element.
|
protected Component |
root
Root
Component . |
protected Map<Component,ComponentHighlighter> |
selectedHighlighters
Highlighters for selected tree elements.
|
comparator, COMPARATOR_PROPERTY, DATA_PROVIDER_PROPERTY, filter, FILTER_PROPERTY
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, DROP_LOCATION_PROPERTY, editableStateProvider, scrollToSelectionListener, SINGLE_TREE_SELECTION, TOOLTIP_PROVIDER_PROPERTY
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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
UNDEFINED
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
InterfaceTree(Component root)
Constructs new interface tree.
|
InterfaceTree(StyleId id,
Component root)
Constructs new interface tree.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Component component) |
boolean |
canHighlight(Component component)
Returns whether or not component can be highlighted.
|
protected InterfaceTreeDataProvider |
createDataProvider()
|
protected InterfaceTreeDataProvider |
createEmptyProvider()
Returns new dummy
InterfaceTreeDataProvider for empty hidden JLabel . |
void |
expand(Component component)
Expands tree to the specified component.
|
StyleId |
getDefaultStyleId()
Returns default component
StyleId . |
Component |
getRootComponent()
Returns root component.
|
void |
hoverChanged(InterfaceTreeNode previous,
InterfaceTreeNode current) |
void |
navigate(Component component)
Navigates tree to the specified component.
|
void |
setDataProvider(ExTreeDataProvider dataProvider)
Sets
ExTreeDataProvider used by this WebExTree . |
void |
setRootComponent(Component root)
Sets root component.
|
void |
valueChanged(TreeSelectionEvent e) |
addChildNode, addChildNodes, clearComparator, clearFilter, expandNode, expandPath, expandPath, expandPath, expandPathEndImpl, expandPathImpl, filter, filter, filter, filterAndSort, filterAndSort, filterAndSort, findNode, getComparator, getDataProvider, getFilter, getModel, getNode, insertChildNode, insertChildNodes, insertChildNodes, performReload, reloadNode, reloadNode, reloadNode, reloadNodeUnderPoint, reloadNodeUnderPoint, reloadPath, reloadPath, reloadRootNode, reloadSelectedNodes, removeNode, removeNode, removeNodes, removeNodes, setChildNodes, setComparator, setFilter, setModel, sort, sort, sort, updateNode, updateNodeStructure, updateNodeStructure
addCellEditorListener, addDictionaryListener, addHoverListener, addLanguageListener, addStyleListener, changeFontSize, collapseAll, collapseAll, collapseAll, collapseAll, collapseAllImpl, collapseNode, collectAllNodesImpl, createDefaultTreeModel, createTreeModel, expandAll, expandAll, expandAll, expandAll, expandAll, expandAll, expandAll, expandAll, expandAllImpl, expandNode, expandRoot, fireHoverChanged, getAvailableNodes, getAvailableNodes, getAvailableNodes, getAvailableNodes, getClosestNodeForLocation, getClosestNodeForLocation, getClosestPathForLocation, getCustomPainter, getEditableStateProvider, getFirstVisibleLeafNode, getFontName, getFontSize, getHoverListeners, getMargin, getMaximumHeight, getMaximumSize, getMaximumWidth, getMinimumHeight, getMinimumSize, getMinimumWidth, getNodeBounds, getNodeBounds, getNodeForLocation, getNodeForLocation, getNodeForPath, getNodeForRow, getNullableRootNode, getOriginalMaximumSize, getOriginalMinimumSize, getOriginalPreferredSize, getPadding, getPainterShape, getPathForLocation, getPathForNode, getPreferredHeight, getPreferredSize, getPreferredWidth, getRootNode, getRowForNode, getScrollableUnitIncrement, getSelectedNode, getSelectedNodeBounds, getSelectedNodes, getSelectedNodes, getSelectedUserObject, getSelectedUserObjects, getSelectedUserObjects, getSelectionMode, getSelectionStyle, getSkin, getStyleId, getToolTipProvider, getToolTipText, getTreeState, getTreeState, getTreeState, getTreeState, getUI, getUIClassID, getUserObject, getVisibleSelectedNodes, isAutoExpandSingleChildNode, isBoldFont, isCollapsed, isExpanded, isExpandSelected, isItalicFont, isLeaf, isMultipleSelectionAllowed, isNodeEditable, isPathEditable, isPlainFont, isScrollToSelection, isSelected, isSelectOnHover, isShapeDetectionEnabled, loadSettings, onDoubleClick, onDragStart, onDragStart, onFocusGain, onFocusLoss, onKeyPress, onKeyPress, onKeyRelease, onKeyRelease, onKeyType, onKeyType, onMenuTrigger, onMouseClick, onMouseClick, onMouseDrag, onMouseDrag, onMouseEnter, onMouseExit, onMousePress, onMousePress, onNodeDoubleClick, onNodeDoubleClick, registerSettings, registerSettings, removeCellEditorListener, removeDictionaryListener, removeDictionaryListeners, removeHoverListener, removeLanguageListener, removeLanguageListeners, removeStyleListener, repaint, repaint, repaint, repaint, resetCustomPainter, resetSkin, resetStyleId, saveSettings, scrollToNode, scrollToNode, scrollToSelection, scrollToStart, selectFirstVisibleLeafNode, selectNextRow, selectNextRow, selectNodeUnderPoint, selectNodeUnderPoint, selectPreviousRow, selectPreviousRow, setAutoExpandSingleChildNode, setBoldFont, setBoldFont, setCellEditor, setCustomPainter, setEditableStateProvider, setExpandSelected, setFontName, setFontSize, setFontSizeAndStyle, setFontSizeAndStyle, setFontStyle, setFontStyle, setItalicFont, setItalicFont, setMargin, setMargin, setMargin, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMultipleSelectionAllowed, setPadding, setPadding, setPadding, setPlainFont, setPlainFont, setPreferredHeight, setPreferredSize, setPreferredWidth, setScrollToSelection, setSelectedNode, setSelectedNodes, setSelectedNodes, setSelectionMode, setSelectionStyle, setSelectOnHover, setShapeDetectionEnabled, setSkin, setSkin, setStyleId, setToolTipProvider, setTreeState, setTreeState, setTreeState, setTreeState, setUI, startEditingNode, startEditingSelectedNode, unregisterSettings, updateNode, updateNodes, updateNodes, updateUI, updateVisibleNodes
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, 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, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellRenderer, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, 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, getNextFocusableComponent, getPopupLocation, 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
@Nullable protected final Component root
Component
.
Might be null
if all active windows are being tracked.@NotNull protected ComponentHighlighter hoverHighlighter
@NotNull protected Map<Component,ComponentHighlighter> selectedHighlighters
public InterfaceTree(@Nullable Component root)
root
- root component@NotNull public StyleId getDefaultStyleId()
Styleable
StyleId
.
This method is asked when initial component StyleId
have to be provided.getDefaultStyleId
in interface Styleable
getDefaultStyleId
in class WebExTree<InterfaceTreeNode>
StyleId
public void setDataProvider(@NotNull ExTreeDataProvider dataProvider)
WebExTree
ExTreeDataProvider
used by this WebExTree
.setDataProvider
in class WebExTree<InterfaceTreeNode>
dataProvider
- new ExTreeDataProvider
for this WebExTree
@NotNull protected InterfaceTreeDataProvider createEmptyProvider()
InterfaceTreeDataProvider
for empty hidden JLabel
.InterfaceTreeDataProvider
for empty hidden JLabel
@NotNull protected InterfaceTreeDataProvider createDataProvider()
InterfaceTreeDataProvider
for the root
Component
public boolean accept(Component component)
public void hoverChanged(@Nullable InterfaceTreeNode previous, @Nullable InterfaceTreeNode current)
hoverChanged
in interface HoverListener<InterfaceTreeNode>
public void valueChanged(@NotNull TreeSelectionEvent e)
valueChanged
in interface TreeSelectionListener
public boolean canHighlight(@Nullable Component component)
component
- component to be highlightedtrue
if component can be highlighted, false
otherwise@Nullable public Component getRootComponent()
public void setRootComponent(@Nullable Component root)
root
- root componentpublic void navigate(@Nullable Component component)
component
- component to navigate toCopyright © 2020. All rights reserved.