public class VariableHeightLayoutCache extends AbstractLayoutCache
警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースとの互換性がなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートがjava.beans
パッケージに追加されています。 XMLEncoder
を参照してください。
AbstractLayoutCache.NodeDimensions
nodeDimensions, rootVisible, rowHeight, treeModel, treeSelectionModel
コンストラクタ | 説明 |
---|---|
VariableHeightLayoutCache() |
修飾子と型 | メソッド | 説明 |
---|---|---|
Rectangle |
getBounds(TreePath path, Rectangle placeIn) |
path で識別される項目が描画されるラベル部分を囲むRectangle を返します。 |
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) |
pathで識別される最後の項目が可視である行を返します。
|
int |
getVisibleChildCount(TreePath path) |
path について可視の子の数を返します。 |
Enumeration<TreePath> |
getVisiblePathsFrom(TreePath path) |
渡された位置から開始される可視のパスを次々に列挙する
Enumerator を返します。 |
void |
invalidatePathBounds(TreePath path) |
path の矩形は無効で、更新される必要があることをLayoutCache に通知します。 |
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, setSelectionModel
public void setModel(TreeModel newModel)
TreeModel
を設定します。setModel
、クラスAbstractLayoutCache
newModel
- データを提供するTreeModel
public void setRootVisible(boolean rootVisible)
TreeModel
のルート・ノードが可視かどうかを設定します。setRootVisible
、クラスAbstractLayoutCache
rootVisible
- ツリーのルート・ノードが表示される場合はtrueAbstractLayoutCache.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、そうでない場合はfalsepublic boolean getExpandedState(TreePath path)
getExpandedState
、クラスAbstractLayoutCache
path
- 照会中のパスpublic Rectangle getBounds(TreePath path, Rectangle placeIn)
path
で識別される項目が描画されるラベル部分を囲むRectangle
を返します。getBounds
、クラスAbstractLayoutCache
path
- 描画されるパスplaceIn
- 取り囲む矩形の境界null
public TreePath getPathForRow(int row)
row
のパスを返します。 row
が可視でない場合は、null
が返されます。 getPathForRow
、クラスAbstractLayoutCache
row
- 対象の位置row
のパス。row
が可視でない場合はnull
public int getRowForPath(TreePath path)
getRowForPath
、クラスAbstractLayoutCache
path
- 対象のTreePath
public int getRowCount()
getRowCount
、クラスAbstractLayoutCache
public void invalidatePathBounds(TreePath path)
path
の矩形は無効で、更新される必要があることをLayoutCache
に通知します。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, yにあるかどうかを判定する必要がある場合は、返されたパスの矩形を取得して、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
について可視の子の数を返します。getVisibleChildCount
、クラスAbstractLayoutCache
path
- 照会中のパスpath
について可視の子の数public void invalidateSizes()
TreeState
に通知します。public boolean isExpanded(TreePath path)
path
で識別される値が現在展開されている場合にtrueを返します。isExpanded
、クラスAbstractLayoutCache
path
で識別される値が現在展開されている場合はtruepublic void treeNodesChanged(TreeModelEvent e)
e.path
は、変更されたノードの親をパスに返します。
e.childIndices
は、変更されたノードのインデックスを返します。
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
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。