| Package | org.aswing.tree |
| Class | public class AbstractLayoutCache |
| Implements | RowMapper |
| Subclasses | FixedHeightLayoutCache |
| Property | Defined by | ||
|---|---|---|---|
| nodeDimensions : NodeDimensions
Object responsible for getting the size of a node.
| AbstractLayoutCache | ||
| rootVisible : Boolean
True if the root node is displayed, false if its children are
the highest visible nodes.
| AbstractLayoutCache | ||
| treeModel : TreeModel
Model providing information.
| AbstractLayoutCache | ||
| treeSelectionModel : TreeSelectionModel
Selection model.
| AbstractLayoutCache | ||
| Method | Defined by | ||
|---|---|---|---|
|
Returns a rectangle giving the bounds needed to draw path.
| AbstractLayoutCache | ||
|
getExpandedState(path:TreePath):Boolean
Returns true if the path is expanded, and visible.
| AbstractLayoutCache | ||
|
Returns the
TreeModel that is providing the data. | AbstractLayoutCache | ||
|
Returns the object that renders nodes in the tree, and which is
responsible for calculating the dimensions of individual nodes.
| AbstractLayoutCache | ||
|
getPathClosestTo(x:int, y:int):TreePath
Returns the path to the node that is closest to x,y.
| AbstractLayoutCache | ||
|
getPathForRow(row:int):TreePath
Returns the path for passed in row.
| AbstractLayoutCache | ||
|
getPreferredHeight():int
Returns the preferred height.
| AbstractLayoutCache | ||
|
getPreferredWidth(bounds:IntRectangle):int
Returns the preferred width for the passed in region.
| AbstractLayoutCache | ||
|
getRowContainingYLocation(location:int):int
Returns the index of the row containing location.
| AbstractLayoutCache | ||
|
getRowCount():int
Number of rows being displayed.
| AbstractLayoutCache | ||
|
getRowForPath(path:TreePath):int
Returns the row that the last item identified in path is visible
at.
| AbstractLayoutCache | ||
|
getRowHeight():int
Returns the height of each row.
| AbstractLayoutCache | ||
|
getRowsForPaths(paths:Array):Array
Returns the rows that the
TreePath instances in
path are being displayed at. | AbstractLayoutCache | ||
|
Returns the model used to maintain the selection.
| AbstractLayoutCache | ||
|
getVisibleChildCount(path:TreePath):int
Returns the number of visible children for row.
| AbstractLayoutCache | ||
|
getVisiblePathsFrom(path:TreePath, totalCount:int):Array
Returns an
Enumerator that increments over the visible
paths starting at the passed in location. | AbstractLayoutCache | ||
|
invalidatePathBounds(path:TreePath):void
Instructs the
LayoutCache that the bounds for
path are invalid, and need to be updated. | AbstractLayoutCache | ||
|
invalidateSizes():void
Informs the
TreeState that it needs to recalculate
all the sizes it is referencing. | AbstractLayoutCache | ||
|
isExpanded(path:TreePath):Boolean
Returns true if the value identified by row is currently expanded.
| AbstractLayoutCache | ||
|
isRootVisible():Boolean
Returns true if the root node of the tree is displayed.
| AbstractLayoutCache | ||
|
setExpandedState(path:TreePath, isExpanded:Boolean):void
Marks the path
path expanded state to
isExpanded. | AbstractLayoutCache | ||
|
Sets the
TreeModel that will provide the data. | AbstractLayoutCache | ||
|
setNodeDimensions(nd:NodeDimensions):void
Sets the renderer that is responsible for drawing nodes in the tree
and which is threfore responsible for calculating the dimensions of
individual nodes.
| AbstractLayoutCache | ||
|
setRootVisible(rootVisible:Boolean):void
Determines whether or not the root node from
the
TreeModel is visible. | AbstractLayoutCache | ||
|
setRowHeight(rowHeight:int):void
Sets the height of each cell.
| AbstractLayoutCache | ||
|
setSelectionModel(newLSM:TreeSelectionModel):void
Sets the
TreeSelectionModel used to manage the
selection to new LSM. | AbstractLayoutCache | ||
|
treeNodesChanged(e:TreeModelEvent):void
Invoked after a node (or a set of siblings) has changed in some way. | AbstractLayoutCache | ||
|
treeNodesInserted(e:TreeModelEvent):void
Invoked after nodes have been inserted into the tree. e.path() returns the parent of the new nodes e.childIndices() returns the indices of the new nodes in ascending order. | AbstractLayoutCache | ||
|
treeNodesRemoved(e:TreeModelEvent):void
Invoked after nodes have been removed from the tree. | AbstractLayoutCache | ||
|
treeStructureChanged(e:TreeModelEvent):void
Invoked after the tree has drastically changed structure from a given node down. | AbstractLayoutCache | ||
| Method | Defined by | ||
|---|---|---|---|
|
countNodeDimensions(value:Object, row:int, depth:int, expanded:Boolean, placeIn:IntRectangle):IntRectangle
Returns, by reference in
placeIn,
the size needed to represent value. | AbstractLayoutCache | ||
| nodeDimensions | property |
protected var nodeDimensions:NodeDimensionsObject responsible for getting the size of a node.
| rootVisible | property |
protected var rootVisible:BooleanTrue if the root node is displayed, false if its children are the highest visible nodes.
| treeModel | property |
protected var treeModel:TreeModelModel providing information.
| treeSelectionModel | property |
protected var treeSelectionModel:TreeSelectionModelSelection model.
| countNodeDimensions | () | method |
protected function countNodeDimensions(value:Object, row:int, depth:int, expanded:Boolean, placeIn:IntRectangle):IntRectangle
Returns, by reference in placeIn,
the size needed to represent value.
If inPlace is null, a newly created
IntRectangle should be returned, otherwise the value
should be placed in inPlace and returned. This will
return null if there is no renderer.
value:Object — the value to be represented
|
|
row:int — row being queried
|
|
depth:int — the depth of the row
|
|
expanded:Boolean — true if row is expanded, false otherwise
|
|
placeIn:IntRectangle — a IntRectangle containing the size needed
to represent value
|
IntRectangle —
a IntRectangle containing the node dimensions,
or null if node has no dimension
|
| getBounds | () | method |
public function getBounds(path:TreePath, placeIn:IntRectangle):IntRectangleReturns a rectangle giving the bounds needed to draw path.
Parameterspath:TreePath — a TreePath specifying a node
|
|
placeIn:IntRectangle — a IntRectangle object giving the
available space
|
IntRectangle —
a IntRectangle object specifying the space to be used
|
| getExpandedState | () | method |
public function getExpandedState(path:TreePath):BooleanReturns true if the path is expanded, and visible.
Parameterspath:TreePath — the path being queried
|
Boolean — true if the path is expanded and visible, false otherwise
|
| getModel | () | method |
public function getModel():TreeModel
Returns the TreeModel that is providing the data.
TreeModel —
the TreeModel that is providing the data
|
| getNodeDimensions | () | method |
public function getNodeDimensions():NodeDimensionsReturns the object that renders nodes in the tree, and which is responsible for calculating the dimensions of individual nodes.
ReturnsNodeDimensions —
the NodeDimensions object
|
| getPathClosestTo | () | method |
public function getPathClosestTo(x:int, y:int):TreePath
Returns the path to the node that is closest to x,y. If
there is nothing currently visible this will return null,
otherwise it'll always return a valid path.
If you need to test if the
returned object is exactly at x, y you should get the bounds for
the returned path and test x, y against that.
x:int — the horizontal component of the desired location
|
|
y:int — the vertical component of the desired location
|
TreePath —
the TreePath closest to the specified point
|
| getPathForRow | () | method |
public function getPathForRow(row:int):TreePath
Returns the path for passed in row. If row is not visible
null is returned.
row:int — the row being queried
|
TreePath —
the TreePath for the given row
|
| getPreferredHeight | () | method |
public function getPreferredHeight():intReturns the preferred height.
Returnsint — the preferred height
|
| getPreferredWidth | () | method |
public function getPreferredWidth(bounds:IntRectangle):int
Returns the preferred width for the passed in region.
The region is defined by the path closest to
(bounds.x, bounds.y) and
ends at bounds.height + bounds.y.
If bounds is null,
the preferred width for all the nodes
will be returned (and this may be a VERY expensive
computation).
bounds:IntRectangle — the region being queried
|
int — the preferred width for the passed in region
|
| getRowContainingYLocation | () | method |
public function getRowContainingYLocation(location:int):intReturns the index of the row containing location. If there are no rows, -1 is returned. If location is beyond the last row index, the last row index is returned.
Parameterslocation:int |
int |
| getRowCount | () | method |
public function getRowCount():intNumber of rows being displayed.
Returnsint — the number of rows being displayed
|
| getRowForPath | () | method |
public function getRowForPath(path:TreePath):intReturns the row that the last item identified in path is visible at. Will return -1 if any of the elements in path are not currently visible.
Parameterspath:TreePath — the TreePath being queried
|
int — the row where the last item in path is visible or -1
if any elements in path aren't currently visible
|
| getRowHeight | () | method |
public function getRowHeight():intReturns the height of each row. If the returned value is less than or equal to 0 the height for each row is determined by the renderer.
Returnsint |
| getRowsForPaths | () | method |
public function getRowsForPaths(paths:Array):Array
Returns the rows that the TreePath instances in
path are being displayed at.
This method should return an array of the same length as that passed
in, and if one of the TreePaths
in path is not valid its entry in the array should
be set to -1.
paths:Array — the array of TreePaths being queried
|
Array — an array of the same length that is passed in containing
the rows that each corresponding where each
TreePath is displayed; if paths
is null, null is returned
|
| getSelectionModel | () | method |
public function getSelectionModel():TreeSelectionModelReturns the model used to maintain the selection.
ReturnsTreeSelectionModel —
the treeSelectionModel
|
| getVisibleChildCount | () | method |
public function getVisibleChildCount(path:TreePath):intReturns the number of visible children for row.
Parameterspath:TreePath — the path being queried
|
int — the number of visible children for the specified path
|
| getVisiblePathsFrom | () | method |
public function getVisiblePathsFrom(path:TreePath, totalCount:int):Array
Returns an Enumerator that increments over the visible
paths starting at the passed in location. The ordering of the
enumeration is based on how the paths are displayed.
The first element of the returned enumeration will be path,
unless it isn't visible,
in which case null will be returned.
path:TreePath — the starting location for the enumeration
|
|
totalCount:int — the total number of path to contains.
|
Array — the Enumerator starting at the desired location
|
| invalidatePathBounds | () | method |
public function invalidatePathBounds(path:TreePath):void
Instructs the LayoutCache that the bounds for
path are invalid, and need to be updated.
path:TreePath — the path being updated
|
| invalidateSizes | () | method |
public function invalidateSizes():void
Informs the TreeState that it needs to recalculate
all the sizes it is referencing.
| isExpanded | () | method |
public function isExpanded(path:TreePath):BooleanReturns true if the value identified by row is currently expanded.
Parameterspath:TreePath |
Boolean |
| isRootVisible | () | method |
public function isRootVisible():BooleanReturns true if the root node of the tree is displayed.
ReturnsBoolean — true if the root node of the tree is displayed
|
| setExpandedState | () | method |
public function setExpandedState(path:TreePath, isExpanded:Boolean):void
Marks the path path expanded state to
isExpanded.
path:TreePath — the path being expanded or collapsed
|
|
isExpanded:Boolean — true if the path should be expanded, false otherwise
|
| setModel | () | method |
public function setModel(newModel:TreeModel):void
Sets the TreeModel that will provide the data.
newModel:TreeModel — the TreeModel that is to
provide the data
|
| setNodeDimensions | () | method |
public function setNodeDimensions(nd:NodeDimensions):voidSets the renderer that is responsible for drawing nodes in the tree and which is threfore responsible for calculating the dimensions of individual nodes.
Parametersnd:NodeDimensions — a NodeDimensions object
|
| setRootVisible | () | method |
public function setRootVisible(rootVisible:Boolean):void
Determines whether or not the root node from
the TreeModel is visible.
rootVisible:Boolean — true if the root node of the tree is to be displayed
|
| setRowHeight | () | method |
public function setRowHeight(rowHeight:int):voidSets the height of each cell. If the specified value is less than or equal to zero the current cell renderer is queried for each row's height.
ParametersrowHeight:int — the height of each cell, in pixels
|
| setSelectionModel | () | method |
public function setSelectionModel(newLSM:TreeSelectionModel):void
Sets the TreeSelectionModel used to manage the
selection to new LSM.
newLSM:TreeSelectionModel — the new TreeSelectionModel
|
| treeNodesChanged | () | method |
public function treeNodesChanged(e:TreeModelEvent):void
Invoked after a node (or a set of siblings) has changed in some way. The node(s) have not changed locations in the tree or altered their children arrays, but other attributes have changed and may affect presentation. Example: the name of a file has changed, but it is in the same location in the file system.
e.path() returns the path the parent of the changed node(s).
e.childIndices() returns the index(es) of the changed node(s).
Parameterse:TreeModelEvent — the TreeModelEvent
|
| treeNodesInserted | () | method |
public function treeNodesInserted(e:TreeModelEvent):void
Invoked after nodes have been inserted into the tree.
e.path() returns the parent of the new nodes
e.childIndices() returns the indices of the new nodes in ascending order.
Parameterse:TreeModelEvent — the TreeModelEvent
|
| treeNodesRemoved | () | method |
public function treeNodesRemoved(e:TreeModelEvent):void
Invoked after nodes have been removed from the tree. Note that if a subtree is removed from the tree, this method may only be invoked once for the root of the removed subtree, not once for each individual set of siblings removed.
e.path() returns the former parent of the deleted nodes.
e.childIndices() returns the indices the nodes had before they were deleted in ascending order.
Parameterse:TreeModelEvent — the TreeModelEvent
|
| treeStructureChanged | () | method |
public function treeStructureChanged(e:TreeModelEvent):void
Invoked after the tree has drastically changed structure from a
given node down. If the path returned by e.getPath()
is of length one and the first element does not identify the
current root node the first element should become the new root
of the tree.
e.path() holds the path to the node.
e.childIndices() returns null.
Parameterse:TreeModelEvent — the TreeModelEvent
|