com.alee.laf.tree
Class WebTreeUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TreeUI
          extended by javax.swing.plaf.basic.BasicTreeUI
              extended by com.alee.laf.tree.WebTreeUI

public class WebTreeUI
extends javax.swing.plaf.basic.BasicTreeUI

Custom UI for JTree component.

Author:
Mikle Garin

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTreeUI
javax.swing.plaf.basic.BasicTreeUI.CellEditorHandler, javax.swing.plaf.basic.BasicTreeUI.ComponentHandler, javax.swing.plaf.basic.BasicTreeUI.FocusHandler, javax.swing.plaf.basic.BasicTreeUI.KeyHandler, javax.swing.plaf.basic.BasicTreeUI.MouseHandler, javax.swing.plaf.basic.BasicTreeUI.MouseInputHandler, javax.swing.plaf.basic.BasicTreeUI.NodeDimensionsHandler, javax.swing.plaf.basic.BasicTreeUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.SelectionModelPropertyChangeHandler, javax.swing.plaf.basic.BasicTreeUI.TreeCancelEditingAction, javax.swing.plaf.basic.BasicTreeUI.TreeExpansionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeHomeAction, javax.swing.plaf.basic.BasicTreeUI.TreeIncrementAction, javax.swing.plaf.basic.BasicTreeUI.TreeModelHandler, javax.swing.plaf.basic.BasicTreeUI.TreePageAction, javax.swing.plaf.basic.BasicTreeUI.TreeSelectionHandler, javax.swing.plaf.basic.BasicTreeUI.TreeToggleAction, javax.swing.plaf.basic.BasicTreeUI.TreeTraverseAction
 
Field Summary
protected  boolean autoExpandSelectedNode
          Style settings.
static javax.swing.ImageIcon CLOSED_ICON
           
static javax.swing.ImageIcon COLLAPSE_ICON
           
static javax.swing.ImageIcon DISABLED_COLLAPSE_ICON
           
static javax.swing.ImageIcon DISABLED_EXPAND_ICON
           
protected  javax.swing.tree.TreePath draggablePath
           
protected  int dropCellShadeWidth
           
protected  java.beans.PropertyChangeListener dropLocationChangeListener
           
static javax.swing.ImageIcon EXPAND_ICON
          Expand and collapse control icons.
protected static float[] fractions
          Default drop line gradient fractions.
protected  boolean highlightRolloverNode
           
protected  java.util.List<java.lang.Integer> initialSelection
           
static javax.swing.ImageIcon LEAF_ICON
           
protected  boolean leftToRight
           
protected  java.awt.Color linesColor
           
protected  java.awt.event.MouseAdapter mouseAdapter
           
static javax.swing.ImageIcon OPEN_ICON
           
protected  java.beans.PropertyChangeListener orientationChangeListener
          Tree listeners.
protected  boolean paintLines
           
protected  int rolloverRow
          Runtime variables.
static javax.swing.ImageIcon ROOT_ICON
          Default node icons.
protected  java.awt.Point selectionEnd
           
protected  int selectionRound
           
protected  int selectionShadeWidth
           
protected  java.awt.Point selectionStart
           
protected  TreeSelectionStyle selectionStyle
           
protected  java.awt.Color selectorBorderColor
           
protected  java.awt.Color selectorColor
           
protected  boolean selectorEnabled
           
protected  int selectorRound
           
protected  java.awt.BasicStroke selectorStroke
           
protected  javax.swing.event.TreeExpansionListener treeExpansionListener
           
protected  javax.swing.event.TreeSelectionListener treeSelectionListener
           
 
Fields inherited from class javax.swing.plaf.basic.BasicTreeUI
cellEditor, collapsedIcon, createdCellEditor, createdRenderer, currentCellRenderer, depthOffset, drawingCache, editingComponent, editingPath, editingRow, editorHasDifferentSize, expandedIcon, largeModel, lastSelectedRow, leftChildIndent, nodeDimensions, preferredMinSize, preferredSize, rendererPane, rightChildIndent, stopEditingInCompleteEditing, totalChildIndent, tree, treeModel, treeSelectionModel, treeState, validCachedPreferredSize
 
