org.apache.pivot.wtk.skin.terra
Class TerraTreeViewSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by 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
protected static class TerraTreeViewSkin.BranchInfo
          An internal data structure that keeps track of skin-related metadata for a tree branch.
protected static class TerraTreeViewSkin.NodeInfo
          An internal data structure that keeps track of skin-related metadata for a tree node.
protected static interface TerraTreeViewSkin.NodeInfoVisitor
          Node info visitor interface.
protected  class TerraTreeViewSkin.VisibleNodeIterator
          Iterates through the visible nodes.
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewListener
TreeViewListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewBranchListener
TreeViewBranchListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewNodeListener
TreeViewNodeListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeViewSelectionListener
TreeViewSelectionListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Constructor Summary
TerraTreeViewSkin()
           
 
Method Summary
protected  void accept(TerraTreeViewSkin.NodeInfoVisitor visitor)
          Accepts the specified visitor on all node info objects that exist in this skin's node info hierarchy.
 void branchCollapsed(TreeView treeView, Sequence.Tree.Path path)
          Called when a tree node is collapsed.
 void branchExpanded(TreeView treeView, Sequence.Tree.Path path)
          Called when a tree node is expanded.
 void checkmarksEnabledChanged(TreeView treeView)
          Called when a tree view's checkmarks enabled flag has changed.
protected  void clearHighlightedNode()
          Clears the highlighted node if one exists.
 void disabledCheckmarkFilterChanged(TreeView treeView, Filter<?> previousDisabledCheckmarkFilter)
          Called when a tree view's disabled checkmark filter has changed.
 void disabledNodeFilterChanged(TreeView treeView, Filter<?> previousDisabledNodeFilter)
          Called when a tree view's disabled node filter has changed.
 void enabledChanged(Component component)
          Called when a component's enabled state has changed.
 void focusedChanged(Component component, Component obverseComponent)
          Called when a component's focused state has changed.
 Color getBackgroundColor()
           
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 Color getBranchControlColor()
           
 Color getBranchControlInactiveSelectionColor()
           
 Color getBranchControlSelectionColor()
           
 Color getColor()
           
 Color getDisabledColor()
           
 Font getFont()
           
 Color getGridColor()
           
 Color getHighlightBackgroundColor()
           
 Color getHighlightColor()
           
 Color getInactiveSelectionBackgroundColor()
           
 Color getInactiveSelectionColor()
           
 int getIndent()
           
 Sequence.Tree.Path getNodeAt(int y)
          Gets the path to the node found at the specified y-coordinate (relative to the tree view).
 Bounds getNodeBounds(Sequence.Tree.Path path)
          Gets the bounds of the node at the specified path relative to the tree view.
protected  Bounds getNodeBounds(TerraTreeViewSkin.NodeInfo nodeInfo)
          Gets the bounding box defined by the specified node, or null if the node is not currently visible.
protected  int getNodeHeight()
          Gets the fixed node height of this skin.
 int getNodeIndent(int depth)
          Gets the pixel indent of nodes at the specified depth.
protected  TerraTreeViewSkin.NodeInfo getNodeInfoAt(int y)
          Gets the metadata associated with the node found at the specified y-coordinate, or null if there is no node at that location.
