|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.tree.AbstractLayoutCache
javax.swing.tree.VariableHeightLayoutCache
public class VariableHeightLayoutCache
注:在以后的版本中,此类将变得更加开放。
警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前的序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder。
| 嵌套类摘要 |
|---|
| 从类 javax.swing.tree.AbstractLayoutCache 继承的嵌套类/接口 |
|---|
AbstractLayoutCache.NodeDimensions |
| 字段摘要 |
|---|
| 从类 javax.swing.tree.AbstractLayoutCache 继承的字段 |
|---|
nodeDimensions, rootVisible, rowHeight, treeModel, treeSelectionModel |
| 构造方法摘要 | |
|---|---|
VariableHeightLayoutCache()
|
|
| 方法摘要 | |
|---|---|
Rectangle |
getBounds(TreePath path,
Rectangle placeIn)
返回 Rectangle,它包围在其中绘制 path 标识的项的标签部分。 |
boolean |
getExpandedState(TreePath path)
如果路径已扩展,并且可见,则返回 true。 |
TreePath |
getPathClosestTo(int x,
int y)
返回最接近 x,y 的节点的路径。 |
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)
树彻底更改给定节点以下的结构之后进行调用。 |
| 从类 javax.swing.tree.AbstractLayoutCache 继承的方法 |
|---|
getModel, getNodeDimensions, getNodeDimensions, getRowHeight, getRowsForPaths, getSelectionModel, isFixedRowHeight, isRootVisible, setSelectionModel |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public VariableHeightLayoutCache()
| 方法详细信息 |
|---|
public void setModel(TreeModel newModel)
TreeModel。
AbstractLayoutCache 中的 setModelnewModel - 将提供数据的 TreeModelpublic void setRootVisible(boolean rootVisible)
TreeModel 的根节点是否可见。
AbstractLayoutCache 中的 setRootVisiblerootVisible - 如果将显示树的根节点,则为 trueAbstractLayoutCache.rootVisiblepublic void setRowHeight(int rowHeight)
AbstractLayoutCache 中的 setRowHeightrowHeight - 每个单元格的高度(以像素为单位)public void setNodeDimensions(AbstractLayoutCache.NodeDimensions nd)
AbstractLayoutCache 中的 setNodeDimensionsnd - 渲染器
public void setExpandedState(TreePath path,
boolean isExpanded)
path 的扩展状态标记为 isExpanded。
AbstractLayoutCache 中的 setExpandedStatepath - 相关的 TreePathisExpanded - 如果应扩展路径,则为 true,否则为 falsepublic boolean getExpandedState(TreePath path)
AbstractLayoutCache 中的 getExpandedStatepath - 正在被查询的路径
public Rectangle getBounds(TreePath path,
Rectangle placeIn)
Rectangle,它包围在其中绘制 path 标识的项的标签部分。
AbstractLayoutCache 中的 getBoundspath - 要绘制的路径placeIn - 矩形的边界
nullpublic TreePath getPathForRow(int row)
row 的路径。如果 row 不可见,则返回 null。
AbstractLayoutCache 中的 getPathForRowrow - 相关的位置
row 的路径,如果 row 不可见,则返回 nullpublic int getRowForPath(TreePath path)
AbstractLayoutCache 中的 getRowForPathpath - 相关的 TreePath
public int getRowCount()
AbstractLayoutCache 中的 getRowCountpublic void invalidatePathBounds(TreePath path)
LayoutCache path 的边界无效,需要更新。
AbstractLayoutCache 中的 invalidatePathBoundspath - 现在无效的 TreePathpublic int getPreferredHeight()
AbstractLayoutCache 中的 getPreferredHeightpublic int getPreferredWidth(Rectangle bounds)
visibleRegion 中区域的首选宽度和高度。
AbstractLayoutCache 中的 getPreferredWidthbounds - 被查询的区域
public TreePath getPathClosestTo(int x,
int y)
null,否则,始终返回一个有效路径。如果需要测试返回的对象是否正好位于 x, y,您应获取返回路径的边界,并根据它测试 x, y。
AbstractLayoutCache 中的 getPathClosestTox - x 坐标y - y 坐标
public Enumeration<TreePath> getVisiblePathsFrom(TreePath path)
Enumerator。该枚举的排序基于路径的显示方式。
AbstractLayoutCache 中的 getVisiblePathsFrompath - TreePath 的起始位置
Enumeratorpublic int getVisibleChildCount(TreePath path)
path 的可见子路径数。
AbstractLayoutCache 中的 getVisibleChildCountpath - 正被查询的路径
path 的可见子路径数public void invalidateSizes()
TreeState 需要重新计算它引用的所有大小。
AbstractLayoutCache 中的 invalidateSizespublic boolean isExpanded(TreePath path)
path 标识的值,则返回 true。
AbstractLayoutCache 中的 isExpandedpath 标识的值,则返回 truepublic void treeNodesChanged(TreeModelEvent e)
e.path 返回已更改节点的父节点的路径。
e.childIndices 返回已更改节点的索引。
AbstractLayoutCache 中的 treeNodesChangede - 相关的 TreeModelEventpublic void treeNodesInserted(TreeModelEvent e)
e.path 返回新节点的父节点。
e.childIndices 按升序返回新节点的索引。
AbstractLayoutCache 中的 treeNodesInsertede - 相关的 TreeModelEventpublic void treeNodesRemoved(TreeModelEvent e)
e.path 返回删除节点的前一个父节点。
e.childIndices 返回节点按升序删除之前具有的索引。
AbstractLayoutCache 中的 treeNodesRemovede - 相关的 TreeModelEventpublic void treeStructureChanged(TreeModelEvent e)
e.getPath 返回的路径长度为一,并且第一个元素不标识当前根节点,则第一个元素应成为树的新根。
e.path 保持节点的路径。
e.childIndices 返回 null。
AbstractLayoutCache 中的 treeStructureChangede - 相关的 TreeModelEvent
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。