public class FixedHeightLayoutCache extends AbstractLayoutCache
 警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans包中。 请参阅XMLEncoder 。 
AbstractLayoutCache.NodeDimensionsnodeDimensions, rootVisible, rowHeight, treeModel, treeSelectionModel| Constructor and Description | 
|---|
| FixedHeightLayoutCache() | 
| Modifier and Type | Method and Description | 
|---|---|
| Rectangle | getBounds(TreePath path, Rectangle placeIn)
              返回一个给出绘制路径所需边界的矩形。 
             | 
| boolean | getExpandedState(TreePath path)
              如果路径被展开且可见,则返回true。 
             | 
| TreePath | getPathClosestTo(int x, int y)
              返回最接近x,y的节点的路径。 
             | 
| TreePath | getPathForRow(int row)
              返回在行中传递的路径。 
             | 
| int | getRowCount()
              返回可见行数。 
             | 
| int | getRowForPath(TreePath path)
              返回在路径中识别的最后一个项目可见的行。 
             | 
| int | getVisibleChildCount(TreePath path)
              返回行的可见子项数。 
             | 
| Enumeration<TreePath> | getVisiblePathsFrom(TreePath path)
              返回一个枚举器,它从传入的位置开始,以可见路径递增。 
             | 
| void | invalidatePathBounds(TreePath path)
              没有什么,FixedHeightLayoutCache不缓存宽度,这是可以改变的。 
             | 
| void | invalidateSizes()
              通知TreeState需要重新计算它所引用的所有大小。 
             | 
| boolean | isExpanded(TreePath path)
              如果当前标识的值目前已被扩展,则返回true。 
             | 
| void | setExpandedState(TreePath path, boolean isExpanded)
              标记路径 
              path展开状态为isExpanded。 | 
| void | setModel(TreeModel newModel)
              设置将提供数据的TreeModel。 
             | 
| 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, getPreferredHeight, getPreferredWidth, getRowHeight, getRowsForPaths, getSelectionModel, isFixedRowHeight, isRootVisible, setNodeDimensions, setSelectionModelpublic void setModel(TreeModel newModel)
setModel在 
            AbstractLayoutCache 
           newModel - 提供数据的TreeModel 
           public void setRootVisible(boolean rootVisible)
setRootVisible在 
            AbstractLayoutCache 
           rootVisible - 如果要显示树的根节点,则为true 
           AbstractLayoutCache.rootVisible 
           public void setRowHeight(int rowHeight)
setRowHeight在 
            AbstractLayoutCache 
           rowHeight - 每个单元格的高度,以像素为单位 
           public int getRowCount()
getRowCount在 
            AbstractLayoutCache 
           public void invalidatePathBounds(TreePath path)
invalidatePathBounds在 
            AbstractLayoutCache 
           path - 正在更新的路径 
           public void invalidateSizes()
invalidateSizes在 
            AbstractLayoutCache类 
           public boolean isExpanded(TreePath path)
isExpanded在 
            AbstractLayoutCache 
           public Rectangle getBounds(TreePath path, Rectangle placeIn)
getBounds在 
            AbstractLayoutCache 
           path - 指定节点的TreePath 
           placeIn - 给出可用空间的Rectangle对象 
           public TreePath getPathForRow(int row)
getPathForRow在 
            AbstractLayoutCache类 
           row - 正在查询的行 
           TreePath 
           public int getRowForPath(TreePath path)
getRowForPath在 
            AbstractLayoutCache 
           path - 被查询的 
            TreePath 
           public TreePath getPathClosestTo(int x, int y)
getPathClosestTo在 
            AbstractLayoutCache 
           x - 所需位置的水平分量 
           y - 所需位置的垂直分量 
           TreePath最接近指定点 
           public int getVisibleChildCount(TreePath path)
getVisibleChildCount在 
            AbstractLayoutCache类 
           path - 被查询的路径 
           public Enumeration<TreePath> getVisiblePathsFrom(TreePath path)
getVisiblePathsFrom在 
            AbstractLayoutCache 
           path - 
            path的起始位置 
           Enumerator从所需位置开始 
           public void setExpandedState(TreePath path, boolean isExpanded)
path扩展状态为 
           isExpanded 。 
          setExpandedState在 
            AbstractLayoutCache 
           path - 正在扩展或折叠的路径 
           isExpanded - 如果路径应该展开,则为true,否则为false 
           public boolean getExpandedState(TreePath path)
getExpandedState在 
            AbstractLayoutCache 
           path - 被查询的路径 
           public void treeNodesChanged(TreeModelEvent e)
节点(或一组兄弟节点)以某种方式更改后调用。 节点没有更改树中的位置或更改其子数组,但其他属性已更改,并可能影响演示。 示例:文件的名称已更改,但它位于文件系统中的相同位置。
e.path()返回已更改节点的父节点的路径。
e.childIndices()返回已更改节点的索引(es)。
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()返回的路径长度为1,而第一个元素不标识当前根节点,则第一个元素应该成为树的新根。
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.