org.apache.pivot.wtk
Interface TreeView.Skin

All Known Implementing Classes:
TerraTreeViewSkin
Enclosing class:
TreeView

public static interface TreeView.Skin

Tree view skin interface. Tree view skins must implement this.


Method Summary
 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.
 int getNodeIndent(int depth)
          Gets the pixel indent of nodes at the specified depth.
 int getRowIndex(Sequence.Tree.Path path)
          Gets the row index of the node, as seen in the current visible nodes list.
 

Method Detail

getNodeAt

Sequence.Tree.Path getNodeAt(int y)
Gets the path to the node found at the specified y-coordinate (relative to the tree view).

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

Bounds getNodeBounds(Sequence.Tree.Path path)
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 getNodeIndent(int).

Parameters:
path - The path to the node.
Returns:
The bounds, or null if the node is not currently visible.

getNodeIndent

int getNodeIndent(int depth)
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.

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

int getRowIndex(Sequence.Tree.Path path)
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.

Parameters:
path - The path to the node.
Returns:
The row index of the node, or -1 if the node is not currently visible.