Constructor Summary
WebTreeUI()
           
 
Method Summary
protected  javax.swing.tree.TreeCellEditor createDefaultCellEditor()
          Returns default tree cell editor.
protected  javax.swing.tree.TreeCellRenderer createDefaultCellRenderer()
          Returns default tree cell renderer.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the WebTreeUI for the specified component.
protected  void drawCentered(java.awt.Component c, java.awt.Graphics g, javax.swing.Icon icon, int x, int y)
          Paints centered icon.
protected  int findCenteredX(int x, int iconWidth)
          Returns centered x coordinate for the icon.
 javax.swing.Icon getCollapsedIcon()
          Returns tree structure collapsed node icon.
 int getDropCellShadeWidth()
          Returns drop cell highlight shade width.
protected  java.awt.Rectangle getDropLineRect(javax.swing.JTree.DropLocation loc)
          Returns drop line rectangle.
 javax.swing.Icon getExpandedIcon()
          Returns tree structure expanded node icon.
 java.awt.Rectangle getFullRowBounds(int row)
          Returns full row bounds by its index.
protected  java.awt.Color getHashColor()
          Returns tree structure lines color.
protected  int getHorizontalLegBuffer()
          
 java.awt.Color getLinesColor()
          Returns tree structure lines color.
protected  java.awt.Rectangle getNodeDropLocationBounds(javax.swing.tree.TreePath dropPath)
          Returns node drop location drawing bounds.
protected  java.awt.Rectangle getPathBounds(javax.swing.tree.TreePath path, java.awt.Insets insets, java.awt.Rectangle bounds)
          Returns path bounds used for painting.
 java.awt.Rectangle getRowBounds(int row)
          Returns row bounds by its index.
 java.awt.Rectangle getRowBounds(int row, boolean countFullRow)
          Returns row bounds by its index.
 int getRowForPoint(java.awt.Point point)
          Returns row index for specified point on the tree.
 int getRowForPoint(java.awt.Point point, boolean countFullRow)
          Returns row index for specified point on the tree.
protected  java.util.List<java.awt.Rectangle> getSelectionRects()
          Returns list of tree selections bounds.
 int getSelectionRound()
          Returns tree selection rounding.
 int getSelectionShadeWidth()
          Returns tree selection shade width.
protected  java.awt.Shape getSelectionShape(java.awt.Rectangle sb, boolean fill)
          Returns selection shape for specified selection bounds.
 TreeSelectionStyle getSelectionStyle()
          Returns tree selection style.
 java.awt.Color getSelectorBorderColor()
          Returns selector border color.
 java.awt.Color getSelectorColor()
          Returns selector color.
 int getSelectorRound()
          Returns selector rounding.
 java.awt.BasicStroke getSelectorStroke()
          Returns selector border stroke.
 void installUI(javax.swing.JComponent c)
          Installs UI in the specified component.
 boolean isAutoExpandSelectedNode()
          Returns whether tree should expand nodes on selection or not.
protected  boolean isDragAvailable()
          Returns whether tree nodes drag available or not.
protected  boolean isDropLine(javax.swing.JTree.DropLocation loc)
          Returns whether the specified drop location should be displayed as line or not.
 boolean isFullLineSelection()
          Returns whether tree selection style points that the whole line is a single cell or not.
 boolean isHighlightRolloverNode()
          Returns whether tree should highlight rollover node or not.
protected  boolean isLocationInCheckBoxControl(javax.swing.tree.TreePath path, int x, int y)
          Returns whether location is in the checkbox tree checkbox control or not.
 boolean isPaintLines()
          Returns whether tree should paint structure lines or not.
 boolean isSelectorAvailable()
          Returns whether selector is available for current tree or not.
 boolean isSelectorEnabled()
          Returns whether selector is enabled or not.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paints tree.
protected  void paintDropLocation(java.awt.Graphics2D g2d)
          Paints drop location if it is available.
protected  void paintMultiselector(java.awt.Graphics2D g2d)
          Paints custom WebLaF multiselector.
protected  void paintRolloverNodeHighlight(java.awt.Graphics2D g2d)
          Paints rollover node highlight.
protected  void paintSelection(java.awt.Graphics2D g2d)
          Paints special WebLaF tree nodes selection.