protected  TerraTreeViewSkin.NodeInfo getNodeInfoAt(Sequence.Tree.Path path)
          Gets the metadata associated with the node at the specified path.
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 int getRowIndex(Sequence.Tree.Path path)
          Gets the row index of the node, as seen in the current visible nodes list.
 Color getSelectionBackgroundColor()
           
 Color getSelectionColor()
           
 boolean getShowBranchControls()
           
 boolean getShowEmptyBranchControls()
           
 boolean getShowGridLines()
           
 boolean getShowHighlight()
           
 int getSpacing()
           
 void install(Component component)
          Associates a skin with a component.
 boolean isFocusable()
          By default, skins are focusable.
 boolean isOpaque()
          By default, skins are assumed to be opaque.
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          UP Selects the previous enabled node when select mode is not TreeView.SelectMode.NONE
DOWN Selects the next enabled node when select mode is not TreeView.SelectMode.NONE SHIFT + UP Increases the selection size by including the previous enabled node when select mode is TreeView.SelectMode.MULTI
SHIFT + DOWN Increases the selection size by including the next enabled node when select mode is TreeView.SelectMode.MULTI
 boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          SPACE toggles check mark selection when select mode is TreeView.SelectMode.SINGLE
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
          Called when a mouse button is clicked over a component.
 boolean mouseDown(Component component, Mouse.Button button, int x, int y)
          Called when a mouse button is pressed over a component.
 boolean mouseMove(Component component, int x, int y)
          Called when the mouse is moved over a component.
 void mouseOut(Component component)
          Called when the mouse exits a component.
 boolean mouseUp(Component component, Mouse.Button button, int x, int y)
          Called when a mouse button is released over a component.
 boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
          Called when the mouse wheel is scrolled over a component.
 void nodeCheckStateChanged(TreeView treeView, Sequence.Tree.Path path, TreeView.NodeCheckState previousCheckState)
          Called when a node's checked state has changed.
 void nodeEditorChanged(TreeView treeView, TreeView.NodeEditor previousNodeEditor)
          Called when a tree view's node editor has changed.
 void nodeInserted(TreeView treeView, Sequence.Tree.Path path, int index)
          Called when a node has been inserted into the tree view.
 void nodeRendererChanged(TreeView treeView, TreeView.NodeRenderer previousNodeRenderer)
          Called when a tree view's node renderer has changed.
 void nodesCleared(TreeView treeView, Sequence.Tree.Path path)
          Called when the nodes in a branch have been cleared.
 void nodesRemoved(TreeView treeView, Sequence.Tree.Path path, int index, int count)
          Called when nodes have been removed from the tree view.
 void nodesSorted(TreeView treeView, Sequence.Tree.Path path)
          Called when the nodes in a branch have been sorted.
 void nodeUpdated(TreeView treeView, Sequence.Tree.Path path, int index)
          Called when a node in the tree view has been updated.
 void paint(Graphics2D graphics)
          Paints the visual.
