所有类


javax.swing.tree
类 VariableHeightLayoutCache

java.lang.Object
  继承者 javax.swing.tree.AbstractLayoutCache
      继承者 javax.swing.tree.VariableHeightLayoutCache
所有已实现的接口:
RowMapper

public class VariableHeightLayoutCache
   
   
   
   
extends AbstractLayoutCache

注:在以后的版本中,此类将变得更加开放。

警告:此类的已序列化对象与以后的 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()
           
 
方法摘要
 RectanglegetBounds(TreePath path, Rectangle placeIn)
          返回 Rectangle,它包围在其中绘制 path 标识的项的标签部分。
 booleangetExpandedState(TreePath path)
          如果路径已扩展,并且可见,则返回 true。
 TreePathgetPathClosestTo(int x, int y)
          返回最接近 x,y 的节点的路径。
 TreePathgetPathForRow(int row)
          返回 row 的路径。
 intgetPreferredHeight()
          返回首选高度。
 intgetPreferredWidth(Rectangle bounds)
          返回 visibleRegion 中区域的首选宽度和高度。
 intgetRowCount()
          返回可见的行数。
 intgetRowForPath(TreePath path)
          返回路径中标识的最后一项在其中可见的行。
 intgetVisibleChildCount(TreePath path)
          返回 path 的可见子路径数。
 Enumeration<TreePath>getVisiblePathsFrom(TreePath path)
          返回从传入位置开始的可见路径的增量的 Enumerator
 voidinvalidatePathBounds(TreePath path)
          指示 LayoutCachepath 的边界无效,需要更新。
 voidinvalidateSizes()
          通知 TreeState 需要重新计算它引用的所有大小。
 booleanisExpanded(TreePath path)
          如果当前扩展了 path 标识的值,则返回 true。
 voidsetExpandedState(TreePath path, boolean isExpanded)
          将路径 path 的扩展状态标记为 isExpanded
 voidsetModel(TreeModel newModel)
          设置将提供数据的 TreeModel
 voidsetNodeDimensions(AbstractLayoutCache.NodeDimensions nd)
          设置负责绘制树中节点的渲染器。
 voidsetRootVisible(boolean rootVisible)
          确定 TreeModel 的根节点是否可见。
 voidsetRowHeight(int rowHeight)
          设置每个单元格的高度。
 voidtreeNodesChanged(TreeModelEvent e)
          按某种方式更改节点(或兄弟节点集)后进行调用。
 voidtreeNodesInserted(TreeModelEvent e)
          将节点插入树后进行调用。
 voidtreeNodesRemoved(TreeModelEvent e)
          将节点从树删除后进行调用。
 voidtreeStructureChanged(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
 

构造方法详细信息

VariableHeightLayoutCache

public VariableHeightLayoutCache()
方法详细信息

setModel

public void setModel(TreeModel newModel)
设置将提供数据的 TreeModel

覆盖:
AbstractLayoutCache 中的 setModel
参数:
newModel - 将提供数据的 TreeModel

setRootVisible

public void setRootVisible(boolean rootVisible)
确定 TreeModel 的根节点是否可见。

覆盖:
AbstractLayoutCache 中的 setRootVisible
参数:
rootVisible - 如果将显示树的根节点,则为 true
另请参见:
AbstractLayoutCache.rootVisible

setRowHeight

public void setRowHeight(int rowHeight)
设置每个单元格的高度。如果指定的值小于或等于零,则会查询当前单元格渲染器以获取每行高度。

覆盖:
AbstractLayoutCache 中的 setRowHeight
参数:
rowHeight - 每个单元格的高度(以像素为单位)

setNodeDimensions

public void setNodeDimensions(AbstractLayoutCache.NodeDimensions nd)
设置负责绘制树中节点的渲染器。

覆盖:
AbstractLayoutCache 中的 setNodeDimensions
参数:
nd - 渲染器

setExpandedState

public void setExpandedState(TreePath path,
                             boolean isExpanded)
将路径 path 的扩展状态标记为 isExpanded

指定者:
AbstractLayoutCache 中的 setExpandedState
参数:
path - 相关的 TreePath
isExpanded - 如果应扩展路径,则为 true,否则为 false

getExpandedState

public boolean getExpandedState(TreePath path)
如果路径已扩展,并且可见,则返回 true。

指定者:
AbstractLayoutCache 中的 getExpandedState
参数:
path - 正在被查询的路径
返回:
如果路径已扩展,并且可见,则返回 true,否则返回 false

getBounds

public Rectangle getBounds(TreePath path,
                           Rectangle placeIn)
返回 Rectangle,它包围在其中绘制 path 标识的项的标签部分。

指定者:
AbstractLayoutCache 中的 getBounds
参数:
path - 要绘制的路径
placeIn - 矩形的边界
返回:
矩形的边界,如果无法确认该节点,则返回 null