Interface ITreeDocument
- All Superinterfaces:
IEventSource
,IGenericDocument
- All Known Implementing Classes:
AbstractTreeDocument
,StaticTreeDocument
A tree document is used to represent hierarchical structures. Nodes of trees implement the
INode
interface. Tree document can be used to model simple trees as well as more complex
table trees (see getColumnLabels()
).-
Method Summary
Modifier and TypeMethodDescriptionaddressToCoordinates
(String address) Convert a node address to node coordinates.coordinatesToAddress
(INodeCoordinates coordinates) Convert node coordinates to an address understandable by the tree document and potentially the unit representing the document.Provide column labels for table trees.int
Get the ideal expansion level of the tree.default String
getReferencedAddress
(INode node) Retrieve the address referenced by theINode
.getRoots()
Get the list of tree roots.Methods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSource
Methods inherited from interface com.pnfsoftware.jeb.core.output.IGenericDocument
dispose, getPropertyManager, getUnit
-
Method Details
-
getRoots
Get the list of tree roots.- Returns:
- the list of roots, cannot be null. Typically contain a single item, empty list at best
-
getColumnLabels
Provide column labels for table trees. A regular tree should return null.- Returns:
- the column labels, in practice at least two elements
-
getInitialExpansionLevel
int getInitialExpansionLevel()Get the ideal expansion level of the tree. Graphical clients should use this method when doing the initial rendering of a tree document.- Returns:
- the initial expansion level. Special values are: 0 to signify "expand nothing"; -1 to signify "expand all".
-
coordinatesToAddress
Convert node coordinates to an address understandable by the tree document and potentially the unit representing the document.Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.
- Parameters:
coordinates
- the node coordinates- Returns:
- the address, null on error
-
addressToCoordinates
Convert a node address to node coordinates.Note: The addressing scheme is unit specific, and defined by the plugin developer. Addresses should not start with the reserved '@' prefix.
- Parameters:
address
- the input address- Returns:
- the coordinates, null on error
-
getReferencedAddress
- Parameters:
node
-INode
to test- Returns:
- the reference address (meaning the virtual content of the node) or null if not applicable.
-