public class VariableHeightLayoutCache extends AbstractLayoutCache
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans包。请看XMLEncoder。
AbstractLayoutCache.NodeDimensionsnodeDimensions, rootVisible, rowHeight, treeModel, treeSelectionModel| Constructor and Description |
|---|
VariableHeightLayoutCache() |
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
getBounds(TreePath path, Rectangle placeIn)
返回
Rectangle附上标签部分,项目经
path将绘制。
|
boolean |
getExpandedState(TreePath path)
如果路径被扩展,并可见返回,则返回真。
|
TreePath |
getPathClosestTo(int x, int y)
返回到最接近X的节点的路径。
|
TreePath |
getPathForRow(int row)
返回
row路径。
|
int |
getPreferredHeight()
返回首选的高度。
|
int |
getPreferredWidth(Rectangle bounds)
返回在
visibleRegion地区首选的宽度和高度。
|
int |
getRowCount()
返回可见行的数目。
|
int |
getRowForPath(TreePath path)
返回路径中标识的最后一个项目的行可见。
|
int |
getVisibleChildCount(TreePath path)
返回
path可见儿童数量。
|
Enumeration<TreePath> |
getVisiblePathsFrom(TreePath path)
返回一个
Enumerator在可见的路径出发,在通过位置增量。
|
void |
invalidatePathBounds(TreePath path)
指导
LayoutCache,
path界是无效的,并需要更新。
|
void |
invalidateSizes()
通知,需要重新计算所有的尺寸是参考
TreeState。
|
boolean |
isExpanded(TreePath path)
如果该值确定的
path目前正在扩大,返回true。
|
void |
setExpandedState(TreePath path, boolean isExpanded)
标记的路径
path膨胀状态
isExpanded。
|
void |
setModel(TreeModel newModel)
集
TreeModel将提供数据。
|
void |
setNodeDimensions(AbstractLayoutCache.NodeDimensions nd)
设置渲染器,负责画树节点。
|
void |
setRootVisible(boolean rootVisible)
确定是否从
TreeModel根节点是可见的。
|
void |
setRowHeight(int rowHeight)
设置每个单元格的高度。
|
void |
treeNodesChanged(TreeModelEvent e)
在一个节点(或一组兄弟姐妹)在某种程度上改变了调用。
|
void |
treeNodesInserted(TreeModelEvent e)
调用节点后已插入到树中。
|
void |
treeNodesRemoved(TreeModelEvent e)
调用后节点已从树中删除。
|
void |
treeStructureChanged(TreeModelEvent e)
在树已从一个给定节点向下急剧变化的结构调用。
|
getModel, getNodeDimensions, getNodeDimensions, getRowHeight, getRowsForPaths, getSelectionModel, isFixedRowHeight, isRootVisible, setSelectionModelpublic void setModel(TreeModel newModel)
TreeModel将提供数据。
setModel 方法重写,继承类
AbstractLayoutCache
newModel -
TreeModel就是提供数据
public void setRootVisible(boolean rootVisible)
TreeModel根节点是可见的。
setRootVisible 方法重写,继承类
AbstractLayoutCache
rootVisible -如果树的根节点将显示
AbstractLayoutCache.rootVisible
public void setRowHeight(int rowHeight)
setRowHeight 方法重写,继承类
AbstractLayoutCache
rowHeight -每个单元的高度,以像素为单位
public void setNodeDimensions(AbstractLayoutCache.NodeDimensions nd)
setNodeDimensions 方法重写,继承类
AbstractLayoutCache
nd -渲染器
public void setExpandedState(TreePath path, boolean isExpanded)
path膨胀状态
isExpanded。
setExpandedState 方法重写,继承类
AbstractLayoutCache
path -感兴趣的
TreePath
isExpanded -如果路径应该扩大,否则为false
public boolean getExpandedState(TreePath path)
getExpandedState 方法重写,继承类
AbstractLayoutCache
path的路径查询
public Rectangle getBounds(TreePath path, Rectangle placeIn)
Rectangle附上标签部分,项目经
path将绘制。
getBounds 方法重写,继承类
AbstractLayoutCache
path -路径的绘制
placeIn -封闭矩形的边界
null如果节点不能确定
public TreePath getPathForRow(int row)
row路径。如果
row是不可见的,
null返回。
getPathForRow 方法重写,继承类
AbstractLayoutCache
row -感兴趣的位置
row路径,或
null如果
row是不可见的
public int getRowForPath(TreePath path)
getRowForPath 方法重写,继承类
AbstractLayoutCache
path -感兴趣的
TreePath
public int getRowCount()
getRowCount 方法重写,继承类
AbstractLayoutCache
public void invalidatePathBounds(TreePath path)
LayoutCache,
path界是无效的,并需要更新。
invalidatePathBounds 方法重写,继承类
AbstractLayoutCache
path -
TreePath现在是无效的
public int getPreferredHeight()
getPreferredHeight 方法重写,继承类
AbstractLayoutCache
public int getPreferredWidth(Rectangle bounds)
visibleRegion地区首选的宽度和高度。
getPreferredWidth 方法重写,继承类
AbstractLayoutCache
bounds -区域查询
public TreePath getPathClosestTo(int x, int y)
null,否则它将总是返回一个有效的路径。如果你需要测试,如果返回的对象是完全在X,你应该得到返回的路径和测试X的界限,对该。
getPathClosestTo 方法重写,继承类
AbstractLayoutCache
x -横坐标
y -坐标
public Enumeration<TreePath> getVisiblePathsFrom(TreePath path)
Enumerator在可见的路径出发,在通过位置增量。枚举的顺序基于如何显示路径。
getVisiblePathsFrom 方法重写,继承类
AbstractLayoutCache
path在
TreePath位置开始
Enumerator在可见的路径的增量
public int getVisibleChildCount(TreePath path)
path可见儿童数量。
getVisibleChildCount 方法重写,继承类
AbstractLayoutCache
path的路径查询
path可见儿童数量
public void invalidateSizes()
TreeState。
invalidateSizes 方法重写,继承类
AbstractLayoutCache
public boolean isExpanded(TreePath path)
path目前正在扩大,返回true。
isExpanded 方法重写,继承类
AbstractLayoutCache
path目前正在扩大
public void treeNodesChanged(TreeModelEvent e)
e.path返回路径的改变节点的父节点(S)。
e.childIndices回报指数(ES)的改变节点(S)。
treeNodesChanged 方法重写,继承类
AbstractLayoutCache
e -感兴趣的
TreeModelEvent
public void treeNodesInserted(TreeModelEvent e)
e.path返回新节点的父。
e.childIndices返回新节点的索引升序。
treeNodesInserted 方法重写,继承类
AbstractLayoutCache
e -感兴趣的
TreeModelEvent
public void treeNodesRemoved(TreeModelEvent e)
e.path返回被删除的节点的前母。
e.childIndices返回节点之前他们的顺序删除索引。
treeNodesRemoved 方法重写,继承类
AbstractLayoutCache
e -感兴趣的
TreeModelEvent
public void treeStructureChanged(TreeModelEvent e)
e.getPath第一元素不确定当前根节点的第一个元素应成为新树的根。
e.path保存路径的节点。
e.childIndices返回null。
treeStructureChanged 方法重写,继承类
AbstractLayoutCache
e -感兴趣的
TreeModelEvent
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.