Package org.apache.pivot.wtk.skin.terra
Class TerraTreeViewSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin
-
- All Implemented Interfaces:
ComponentKeyListener,ComponentListener,ComponentMouseButtonListener,ComponentMouseListener,ComponentMouseWheelListener,ComponentStateListener,ComponentTooltipListener,ConstrainedVisual,Skin,TreeView.Skin,TreeViewBranchListener,TreeViewListener,TreeViewNodeListener,TreeViewNodeStateListener,TreeViewSelectionListener,Visual
public class TerraTreeViewSkin extends ComponentSkin implements TreeView.Skin, TreeViewListener, TreeViewBranchListener, TreeViewNodeListener, TreeViewNodeStateListener, TreeViewSelectionListener
Tree view skin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceTerraTreeViewSkin.NodeInfoVisitorNode info visitor interface.protected classTerraTreeViewSkin.VisibleNodeIteratorIterates through the visible nodes.-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter, ComponentKeyListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter, ComponentListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter, ComponentMouseButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter, ComponentMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseWheelListener
ComponentMouseWheelListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter, ComponentStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentTooltipListener
ComponentTooltipListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewBranchListener
TreeViewBranchListener.Adapter, TreeViewBranchListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewListener
TreeViewListener.Adapter, TreeViewListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewNodeListener
TreeViewNodeListener.Adapter, TreeViewNodeListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewNodeStateListener
TreeViewNodeStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewSelectionListener
TreeViewSelectionListener.Adapter, TreeViewSelectionListener.Listeners
-
-
Constructor Summary
Constructors Constructor Description TerraTreeViewSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaccept(TerraTreeViewSkin.NodeInfoVisitor visitor)Accepts the specified visitor on all node info objects that exist in this skin's node info hierarchy.voidbranchCollapsed(TreeView treeView, Sequence.Tree.Path path)Called when a tree node is collapsed.voidbranchExpanded(TreeView treeView, Sequence.Tree.Path path)Called when a tree node is expanded.voidbranchExpandedChangeVetoed(TreeView treeView, Sequence.Tree.Path path, Vote reason)Called when thepreviewBranchExpandedChange()tally produces anything but aVote.APPROVEresult (to say NOT to expand or collapse the branch).voidcheckmarksEnabledChanged(TreeView treeView)Called when a tree view's checkmarks enabled flag has changed.protected voidclearHighlightedNode()Clears the highlighted node if one exists.voiddisabledCheckmarkFilterChanged(TreeView treeView, Filter<?> previousDisabledCheckmarkFilter)Called when a tree view's disabled checkmark filter has changed.voiddisabledNodeFilterChanged(TreeView treeView, Filter<?> previousDisabledNodeFilter)Called when a tree view's disabled node filter has changed.voidenabledChanged(Component component)Called when a component's enabled state has changed.voidfocusedChanged(Component component, Component obverseComponent)Called when a component's focused state has changed.java.awt.ColorgetBackgroundColor()intgetBaseline(int width, int height)Should be implemented in every subclass.java.awt.ColorgetBranchControlColor()java.awt.ColorgetBranchControlInactiveSelectionColor()java.awt.ColorgetBranchControlSelectionColor()protected org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.BranchInfogetBranchInfoAt(Sequence.Tree.Path path)java.awt.ColorgetColor()java.awt.ColorgetDisabledColor()java.awt.FontgetFont()java.awt.ColorgetGridColor()java.awt.ColorgetHighlightBackgroundColor()java.awt.ColorgetHighlightColor()java.awt.ColorgetInactiveSelectionBackgroundColor()java.awt.ColorgetInactiveSelectionColor()intgetIndent()Sequence.Tree.PathgetNodeAt(int y)Gets the path to the node found at the specified y-coordinate (relative to the tree view).BoundsgetNodeBounds(Sequence.Tree.Path path)Gets the bounds of the node at the specified path relative to the tree view.protected BoundsgetNodeBounds(org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo nodeInfo)protected intgetNodeHeight()intgetNodeIndent(int depth)Gets the pixel indent of nodes at the specified depth.protected org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfogetNodeInfoAt(int y)protected org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfogetNodeInfoAt(Sequence.Tree.Path path)intgetPreferredHeight(int width)Returns the visual's preferred height given the provided width constraint.intgetPreferredWidth(int height)Returns the visual's preferred width given the provided height constraint.intgetRowIndex(Sequence.Tree.Path path)Gets the row index of the node, as seen in the current visible nodes list.java.awt.ColorgetSelectionBackgroundColor()java.awt.ColorgetSelectionColor()booleangetShowBranchControls()booleangetShowEmptyBranchControls()booleangetShowGridLines()booleangetShowHighlight()intgetSpacing()TreeViewgetTreeView()voidinstall(Component component)Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.booleanisFocusable()By default, skins are focusable.booleanisOpaque()By default, skins are assumed to be opaque.booleankeyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)Keyboard handling (arrow keys with modifiers).booleankeyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)SPACEtoggles check mark selection when select mode isTreeView.SelectMode.SINGLE.voidlayout()If the component on which the skin is installed is a container, lays out the container's children.booleanmouseClick(Component component, Mouse.Button button, int x, int y, int count)Called when a mouse button is clicked over a component.booleanmouseDown(Component component, Mouse.Button button, int x, int y)Called when a mouse button is pressed over a component.booleanmouseMove(Component component, int x, int y)Called when the mouse is moved over a component.voidmouseOut(Component component)Called when the mouse exits a component.booleanmouseUp(Component component, Mouse.Button button, int x, int y)Called when a mouse button is released over a component.booleanmouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)Called when the mouse wheel is scrolled over a component.voidnodeCheckStateChanged(TreeView treeView, Sequence.Tree.Path path, TreeView.NodeCheckState previousCheckState)Called when a node's checked state has changed.voidnodeInserted(TreeView treeView, Sequence.Tree.Path path, int index)Called when a node has been inserted into the tree view.voidnodeRendererChanged(TreeView treeView, TreeView.NodeRenderer previousNodeRenderer)Called when a tree view's node renderer has changed.voidnodesCleared(TreeView treeView, Sequence.Tree.Path path)Called when the nodes in a branch have been cleared.voidnodesRemoved(TreeView treeView, Sequence.Tree.Path path, int index, int count)Called when nodes have been removed from the tree view.voidnodesSorted(TreeView treeView, Sequence.Tree.Path path)Called when the nodes in a branch have been sorted.voidnodeUpdated(TreeView treeView, Sequence.Tree.Path path, int index)Called when a node in the tree view has been updated.voidpaint(java.awt.Graphics2D graphics)Paints the visual.VotepreviewBranchExpandedChange(TreeView treeView, Sequence.Tree.Path path)Called before a tree node is expanded or collapsed to allow the application or the skin to refuse the operation.protected voidrepaintNode(org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo nodeInfo)Repaints the region occupied by the specified node.voidselectedPathAdded(TreeView treeView, Sequence.Tree.Path path)Called when a selected path has been added to a tree view.voidselectedPathRemoved(TreeView treeView, Sequence.Tree.Path path)Called when a selected path has been removed from a tree view.voidselectedPathsChanged(TreeView treeView, Sequence<Sequence.Tree.Path> previousSelectedPaths)Called when a tree view's selection state has been reset.voidselectModeChanged(TreeView treeView, TreeView.SelectMode previousSelectMode)Called when a tree view's select mode has changed.voidsetBackgroundColor(int backgroundColorIndex)voidsetBackgroundColor(java.awt.Color backgroundColorValue)voidsetBackgroundColor(java.lang.String backgroundColorString)voidsetBranchControlColor(int branchControlColorIndex)voidsetBranchControlColor(java.awt.Color branchControlColorValue)voidsetBranchControlColor(java.lang.String branchControlColorString)voidsetBranchControlInactiveSelectionColor(int branchControlInactiveSelectionIndex)voidsetBranchControlInactiveSelectionColor(java.awt.Color branchControlInactiveSelectionColorValue)voidsetBranchControlInactiveSelectionColor(java.lang.String branchControlInactiveSelectionString)voidsetBranchControlSelectionColor(int branchControlSelectionColorIndex)voidsetBranchControlSelectionColor(java.awt.Color branchControlSelectionColorValue)voidsetBranchControlSelectionColor(java.lang.String branchControlSelectionColorString)voidsetColor(int colorIndex)voidsetColor(java.awt.Color colorValue)voidsetColor(java.lang.String colorString)voidsetDisabledColor(int disabledColorIndex)voidsetDisabledColor(java.awt.Color disabledColorValue)voidsetDisabledColor(java.lang.String disabledColorString)voidsetFont(java.awt.Font newFont)voidsetFont(java.lang.String fontString)voidsetFont(Dictionary<java.lang.String,?> fontDictionary)voidsetGridColor(int gridColorIndex)voidsetGridColor(java.awt.Color gridColorValue)voidsetGridColor(java.lang.String gridColorString)voidsetHighlightBackgroundColor(int highlightBackgroundColorIndex)voidsetHighlightBackgroundColor(java.awt.Color highlightBackgroundColorValue)voidsetHighlightBackgroundColor(java.lang.String highlightBackgroundColorString)voidsetHighlightColor(int highlightColorIndex)voidsetHighlightColor(java.awt.Color highlightColorValue)voidsetHighlightColor(java.lang.String highlightColorString)voidsetInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundIndex)voidsetInactiveSelectionBackgroundColor(java.awt.Color inactiveSelectionBackgroundColorValue)voidsetInactiveSelectionBackgroundColor(java.lang.String inactiveSelectionBackgroundString)voidsetInactiveSelectionColor(int inactiveSelectionColorIndex)voidsetInactiveSelectionColor(java.awt.Color inactiveSelectionColorValue)voidsetInactiveSelectionColor(java.lang.String inactiveSelectionColorString)voidsetIndent(int indentValue)voidsetIndent(java.lang.Number indentValue)voidsetSelectionBackgroundColor(int selectionBackgroundColorIndex)voidsetSelectionBackgroundColor(java.awt.Color selectionBackgroundColorValue)voidsetSelectionBackgroundColor(java.lang.String selectionBackgroundColorString)voidsetSelectionColor(int selectionColorIndex)voidsetSelectionColor(java.awt.Color selectionColorValue)voidsetSelectionColor(java.lang.String selectionColorString)voidsetShowBranchControls(boolean showBranchControlsValue)voidsetShowEmptyBranchControls(boolean showEmptyBranchControlsValue)voidsetShowGridLines(boolean showGridLinesValue)voidsetShowHighlight(boolean showHighlightValue)voidsetSpacing(int spacingValue)voidsetSpacing(java.lang.Number spacingValue)voidshowMixedCheckmarkStateChanged(TreeView treeView)Called when a tree view's "show mixed checkmark state" flag has changed.voidtreeDataChanged(TreeView treeView, List<?> previousTreeData)Called when a tree view's data has changed.-
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, fontFromObject, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getPreferredSize, getSize, getTextInputMethodListener, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, keyTyped, locationChanged, menuHandlerChanged, mouseOver, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setDefaultStyles, setSize, sizeChanged, themeHasThickFocusRectangle, themeHasTransitionEnabled, themeIsDark, themeIsFlat, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
setSize
-
Methods inherited from interface org.apache.pivot.wtk.TreeViewListener
nodeEditorChanged
-
Methods inherited from interface org.apache.pivot.wtk.TreeViewSelectionListener
selectedNodeChanged
-
-
-
-
Method Detail
-
getTreeView
public TreeView getTreeView()
- Returns:
- the
TreeViewwe are attached to.
-
install
public void install(Component component)
Description copied from class:ComponentSkinMust be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.- Specified by:
installin interfaceSkin- Overrides:
installin classComponentSkin- Parameters:
component- The component to which the skin is being attached.
-
getPreferredWidth
public int getPreferredWidth(int height)
Description copied from interface:ConstrainedVisualReturns the visual's preferred width given the provided height constraint.- Specified by:
getPreferredWidthin interfaceConstrainedVisual- Parameters:
height- The height by which to constrain the preferred width, or-1for no constraint.- Returns:
- The preferred width given the height constraint.
-
getPreferredHeight
public int getPreferredHeight(int width)
Description copied from interface:ConstrainedVisualReturns the visual's preferred height given the provided width constraint.- Specified by:
getPreferredHeightin interfaceConstrainedVisual- Parameters:
width- The width by which to constrain the preferred height, or-1for no constraint.- Returns:
- The preferred height given the width constraint.
-
getBaseline
public int getBaseline(int width, int height)Description copied from class:ComponentSkinShould be implemented in every subclass.The default implementation here simply returns -1 (no baseline).
- Specified by:
getBaselinein interfaceConstrainedVisual- Overrides:
getBaselinein classComponentSkin- Parameters:
width- Constrained width to compute the baseline for.height- Constrained height to compute the baseline for.- Returns:
- The baseline relative to the origin of this visual, or
-1if this visual does not have a baseline.
-
layout
public void layout()
Description copied from interface:SkinIf the component on which the skin is installed is a container, lays out the container's children.
-
paint
public void paint(java.awt.Graphics2D graphics)
Description copied from interface:VisualPaints the visual.
-
getFont
public java.awt.Font getFont()
-
setFont
public void setFont(java.awt.Font newFont)
-
setFont
public final void setFont(java.lang.String fontString)
-
setFont
public final void setFont(Dictionary<java.lang.String,?> fontDictionary)
-
getColor
public java.awt.Color getColor()
-
setColor
public void setColor(java.awt.Color colorValue)
-
setColor
public void setColor(java.lang.String colorString)
-
setColor
public final void setColor(int colorIndex)
-
getDisabledColor
public java.awt.Color getDisabledColor()
-
setDisabledColor
public void setDisabledColor(java.awt.Color disabledColorValue)
-
setDisabledColor
public void setDisabledColor(java.lang.String disabledColorString)
-
setDisabledColor
public final void setDisabledColor(int disabledColorIndex)
-
getBackgroundColor
public java.awt.Color getBackgroundColor()
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color backgroundColorValue)
-
setBackgroundColor
public void setBackgroundColor(java.lang.String backgroundColorString)
-
setBackgroundColor
public final void setBackgroundColor(int backgroundColorIndex)
-
getSelectionColor
public java.awt.Color getSelectionColor()
-
setSelectionColor
public void setSelectionColor(java.awt.Color selectionColorValue)
-
setSelectionColor
public void setSelectionColor(java.lang.String selectionColorString)
-
setSelectionColor
public final void setSelectionColor(int selectionColorIndex)
-
getSelectionBackgroundColor
public java.awt.Color getSelectionBackgroundColor()
-
setSelectionBackgroundColor
public void setSelectionBackgroundColor(java.awt.Color selectionBackgroundColorValue)
-
setSelectionBackgroundColor
public void setSelectionBackgroundColor(java.lang.String selectionBackgroundColorString)
-
setSelectionBackgroundColor
public final void setSelectionBackgroundColor(int selectionBackgroundColorIndex)
-
getInactiveSelectionColor
public java.awt.Color getInactiveSelectionColor()
-
setInactiveSelectionColor
public void setInactiveSelectionColor(java.awt.Color inactiveSelectionColorValue)
-
setInactiveSelectionColor
public void setInactiveSelectionColor(java.lang.String inactiveSelectionColorString)
-
setInactiveSelectionColor
public final void setInactiveSelectionColor(int inactiveSelectionColorIndex)
-
getInactiveSelectionBackgroundColor
public java.awt.Color getInactiveSelectionBackgroundColor()
-
setInactiveSelectionBackgroundColor
public void setInactiveSelectionBackgroundColor(java.awt.Color inactiveSelectionBackgroundColorValue)
-
setInactiveSelectionBackgroundColor
public void setInactiveSelectionBackgroundColor(java.lang.String inactiveSelectionBackgroundString)
-
setInactiveSelectionBackgroundColor
public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundIndex)
-
getHighlightColor
public java.awt.Color getHighlightColor()
-
setHighlightColor
public void setHighlightColor(java.awt.Color highlightColorValue)
-
setHighlightColor
public void setHighlightColor(java.lang.String highlightColorString)
-
setHighlightColor
public final void setHighlightColor(int highlightColorIndex)
-
getHighlightBackgroundColor
public java.awt.Color getHighlightBackgroundColor()
-
setHighlightBackgroundColor
public void setHighlightBackgroundColor(java.awt.Color highlightBackgroundColorValue)
-
setHighlightBackgroundColor
public void setHighlightBackgroundColor(java.lang.String highlightBackgroundColorString)
-
setHighlightBackgroundColor
public final void setHighlightBackgroundColor(int highlightBackgroundColorIndex)
-
getSpacing
public int getSpacing()
-
setSpacing
public void setSpacing(int spacingValue)
-
setSpacing
public void setSpacing(java.lang.Number spacingValue)
-
getIndent
public int getIndent()
-
setIndent
public void setIndent(int indentValue)
-
setIndent
public void setIndent(java.lang.Number indentValue)
-
getShowHighlight
public boolean getShowHighlight()
-
setShowHighlight
public void setShowHighlight(boolean showHighlightValue)
-
getShowBranchControls
public boolean getShowBranchControls()
-
setShowBranchControls
public void setShowBranchControls(boolean showBranchControlsValue)
-
getShowEmptyBranchControls
public boolean getShowEmptyBranchControls()
-
setShowEmptyBranchControls
public void setShowEmptyBranchControls(boolean showEmptyBranchControlsValue)
-
getBranchControlColor
public java.awt.Color getBranchControlColor()
-
setBranchControlColor
public void setBranchControlColor(java.awt.Color branchControlColorValue)
-
setBranchControlColor
public void setBranchControlColor(java.lang.String branchControlColorString)
-
setBranchControlColor
public final void setBranchControlColor(int branchControlColorIndex)
-
getBranchControlSelectionColor
public java.awt.Color getBranchControlSelectionColor()
-
setBranchControlSelectionColor
public void setBranchControlSelectionColor(java.awt.Color branchControlSelectionColorValue)
-
setBranchControlSelectionColor
public void setBranchControlSelectionColor(java.lang.String branchControlSelectionColorString)
-
setBranchControlSelectionColor
public final void setBranchControlSelectionColor(int branchControlSelectionColorIndex)
-
getBranchControlInactiveSelectionColor
public java.awt.Color getBranchControlInactiveSelectionColor()
-
setBranchControlInactiveSelectionColor
public void setBranchControlInactiveSelectionColor(java.awt.Color branchControlInactiveSelectionColorValue)
-
setBranchControlInactiveSelectionColor
public void setBranchControlInactiveSelectionColor(java.lang.String branchControlInactiveSelectionString)
-
setBranchControlInactiveSelectionColor
public final void setBranchControlInactiveSelectionColor(int branchControlInactiveSelectionIndex)
-
getGridColor
public java.awt.Color getGridColor()
-
setGridColor
public void setGridColor(java.awt.Color gridColorValue)
-
setGridColor
public void setGridColor(java.lang.String gridColorString)
-
setGridColor
public final void setGridColor(int gridColorIndex)
-
getShowGridLines
public boolean getShowGridLines()
-
setShowGridLines
public void setShowGridLines(boolean showGridLinesValue)
-
getNodeHeight
protected int getNodeHeight()
- Returns:
- The fixed node height of this skin.
-
getNodeInfoAt
protected final org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo getNodeInfoAt(int y)
- Parameters:
y- The current Y location.- Returns:
- The metadata associated with the node found at the specified
y-coordinate, or
nullif there is no node at that location.
-
getNodeInfoAt
protected final org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo getNodeInfoAt(Sequence.Tree.Path path)
- Parameters:
path- The path to query.- Returns:
- The metadata associated with the node at the specified path. The path must be valid. The empty path is supported and represents the root node info.
-
getBranchInfoAt
protected final org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.BranchInfo getBranchInfoAt(Sequence.Tree.Path path)
- Parameters:
path- The path to query.- Returns:
- The metadata for the branch node at the specified path.
- See Also:
getNodeInfoAt(Path)
-
getNodeBounds
protected final Bounds getNodeBounds(org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo nodeInfo)
- Parameters:
nodeInfo- The node information to search for.- Returns:
- The bounding box defined by the specified node, or
nullif the node is not currently visible.
-
accept
protected final void accept(TerraTreeViewSkin.NodeInfoVisitor visitor)
Accepts the specified visitor on all node info objects that exist in this skin's node info hierarchy.- Parameters:
visitor- The callback to execute on each node info object
-
repaintNode
protected void repaintNode(org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo nodeInfo)
Repaints the region occupied by the specified node.- Parameters:
nodeInfo- The node to search for.
-
clearHighlightedNode
protected void clearHighlightedNode()
Clears the highlighted node if one exists.
-
mouseMove
public boolean mouseMove(Component component, int x, int y)
Description copied from interface:ComponentMouseListenerCalled when the mouse is moved over a component.- Specified by:
mouseMovein interfaceComponentMouseListener- Overrides:
mouseMovein classComponentSkin- Parameters:
component- Component that is under the mouse.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default return).
-
mouseOut
public void mouseOut(Component component)
Description copied from interface:ComponentMouseListenerCalled when the mouse exits a component.Default is to do nothing.
- Specified by:
mouseOutin interfaceComponentMouseListener- Overrides:
mouseOutin classComponentSkin- Parameters:
component- Component that has now lost the mouse pointer.
-
mouseDown
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is pressed over a component.- Specified by:
mouseDownin interfaceComponentMouseButtonListener- Overrides:
mouseDownin classComponentSkin- Parameters:
component- Component that is under the mouse pointer.button- Which mouse button was pressed.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
mouseUp
public boolean mouseUp(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is released over a component.- Specified by:
mouseUpin interfaceComponentMouseButtonListener- Overrides:
mouseUpin classComponentSkin- Parameters:
component- Component user the mouse pointer.button- Which mouse button that was released.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
mouseClick
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is clicked over a component.- Specified by:
mouseClickin interfaceComponentMouseButtonListener- Overrides:
mouseClickin classComponentSkin- Parameters:
component- Component user the mouse pointer.button- Which mouse button was clicked.x- X position of the mouse.y- Y position of the mouse.count- Number of clicks (1 = single click, 2 = double click, etc.).- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
mouseWheel
public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
Description copied from interface:ComponentMouseWheelListenerCalled when the mouse wheel is scrolled over a component.- Specified by:
mouseWheelin interfaceComponentMouseWheelListener- Overrides:
mouseWheelin classComponentSkin- Parameters:
component- Component under the mouse pointer.scrollType- What type of scroll was requested on the mouse.scrollAmount- Amount of scrolling.wheelRotation- Rotation value.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate.
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
Keyboard handling (arrow keys with modifiers).UPSelects the previous enabled node when select mode is notTreeView.SelectMode.NONEDOWNSelects the next enabled node when select mode is notTreeView.SelectMode.NONESHIFT+UPIncreases the selection size by including the previous enabled node when select mode isTreeView.SelectMode.MULTISHIFT+DOWNIncreases the selection size by including the next enabled node when select mode isTreeView.SelectMode.MULTI
- Specified by:
keyPressedin interfaceComponentKeyListener- Overrides:
keyPressedin classComponentSkin- Parameters:
component- Component that has the focus.keyCode- The key code for the key that was pressed.keyLocation- Location value for the key (left or right for shift keys, etc.).- Returns:
trueto consume the event;falseto allow it to propagate.
-
keyReleased
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACEtoggles check mark selection when select mode isTreeView.SelectMode.SINGLE.- Specified by:
keyReleasedin interfaceComponentKeyListener- Overrides:
keyReleasedin classComponentSkin- Parameters:
component- Component that has the focus, that is receiving this key event.keyCode- Code for the key that was released.keyLocation- Location of the key.- Returns:
trueto consume the event;falseto allow it to propagate.
-
isFocusable
public boolean isFocusable()
Description copied from class:ComponentSkinBy default, skins are focusable.- Specified by:
isFocusablein interfaceSkin- Overrides:
isFocusablein classComponentSkin- Returns:
trueif this skin is focusable;false, otherwise.
-
isOpaque
public boolean isOpaque()
Description copied from class:ComponentSkinBy default, skins are assumed to be opaque.- Specified by:
isOpaquein interfaceSkin- Overrides:
isOpaquein classComponentSkin- Returns:
trueif this skin is opaque;falseif any part of it is transparent or translucent.
-
enabledChanged
public void enabledChanged(Component component)
Description copied from interface:ComponentStateListenerCalled when a component's enabled state has changed.Called both when the component is enabled and when it is disabled. The component's
enabledflag has already been set when this method is called so the new state can be determined by calling theComponent.isEnabled()method.- Specified by:
enabledChangedin interfaceComponentStateListener- Overrides:
enabledChangedin classComponentSkin- Parameters:
component- The component whose enabled state is changing.
-
focusedChanged
public void focusedChanged(Component component, Component obverseComponent)
Description copied from interface:ComponentStateListenerCalled when a component's focused state has changed.This will be called both when a component gains focus and when it loses focus. The currently focused component has already been set when this method is called, so that the new state of the component can be determined by calling the
Component.isFocused()method.- Specified by:
focusedChangedin interfaceComponentStateListener- Overrides:
focusedChangedin classComponentSkin- Parameters:
component- The component that is either gaining focus or the one that previously had focus and is now losing it.obverseComponent- If the component is gaining focus, this is the component that is losing focus. If the component is losing focus this is the component that is gaining the focus instead.
-
getNodeAt
public Sequence.Tree.Path getNodeAt(int y)
Description copied from interface:TreeView.SkinGets the path to the node found at the specified y-coordinate (relative to the tree view).- Specified by:
getNodeAtin interfaceTreeView.Skin- Parameters:
y- The y-coordinate in pixels.- Returns:
- The path to the node, or
nullif there is no node being painted at the specified y-coordinate.
-
getNodeBounds
public Bounds getNodeBounds(Sequence.Tree.Path path)
Description copied from interface:TreeView.SkinGets the bounds of the node at the specified path relative to the tree view. Note that all nodes are left aligned with the tree; to get the pixel value of a node's indent, useTreeView.Skin.getNodeIndent(int).- Specified by:
getNodeBoundsin interfaceTreeView.Skin- Parameters:
path- The path to the node.- Returns:
- The bounds, or
nullif the node is not currently visible.
-
getNodeIndent
public int getNodeIndent(int depth)
Description copied from interface:TreeView.SkinGets the pixel indent of nodes at the specified depth. Depth is measured in generations away from the tree view's "root" node, which is represented by thetree data.- Specified by:
getNodeIndentin interfaceTreeView.Skin- Parameters:
depth- The depth, where the first child of the root has depth 1, the child of that branch has depth 2, etc.- Returns:
- The indent in pixels to the node's content.
-
getRowIndex
public int getRowIndex(Sequence.Tree.Path path)
Description copied from interface:TreeView.SkinGets the row index of the node, as seen in the current visible nodes list. Note that as branches are expanded and collapsed, the row index of any given node in the tree will change.- Specified by:
getRowIndexin interfaceTreeView.Skin- Parameters:
path- The path to the node.- Returns:
- The row index of the node, or
-1if the node is not currently visible.
-
treeDataChanged
public void treeDataChanged(TreeView treeView, List<?> previousTreeData)
Description copied from interface:TreeViewListenerCalled when a tree view's data has changed.- Specified by:
treeDataChangedin interfaceTreeViewListener- Parameters:
treeView- The source of this event.previousTreeData- The previous data for this tree.
-
nodeRendererChanged
public void nodeRendererChanged(TreeView treeView, TreeView.NodeRenderer previousNodeRenderer)
Description copied from interface:TreeViewListenerCalled when a tree view's node renderer has changed.- Specified by:
nodeRendererChangedin interfaceTreeViewListener- Parameters:
treeView- The source of this event.previousNodeRenderer- The previous renderer for tree nodes.
-
selectModeChanged
public void selectModeChanged(TreeView treeView, TreeView.SelectMode previousSelectMode)
Description copied from interface:TreeViewListenerCalled when a tree view's select mode has changed.- Specified by:
selectModeChangedin interfaceTreeViewListener- Parameters:
treeView- The source of this event.previousSelectMode- What the tree view's select mode was before the change.
-
checkmarksEnabledChanged
public void checkmarksEnabledChanged(TreeView treeView)
Description copied from interface:TreeViewListenerCalled when a tree view's checkmarks enabled flag has changed.- Specified by:
checkmarksEnabledChangedin interfaceTreeViewListener- Parameters:
treeView- The source of this event.
-
showMixedCheckmarkStateChanged
public void showMixedCheckmarkStateChanged(TreeView treeView)
Description copied from interface:TreeViewListenerCalled when a tree view's "show mixed checkmark state" flag has changed.- Specified by:
showMixedCheckmarkStateChangedin interfaceTreeViewListener- Parameters:
treeView- The tree view that has changed.
-
disabledNodeFilterChanged
public void disabledNodeFilterChanged(TreeView treeView, Filter<?> previousDisabledNodeFilter)
Description copied from interface:TreeViewListenerCalled when a tree view's disabled node filter has changed.- Specified by:
disabledNodeFilterChangedin interfaceTreeViewListener- Parameters:
treeView- The tree view that has changed.previousDisabledNodeFilter- The previous filter that determines the disabled nodes.
-
disabledCheckmarkFilterChanged
public void disabledCheckmarkFilterChanged(TreeView treeView, Filter<?> previousDisabledCheckmarkFilter)
Description copied from interface:TreeViewListenerCalled when a tree view's disabled checkmark filter has changed.- Specified by:
disabledCheckmarkFilterChangedin interfaceTreeViewListener- Parameters:
treeView- The source of this event.previousDisabledCheckmarkFilter- The previous filter that determined the disabled checkmarks.
-
branchExpanded
public void branchExpanded(TreeView treeView, Sequence.Tree.Path path)
Description copied from interface:TreeViewBranchListenerCalled when a tree node is expanded. This event can be used to perform lazy loading of tree node data.- Specified by:
branchExpandedin interfaceTreeViewBranchListener- Parameters:
treeView- The source of the event.path- The path of the node that was shown.
-
branchCollapsed
public void branchCollapsed(TreeView treeView, Sequence.Tree.Path path)
Description copied from interface:TreeViewBranchListenerCalled when a tree node is collapsed.- Specified by:
branchCollapsedin interfaceTreeViewBranchListener- Parameters:
treeView- The source of the event.path- The path of the node that was collapsed.
-
previewBranchExpandedChange
public Vote previewBranchExpandedChange(TreeView treeView, Sequence.Tree.Path path)
Description copied from interface:TreeViewBranchListenerCalled before a tree node is expanded or collapsed to allow the application or the skin to refuse the operation.- Specified by:
previewBranchExpandedChangein interfaceTreeViewBranchListener- Parameters:
treeView- The source of the event.path- The path of the node about to be collapsed or expanded.- Returns:
- The accumulated vote as to whether to allow this expansion or collapse.
-
branchExpandedChangeVetoed
public void branchExpandedChangeVetoed(TreeView treeView, Sequence.Tree.Path path, Vote reason)
Description copied from interface:TreeViewBranchListenerCalled when thepreviewBranchExpandedChange()tally produces anything but aVote.APPROVEresult (to say NOT to expand or collapse the branch). The application or skin can reverse any GUI changes that may have happened in the preview method.- Specified by:
branchExpandedChangeVetoedin interfaceTreeViewBranchListener- Parameters:
treeView- The source of the event.path- The path of the node whose state will remain the same.reason- The tallied vote result that caused the veto.
-
nodeInserted
public void nodeInserted(TreeView treeView, Sequence.Tree.Path path, int index)
Description copied from interface:TreeViewNodeListenerCalled when a node has been inserted into the tree view.- Specified by:
nodeInsertedin interfaceTreeViewNodeListener- Parameters:
treeView- The source of this event.path- The path to the branch where the node was inserted.index- The index of the newly inserted node within the branch.
-
nodesRemoved
public void nodesRemoved(TreeView treeView, Sequence.Tree.Path path, int index, int count)
Description copied from interface:TreeViewNodeListenerCalled when nodes have been removed from the tree view.- Specified by:
nodesRemovedin interfaceTreeViewNodeListener- Parameters:
treeView- The source of this event.path- The path to the branch where the node(s) were removed.index- The index to the first removed node within the branch.count- The number of nodes that were removed, or-1if all nodes were removed.
-
nodeUpdated
public void nodeUpdated(TreeView treeView, Sequence.Tree.Path path, int index)
Description copied from interface:TreeViewNodeListenerCalled when a node in the tree view has been updated.- Specified by:
nodeUpdatedin interfaceTreeViewNodeListener- Parameters:
treeView- The source of this event.path- Path to the branch that is the parent of the updated node.index- Index of the updated node within the branch.
-
nodesCleared
public void nodesCleared(TreeView treeView, Sequence.Tree.Path path)
Description copied from interface:TreeViewNodeListenerCalled when the nodes in a branch have been cleared.- Specified by:
nodesClearedin interfaceTreeViewNodeListener- Parameters:
treeView- The source of this event.path- Path to the branch where the nodes were cleared.
-
nodesSorted
public void nodesSorted(TreeView treeView, Sequence.Tree.Path path)
Description copied from interface:TreeViewNodeListenerCalled when the nodes in a branch have been sorted.- Specified by:
nodesSortedin interfaceTreeViewNodeListener- Parameters:
treeView- The source of this event.path- Path to the branch where the nodes were sorted.
-
nodeCheckStateChanged
public void nodeCheckStateChanged(TreeView treeView, Sequence.Tree.Path path, TreeView.NodeCheckState previousCheckState)
Description copied from interface:TreeViewNodeStateListenerCalled when a node's checked state has changed.- Specified by:
nodeCheckStateChangedin interfaceTreeViewNodeStateListener- Parameters:
treeView- The source of this event.path- Path to the node whose state has changed.previousCheckState- The previous check state of this node.
-
selectedPathAdded
public void selectedPathAdded(TreeView treeView, Sequence.Tree.Path path)
Description copied from interface:TreeViewSelectionListenerCalled when a selected path has been added to a tree view.- Specified by:
selectedPathAddedin interfaceTreeViewSelectionListener- Parameters:
treeView- The source of this event.path- The path that has been added to the selection.
-
selectedPathRemoved
public void selectedPathRemoved(TreeView treeView, Sequence.Tree.Path path)
Description copied from interface:TreeViewSelectionListenerCalled when a selected path has been removed from a tree view.- Specified by:
selectedPathRemovedin interfaceTreeViewSelectionListener- Parameters:
treeView- The source of this event.path- The path that was removed from the selection.
-
selectedPathsChanged
public void selectedPathsChanged(TreeView treeView, Sequence<Sequence.Tree.Path> previousSelectedPaths)
Description copied from interface:TreeViewSelectionListenerCalled when a tree view's selection state has been reset.- Specified by:
selectedPathsChangedin interfaceTreeViewSelectionListener- Parameters:
treeView- The source of this event.previousSelectedPaths- The list of paths that were previously selected.
-
-