protected  void repaintNode(TerraTreeViewSkin.NodeInfo nodeInfo)
          Repaints the region occupied by the specified node.
 void selectedNodeChanged(TreeView treeView, Object previousSelectedNode)
          Called when a tree view's selected node has changed.
 void selectedPathAdded(TreeView treeView, Sequence.Tree.Path path)
          Called when a selected path has been added to a tree view.
 void selectedPathRemoved(TreeView treeView, Sequence.Tree.Path path)
          Called when a selected path has been removed from a tree view.
 void selectedPathsChanged(TreeView treeView, Sequence<Sequence.Tree.Path> previousSelectedPaths)
          Called when a tree view's selection state has been reset.
 void selectModeChanged(TreeView treeView, TreeView.SelectMode previousSelectMode)
          Called when a tree view's select mode has changed.
 void setBackgroundColor(Color backgroundColor)
           
 void setBackgroundColor(int backgroundColor)
           
 void setBackgroundColor(String backgroundColor)
           
 void setBranchControlColor(Color branchControlColor)
           
 void setBranchControlColor(int branchControlColor)
           
 void setBranchControlColor(String branchControlColor)
           
 void setBranchControlInactiveSelectionColor(Color branchControlInactiveSelectionColor)
           
 void setBranchControlInactiveSelectionColor(int branchControlInactiveSelectionColor)
           
 void setBranchControlInactiveSelectionColor(String branchControlInactiveSelectionColor)
           
 void setBranchControlSelectionColor(Color branchControlSelectionColor)
           
 void setBranchControlSelectionColor(int branchControlSelectionColor)
           
 void setBranchControlSelectionColor(String branchControlSelectionColor)
           
 void setColor(Color color)
           
 void setColor(int color)
           
 void setColor(String color)
           
 void setDisabledColor(Color disabledColor)
           
 void setDisabledColor(int disabledColor)
           
 void setDisabledColor(String disabledColor)
           
 void setFont(Dictionary<String,?> font)
           
 void setFont(Font font)
           
 void setFont(String font)
           
 void setGridColor(Color gridColor)
           
 void setGridColor(int gridColor)
           
 void setGridColor(String gridColor)
           
 void setHighlightBackgroundColor(Color highlightBackgroundColor)
           
 void setHighlightBackgroundColor(int highlightBackgroundColor)
           
 void setHighlightBackgroundColor(String highlightBackgroundColor)
           
 void setHighlightColor(Color highlightColor)
           
 void setHighlightColor(int highlightColor)
           
 void setHighlightColor(String highlightColor)
           
 void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
           
 void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)
           
 void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
           
 void setInactiveSelectionColor(Color inactiveSelectionColor)
           
 void setInactiveSelectionColor(int inactiveSelectionColor)
           
 void setInactiveSelectionColor(String inactiveSelectionColor)
           
 void setIndent(int indent)
           
 void setIndent(Number indent)
           
 void setSelectionBackgroundColor(Color selectionBackgroundColor)
           
 void setSelectionBackgroundColor(int selectionBackgroundColor)
           
 void setSelectionBackgroundColor(String selectionBackgroundColor)
           
 void setSelectionColor(Color selectionColor)
           
 void setSelectionColor(int selectionColor)
           
 void setSelectionColor(String selectionColor)
           
 void setShowBranchControls(boolean showBranchControls)
           
 void setShowEmptyBranchControls(boolean showEmptyBranchControls)
           
 void setShowGridLines(boolean showGridLines)
           
 void setShowHighlight(boolean showHighlight)
           
 void setSpacing(int spacing)
           
 void setSpacing(Number spacing)
           
 void showMixedCheckmarkStateChanged(TreeView treeView)
          Called when a tree view's "show mixed checkmark state" flag has changed.
 void treeDataChanged(TreeView treeView, List<?> previousTreeData)
          Called when a tree view's data has changed.
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, getBaseline, getComponent, getHeight, getPreferredSize, getWidth, heightLimitsChanged, invalidateComponent, keyTyped, locationChanged, menuHandlerChanged, mouseOver, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerraTreeViewSkin

public TerraTreeViewSkin()
Method Detail

install

public void install(Component component)
Description copied from interface: Skin
Associates a skin with a component.

Specified by:
install in interface Skin
Overrides:
install in class ComponentSkin
Parameters:
component - The component to which the skin is being attached.

getPreferredWidth

public int getPreferredWidth(int height)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.

Specified by:
getPreferredWidth in interface ConstrainedVisual
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

getPreferredHeight

public int getPreferredHeight(int width)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.

Specified by:
getPreferredHeight in interface ConstrainedVisual
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getBaseline

public int getBaseline(int width,
                       int height)
Description copied from interface: ConstrainedVisual
Returns the baseline for a given width and height.

Specified by:
getBaseline in interface ConstrainedVisual
Overrides:
getBaseline in class ComponentSkin
Returns:
The baseline relative to the origin of this visual, or -1 if this visual does not have a baseline.

layout

public void layout()
Description copied from interface: Skin
If the component on which the skin is installed is a container, lays out the container's children.

Specified by:
layout in interface Skin

paint

public void paint(Graphics2D graphics)
Description copied from interface: Visual
Paints the visual.

Specified by:
paint in interface Visual
Parameters:
graphics - The graphics context in which to paint the visual.

getFont

public Font getFont()

setFont

public void setFont(Font font)

setFont

public final void setFont(String font)

setFont

public final void setFont(Dictionary<String,?> font)

getColor

public Color getColor()

setColor

public void setColor(Color color)

setColor

public void setColor(String color)

setColor

public final void setColor(int color)

getDisabledColor

public Color getDisabledColor()

setDisabledColor

public void setDisabledColor(Color disabledColor)

setDisabledColor

