|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.TreeUI javax.swing.plaf.basic.BasicTreeUI com.alee.laf.tree.WebTreeUI
public class WebTreeUI
Custom UI for JTree component.
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 |
---|
public static javax.swing.ImageIcon EXPAND_ICON
public static javax.swing.ImageIcon COLLAPSE_ICON
public static javax.swing.ImageIcon DISABLED_EXPAND_ICON
public static javax.swing.ImageIcon DISABLED_COLLAPSE_ICON
public static javax.swing.ImageIcon ROOT_ICON
public static javax.swing.ImageIcon CLOSED_ICON
public static javax.swing.ImageIcon OPEN_ICON
public static javax.swing.ImageIcon LEAF_ICON
protected static final float[] fractions
protected boolean autoExpandSelectedNode
protected boolean highlightRolloverNode
protected boolean paintLines
protected java.awt.Color linesColor
protected TreeSelectionStyle selectionStyle
protected int selectionRound
protected int selectionShadeWidth
protected boolean selectorEnabled
protected java.awt.Color selectorColor
protected java.awt.Color selectorBorderColor
protected int selectorRound
protected java.awt.BasicStroke selectorStroke
protected int dropCellShadeWidth
protected java.beans.PropertyChangeListener orientationChangeListener
protected java.beans.PropertyChangeListener dropLocationChangeListener
protected javax.swing.event.TreeSelectionListener treeSelectionListener
protected javax.swing.event.TreeExpansionListener treeExpansionListener
protected java.awt.event.MouseAdapter mouseAdapter
protected int rolloverRow
protected java.util.List<java.lang.Integer> initialSelection
protected java.awt.Point selectionStart
protected java.awt.Point selectionEnd
protected boolean leftToRight
protected javax.swing.tree.TreePath draggablePath
Constructor Detail |
---|
public WebTreeUI()
Method Detail |
---|
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c
- component that will use UI instance
public void installUI(javax.swing.JComponent c)
installUI
in class javax.swing.plaf.basic.BasicTreeUI
c
- component for this UIpublic void uninstallUI(javax.swing.JComponent c)
uninstallUI
in class javax.swing.plaf.basic.BasicTreeUI
c
- component with this UIprotected boolean isDragAvailable()
public boolean isAutoExpandSelectedNode()
public void setAutoExpandSelectedNode(boolean autoExpandSelectedNode)
autoExpandSelectedNode
- whether tree should expand nodes on selection or notpublic boolean isHighlightRolloverNode()
public void setHighlightRolloverNode(boolean highlight)
highlight
- whether tree should highlight rollover node or notpublic boolean isPaintLines()
public void setPaintLines(boolean paint)
paint
- whether tree should paint structure lines or notpublic java.awt.Color getLinesColor()
public void setLinesColor(java.awt.Color color)
color
- tree structure lines colorpublic TreeSelectionStyle getSelectionStyle()
public void setSelectionStyle(TreeSelectionStyle style)
style
- tree selection stylepublic int getSelectionRound()
public void setSelectionRound(int round)
round
- tree selection roundingpublic int getSelectionShadeWidth()
public void setSelectionShadeWidth(int shadeWidth)
shadeWidth
- tree selection shade widthpublic boolean isSelectorEnabled()
public void setSelectorEnabled(boolean enabled)
enabled
- whether selector is enabled or notpublic java.awt.Color getSelectorColor()
public void setSelectorColor(java.awt.Color color)
color
- selector colorpublic java.awt.Color getSelectorBorderColor()
public void setSelectorBorderColor(java.awt.Color color)
color
- selector border colorpublic int getSelectorRound()
public void setSelectorRound(int round)
round
- selector roundingpublic java.awt.BasicStroke getSelectorStroke()
public void setSelectorStroke(java.awt.BasicStroke stroke)
stroke
- selector border strokepublic int getDropCellShadeWidth()
public void setDropCellShadeWidth(int dropCellShadeWidth)
dropCellShadeWidth
- new drop cell highlight shade widthpublic boolean isSelectorAvailable()
public boolean isFullLineSelection()
public int getRowForPoint(java.awt.Point point)
point
- point on the tree
public int getRowForPoint(java.awt.Point point, boolean countFullRow)
point
- point on the treecountFullRow
- whether take the whole row into account or just node renderer rect
public java.awt.Rectangle getRowBounds(int row)
row
- row index
public java.awt.Rectangle getRowBounds(int row, boolean countFullRow)
row
- row indexcountFullRow
- whether take the whole row into account or just node renderer rect
public java.awt.Rectangle getFullRowBounds(int row)
row
- row index
protected javax.swing.tree.TreeCellEditor createDefaultCellEditor()
createDefaultCellEditor
in class javax.swing.plaf.basic.BasicTreeUI
protected javax.swing.tree.TreeCellRenderer createDefaultCellRenderer()
createDefaultCellRenderer
in class javax.swing.plaf.basic.BasicTreeUI
protected void selectPathForEvent(javax.swing.tree.TreePath path, java.awt.event.MouseEvent e)
selectPathForEvent
in class javax.swing.plaf.basic.BasicTreeUI
path
- tree path to selecte
- event to processprotected boolean isLocationInCheckBoxControl(javax.swing.tree.TreePath path, int x, int y)
path
- tree pathx
- location X coordinatey
- location Y coordinate
protected java.awt.Color getHashColor()
getHashColor
in class javax.swing.plaf.basic.BasicTreeUI
public javax.swing.Icon getExpandedIcon()
getExpandedIcon
in class javax.swing.plaf.basic.BasicTreeUI
public javax.swing.Icon getCollapsedIcon()
getCollapsedIcon
in class javax.swing.plaf.basic.BasicTreeUI
protected void drawCentered(java.awt.Component c, java.awt.Graphics g, javax.swing.Icon icon, int x, int y)
drawCentered
in class javax.swing.plaf.basic.BasicTreeUI
c
- componentg
- graphicsicon
- iconx
- x coordinatey
- y coordinateprotected int findCenteredX(int x, int iconWidth)
x
- x coordinateiconWidth
- icon width
protected void repaintSelection()
protected java.util.List<java.awt.Rectangle> getSelectionRects()
protected int getHorizontalLegBuffer()
getHorizontalLegBuffer
in class javax.swing.plaf.basic.BasicTreeUI
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
paint
in class javax.swing.plaf.basic.BasicTreeUI
g
- graphicsc
- componentprotected void paintSelection(java.awt.Graphics2D g2d)
g2d
- graphics contextprotected void paintRolloverNodeHighlight(java.awt.Graphics2D g2d)
g2d
- graphics contextprotected void paintTree(java.awt.Graphics2D g2d)
g2d
- graphics contextprotected void paintDropLocation(java.awt.Graphics2D g2d)
g2d
- graphics contextprotected java.awt.Rectangle getNodeDropLocationBounds(javax.swing.tree.TreePath dropPath)
dropPath
- node path
protected void paintMultiselector(java.awt.Graphics2D g2d)
g2d
- graphics contextprotected boolean isDropLine(javax.swing.JTree.DropLocation loc)
loc
- drop location
protected java.awt.Rectangle getDropLineRect(javax.swing.JTree.DropLocation loc)
loc
- drop location
protected java.awt.Rectangle getPathBounds(javax.swing.tree.TreePath path, java.awt.Insets insets, java.awt.Rectangle bounds)
path
- tree pathinsets
- tree insetsbounds
- bounds buffer
protected java.awt.Shape getSelectionShape(java.awt.Rectangle sb, boolean fill)
sb
- selection boundsfill
- should fill the whole cell
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |