javax.swing.tree
public abstract class AbstractLayoutCache extends Object implements RowMapper
Modifier and Type | Class and Description |
---|---|
static class |
AbstractLayoutCache.NodeDimensions
class NodeDimensions
|
Modifier and Type | Field and Description |
---|---|
protected AbstractLayoutCache.NodeDimensions |
nodeDimensions
nodeDimensions
|
protected boolean |
rootVisible
rootVisible
|
protected int |
rowHeight
rowHeight
|
protected TreeModel |
treeModel
treeModel
|
protected TreeSelectionModel |
treeSelectionModel
treeSelectionModel
|
Constructor and Description |
---|
AbstractLayoutCache()
Constructor AbstractLayoutCache
|
Modifier and Type | Method and Description |
---|---|
abstract Rectangle |
getBounds(TreePath value0,
Rectangle value1)
getBounds
|
abstract boolean |
getExpandedState(TreePath path)
getExpandedState
|
TreeModel |
getModel()
Returns the model that provides the tree data.
|
AbstractLayoutCache.NodeDimensions |
getNodeDimensions()
getNodeDimensions
|
protected Rectangle |
getNodeDimensions(Object value,
int row,
int depth,
boolean expanded,
Rectangle bounds)
Get the node dimensions.
|
abstract TreePath |
getPathClosestTo(int value0,
int value1)
getPathClosestTo
|
abstract TreePath |
getPathForRow(int row)
getPathForRow
|
int |
getPreferredHeight()
Get the sum of heights for all rows.
|
int |
getPreferredWidth(Rectangle rect)
Get the maximal width.
|
abstract int |
getRowCount()
getRowCount
|
abstract int |
getRowForPath(TreePath path)
getRowForPath
|
int |
getRowHeight()
getRowHeight
|
int[] |
getRowsForPaths(TreePath[] paths)
Get the tree row numbers for the given pathes.
|
TreeSelectionModel |
getSelectionModel()
getSelectionModel
|
abstract int |
getVisibleChildCount(TreePath path)
getVisibleChildCount
|
abstract Enumeration<TreePath> |
getVisiblePathsFrom(TreePath path)
getVisiblePathsFrom
|
abstract void |
invalidatePathBounds(TreePath path)
invalidatePathBounds
|
abstract void |
invalidateSizes()
invalidateSizes
|
abstract boolean |
isExpanded(TreePath value0)
isExpanded
|
protected boolean |
isFixedRowHeight()
Returns true if this layout supposes that all rows have the fixed
height.
|
boolean |
isRootVisible()
isRootVisible
|
abstract void |
setExpandedState(TreePath value0,
boolean value1)
setExpandedState
|
void |
setModel(TreeModel model)
Sets the model that provides the tree data.
|
void |
setNodeDimensions(AbstractLayoutCache.NodeDimensions dimensions)
setNodeDimensions
|
void |
setRootVisible(boolean visible)
setRootVisible
|
void |
setRowHeight(int height)
setRowHeight
|
void |
setSelectionModel(TreeSelectionModel model)
setSelectionModel
|
abstract void |
treeNodesChanged(TreeModelEvent event)
treeNodesChanged
|
abstract void |
treeNodesInserted(TreeModelEvent event)
treeNodesInserted
|
abstract void |
treeNodesRemoved(TreeModelEvent event)
treeNodesRemoved
|
abstract void |
treeStructureChanged(TreeModelEvent event)
treeStructureChanged
|
protected AbstractLayoutCache.NodeDimensions nodeDimensions
protected TreeSelectionModel treeSelectionModel
protected boolean rootVisible
protected int rowHeight
public AbstractLayoutCache()
public void setNodeDimensions(AbstractLayoutCache.NodeDimensions dimensions)
dimensions
- TODOpublic AbstractLayoutCache.NodeDimensions getNodeDimensions()
protected Rectangle getNodeDimensions(Object value, int row, int depth, boolean expanded, Rectangle bounds)
FixedHeightLayoutCache
. If the method is not overridden and
the property is not set, the InternalError is thrown.value
- the last node in the pathrow
- the node rowdepth
- the indentation depthexpanded
- true if this node is expanded, false otherwisebounds
- the area where the tree is displayedpublic void setModel(TreeModel model)
model
- the modelpublic TreeModel getModel()
public void setRootVisible(boolean visible)
visible
- true
if root should be visible,
false
otherwisepublic boolean isRootVisible()
true
if root is visible,
false
otherwisepublic void setRowHeight(int height)
height
- the row heightpublic int getRowHeight()
public void setSelectionModel(TreeSelectionModel model)
model
- the modelpublic TreeSelectionModel getSelectionModel()
public int getPreferredHeight()
VariableHeightLayoutCache
, FixedHeightLayoutCache
) for
the better performance.public int getPreferredWidth(Rectangle rect)
VariableHeightLayoutCache
, FixedHeightLayoutCache
) for
the better performance.rect
- the rectangle that is used during the method workpublic abstract boolean isExpanded(TreePath value0)
value0
- TODOpublic abstract Rectangle getBounds(TreePath value0, Rectangle value1)
value0
- TODOvalue1
- TODOpublic abstract TreePath getPathForRow(int row)
row
- the rowpublic abstract int getRowForPath(TreePath path)
path
- the tree pathpublic abstract TreePath getPathClosestTo(int value0, int value1)
value0
- TODOvalue1
- TODOpublic abstract Enumeration<TreePath> getVisiblePathsFrom(TreePath path)
path
- the tree pathpublic abstract int getVisibleChildCount(TreePath path)
path
- the tree pathpublic abstract void setExpandedState(TreePath value0, boolean value1)
value0
- TODOvalue1
- TODOpublic abstract boolean getExpandedState(TreePath path)
path
- the tree pathpublic abstract int getRowCount()
public abstract void invalidateSizes()
public abstract void invalidatePathBounds(TreePath path)
path
- the tree pathpublic abstract void treeNodesChanged(TreeModelEvent event)
event
- the event to sendpublic abstract void treeNodesInserted(TreeModelEvent event)
event
- the event to sendpublic abstract void treeNodesRemoved(TreeModelEvent event)
event
- the event to sendpublic abstract void treeStructureChanged(TreeModelEvent event)
event
- the event to sendpublic int[] getRowsForPaths(TreePath[] paths)
getRowForPath(TreePath)
.getRowsForPaths
in interface RowMapper
paths
- the tree paths the array of the tree pathes.protected boolean isFixedRowHeight()