public void setDisabledColor(String disabledColor)

setDisabledColor

public final void setDisabledColor(int disabledColor)

getBackgroundColor

public Color getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(Color backgroundColor)

setBackgroundColor

public void setBackgroundColor(String backgroundColor)

setBackgroundColor

public final void setBackgroundColor(int backgroundColor)

getSelectionColor

public Color getSelectionColor()

setSelectionColor

public void setSelectionColor(Color selectionColor)

setSelectionColor

public void setSelectionColor(String selectionColor)

setSelectionColor

public final void setSelectionColor(int selectionColor)

getSelectionBackgroundColor

public Color getSelectionBackgroundColor()

setSelectionBackgroundColor

public void setSelectionBackgroundColor(Color selectionBackgroundColor)

setSelectionBackgroundColor

public void setSelectionBackgroundColor(String selectionBackgroundColor)

setSelectionBackgroundColor

public final void setSelectionBackgroundColor(int selectionBackgroundColor)

getInactiveSelectionColor

public Color getInactiveSelectionColor()

setInactiveSelectionColor

public void setInactiveSelectionColor(Color inactiveSelectionColor)

setInactiveSelectionColor

public void setInactiveSelectionColor(String inactiveSelectionColor)

setInactiveSelectionColor

public final void setInactiveSelectionColor(int inactiveSelectionColor)

getInactiveSelectionBackgroundColor

public Color getInactiveSelectionBackgroundColor()

setInactiveSelectionBackgroundColor

public void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)

setInactiveSelectionBackgroundColor

public void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)

setInactiveSelectionBackgroundColor

public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)

getHighlightColor

public Color getHighlightColor()

setHighlightColor

public void setHighlightColor(Color highlightColor)

setHighlightColor

public void setHighlightColor(String highlightColor)

setHighlightColor

public final void setHighlightColor(int highlightColor)

getHighlightBackgroundColor

public Color getHighlightBackgroundColor()

setHighlightBackgroundColor

public void setHighlightBackgroundColor(Color highlightBackgroundColor)

setHighlightBackgroundColor

public void setHighlightBackgroundColor(String highlightBackgroundColor)

setHighlightBackgroundColor

public final void setHighlightBackgroundColor(int highlightBackgroundColor)

getSpacing

public int getSpacing()

setSpacing

public void setSpacing(int spacing)

setSpacing

public void setSpacing(Number spacing)

getIndent

public int getIndent()

setIndent

public void setIndent(int indent)

setIndent

public void setIndent(Number indent)

getShowHighlight

public boolean getShowHighlight()

setShowHighlight

public void setShowHighlight(boolean showHighlight)

getShowBranchControls

public boolean getShowBranchControls()

setShowBranchControls

public void setShowBranchControls(boolean showBranchControls)

getShowEmptyBranchControls

public boolean getShowEmptyBranchControls()

setShowEmptyBranchControls

public void setShowEmptyBranchControls(boolean showEmptyBranchControls)

getBranchControlColor

public Color getBranchControlColor()

setBranchControlColor

public void setBranchControlColor(Color branchControlColor)

setBranchControlColor

public void setBranchControlColor(String branchControlColor)

setBranchControlColor

public final void setBranchControlColor(int branchControlColor)

getBranchControlSelectionColor

public Color getBranchControlSelectionColor()

setBranchControlSelectionColor

public void setBranchControlSelectionColor(Color branchControlSelectionColor)

setBranchControlSelectionColor

public void setBranchControlSelectionColor(String branchControlSelectionColor)

setBranchControlSelectionColor

public final void setBranchControlSelectionColor(int branchControlSelectionColor)

getBranchControlInactiveSelectionColor

public Color getBranchControlInactiveSelectionColor()

setBranchControlInactiveSelectionColor

public void setBranchControlInactiveSelectionColor(Color branchControlInactiveSelectionColor)

setBranchControlInactiveSelectionColor

public void setBranchControlInactiveSelectionColor(String branchControlInactiveSelectionColor)

