public class WebTreeUI extends javax.swing.plaf.basic.BasicTreeUI implements Styleable, ShapeProvider, MarginSupport, PaddingSupport
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| Modifier and Type | Field and Description |
|---|---|
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 |
static javax.swing.ImageIcon |
EXPAND_ICON
Expand and collapse control icons.
|
protected boolean |
expandSelected |
protected TreePathHoverBehavior |
hoverNodeTracker
Listeners.
|
protected int |
hoverRow |
static javax.swing.ImageIcon |
LEAF_ICON |
protected java.awt.Insets |
margin
Runtime variables.
|
static javax.swing.ImageIcon |
OPEN_ICON |
protected java.awt.Insets |
padding |
protected ITreePainter |
painter
Component painter.
|
static javax.swing.ImageIcon |
ROOT_ICON
Default node icons.
|
protected TreeSelectionStyle |
selectionStyle
Style settings.
|
protected boolean |
selectOnHover |
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, validCachedPreferredSizeEMPTYEMPTY| Constructor and Description |
|---|
WebTreeUI() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
javax.swing.CellRendererPane |
getCellRendererPane()
Returns tree cell renderer pane.
|
javax.swing.Icon |
getCollapsedIcon()
Returns tree structure collapsed node icon.
|
javax.swing.Icon |
getExpandedIcon()
Returns tree structure expanded node icon.
|
java.awt.Rectangle |
getFullPathBounds(javax.swing.tree.TreePath path,
boolean countFullRow)
Returns full path bounds.
|
java.awt.Rectangle |
getFullRowBounds(int row)
Returns full row bounds by its index.
|
int |
getHoverRow()
Returns current hover row.
|
java.awt.Insets |
getMargin()
Returns current margin.
|
java.awt.Insets |
getPadding()
Returns current padding.
|
Painter |
getPainter()
Returns tree painter.
|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c) |
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.
|
TreeSelectionStyle |
getSelectionStyle()
Returns tree selection style.
|
StyleId |
getStyleId()
Returns component style ID.
|
protected ToolTipProvider<? extends WebTree> |
getToolTipProvider()
Returns custom WebLaF tooltip provider.
|
javax.swing.tree.AbstractLayoutCache |
getTreeState()
Returns state of tree.
|
java.util.Enumeration<javax.swing.tree.TreePath> |
getVisiblePaths()
Returns visible paths enumeration.
|
void |
installUI(javax.swing.JComponent c)
Installs UI in the specified component.
|
boolean |
isExpandSelected()
Returns whether tree should expand nodes on selection or not.
|
protected boolean |
isFullLineSelection()
Returns whether tree selection style points that the whole line is a single cell or not.
|
boolean |
isLocationInCheckBoxControl(javax.swing.tree.TreePath path,
int x,
int y)
Returns whether location is in the checkbox tree checkbox control or not.
|
boolean |
isSelectOnHover()
Returns whether or not nodes should be selected on hover.
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c) |
java.awt.Shape |
provideShape()
Returns component shape.
|
protected void |
selectPathForEvent(javax.swing.tree.TreePath path,
java.awt.event.MouseEvent e)
Selects tree path for the specified event.
|
void |
setExpandSelected(boolean expandSelected)
Sets whether tree should expand nodes on selection or not.
|
void |
setMargin(java.awt.Insets margin)
Sets new margin.
|
void |
setPadding(java.awt.Insets padding)
Sets new padding.
|
void |
setPainter(Painter painter)
Sets tree painter.
|
void |
setSelectionStyle(TreeSelectionStyle style)
Sets tree selection style.
|
void |
setSelectOnHover(boolean select)
Sets whether or not nodes should be selected on hover.
|
StyleId |
setStyleId(StyleId id)
Sets new component style ID.
|
void |
uninstallUI(javax.swing.JComponent c)
Uninstalls UI from the specified component.
|
cancelEditing, checkForClickInExpandControl, completeEditing, completeEditing, completeUIInstall, completeUIUninstall, configureLayoutCache, createCellEditorListener, createCellRendererPane, createComponentListener, createFocusListener, createKeyListener, createLayoutCache, createMouseListener, createNodeDimensions, createPropertyChangeListener, createSelectionModelPropertyChangeListener, createTreeExpansionListener, createTreeModelListener, createTreeSelectionListener, drawCentered, drawDashedHorizontalLine, drawDashedVerticalLine, ensureRowsAreVisible, getBaseline, getBaselineResizeBehavior, getCellEditor, getCellRenderer, getClosestPathForLocation, getDropLineRect, getEditingPath, getHashColor, getHorizontalLegBuffer, getLastChildPath, getLeadSelectionRow, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathBounds, getPathForRow, getPreferredMinSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getRowX, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installDefaults, installKeyboardActions, installListeners, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintDropLine, 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, updateLeadSelectionRow, updateRenderer, updateSizepublic 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 TreeSelectionStyle selectionStyle
protected boolean expandSelected
protected boolean selectOnHover
@DefaultPainter(value=TreePainter.class) protected ITreePainter painter
protected TreePathHoverBehavior hoverNodeTracker
protected java.awt.Insets margin
protected java.awt.Insets padding
protected int hoverRow
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c - component that will use UI instancepublic void installUI(javax.swing.JComponent c)
installUI in class javax.swing.plaf.basic.BasicTreeUIc - component for this UIpublic void uninstallUI(javax.swing.JComponent c)
uninstallUI in class javax.swing.plaf.basic.BasicTreeUIc - component with this UIpublic StyleId getStyleId()
StyleablegetStyleId in interface Styleablepublic StyleId setStyleId(StyleId id)
StyleablesetStyleId in interface Styleableid - custom component style IDpublic java.awt.Shape provideShape()
ShapeProviderprovideShape in interface ShapeProviderpublic java.awt.Insets getMargin()
MarginSupportgetMargin in interface MarginSupportpublic void setMargin(java.awt.Insets margin)
MarginSupportnull can be provided to set an empty [0,0,0,0] margin.setMargin in interface MarginSupportmargin - new marginpublic java.awt.Insets getPadding()
PaddingSupportgetPadding in interface PaddingSupportpublic void setPadding(java.awt.Insets padding)
PaddingSupportnull can be provided to set an empty [0,0,0,0] padding.setPadding in interface PaddingSupportpadding - new paddingpublic Painter getPainter()
public void setPainter(Painter painter)
painter - new tree painterpublic int getHoverRow()
public void paint(java.awt.Graphics g,
javax.swing.JComponent c)
paint in class javax.swing.plaf.basic.BasicTreeUIpublic int getRowForPoint(java.awt.Point point)
point - point on the treepublic int getRowForPoint(java.awt.Point point,
boolean countFullRow)
point - point on the treecountFullRow - whether take the whole row into account or just node renderer rectpublic java.awt.Rectangle getRowBounds(int row)
row - row indexpublic java.awt.Rectangle getRowBounds(int row,
boolean countFullRow)
row - row indexcountFullRow - whether take the whole row into account or just node renderer rectpublic java.awt.Rectangle getFullRowBounds(int row)
row - row indexpublic java.awt.Rectangle getFullPathBounds(javax.swing.tree.TreePath path,
boolean countFullRow)
path - tree pathcountFullRow - whether take the whole row into account or just node renderer rectpublic java.util.Enumeration<javax.swing.tree.TreePath> getVisiblePaths()
protected javax.swing.tree.TreeCellEditor createDefaultCellEditor()
createDefaultCellEditor in class javax.swing.plaf.basic.BasicTreeUIprotected javax.swing.tree.TreeCellRenderer createDefaultCellRenderer()
createDefaultCellRenderer in class javax.swing.plaf.basic.BasicTreeUIprotected void selectPathForEvent(javax.swing.tree.TreePath path,
java.awt.event.MouseEvent e)
selectPathForEvent in class javax.swing.plaf.basic.BasicTreeUIpath - tree path to selecte - event to processpublic boolean isLocationInCheckBoxControl(javax.swing.tree.TreePath path,
int x,
int y)
WebCheckBoxTree.
todo Separate UI for WebCheckBoxTreepath - tree pathx - location X coordinatey - location Y coordinateprotected ToolTipProvider<? extends WebTree> getToolTipProvider()
public javax.swing.Icon getExpandedIcon()
getExpandedIcon in class javax.swing.plaf.basic.BasicTreeUIpublic javax.swing.Icon getCollapsedIcon()
getCollapsedIcon in class javax.swing.plaf.basic.BasicTreeUIpublic javax.swing.CellRendererPane getCellRendererPane()
public javax.swing.tree.AbstractLayoutCache getTreeState()
public TreeSelectionStyle getSelectionStyle()
public void setSelectionStyle(TreeSelectionStyle style)
style - tree selection stylepublic boolean isExpandSelected()
public void setExpandSelected(boolean expandSelected)
expandSelected - whether tree should expand nodes on selection or notpublic boolean isSelectOnHover()
public void setSelectOnHover(boolean select)
select - whether or not nodes should be selected on hoverprotected boolean isFullLineSelection()
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
getPreferredSize in class javax.swing.plaf.basic.BasicTreeUI