protected  void paintTree(java.awt.Graphics2D g2d)
          Paints all base tree elements.
protected  void repaintSelection()
          Repaints all rectangles containing tree selections.
protected  void selectPathForEvent(javax.swing.tree.TreePath path, java.awt.event.MouseEvent e)
          Selects tree path for the specified event.
 void setAutoExpandSelectedNode(boolean autoExpandSelectedNode)
          Sets whether tree should expand nodes on selection or not.
 void setDropCellShadeWidth(int dropCellShadeWidth)
          Sets drop cell highlight shade width.
 void setHighlightRolloverNode(boolean highlight)
          Sets whether tree should highlight rollover node or not.
 void setLinesColor(java.awt.Color color)
          Sets tree structure lines color.
 void setPaintLines(boolean paint)
          Sets whether tree should paint structure lines or not.
 void setSelectionRound(int round)
          Sets tree selection rounding.
 void setSelectionShadeWidth(int shadeWidth)
          Sets tree selection shade width.
 void setSelectionStyle(TreeSelectionStyle style)
          Sets tree selection style.
 void setSelectorBorderColor(java.awt.Color color)
          Sets selector border color.
 void setSelectorColor(java.awt.Color color)
          Sets selector color.
 void setSelectorEnabled(boolean enabled)
          Sets whether selector is enabled or not.
 void setSelectorRound(int round)
          Sets selector rounding.
 void setSelectorStroke(java.awt.BasicStroke stroke)
          Sets selector border stroke.
 void uninstallUI(javax.swing.JComponent c)
          Uninstalls UI from the specified component.
 
Methods inherited from class javax.swing.plaf.basic.BasicTreeUI
cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createFocusListener, createKeyListener, createLayoutCache, createMouseListener, createNodeDimensions, createPropertyChangeListener, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, createTreeSelectionListener, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getEditingPath, getLastChildPath, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathBounds, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installDefaults, installKeyboardActions, installListeners, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintExpandControl, paintHorizontalLine, paintHorizontalPartOfLeg, paintRow, paintVerticalLine, paintVerticalPartOfLeg, pathWasCollapsed, pathWasExpanded, prepareForUIInstall, prepareForUIUninstall, setCellEditor, setCellRenderer, setCollapsedIcon, setEditable, setExpandedIcon, setHashColor, setLargeModel, setLeftChildIndent, setModel, setPreferredMinSize, setRightChildIndent, setRootVisible, setRowHeight, setSelectionModel, setShowsRootHandles, shouldPaintExpandControl, startEditing, startEditingAtPath, stopEditing, toggleExpandState, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateRenderer, updateSize
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPAND_ICON

public static javax.swing.ImageIcon EXPAND_ICON
Expand and collapse control icons.


COLLAPSE_ICON

public static javax.swing.ImageIcon COLLAPSE_ICON

DISABLED_EXPAND_ICON

public static javax.swing.ImageIcon DISABLED_EXPAND_ICON

DISABLED_COLLAPSE_ICON

public static javax.swing.ImageIcon DISABLED_COLLAPSE_ICON

ROOT_ICON

public static javax.swing.ImageIcon ROOT_ICON
Default node icons.


CLOSED_ICON

public static javax.swing.ImageIcon CLOSED_ICON

OPEN_ICON

public static javax.swing.ImageIcon OPEN_ICON

LEAF_ICON

public static javax.swing.ImageIcon LEAF_ICON

fractions

protected static final float[] fractions
Default drop line gradient fractions.


autoExpandSelectedNode

protected boolean autoExpandSelectedNode
Style settings.


highlightRolloverNode

protected boolean highlightRolloverNode

paintLines

protected boolean paintLines

linesColor

protected java.awt.Color linesColor

selectionStyle

protected TreeSelectionStyle selectionStyle

selectionRound

protected int selectionRound

selectionShadeWidth

protected int selectionShadeWidth

selectorEnabled

protected boolean selectorEnabled

selectorColor

protected java.awt.Color selectorColor

selectorBorderColor

protected java.awt.Color selectorBorderColor

selectorRound

protected int selectorRound

selectorStroke