setBranchControlInactiveSelectionColor

public final void setBranchControlInactiveSelectionColor(int branchControlInactiveSelectionColor)

getGridColor

public Color getGridColor()

setGridColor

public void setGridColor(Color gridColor)

setGridColor

public void setGridColor(String gridColor)

setGridColor

public final void setGridColor(int gridColor)

getShowGridLines

public boolean getShowGridLines()

setShowGridLines

public void setShowGridLines(boolean showGridLines)

getNodeHeight

protected int getNodeHeight()
Gets the fixed node height of this skin.


getNodeInfoAt

protected final TerraTreeViewSkin.NodeInfo getNodeInfoAt(int y)
Gets the metadata associated with the node found at the specified y-coordinate, or null if there is no node at that location.


getNodeInfoAt

protected final TerraTreeViewSkin.NodeInfo getNodeInfoAt(Sequence.Tree.Path path)
Gets 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.


getNodeBounds

protected final Bounds getNodeBounds(TerraTreeViewSkin.NodeInfo nodeInfo)
Gets the bounding box defined by the specified node, or null if 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(TerraTreeViewSkin.NodeInfo nodeInfo)
Repaints the region occupied by the specified node.


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: ComponentMouseListener
Called when the mouse is moved over a component.

Specified by:
mouseMove in interface ComponentMouseListener
Overrides:
mouseMove in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

mouseOut

public void mouseOut(Component component)
Description copied from interface: ComponentMouseListener
Called when the mouse exits a component.

Specified by:
mouseOut in interface ComponentMouseListener
Overrides:
mouseOut in class ComponentSkin

mouseDown

public boolean mouseDown(Component component,
                         Mouse.Button button,
                         int x,
                         int y)
Description copied from interface: ComponentMouseButtonListener
Called when a mouse button is pressed over a component.

Specified by:
mouseDown in interface ComponentMouseButtonListener
Overrides:
mouseDown in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

mouseUp

public boolean mouseUp(Component component,
                       Mouse.Button button,
                       int x,
                       int y)
Description copied from interface: ComponentMouseButtonListener
Called when a mouse button is released over a component.

Specified by:
mouseUp in interface ComponentMouseButtonListener
Overrides:
mouseUp in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

mouseClick

public boolean mouseClick(Component component,
                          Mouse.Button button,
                          int x,
                          int y,
                          int count)
Description copied from interface: ComponentMouseButtonListener
Called when a mouse button is clicked over a component.

Specified by:
mouseClick in interface ComponentMouseButtonListener
Overrides:
mouseClick in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

mouseWheel

public boolean mouseWheel(Component component,
                          Mouse.ScrollType scrollType,
                          int scrollAmount,
                          int wheelRotation,
                          int x,
                          int y)
Description copied from interface: ComponentMouseWheelListener
Called when the mouse wheel is scrolled over a component.

Specified by:
mouseWheel in interface ComponentMouseWheelListener
Overrides:
mouseWheel in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

keyPressed

public boolean keyPressed(Component component,
                          int keyCode,
                          Keyboard.KeyLocation keyLocation)
UP Selects the previous enabled node when select mode is not TreeView.SelectMode.NONE
DOWN Selects the next enabled node when select mode is not TreeView.SelectMode.NONE

SHIFT + UP Increases the selection size by including the previous enabled node when select mode is TreeView.SelectMode.MULTI
SHIFT + DOWN Increases the selection size by including the next enabled node when select mode is TreeView.SelectMode.MULTI

Specified by:
keyPressed in interface ComponentKeyListener
Overrides:
keyPressed in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

keyReleased

public boolean keyReleased(Component component,
                           int keyCode,
                           Keyboard.KeyLocation keyLocation)
SPACE toggles check mark selection when select mode is TreeView.SelectMode.SINGLE

Specified by:
keyReleased in interface ComponentKeyListener
Overrides:
keyReleased in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

isFocusable

public boolean isFocusable()
Description copied from class: ComponentSkin
By default, skins are focusable.

