public class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, SynthUI
JTree
提供Synth L&F UI代表。
BasicTreeUI.CellEditorHandler, BasicTreeUI.ComponentHandler, BasicTreeUI.FocusHandler, BasicTreeUI.KeyHandler, BasicTreeUI.MouseHandler, BasicTreeUI.MouseInputHandler, BasicTreeUI.NodeDimensionsHandler, BasicTreeUI.PropertyChangeHandler, BasicTreeUI.SelectionModelPropertyChangeHandler, BasicTreeUI.TreeCancelEditingAction, BasicTreeUI.TreeExpansionHandler, BasicTreeUI.TreeHomeAction, BasicTreeUI.TreeIncrementAction, BasicTreeUI.TreeModelHandler, BasicTreeUI.TreePageAction, BasicTreeUI.TreeSelectionHandler, BasicTreeUI.TreeToggleAction, BasicTreeUI.TreeTraverseAction
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
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
Constructor and Description |
---|
SynthTreeUI() |
Modifier and Type | Method and Description |
---|---|
protected TreeCellEditor |
createDefaultCellEditor()
创建默认单元格编辑器。
|
protected TreeCellRenderer |
createDefaultCellRenderer()
返回用于执行每个节点冲压的默认单元格渲染器。
|
static ComponentUI |
createUI(JComponent x)
为给定的组件创建一个新的UI对象。
|
protected void |
drawCentered(Component c, Graphics graphics, Icon icon, int x, int y) |
SynthContext |
getContext(JComponent c)
返回指定组件的上下文。
|
Icon |
getExpandedIcon() |
protected int |
getRowX(int row, int depth)
返回沿x轴的位置,以呈现特定的行。
|
protected void |
installDefaults() |
protected void |
installListeners() |
void |
paint(Graphics g, JComponent c)
根据外观和外观绘制指定的组件。
|
protected void |
paint(SynthContext context, Graphics g)
绘制指定的组件。
|
void |
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
画边框
|
protected void |
paintDropLine(Graphics g)
画下线。
|
protected void |
paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
绘制一行的展开(切换)部分。
|
protected void |
paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
画一条水平线。
|
protected void |
paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
涂抹腿部的水平部分。
|
protected void |
paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
画一条垂直线。
|
protected void |
paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
涂上腿部的垂直部分。
|
void |
propertyChange(PropertyChangeEvent event)
当绑定属性更改时,此方法将被调用。
|
protected void |
uninstallDefaults() |
protected void |
uninstallListeners() |
void |
update(Graphics g, JComponent c)
通知此UI代理重新绘制指定的组件。
|
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, getCollapsedIcon, getDropLineRect, getEditingPath, getHashColor, getHorizontalLegBuffer, getLastChildPath, getLeadSelectionRow, getLeftChildIndent, getMaximumSize, getMinimumSize, getModel, getPathBounds, getPathForRow, getPreferredMinSize, getPreferredSize, getPreferredSize, getRightChildIndent, getRowCount, getRowForPath, getRowHeight, getSelectionModel, getShowsRootHandles, getVerticalLegBuffer, handleExpandControlClick, installComponents, installKeyboardActions, installUI, isDropLine, isEditable, isEditing, isLargeModel, isLeaf, isLocationInExpandControl, isMultiSelectEvent, isRootVisible, isToggleEvent, isToggleSelectionEvent, paintRow, pathWasCollapsed, pathWasExpanded, prepareForUIInstall, prepareForUIUninstall, selectPathForEvent, setCellEditor, setCellRenderer, setCollapsedIcon, setEditable, setExpandedIcon, setHashColor, setLargeModel, setLeftChildIndent, setModel, setPreferredMinSize, setRightChildIndent, setRootVisible, setRowHeight, setSelectionModel, setShowsRootHandles, shouldPaintExpandControl, startEditing, startEditingAtPath, stopEditing, toggleExpandState, uninstallComponents, uninstallKeyboardActions, uninstallUI, updateCachedPreferredSize, updateCellEditor, updateDepthOffset, updateExpandedDescendants, updateLayoutCacheExpandedNodes, updateLeadSelectionRow, updateRenderer, updateSize
contains, getAccessibleChild, getAccessibleChildrenCount
public static ComponentUI createUI(JComponent x)
x
- 为其创建UI对象的组件
public Icon getExpandedIcon()
protected void installDefaults()
installDefaults
在类
BasicTreeUI
protected void installListeners()
public SynthContext getContext(JComponent c)
getContext
在界面
SynthUI
c
- 组件请求SynthContext。
protected TreeCellEditor createDefaultCellEditor()
protected TreeCellRenderer createDefaultCellRenderer()
protected void uninstallDefaults()
protected void uninstallListeners()
public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)
方法。
通常,此方法不需要被子类覆盖。 所有Look和Feel渲染代码应该位于paint
方法中。
update
在
ComponentUI
g
- 用于绘画的
Graphics
对象
c
- 正在涂漆的组件
paint(SynthContext,Graphics)
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
paintBorder
在界面
SynthUI
context
- 组件上下文
g
-
Graphics
上画
x
- X坐标
y
- Y坐标
w
- 边框的宽度
h
- 边框的高度
public void paint(Graphics g, JComponent c)
Synth Look and Feel不使用此方法。 绘画由paint(SynthContext,Graphics)
处理。
paint
在类
BasicTreeUI
g
- 用于绘画的
Graphics
对象
c
- 被涂的组件
paint(SynthContext,Graphics)
protected void paint(SynthContext context, Graphics g)
context
- 正在绘制的组件的上下文
g
- 用于绘画的
Graphics
对象
update(Graphics,JComponent)
protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
clipBounds
或insets
。
注: parentRow
可以为-1,如果根不可见。
protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
clipBounds
, insets
。
protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
clipBounds
或insets
。
protected void drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
drawCentered
在
BasicTreeUI
public void propertyChange(PropertyChangeEvent event)
propertyChange
在接口
PropertyChangeListener
event
- 描述事件源和已更改的属性的PropertyChangeEvent对象。
protected void paintDropLine(Graphics g)
paintDropLine
在
BasicTreeUI
g
-
Graphics
对象绘制
protected int getRowX(int row, int depth)
getRowX
在
BasicTreeUI
row
- 返回x位置的行
depth
- 行的深度