protected java.awt.BasicStroke selectorStroke

dropCellShadeWidth

protected int dropCellShadeWidth

orientationChangeListener

protected java.beans.PropertyChangeListener orientationChangeListener
Tree listeners.


dropLocationChangeListener

protected java.beans.PropertyChangeListener dropLocationChangeListener

treeSelectionListener

protected javax.swing.event.TreeSelectionListener treeSelectionListener

treeExpansionListener

protected javax.swing.event.TreeExpansionListener treeExpansionListener

mouseAdapter

protected java.awt.event.MouseAdapter mouseAdapter

rolloverRow

protected int rolloverRow
Runtime variables.


initialSelection

protected java.util.List<java.lang.Integer> initialSelection

selectionStart

protected java.awt.Point selectionStart

selectionEnd

protected java.awt.Point selectionEnd

leftToRight

protected boolean leftToRight

draggablePath

protected javax.swing.tree.TreePath draggablePath
Constructor Detail

WebTreeUI

public WebTreeUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Returns an instance of the WebTreeUI for the specified component. This tricky method is used by UIManager to create component UIs when needed.

Parameters:
c - component that will use UI instance
Returns:
instance of the WebTreeUI

installUI

public void installUI(javax.swing.JComponent c)
Installs UI in the specified component.

Overrides:
installUI in class javax.swing.plaf.basic.BasicTreeUI
Parameters:
c - component for this UI

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Uninstalls UI from the specified component.

Overrides:
uninstallUI in class javax.swing.plaf.basic.BasicTreeUI
Parameters:
c - component with this UI

isDragAvailable

protected boolean isDragAvailable()
Returns whether tree nodes drag available or not.

Returns:
true if tree nodes drag available, false otherwise

isAutoExpandSelectedNode

public boolean isAutoExpandSelectedNode()
Returns whether tree should expand nodes on selection or not.

Returns:
true if tree should expand nodes on selection, false otherwise

setAutoExpandSelectedNode

public void setAutoExpandSelectedNode(boolean autoExpandSelectedNode)
Sets whether tree should expand nodes on selection or not.

Parameters:
autoExpandSelectedNode - whether tree should expand nodes on selection or not

isHighlightRolloverNode

public boolean isHighlightRolloverNode()
Returns whether tree should highlight rollover node or not.

Returns:
true if tree should highlight rollover, false otherwise

setHighlightRolloverNode

public void setHighlightRolloverNode(boolean highlight)
Sets whether tree should highlight rollover node or not.

Parameters:
highlight - whether tree should highlight rollover node or not

isPaintLines

public boolean isPaintLines()
Returns whether tree should paint structure lines or not.

Returns:
true if tree should paint structure lines, false otherwise

setPaintLines

public void setPaintLines(boolean paint)
Sets whether tree should paint structure lines or not.

Parameters:
paint - whether tree should paint structure lines or not

getLinesColor

public java.awt.Color getLinesColor()
Returns tree structure lines color.

Returns:
tree structure lines color

setLinesColor

public void setLinesColor(java.awt.Color color)
Sets tree structure lines color.

Parameters:
color - tree structure lines color

getSelectionStyle

public TreeSelectionStyle getSelectionStyle()
Returns tree selection style.

Returns:
tree selection style

setSelectionStyle

public void setSelectionStyle(TreeSelectionStyle style)
Sets tree selection style.

Parameters:
style - tree selection style

getSelectionRound

public int getSelectionRound()
Returns tree selection rounding.

Returns:
tree selection rounding

setSelectionRound

public void setSelectionRound(int round)
Sets tree selection rounding.

Parameters:
round - tree selection rounding

getSelectionShadeWidth

public int getSelectionShadeWidth()
Returns tree selection shade width.

Returns:
tree selection shade width

setSelectionShadeWidth

public void setSelectionShadeWidth(int shadeWidth)
Sets tree selection shade width.

Parameters:
shadeWidth - tree selection shade width

isSelectorEnabled

public boolean isSelectorEnabled()
Returns whether selector is enabled or not.

Returns:
true if selector is enabled, false otherwise

setSelectorEnabled

public void setSelectorEnabled(boolean enabled)
Sets whether selector is enabled or not.