Specified by:
isFocusable in interface Skin
Overrides:
isFocusable in class ComponentSkin
Returns:
true if this skin is focusable; false, otherwise.

isOpaque

public boolean isOpaque()
Description copied from class: ComponentSkin
By default, skins are assumed to be opaque.

Specified by:
isOpaque in interface Skin
Overrides:
isOpaque in class ComponentSkin
Returns:
true if this skin is opaque; false if any part of it is transparent or translucent.

enabledChanged

public void enabledChanged(Component component)
Description copied from interface: ComponentStateListener
Called when a component's enabled state has changed.

Called both when the component is enabled and when it is disabled. The component's enabled flag has already been set when this method is called so the new state can be determined by calling the Component.isEnabled() method.

Specified by:
enabledChanged in interface ComponentStateListener
Overrides:
enabledChanged in class ComponentSkin
Parameters:
component - The component whose enabled state is changing.

focusedChanged

public void focusedChanged(Component component,
                           Component obverseComponent)
Description copied from interface: ComponentStateListener
Called 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:
focusedChanged in interface ComponentStateListener
Overrides:
focusedChanged in class ComponentSkin
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.Skin
Gets the path to the node found at the specified y-coordinate (relative to the tree view).

Specified by:
getNodeAt in interface TreeView.Skin
Parameters:
y - The y-coordinate in pixels.
Returns:
The path to the node, or null if there is no node being painted at the specified y-coordinate.

getNodeBounds

public Bounds getNodeBounds(Sequence.Tree.Path path)
Description copied from interface: TreeView.Skin
Gets 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, use TreeView.Skin.getNodeIndent(int).

Specified by:
getNodeBounds in interface TreeView.Skin
Parameters:
path - The path to the node.
Returns:
The bounds, or null if the node is not currently visible.

getNodeIndent

public int getNodeIndent(int depth)
Description copied from interface: TreeView.Skin
Gets 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 the tree data.

Specified by:
getNodeIndent in interface TreeView.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.Skin
Gets 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:
getRowIndex in interface TreeView.Skin
Parameters:
path - The path to the node.
Returns:
The row index of the node, or -1 if the node is not currently visible.

treeDataChanged

public void treeDataChanged(TreeView treeView,
                            List<?> previousTreeData)
Description copied from interface: TreeViewListener
Called when a tree view's data has changed.

Specified by:
treeDataChanged in interface TreeViewListener

nodeRendererChanged

public void nodeRendererChanged(TreeView treeView,
                                TreeView.NodeRenderer previousNodeRenderer)
Description copied from interface: TreeViewListener
Called when a tree view's node renderer has changed.

Specified by:
nodeRendererChanged in interface TreeViewListener

nodeEditorChanged

public void nodeEditorChanged(TreeView treeView,
                              TreeView.NodeEditor previousNodeEditor)
Description copied from interface: TreeViewListener
Called when a tree view's node editor has changed.

Specified by:
nodeEditorChanged in interface TreeViewListener

selectModeChanged

public void selectModeChanged(TreeView treeView,
                              TreeView.SelectMode previousSelectMode)
Description copied from interface: TreeViewListener
Called when a tree view's select mode has changed.

Specified by:
selectModeChanged in interface TreeViewListener

checkmarksEnabledChanged

public void checkmarksEnabledChanged(TreeView treeView)
Description copied from interface: TreeViewListener
Called when a tree view's checkmarks enabled flag has changed.

Specified by:
checkmarksEnabledChanged in interface TreeViewListener

showMixedCheckmarkStateChanged

public void showMixedCheckmarkStateChanged(TreeView treeView)
Description copied from interface: TreeViewListener
Called when a tree view's "show mixed checkmark state" flag has changed.

Specified by:
showMixedCheckmarkStateChanged in interface TreeViewListener

disabledNodeFilterChanged

public void disabledNodeFilterChanged(TreeView treeView,
                                      Filter<?> previousDisabledNodeFilter)
