public class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, SynthUI
JTree
。
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)
为给定组件创建一个新的用户界面对象。
|
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()
getExpandedIcon
方法重写,继承类
BasicTreeUI
protected void installDefaults()
installDefaults
方法重写,继承类
BasicTreeUI
protected void installListeners()
installListeners
方法重写,继承类
BasicTreeUI
public SynthContext getContext(JComponent c)
getContext
接口
SynthUI
c
组件请求synthcontext。
protected TreeCellEditor createDefaultCellEditor()
createDefaultCellEditor
方法重写,继承类
BasicTreeUI
protected TreeCellRenderer createDefaultCellRenderer()
createDefaultCellRenderer
方法重写,继承类
BasicTreeUI
protected void uninstallDefaults()
uninstallDefaults
方法重写,继承类
BasicTreeUI
protected void uninstallListeners()
uninstallListeners
方法重写,继承类
BasicTreeUI
public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)
方法。
在一般情况下,该方法不需要由子类重写。所有的外观和感觉的渲染代码应该在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外观。绘画是由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如果根是不可见的。
paintHorizontalPartOfLeg
方法重写,继承类
BasicTreeUI
protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
paintHorizontalLine
方法重写,继承类
BasicTreeUI
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
clipBounds
,
insets
。
paintVerticalPartOfLeg
方法重写,继承类
BasicTreeUI
protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom)
paintVerticalLine
方法重写,继承类
BasicTreeUI
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
clipBounds
,或
insets
。
paintExpandControl
方法重写,继承类
BasicTreeUI
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
-行深度
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.