Parameters:
enabled - whether selector is enabled or not

getSelectorColor

public java.awt.Color getSelectorColor()
Returns selector color.

Returns:
selector color

setSelectorColor

public void setSelectorColor(java.awt.Color color)
Sets selector color.

Parameters:
color - selector color

getSelectorBorderColor

public java.awt.Color getSelectorBorderColor()
Returns selector border color.

Returns:
selector border color

setSelectorBorderColor

public void setSelectorBorderColor(java.awt.Color color)
Sets selector border color.

Parameters:
color - selector border color

getSelectorRound

public int getSelectorRound()
Returns selector rounding.

Returns:
selector rounding

setSelectorRound

public void setSelectorRound(int round)
Sets selector rounding.

Parameters:
round - selector rounding

getSelectorStroke

public java.awt.BasicStroke getSelectorStroke()
Returns selector border stroke.

Returns:
selector border stroke

setSelectorStroke

public void setSelectorStroke(java.awt.BasicStroke stroke)
Sets selector border stroke.

Parameters:
stroke - selector border stroke

getDropCellShadeWidth

public int getDropCellShadeWidth()
Returns drop cell highlight shade width.

Returns:
drop cell highlight shade width

setDropCellShadeWidth

public void setDropCellShadeWidth(int dropCellShadeWidth)
Sets drop cell highlight shade width.

Parameters:
dropCellShadeWidth - new drop cell highlight shade width

isSelectorAvailable

public boolean isSelectorAvailable()
Returns whether selector is available for current tree or not.

Returns:
true if selector is available for current tree, false otherwise

isFullLineSelection

public boolean isFullLineSelection()
Returns whether tree selection style points that the whole line is a single cell or not.

Returns:
true if tree selection style points that the whole line is a single cell, false otherwise

getRowForPoint

public int getRowForPoint(java.awt.Point point)
Returns row index for specified point on the tree. This method takes selection style into account.

Parameters:
point - point on the tree
Returns:
row index for specified point on the tree

getRowForPoint

public int getRowForPoint(java.awt.Point point,
                          boolean countFullRow)
Returns row index for specified point on the tree.

Parameters:
point - point on the tree
countFullRow - whether take the whole row into account or just node renderer rect
Returns:
row index for specified point on the tree

getRowBounds

public java.awt.Rectangle getRowBounds(int row)
Returns row bounds by its index. This method takes selection style into account.

Parameters:
row - row index
Returns:
row bounds by its index

getRowBounds

public java.awt.Rectangle getRowBounds(int row,
                                       boolean countFullRow)
Returns row bounds by its index.

Parameters:
row - row index
countFullRow - whether take the whole row into account or just node renderer rect
Returns:
row bounds by its index

getFullRowBounds

public java.awt.Rectangle getFullRowBounds(int row)
Returns full row bounds by its index.

Parameters:
row - row index
Returns:
full row bounds by its index

createDefaultCellEditor

protected javax.swing.tree.TreeCellEditor createDefaultCellEditor()
Returns default tree cell editor.

Overrides:
createDefaultCellEditor in class javax.swing.plaf.basic.BasicTreeUI
Returns:
default tree cell editor

createDefaultCellRenderer

protected javax.swing.tree.TreeCellRenderer createDefaultCellRenderer()
Returns default tree cell renderer.

Overrides:
createDefaultCellRenderer in class javax.swing.plaf.basic.BasicTreeUI
Returns:
default tree cell renderer

selectPathForEvent

protected void selectPathForEvent(javax.swing.tree.TreePath path,
                                  java.awt.event.MouseEvent e)
Selects tree path for the specified event.

Overrides:
selectPathForEvent in class javax.swing.plaf.basic.BasicTreeUI
Parameters:
path - tree path to select
e - event to process

isLocationInCheckBoxControl

protected boolean isLocationInCheckBoxControl(javax.swing.tree.TreePath path,
                                              int x,
                                              int y)
Returns whether location is in the checkbox tree checkbox control or not.

Parameters:
path - tree path
x - location X coordinate
y - location Y coordinate
Returns:
true if location is in the checkbox tree checkbox control, false otherwise

getHashColor

protected java.awt.Color getHashColor()
Returns tree structure lines color.

