|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.wtk.skin.ComponentSkin
pivot.wtk.skin.terra.TerraTreeViewSkin
public class TerraTreeViewSkin
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. |
Field Summary |
---|
Fields inherited from class pivot.wtk.skin.ComponentSkin |
---|
SHOW_TOOLTIP_TIMEOUT |
Constructor Summary | |
---|---|
TerraTreeViewSkin()
|
Method Summary | |
---|---|
void |
branchCollapsed(TreeView treeView,
Sequence<java.lang.Integer> path)
Called when a tree node is collapsed. |
void |
branchExpanded(TreeView treeView,
Sequence<java.lang.Integer> 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 |
enabledChanged(Component component)
Called when a component's enabled state has changed. |
void |
focusedChanged(Component component,
boolean temporary)
Called when a component's focused state has changed. |
java.awt.Color |
getBackgroundColor()
|
java.awt.Color |
getBranchControlColor()
|
java.awt.Color |
getBranchControlDisabledColor()
|
java.awt.Color |
getBranchControlInactiveSelectionColor()
|
java.awt.Color |
getBranchControlSelectionColor()
|
java.awt.Color |
getColor()
|
java.awt.Color |
getDisabledColor()
|
java.awt.Font |
getFont()
|
java.awt.Color |
getGridColor()
|
java.awt.Color |
getHighlightBackgroundColor()
|
java.awt.Color |
getHighlightColor()
|
java.awt.Color |
getInactiveSelectionBackgroundColor()
|
java.awt.Color |
getInactiveSelectionColor()
|
int |
getIndent()
|
Sequence<java.lang.Integer> |
getNodeAt(int y)
Gets the path to the node found at the specified y-coordinate (relative to the tree view). |
Bounds |
getNodeBounds(Sequence<java.lang.Integer> 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<java.lang.Integer> 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. |
Dimensions |
getPreferredSize()
Returns the visual's unconstrained preferred size. |
int |
getPreferredWidth(int height)
Returns the visual's preferred width given the provided height constraint. |
java.awt.Color |
getSelectionBackgroundColor()
|
java.awt.Color |
getSelectionColor()
|
boolean |
getShowBranchControls()
|
boolean |
getShowGridLines()
|
boolean |
getShowHighlight()
|
int |
getSpacing()
|
void |
install(Component component)
Associates a skin with a component. |
boolean |
keyPressed(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
Called when a key has been pressed. |
boolean |
keyReleased(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
Called when a key has been released. |
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 |
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<java.lang.Integer> path,
TreeView.NodeCheckState previousCheckState)
Called when a node's checked state has changed. |
void |
nodeDisabledChanged(TreeView treeView,
Sequence<java.lang.Integer> path)
Called when a node's disabled 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<java.lang.Integer> 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 |
nodesRemoved(TreeView treeView,
Sequence<java.lang.Integer> path,
int index,
int count)
Called when nodes have been removed from the tree view. |
void |
nodesSorted(TreeView treeView,
Sequence<java.lang.Integer> path)
Called when the nodes in a branch have been sorted. |
void |
nodeUpdated(TreeView treeView,
Sequence<java.lang.Integer> path,
int index)
Called when a node in the tree view has been updated. |
void |
paint(java.awt.Graphics2D graphics)
Paints the visual. |
protected void |
repaintNode(TerraTreeViewSkin.NodeInfo nodeInfo)
Repaints the region occupied by the specified node. |
void |
selectedPathAdded(TreeView treeView,
Sequence<java.lang.Integer> path)
Called when a selected path has been added to a tree view. |
void |
selectedPathRemoved(TreeView treeView,
Sequence<java.lang.Integer> path)
Called when a selected path has been removed from a tree view. |
void |
selectedPathsChanged(TreeView treeView,
Sequence<Sequence<java.lang.Integer>> 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(java.awt.Color backgroundColor)
|
void |
setBackgroundColor(int backgroundColor)
|
void |
setBackgroundColor(java.lang.String backgroundColor)
|
void |
setBranchControlColor(java.awt.Color branchControlColor)
|
void |
setBranchControlColor(int branchControlColor)
|
void |
setBranchControlColor(java.lang.String branchControlColor)
|
void |
setBranchControlDisabledColor(java.awt.Color branchControlDisabledColor)
|
void |
setBranchControlDisabledColor(int branchControlDisabledColor)
|
void |
setBranchControlDisabledColor(java.lang.String branchControlDisabledColor)
|
void |
setBranchControlInactiveSelectionColor(java.awt.Color branchControlInactiveSelectionColor)
|
void |
setBranchControlInactiveSelectionColor(int branchControlInactiveSelectionColor)
|
void |
setBranchControlInactiveSelectionColor(java.lang.String branchControlInactiveSelectionColor)
|
void |
setBranchControlSelectionColor(java.awt.Color branchControlSelectionColor)
|
void |
setBranchControlSelectionColor(int branchControlSelectionColor)
|
void |
setBranchControlSelectionColor(java.lang.String branchControlSelectionColor)
|
void |
setColor(java.awt.Color color)
|
void |
setColor(int color)
|
void |
setColor(java.lang.String color)
|
void |
setDisabledColor(java.awt.Color disabledColor)
|
void |
setDisabledColor(int disabledColor)
|
void |
setDisabledColor(java.lang.String disabledColor)
|
void |
setFont(java.awt.Font font)
|
void |
setFont(java.lang.String font)
|
void |
setGridColor(java.awt.Color gridColor)
|
void |
setGridColor(int gridColor)
|
void |
setGridColor(java.lang.String gridColor)
|
void |
setHighlightBackgroundColor(java.awt.Color highlightBackgroundColor)
|
void |
setHighlightBackgroundColor(int highlightBackgroundColor)
|
void |
setHighlightBackgroundColor(java.lang.String highlightBackgroundColor)
|
void |
setHighlightColor(java.awt.Color highlightColor)
|
void |
setHighlightColor(int highlightColor)
|
void |
setHighlightColor(java.lang.String highlightColor)
|
void |
setInactiveSelectionBackgroundColor(java.awt.Color inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionBackgroundColor(java.lang.String inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionColor(java.awt.Color inactiveSelectionColor)
|
void |
setInactiveSelectionColor(int inactiveSelectionColor)
|
void |
setInactiveSelectionColor(java.lang.String inactiveSelectionColor)
|
void |
setIndent(int indent)
|
void |
setIndent(java.lang.Number indent)
|
void |
setSelectionBackgroundColor(java.awt.Color selectionBackgroundColor)
|
void |
setSelectionBackgroundColor(int selectionBackgroundColor)
|
void |
setSelectionBackgroundColor(java.lang.String selectionBackgroundColor)
|
void |
setSelectionColor(java.awt.Color selectionColor)
|
void |
setSelectionColor(int selectionColor)
|
void |
setSelectionColor(java.lang.String selectionColor)
|
void |
setShowBranchControls(boolean showBranchControls)
|
void |
setShowGridLines(boolean showGridLines)
|
void |
setShowHighlight(boolean showHighlight)
|
void |
setSpacing(int spacing)
|
void |
setSpacing(java.lang.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. |
void |
uninstall()
Dissociates a skin from a component. |
Methods inherited from class pivot.wtk.skin.ComponentSkin |
---|
cursorChanged, decodeColor, displayableChanged, getComponent, getHeight, getWidth, invalidateComponent, isFocusable, keyTyped, locationChanged, mouseOver, mouseUp, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerraTreeViewSkin()
Method Detail |
---|
public void install(Component component)
Skin
install
in interface Skin
install
in class ComponentSkin
component
- The component to which the skin is being attached.public void uninstall()
Skin
uninstall
in interface Skin
uninstall
in class ComponentSkin
public int getPreferredWidth(int height)
ConstrainedVisual
getPreferredWidth
in interface ConstrainedVisual
height
- The height by which to constrain the preferred width, or -1
for no constraint.public int getPreferredHeight(int width)
ConstrainedVisual
getPreferredHeight
in interface ConstrainedVisual
width
- The width by which to constrain the preferred height, or -1
for no constraint.public Dimensions getPreferredSize()
ConstrainedVisual
getPreferredSize
in interface ConstrainedVisual
getPreferredSize
in class ComponentSkin
public void layout()
Skin
layout
in interface Skin
public void paint(java.awt.Graphics2D graphics)
Visual
paint
in interface Visual
graphics
- The graphics context in which to paint the visual.public java.awt.Font getFont()
public void setFont(java.awt.Font font)
public void setFont(java.lang.String font)
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public void setColor(java.lang.String color)
public final void setColor(int color)
public java.awt.Color getDisabledColor()
public void setDisabledColor(java.awt.Color disabledColor)
public void setDisabledColor(java.lang.String disabledColor)
public final void setDisabledColor(int disabledColor)
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
public void setBackgroundColor(java.lang.String backgroundColor)
public final void setBackgroundColor(int backgroundColor)
public java.awt.Color getSelectionColor()
public void setSelectionColor(java.awt.Color selectionColor)
public void setSelectionColor(java.lang.String selectionColor)
public final void setSelectionColor(int selectionColor)
public java.awt.Color getSelectionBackgroundColor()
public void setSelectionBackgroundColor(java.awt.Color selectionBackgroundColor)
public void setSelectionBackgroundColor(java.lang.String selectionBackgroundColor)
public final void setSelectionBackgroundColor(int selectionBackgroundColor)
public java.awt.Color getInactiveSelectionColor()
public void setInactiveSelectionColor(java.awt.Color inactiveSelectionColor)
public void setInactiveSelectionColor(java.lang.String inactiveSelectionColor)
public final void setInactiveSelectionColor(int inactiveSelectionColor)
public java.awt.Color getInactiveSelectionBackgroundColor()
public void setInactiveSelectionBackgroundColor(java.awt.Color inactiveSelectionBackgroundColor)
public void setInactiveSelectionBackgroundColor(java.lang.String inactiveSelectionBackgroundColor)
public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)
public java.awt.Color getHighlightColor()
public void setHighlightColor(java.awt.Color highlightColor)
public void setHighlightColor(java.lang.String highlightColor)
public final void setHighlightColor(int highlightColor)
public java.awt.Color getHighlightBackgroundColor()
public void setHighlightBackgroundColor(java.awt.Color highlightBackgroundColor)
public void setHighlightBackgroundColor(java.lang.String highlightBackgroundColor)
public final void setHighlightBackgroundColor(int highlightBackgroundColor)
public int getSpacing()
public void setSpacing(int spacing)
public void setSpacing(java.lang.Number spacing)
public int getIndent()
public void setIndent(int indent)
public void setIndent(java.lang.Number indent)
public boolean getShowHighlight()
public void setShowHighlight(boolean showHighlight)
public boolean getShowBranchControls()
public void setShowBranchControls(boolean showBranchControls)
public java.awt.Color getBranchControlColor()
public void setBranchControlColor(java.awt.Color branchControlColor)
public void setBranchControlColor(java.lang.String branchControlColor)
public final void setBranchControlColor(int branchControlColor)
public java.awt.Color getBranchControlDisabledColor()
public void setBranchControlDisabledColor(java.awt.Color branchControlDisabledColor)
public void setBranchControlDisabledColor(java.lang.String branchControlDisabledColor)
public final void setBranchControlDisabledColor(int branchControlDisabledColor)
public java.awt.Color getBranchControlSelectionColor()
public void setBranchControlSelectionColor(java.awt.Color branchControlSelectionColor)
public void setBranchControlSelectionColor(java.lang.String branchControlSelectionColor)
public final void setBranchControlSelectionColor(int branchControlSelectionColor)
public java.awt.Color getBranchControlInactiveSelectionColor()
public void setBranchControlInactiveSelectionColor(java.awt.Color branchControlInactiveSelectionColor)
public void setBranchControlInactiveSelectionColor(java.lang.String branchControlInactiveSelectionColor)
public final void setBranchControlInactiveSelectionColor(int branchControlInactiveSelectionColor)
public java.awt.Color getGridColor()
public void setGridColor(java.awt.Color gridColor)
public void setGridColor(java.lang.String gridColor)
public final void setGridColor(int gridColor)
public boolean getShowGridLines()
public void setShowGridLines(boolean showGridLines)
protected int getNodeHeight()
protected TerraTreeViewSkin.NodeInfo getNodeInfoAt(int y)
protected TerraTreeViewSkin.NodeInfo getNodeInfoAt(Sequence<java.lang.Integer> path)
protected Bounds getNodeBounds(TerraTreeViewSkin.NodeInfo nodeInfo)
protected void repaintNode(TerraTreeViewSkin.NodeInfo nodeInfo)
protected void clearHighlightedNode()
public boolean mouseMove(Component component, int x, int y)
ComponentMouseListener
mouseMove
in interface ComponentMouseListener
mouseMove
in class ComponentSkin
public void mouseOut(Component component)
ComponentMouseListener
mouseOut
in interface ComponentMouseListener
mouseOut
in class ComponentSkin
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
ComponentMouseButtonListener
mouseDown
in interface ComponentMouseButtonListener
mouseDown
in class ComponentSkin
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
ComponentMouseButtonListener
mouseClick
in interface ComponentMouseButtonListener
mouseClick
in class ComponentSkin
public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
ComponentMouseWheelListener
mouseWheel
in interface ComponentMouseWheelListener
mouseWheel
in class ComponentSkin
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ComponentKeyListener
keyPressed
in interface ComponentKeyListener
keyPressed
in class ComponentSkin
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ComponentKeyListener
keyReleased
in interface ComponentKeyListener
keyReleased
in class ComponentSkin
public void enabledChanged(Component component)
ComponentStateListener
enabledChanged
in interface ComponentStateListener
enabledChanged
in class ComponentSkin
public void focusedChanged(Component component, boolean temporary)
ComponentStateListener
focusedChanged
in interface ComponentStateListener
focusedChanged
in class ComponentSkin
public Sequence<java.lang.Integer> getNodeAt(int y)
TreeView.Skin
getNodeAt
in interface TreeView.Skin
y
- The y-coordinate in pixels.
public Bounds getNodeBounds(Sequence<java.lang.Integer> path)
TreeView.Skin
TreeView.Skin.getNodeIndent(int)
.
getNodeBounds
in interface TreeView.Skin
path
- The path to the node.
public int getNodeIndent(int depth)
TreeView.Skin
tree data
.
getNodeIndent
in interface TreeView.Skin
depth
- The depth, where the first child of the root has depth 1, the child
of that branch has depth 2, etc.
public void treeDataChanged(TreeView treeView, List<?> previousTreeData)
TreeViewListener
treeDataChanged
in interface TreeViewListener
public void nodeRendererChanged(TreeView treeView, TreeView.NodeRenderer previousNodeRenderer)
TreeViewListener
nodeRendererChanged
in interface TreeViewListener
public void nodeEditorChanged(TreeView treeView, TreeView.NodeEditor previousNodeEditor)
TreeViewListener
nodeEditorChanged
in interface TreeViewListener
public void selectModeChanged(TreeView treeView, TreeView.SelectMode previousSelectMode)
TreeViewListener
selectModeChanged
in interface TreeViewListener
public void checkmarksEnabledChanged(TreeView treeView)
TreeViewListener
checkmarksEnabledChanged
in interface TreeViewListener
public void showMixedCheckmarkStateChanged(TreeView treeView)
TreeViewListener
showMixedCheckmarkStateChanged
in interface TreeViewListener
public void branchExpanded(TreeView treeView, Sequence<java.lang.Integer> path)
TreeViewBranchListener
branchExpanded
in interface TreeViewBranchListener
treeView
- The source of the event.path
- The path of the node that was shown.public void branchCollapsed(TreeView treeView, Sequence<java.lang.Integer> path)
TreeViewBranchListener
branchCollapsed
in interface TreeViewBranchListener
treeView
- The source of the event.path
- The path of the node that was collapsed.public void nodeInserted(TreeView treeView, Sequence<java.lang.Integer> path, int index)
TreeViewNodeListener
nodeInserted
in interface TreeViewNodeListener
public void nodesRemoved(TreeView treeView, Sequence<java.lang.Integer> path, int index, int count)
TreeViewNodeListener
nodesRemoved
in interface TreeViewNodeListener
count
- The number of nodes that were removed, or -1 if all nodes
were removed.public void nodeUpdated(TreeView treeView, Sequence<java.lang.Integer> path, int index)
TreeViewNodeListener
nodeUpdated
in interface TreeViewNodeListener
public void nodesSorted(TreeView treeView, Sequence<java.lang.Integer> path)
TreeViewNodeListener
nodesSorted
in interface TreeViewNodeListener
public void nodeDisabledChanged(TreeView treeView, Sequence<java.lang.Integer> path)
TreeViewNodeStateListener
nodeDisabledChanged
in interface TreeViewNodeStateListener
public void nodeCheckStateChanged(TreeView treeView, Sequence<java.lang.Integer> path, TreeView.NodeCheckState previousCheckState)
TreeViewNodeStateListener
nodeCheckStateChanged
in interface TreeViewNodeStateListener
public void selectedPathAdded(TreeView treeView, Sequence<java.lang.Integer> path)
TreeViewSelectionListener
selectedPathAdded
in interface TreeViewSelectionListener
public void selectedPathRemoved(TreeView treeView, Sequence<java.lang.Integer> path)
TreeViewSelectionListener
selectedPathRemoved
in interface TreeViewSelectionListener
public void selectedPathsChanged(TreeView treeView, Sequence<Sequence<java.lang.Integer>> previousSelectedPaths)
TreeViewSelectionListener
selectedPathsChanged
in interface TreeViewSelectionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |