public class BasicTreeUI extends TreeUI
Modifier and Type | Class and Description |
---|---|
class |
BasicTreeUI.CellEditorHandler
负责获取单元格编辑事件并相应地更新树的侦听器。
|
class |
BasicTreeUI.ComponentHandler
更新首选的大小,当滚动(如果必要的话)。
|
class |
BasicTreeUI.FocusHandler
重画的导联选择行时失去了焦点了。
|
class |
BasicTreeUI.KeyHandler
这是用来获得多个关键的事件,以适当地生成事件。
|
class |
BasicTreeUI.MouseHandler
treemouselistener负责更新基于鼠标事件的选择。
|
class |
BasicTreeUI.MouseInputHandler
MouseInputHandler负责传递所有的鼠标事件,包括鼠标移动事件,直到鼠标释放到目的地,它是用。
|
class |
BasicTreeUI.NodeDimensionsHandler
类负责获取节点的大小,方法是给basictreeui方法。
|
class |
BasicTreeUI.PropertyChangeHandler
那棵树propertychangelistener。
|
class |
BasicTreeUI.SelectionModelPropertyChangeHandler
在treeselectionmodel听众,重置行选择如果模型的变化特性。
|
class |
BasicTreeUI.TreeCancelEditingAction
cancelediting action调用时执行的动作。
|
class |
BasicTreeUI.TreeExpansionHandler
更新响应节点展开/折叠的treestate。
|
class |
BasicTreeUI.TreeHomeAction
treehomeaction用于处理结束/家的行动。
|
class |
BasicTreeUI.TreeIncrementAction
treeincrementaction是用来处理上/下行动。
|
class |
BasicTreeUI.TreeModelHandler
将所有的treestate事件树模型。
|
class |
BasicTreeUI.TreePageAction
treepageaction处理页面事件。
|
class |
BasicTreeUI.TreeSelectionHandler
侦听选择模型中的更改,并相应地更新显示。
|
class |
BasicTreeUI.TreeToggleAction
对于第一个选定的行展开将切换。
|
class |
BasicTreeUI.TreeTraverseAction
TreeTraverseAction 是用于左/右键。
|
Modifier and Type | Field and Description |
---|---|
protected TreeCellEditor |
cellEditor
树的编辑器。
|
protected Icon |
collapsedIcon |
protected boolean |
createdCellEditor
设置为真正的,如果编辑器,是目前在树中创建的这个实例。
|
protected boolean |
createdRenderer
设置为true,如果渲染器,目前在树是由这个实例创建。
|
protected TreeCellRenderer |
currentCellRenderer
渲染器,是被用来做实际的细胞图。
|
protected int |
depthOffset
多少的深度应偏移,以正确计算X位置。
|
protected Hashtable<TreePath,Boolean> |
drawingCache
用于最大限度地减少垂直线的绘制。
|
protected Component |
editingComponent
编辑时,这将是做实际编辑的组件。
|
protected TreePath |
editingPath
正在编辑的路径。
|
protected int |
editingRow
正在编辑的行。
|
protected boolean |
editorHasDifferentSize
设置为true,如果编辑具有比渲染不同尺寸。
|
protected Icon |
expandedIcon |
protected boolean |
largeModel
如果一个大型做优化。
|
protected int |
lastSelectedRow
最后选定的行的索引。
|
protected int |
leftChildIndent
距离左缘和在垂直线将绘制。
|
protected AbstractLayoutCache.NodeDimensions |
nodeDimensions
负责向treestate一节点所需的尺寸。
|
protected Dimension |
preferredMinSize
最小优先尺寸。
|
protected Dimension |
preferredSize
大小,需要完全显示所有的节点。
|
protected CellRendererPane |
rendererPane
用于油漆treecellrenderer。
|
protected int |
rightChildIndent
距离增加leftchildindent确定单元格的内容将被吸引。
|
protected boolean |
stopEditingInCompleteEditing
设置为false时,编辑和shouldselectcell()返回真正意义的节点应选择编辑之前,用于completeediting。
|
protected int |
totalChildIndent
总距离将缩。
|
protected JTree |
tree
组件,我们将要绘制。
|
protected TreeModel |
treeModel
用于确定显示什么。
|
protected TreeSelectionModel |
treeSelectionModel
模型保持选择。
|
protected AbstractLayoutCache |
treeState
负责处理大小和扩展问题的对象。
|
protected boolean |
validCachedPreferredSize
是preferredsize有效吗?
|
Constructor and Description |
---|
BasicTreeUI() |
Modifier and Type | Method and Description |
---|---|
void |
cancelEditing(JTree tree)
取消当前编辑会话。
|
protected void |
checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
如果
mouseX 和
mouseY 在展开/折叠区域的
row ,这将触发的行。
|
protected void |
completeEditing()
消息来停止编辑会话。
|
protected void |
completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
停止编辑会话。
|
protected void |
completeUIInstall()
调用installui毕竟默认/听众已安装。
|
protected void |
completeUIUninstall() |
protected void |
configureLayoutCache()
将基于我们提供的外观和感觉的树treestate实例。
|
protected CellEditorListener |
createCellEditorListener()
创建一个侦听器来处理当前编辑器中的事件。
|
protected CellRendererPane |
createCellRendererPane()
返回渲染面板,渲染器组件被放置在。
|
protected ComponentListener |
createComponentListener()
创建并返回一个新的componenthandler。
|
protected TreeCellEditor |
createDefaultCellEditor()
创建一个默认的单元格编辑器。
|
protected TreeCellRenderer |
createDefaultCellRenderer()
返回的默认单元格渲染器,是用来做每个节点的冲压。
|
protected FocusListener |
createFocusListener()
创建一个侦听器,该侦听器负责更新焦点丢失/获得的显示时的显示。
|
protected KeyListener |
createKeyListener()
创建侦听器负责从树上获取关键事件。
|
protected AbstractLayoutCache |
createLayoutCache()
创建负责管理扩展的对象的对象,以及节点的大小。
|
protected MouseListener |
createMouseListener()
创建负责更新基于鼠标事件的选择的侦听器。
|
protected AbstractLayoutCache.NodeDimensions |
createNodeDimensions()
创建nodedimensions即能判断一个给定的树节点的大小的一个实例。
|
protected PropertyChangeListener |
createPropertyChangeListener()
创建一个侦听器,该侦听器负责基于树的更改来更新用户界面。
|
protected PropertyChangeListener |
createSelectionModelPropertyChangeListener()
创建负责从选择模型获取属性更改事件的侦听器。
|
protected TreeExpansionListener |
createTreeExpansionListener()
创建并返回负责更新treestate当节点扩展状态变化的对象。
|
protected TreeModelListener |
createTreeModelListener()
返回一个可以在模型更改时更新树的侦听器。
|
protected TreeSelectionListener |
createTreeSelectionListener()
创建基于选择更改方法的更新显示的侦听器。
|
static ComponentUI |
createUI(JComponent x) |
protected void |
drawCentered(Component c, Graphics graphics, Icon icon, int x, int y) |
protected void |
drawDashedHorizontalLine(Graphics g, int y, int x1, int x2) |
protected void |
drawDashedVerticalLine(Graphics g, int x, int y1, int y2) |
protected void |
ensureRowsAreVisible(int beginRow, int endRow)
确保确定的beginrow通过endrow行可见。
|
int |
getBaseline(JComponent c, int width, int height)
返回基线。
|
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(JComponent c)
返回一个枚举指示组件的尺寸的变化的基线。
|
protected TreeCellEditor |
getCellEditor() |
protected TreeCellRenderer |
getCellRenderer()
currentcellrenderer返回,这将是树木的渲染,或defaultcellrenderer,哪个不是空的。
|
TreePath |
getClosestPathForLocation(JTree tree, int x, int y)
返回到最接近X的节点的路径。
|
Icon |
getCollapsedIcon() |
protected Rectangle |
getDropLineRect(JTree.DropLocation loc)
返回一个坚定滴线盒。
|
TreePath |
getEditingPath(JTree tree)
返回正在编辑的元素的路径。
|
Icon |
getExpandedIcon() |
protected Color |
getHashColor() |
protected int |
getHorizontalLegBuffer()
节点之间的腿的水平元素在默认情况下,在子节点的左侧右侧开始。
|
protected TreePath |
getLastChildPath(TreePath parent)
回到
parent 最后一个子路径。
|
protected int |
getLeadSelectionRow()
返回选择的引导行。
|
int |
getLeftChildIndent() |
Dimension |
getMaximumSize(JComponent c)
返回此组件的最大尺寸,这将是首选的大小如果实例目前在使用的,或0,0。
|
Dimension |
getMinimumSize(JComponent c)
返回此组件的最小大小。
|
protected TreeModel |
getModel() |
Rectangle |
getPathBounds(JTree tree, TreePath path)
返回包含路径的最后一个项目将被绘制到的标签部分的矩形框。
|
TreePath |
getPathForRow(JTree tree, int row)
返回行中的路径。
|
Dimension |
getPreferredMinSize()
返回最小首选大小。
|
Dimension |
getPreferredSize(JComponent c)
返回的优选尺寸正确显示树,这是一个getpreferredsize覆盖法(C,真的)。
|
Dimension |
getPreferredSize(JComponent c, boolean checkConsistency)
返回首选大小来表示C.的树
|
int |
getRightChildIndent() |
int |
getRowCount(JTree tree)
返回正在显示的行数。
|
int |
getRowForPath(JTree tree, TreePath path)
返回路径中确定的最后一个项目的行的可见光行。
|
protected int |
getRowHeight() |
protected int |
getRowX(int row, int depth)
返回的位置,沿着x轴,使某一行。
|
protected TreeSelectionModel |
getSelectionModel() |
protected boolean |
getShowsRootHandles() |
protected int |
getVerticalLegBuffer()
节点之间的腿的垂直元素在默认情况下在父节点的底部开始。
|
protected void |
handleExpandControlClick(TreePath path, int mouseX, int mouseY)
消息,当用户点击特定的行,这个调用的toggleexpandstate。
|
protected void |
installComponents()
intalls树的子组件,这是渲染器窗格。
|
protected void |
installDefaults() |
protected void |
installKeyboardActions() |
protected void |
installListeners() |
void |
installUI(JComponent c)
配置指定的组件适当的外观和感觉。
|
protected boolean |
isDropLine(JTree.DropLocation loc)
告诉如果
DropLocation 应该显示的节点之间的线。
|
protected boolean |
isEditable() |
boolean |
isEditing(JTree tree)
如果正在编辑树,则返回真。
|
protected boolean |
isLargeModel() |
protected boolean |
isLeaf(int row) |
protected boolean |
isLocationInExpandControl(TreePath path, int mouseX, int mouseY)
如果
mouseX 和
mouseY 落在排的面积是用来展开/折叠的节点和节点
row 并不代表叶返回true。
|
protected boolean |
isMultiSelectEvent(MouseEvent event)
返回真正的标志,节点上的鼠标事件应该从锚点选择。
|
protected boolean |
isRootVisible() |
protected boolean |
isToggleEvent(MouseEvent event)
返回TRUE指示行下鼠标应切换基于事件。
|
protected boolean |
isToggleSelectionEvent(MouseEvent event)
返回真表示节点上的鼠标事件应该切换只在鼠标下的行的选择。
|
void |
paint(Graphics g, JComponent c)
适当地绘制指定的组件的外观和感觉。
|
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 |
paintRow(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)
油漆腿的垂直部分。
|
protected void |
pathWasCollapsed(TreePath path)
消息从visibletreenode之后已经倒塌。
|
protected void |
pathWasExpanded(TreePath path)
消息从visibletreenode后已扩大。
|
protected void |
prepareForUIInstall()
在
tree 调用实例变量已经确定,但在任何违约或听者已安装。
|
protected void |
prepareForUIUninstall() |
protected void |
selectPathForEvent(TreePath path, MouseEvent event)
信息更新基于对特定事件的连续选择。
|
protected void |
setCellEditor(TreeCellEditor editor)
设置单元格编辑器。
|
protected void |
setCellRenderer(TreeCellRenderer tcr)
集
tcr 的treecellrenderer。
|
void |
setCollapsedIcon(Icon newG) |
protected void |
setEditable(boolean newValue)
配置接收机允许或不允许,编辑。
|
void |
setExpandedIcon(Icon newG) |
protected void |
setHashColor(Color color) |
protected void |
setLargeModel(boolean largeModel)
更新componentlistener,如果必要的话。
|
void |
setLeftChildIndent(int newAmount) |
protected void |
setModel(TreeModel model)
集的树。
|
void |
setPreferredMinSize(Dimension newSize)
设置首选的最小尺寸。
|
void |
setRightChildIndent(int newAmount) |
protected void |
setRootVisible(boolean newValue)
设置根为可见。
|
protected void |
setRowHeight(int rowHeight)
设置行的高度,这是提交给treestate。
|
protected void |
setSelectionModel(TreeSelectionModel newLSM)
重置选择模型。
|
protected void |
setShowsRootHandles(boolean newValue)
确定节点句柄是否要显示。
|
protected boolean |
shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
如果为指定行绘制展开(切换)控件,则返回真。
|
protected boolean |
startEditing(TreePath path, MouseEvent event)
将开始编辑节点如果有celleditor和shouldselectcell返回true。
|
void |
startEditingAtPath(JTree tree, TreePath path)
选择路径中的最后一个项目,并试图编辑它。
|
boolean |
stopEditing(JTree tree)
停止当前编辑会话。
|
protected void |
toggleExpandState(TreePath path)
如果它没有展开,或折叠行,如果它被扩展,则扩展路径。
|
protected void |
uninstallComponents()
卸载列表窗格。
|
protected void |
uninstallDefaults() |
protected void |
uninstallKeyboardActions() |
protected void |
uninstallListeners() |
void |
uninstallUI(JComponent c)
逆转形态,完成指定的组件在
installUI 。
|
protected void |
updateCachedPreferredSize()
更新
preferredSize 实例变量,这是返回
getPreferredSize() 。
|
protected void |
updateCellEditor()
更新基于JTree的编辑,我们包含在celleditor。
|
protected void |
updateDepthOffset()
更新每一个深度应该被抵消多少。
|
protected void |
updateExpandedDescendants(TreePath path)
更新所有的后代的
path 从树上得到扩展的后裔和转发到树状态的展开状态。
|
protected void |
updateLayoutCacheExpandedNodes()
使所有节点在JTree扩大扩大在LayoutCache。
|
protected void |
updateLeadSelectionRow()
更新选择的引导行。
|
protected void |
updateRenderer()
消息从树上我们在渲染了。
|
protected void |
updateSize()
标记为无效的缓存大小,和消息
treeDidChange 树。
|
contains, getAccessibleChild, getAccessibleChildrenCount, update
protected transient Icon collapsedIcon
protected transient Icon expandedIcon
protected int leftChildIndent
protected int rightChildIndent
protected int totalChildIndent
protected Dimension preferredMinSize
protected int lastSelectedRow
protected JTree tree
protected transient TreeCellRenderer currentCellRenderer
protected boolean createdRenderer
protected transient TreeCellEditor cellEditor
protected boolean createdCellEditor
protected boolean stopEditingInCompleteEditing
protected CellRendererPane rendererPane
protected Dimension preferredSize
protected boolean validCachedPreferredSize
protected AbstractLayoutCache treeState
protected boolean largeModel
protected AbstractLayoutCache.NodeDimensions nodeDimensions
protected TreeModel treeModel
protected TreeSelectionModel treeSelectionModel
protected int depthOffset
protected Component editingComponent
protected TreePath editingPath
protected int editingRow
protected boolean editorHasDifferentSize
public static ComponentUI createUI(JComponent x)
protected Color getHashColor()
protected void setHashColor(Color color)
public void setLeftChildIndent(int newAmount)
public int getLeftChildIndent()
public void setRightChildIndent(int newAmount)
public int getRightChildIndent()
public void setExpandedIcon(Icon newG)
public Icon getExpandedIcon()
public void setCollapsedIcon(Icon newG)
public Icon getCollapsedIcon()
protected void setLargeModel(boolean largeModel)
protected boolean isLargeModel()
protected void setRowHeight(int rowHeight)
protected int getRowHeight()
protected void setCellRenderer(TreeCellRenderer tcr)
tcr
的treecellrenderer。这个调用的
updateRenderer
。
protected TreeCellRenderer getCellRenderer()
protected void setModel(TreeModel model)
protected TreeModel getModel()
protected void setRootVisible(boolean newValue)
protected boolean isRootVisible()
protected void setShowsRootHandles(boolean newValue)
protected boolean getShowsRootHandles()
protected void setCellEditor(TreeCellEditor editor)
protected TreeCellEditor getCellEditor()
protected void setEditable(boolean newValue)
protected boolean isEditable()
protected void setSelectionModel(TreeSelectionModel newLSM)
protected TreeSelectionModel getSelectionModel()
public Rectangle getPathBounds(JTree tree, TreePath path)
getPathBounds
方法重写,继承类
TreeUI
public TreePath getPathForRow(JTree tree, int row)
getPathForRow
方法重写,继承类
TreeUI
public int getRowForPath(JTree tree, TreePath path)
getRowForPath
方法重写,继承类
TreeUI
public int getRowCount(JTree tree)
getRowCount
方法重写,继承类
TreeUI
public TreePath getClosestPathForLocation(JTree tree, int x, int y)
getClosestPathForLocation
方法重写,继承类
TreeUI
public boolean isEditing(JTree tree)
public boolean stopEditing(JTree tree)
stopEditing
方法重写,继承类
TreeUI
public void cancelEditing(JTree tree)
cancelEditing
方法重写,继承类
TreeUI
public void startEditingAtPath(JTree tree, TreePath path)
startEditingAtPath
方法重写,继承类
TreeUI
public TreePath getEditingPath(JTree tree)
getEditingPath
方法重写,继承类
TreeUI
public void installUI(JComponent c)
ComponentUI
ComponentUI
实例被安装在指定组件的UI代理。这种方法应该完全配置的组件外观和感觉,包括以下内容:
LayoutManager
组件上的必要。PropertyChangeListener
变化适当。installUI
方法重写,继承类
ComponentUI
c
-组件,UI代理被安装
ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
protected void prepareForUIInstall()
tree
调用实例变量已经确定,但在任何违约或听者已安装。
protected void completeUIInstall()
protected void installDefaults()
protected void installListeners()
protected void installKeyboardActions()
protected void installComponents()
protected AbstractLayoutCache.NodeDimensions createNodeDimensions()
protected PropertyChangeListener createPropertyChangeListener()
protected MouseListener createMouseListener()
protected FocusListener createFocusListener()
protected KeyListener createKeyListener()
protected PropertyChangeListener createSelectionModelPropertyChangeListener()
protected TreeSelectionListener createTreeSelectionListener()
protected CellEditorListener createCellEditorListener()
protected ComponentListener createComponentListener()
protected TreeExpansionListener createTreeExpansionListener()
protected AbstractLayoutCache createLayoutCache()
protected CellRendererPane createCellRendererPane()
protected TreeCellEditor createDefaultCellEditor()
protected TreeCellRenderer createDefaultCellRenderer()
protected TreeModelListener createTreeModelListener()
public void uninstallUI(JComponent c)
ComponentUI
installUI
。这个方法被调用时,这个
UIComponent
实例被作为指定组件的UI代理删除。这种方法应该撤消配置进行
installUI
,小心留下的
JComponent
实例在干净的状态(没有多余的听众,外观和感觉的特定属性的对象,等)。这应包括以下几个方面:
uninstallUI
方法重写,继承类
ComponentUI
c
-从这个UI代理被删除的组件;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
protected void prepareForUIUninstall()
protected void completeUIUninstall()
protected void uninstallDefaults()
protected void uninstallListeners()
protected void uninstallKeyboardActions()
protected void uninstallComponents()
public int getBaseline(JComponent c, int width, int height)
getBaseline
方法重写,继承类
ComponentUI
c
-
JComponent
基线被要求
width
的宽度得到基线
height
-高度得到基线
null
c
NullPointerException
IllegalArgumentException
如果宽度或高度小于0
JComponent.getBaseline(int, int)
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
getBaselineResizeBehavior
方法重写,继承类
ComponentUI
c
-
JComponent
返回基线调整行为
null
c
NullPointerException
JComponent.getBaseline(int, int)
public void paint(Graphics g, JComponent c)
ComponentUI
ComponentUI.update
方法调用时指定的组件正在粉刷。子类应重写此方法,并使用指定的
Graphics
对象呈现的成分含量。
paint
方法重写,继承类
ComponentUI
g
-其中
Graphics
背景画
c
-正在绘制的构件;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
protected boolean isDropLine(JTree.DropLocation loc)
DropLocation
应该显示的节点之间的线。这意味着
javax.swing.DropMode.INSERT
和
javax.swing.DropMode.ON_OR_INSERT
下降模式。
loc
-
DropLocation
true
如果放置位置应该显示为一行
protected void paintDropLine(Graphics g)
g
-
Graphics
对象绘制
protected Rectangle getDropLineRect(JTree.DropLocation loc)
loc
-
DropLocation
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 paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path)
clipBounds
,
insets
。
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 paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
clipBounds
,或
insets
。
protected boolean shouldPaintExpandControl(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 paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
protected int getVerticalLegBuffer()
protected int getHorizontalLegBuffer()
protected void drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
protected void drawDashedVerticalLine(Graphics g, int x, int y1, int y2)
protected int getRowX(int row, int depth)
row
行返回x的位置
depth
-行深度
protected void updateLayoutCacheExpandedNodes()
protected void updateExpandedDescendants(TreePath path)
path
从树上得到扩展的后裔和转发到树状态的展开状态。
protected void updateDepthOffset()
protected void updateCellEditor()
protected void updateRenderer()
protected void configureLayoutCache()
protected void updateSize()
treeDidChange
树。
protected void updateCachedPreferredSize()
preferredSize
实例变量,这是返回
getPreferredSize()
。
对于从左到右的方向,规模从目前的abstractlayoutcache确定。RTL的取向,首选大小成为宽度减去最小的位置。
protected void pathWasExpanded(TreePath path)
protected void pathWasCollapsed(TreePath path)
protected void ensureRowsAreVisible(int beginRow, int endRow)
public void setPreferredMinSize(Dimension newSize)
public Dimension getPreferredMinSize()
public Dimension getPreferredSize(JComponent c)
getPreferredSize
方法重写,继承类
ComponentUI
c
优先度的被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
JComponent.getPreferredSize()
,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getPreferredSize(JComponent c, boolean checkConsistency)
public Dimension getMinimumSize(JComponent c)
getMinimumSize
方法重写,继承类
ComponentUI
c
最小尺寸的是被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
Dimension
对象或
null
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
getMaximumSize
方法重写,继承类
ComponentUI
c
-其最大尺寸被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
Dimension
对象或
null
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
protected void completeEditing()
getInvokesStopCellEditing
返回true,stopcellediting将当前编辑器调用。然后completeediting将信息虚假的,真实的,虚假的取消任何挥之不去的编辑。
protected void completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree)
protected boolean startEditing(TreePath path, MouseEvent event)
这假设路径是有效的和可见的。
protected void checkForClickInExpandControl(TreePath path, int mouseX, int mouseY)
mouseX
和
mouseY
在展开/折叠区域的
row
,这将触发的行。
protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY)
mouseX
和
mouseY
落在排的面积是用来展开/折叠的节点和节点
row
并不代表叶返回true。
protected void handleExpandControlClick(TreePath path, int mouseX, int mouseY)
protected void toggleExpandState(TreePath path)
protected boolean isToggleSelectionEvent(MouseEvent event)
protected boolean isMultiSelectEvent(MouseEvent event)
protected boolean isToggleEvent(MouseEvent event)
protected void selectPathForEvent(TreePath path, MouseEvent event)
protected boolean isLeaf(int row)
row
节点是叶。
protected void updateLeadSelectionRow()
protected int getLeadSelectionRow()
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.