Overrides:
getHashColor in class javax.swing.plaf.basic.BasicTreeUI
Returns:
tree structure lines color

getExpandedIcon

public javax.swing.Icon getExpandedIcon()
Returns tree structure expanded node icon.

Overrides:
getExpandedIcon in class javax.swing.plaf.basic.BasicTreeUI
Returns:
tree structure expanded node icon

getCollapsedIcon

public javax.swing.Icon getCollapsedIcon()
Returns tree structure collapsed node icon.

Overrides:
getCollapsedIcon in class javax.swing.plaf.basic.BasicTreeUI
Returns:
tree structure collapsed node icon

drawCentered

protected void drawCentered(java.awt.Component c,
                            java.awt.Graphics g,
                            javax.swing.Icon icon,
                            int x,
                            int y)
Paints centered icon.

Overrides:
drawCentered in class javax.swing.plaf.basic.BasicTreeUI
Parameters:
c - component
g - graphics
icon - icon
x - x coordinate
y - y coordinate

findCenteredX

protected int findCenteredX(int x,
                            int iconWidth)
Returns centered x coordinate for the icon.

Parameters:
x - x coordinate
iconWidth - icon width
Returns:
centered x coordinate

repaintSelection

protected void repaintSelection()
Repaints all rectangles containing tree selections. This method is optimized to repaint only those area which are actually has selection in them.


getSelectionRects

protected java.util.List<java.awt.Rectangle> getSelectionRects()
Returns list of tree selections bounds. This method takes selection style into account.

Returns:
list of tree selections bounds

getHorizontalLegBuffer

protected int getHorizontalLegBuffer()

Overrides:
getHorizontalLegBuffer in class javax.swing.plaf.basic.BasicTreeUI

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Paints tree.

Overrides:
paint in class javax.swing.plaf.basic.BasicTreeUI
Parameters:
g - graphics
c - component

paintSelection

protected void paintSelection(java.awt.Graphics2D g2d)
Paints special WebLaF tree nodes selection. It is rendered separately from nodes allowing you to simplify your tree cell renderer component.

Parameters:
g2d - graphics context

paintRolloverNodeHighlight

protected void paintRolloverNodeHighlight(java.awt.Graphics2D g2d)
Paints rollover node highlight.

Parameters:
g2d - graphics context

paintTree

protected void paintTree(java.awt.Graphics2D g2d)
Paints all base tree elements. This is almost the same method as in BasicTreeUI but it doesn't paint drop line.

Parameters:
g2d - graphics context

paintDropLocation

protected void paintDropLocation(java.awt.Graphics2D g2d)
Paints drop location if it is available.

Parameters:
g2d - graphics context

getNodeDropLocationBounds

protected java.awt.Rectangle getNodeDropLocationBounds(javax.swing.tree.TreePath dropPath)
Returns node drop location drawing bounds.

Parameters:
dropPath - node path
Returns:
node drop location drawing bounds

paintMultiselector

protected void paintMultiselector(java.awt.Graphics2D g2d)
Paints custom WebLaF multiselector.

Parameters:
g2d - graphics context

isDropLine

protected boolean isDropLine(javax.swing.JTree.DropLocation loc)
Returns whether the specified drop location should be displayed as line or not.

Parameters:
loc - drop location
Returns:
true if the specified drop location should be displayed as line, false otherwise

getDropLineRect

protected java.awt.Rectangle getDropLineRect(javax.swing.JTree.DropLocation loc)
Returns drop line rectangle.

Parameters:
loc - drop location
Returns:
drop line rectangle

getPathBounds

protected java.awt.Rectangle getPathBounds(javax.swing.tree.TreePath path,
                                           java.awt.Insets insets,
                                           java.awt.Rectangle bounds)
Returns path bounds used for painting.

Parameters:
path - tree path
insets - tree insets
bounds - bounds buffer
Returns:
path bounds

getSelectionShape

protected java.awt.Shape getSelectionShape(java.awt.Rectangle sb,
                                           boolean fill)
Returns selection shape for specified selection bounds.

Parameters:
sb - selection bounds
fill - should fill the whole cell
Returns:
selection shape for specified selection bounds