public class VariableHeightLayoutCache extends AbstractLayoutCache
 警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从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)
              如果路径被展开且可见,则返回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的可见子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 - 如果要显示树的根节点,则为true 
           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 - 如果路径应该展开,则为true,否则为false 
           public boolean getExpandedState(TreePath path)
getExpandedState在 
            AbstractLayoutCache 
           path - 被查询的路径 
           public Rectangle getBounds(TreePath path, Rectangle placeIn)
Rectangle path标识的项目的标签部分的 
           path 。 
          getBounds在 
            AbstractLayoutCache类 
           path - 要绘制的路径 
           placeIn - 
            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,y。 
          getPathClosestTo在 
            AbstractLayoutCache 
           x - x坐标 
           y - y坐标 
           public Enumeration<TreePath> getVisiblePathsFrom(TreePath path)
Enumerator ,从传入的位置开始可见的路径递增。 
           枚举的顺序是基于路径的显示方式。 
          getVisiblePathsFrom在 
            AbstractLayoutCache 
           path - 位置在 
            TreePath开始 
           Enumerator可以在可见的路径上递增 
           public int getVisibleChildCount(TreePath path)
path的可见子 
           path 。 
          getVisibleChildCount在 
            AbstractLayoutCache 
           path - 被查询的路径 
           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返回已更改节点的父节点的路径。 
 e.childIndices返回已更改节点的索引(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返回的路径长度为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.