Class AbstractTreeDocument
java.lang.Object
com.pnfsoftware.jeb.util.events.EventSource
com.pnfsoftware.jeb.core.output.tree.impl.AbstractTreeDocument
- All Implemented Interfaces:
IGenericDocument
,ITreeDocument
,IEventSource
- Direct Known Subclasses:
StaticTreeDocument
An adapter for non-table trees. This class can be extended to serve as a base class for table
trees as well, by overriding the
getColumnLabels()
method
The addressing system implemented in this adapter is trivial: it is a string representation of
INodeCoordinates
.
Example: coordinates: (0,10,4) -> address: "0,10,4"
Clients may also override dispose().
-
Field Summary
Fields inherited from class com.pnfsoftware.jeb.util.events.EventSource
onEventCallCount
-
Constructor Summary
Constructors -
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.coordinatesToAddress
(INodeCoordinates coordinates, Function<List<INode>, String> f) Helper method to build address from coordinatesvoid
dispose()
The default implementation does nothing.Provide column labels for table trees.int
Get the ideal expansion level of the tree.The default implementation returns null.Methods inherited from class com.pnfsoftware.jeb.util.events.EventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, notifyListeners, notifyListeners, relay, removeListener, setParentSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
getUnit
Methods inherited from interface com.pnfsoftware.jeb.core.output.tree.ITreeDocument
getReferencedAddress, getRoots
-
Constructor Details
-
AbstractTreeDocument
public AbstractTreeDocument()
-
-
Method Details
-
dispose
public void dispose()The default implementation does nothing.- Specified by:
dispose
in interfaceIGenericDocument
-
getPropertyManager
The default implementation returns null.- Specified by:
getPropertyManager
in interfaceIGenericDocument
- Returns:
- a PM, null if none
-
getColumnLabels
Description copied from interface:ITreeDocument
Provide column labels for table trees. A regular tree should return null.- Specified by:
getColumnLabels
in interfaceITreeDocument
- Returns:
- the column labels, in practice at least two elements
-
getInitialExpansionLevel
public int getInitialExpansionLevel()Description copied from interface:ITreeDocument
Get the ideal expansion level of the tree. Graphical clients should use this method when doing the initial rendering of a tree document.- Specified by:
getInitialExpansionLevel
in interfaceITreeDocument
- Returns:
- the initial expansion level. Special values are: 0 to signify "expand nothing"; -1 to signify "expand all".
-
coordinatesToAddress
Description copied from interface:ITreeDocument
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.
- Specified by:
coordinatesToAddress
in interfaceITreeDocument
- Parameters:
coordinates
- the node coordinates- Returns:
- the address, null on error
-
addressToCoordinates
Description copied from interface:ITreeDocument
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.
- Specified by:
addressToCoordinates
in interfaceITreeDocument
- Parameters:
address
- the input address- Returns:
- the coordinates, null on error
-
coordinatesToAddress
Helper method to build address from coordinates- Parameters:
coordinates
-INodeCoordinates
f
- function- argument: list of
INode
representing the INode path- result: String address
- argument: list of
- Returns:
-