Description copied from interface: TreeViewListener
Called when a tree view's disabled node filter has changed.

Specified by:
disabledNodeFilterChanged in interface TreeViewListener

disabledCheckmarkFilterChanged

public void disabledCheckmarkFilterChanged(TreeView treeView,
                                           Filter<?> previousDisabledCheckmarkFilter)
Description copied from interface: TreeViewListener
Called when a tree view's disabled checkmark filter has changed.

Specified by:
disabledCheckmarkFilterChanged in interface TreeViewListener

branchExpanded

public void branchExpanded(TreeView treeView,
                           Sequence.Tree.Path path)
Description copied from interface: TreeViewBranchListener
Called when a tree node is expanded. This event can be used to perform lazy loading of tree node data.

Specified by:
branchExpanded in interface TreeViewBranchListener
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: TreeViewBranchListener
Called when a tree node is collapsed.

Specified by:
branchCollapsed in interface TreeViewBranchListener
Parameters:
treeView - The source of the event.
path - The path of the node that was collapsed.

nodeInserted

public void nodeInserted(TreeView treeView,
                         Sequence.Tree.Path path,
                         int index)
Description copied from interface: TreeViewNodeListener
Called when a node has been inserted into the tree view.

Specified by:
nodeInserted in interface TreeViewNodeListener

nodesRemoved

public void nodesRemoved(TreeView treeView,
                         Sequence.Tree.Path path,
                         int index,
                         int count)
Description copied from interface: TreeViewNodeListener
Called when nodes have been removed from the tree view.

Specified by:
nodesRemoved in interface TreeViewNodeListener
count - The number of nodes that were removed, or -1 if all nodes were removed.

nodeUpdated

public void nodeUpdated(TreeView treeView,
                        Sequence.Tree.Path path,
                        int index)
Description copied from interface: TreeViewNodeListener
Called when a node in the tree view has been updated.

Specified by:
nodeUpdated in interface TreeViewNodeListener

nodesCleared

public void nodesCleared(TreeView treeView,
                         Sequence.Tree.Path path)
Description copied from interface: TreeViewNodeListener
Called when the nodes in a branch have been cleared.

Specified by:
nodesCleared in interface TreeViewNodeListener

nodesSorted

public void nodesSorted(TreeView treeView,
                        Sequence.Tree.Path path)
Description copied from interface: TreeViewNodeListener
Called when the nodes in a branch have been sorted.

Specified by:
nodesSorted in interface TreeViewNodeListener

nodeCheckStateChanged

public void nodeCheckStateChanged(TreeView treeView,
                                  Sequence.Tree.Path path,
                                  TreeView.NodeCheckState previousCheckState)
Description copied from interface: TreeViewNodeStateListener
Called when a node's checked state has changed.

Specified by:
nodeCheckStateChanged in interface TreeViewNodeStateListener

selectedPathAdded

public void selectedPathAdded(TreeView treeView,
                              Sequence.Tree.Path path)
Description copied from interface: TreeViewSelectionListener
Called when a selected path has been added to a tree view.

Specified by:
selectedPathAdded in interface TreeViewSelectionListener

selectedPathRemoved

public void selectedPathRemoved(TreeView treeView,
                                Sequence.Tree.Path path)
Description copied from interface: TreeViewSelectionListener
Called when a selected path has been removed from a tree view.

Specified by:
selectedPathRemoved in interface TreeViewSelectionListener

selectedPathsChanged

public void selectedPathsChanged(TreeView treeView,
                                 Sequence<Sequence.Tree.Path> previousSelectedPaths)
Description copied from interface: TreeViewSelectionListener
Called when a tree view's selection state has been reset.

Specified by:
selectedPathsChanged in interface TreeViewSelectionListener

selectedNodeChanged

public void selectedNodeChanged(TreeView treeView,
                                Object previousSelectedNode)
Description copied from interface: TreeViewSelectionListener
Called when a tree view's selected node has changed.

Specified by:
selectedNodeChanged in interface TreeViewSelectionListener