Package eu.bandm.tools.graficUtils
Class SwingForester.LazyNode
java.lang.Object
eu.bandm.tools.graficUtils.SwingForester.TreeProxy
eu.bandm.tools.graficUtils.SwingForester.LazyNode
- All Implemented Interfaces:
TreeNode
- Direct Known Subclasses:
FormatTree.Inner1
- Enclosing class:
- SwingForester
Lazy node which will display sub-nodes on demand. Must be subclassed by the user
for lazy evaluation.
-
Field Summary
Modifier and TypeFieldDescriptionList of subtrees.protected final String
The displayed name (of a field of a type constructor.)Fields inherited from class eu.bandm.tools.graficUtils.SwingForester.TreeProxy
label, parent, source
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add aSwingForester.Leaf
displaying one primitive field of an object.protected void
Add aSwingForester.Leaf
displaying one primitive field of an object.protected void
Add aSwingForester.TreeProxy
displaying an object.protected void
Add a just created sub-node to the list of children.protected void
Add a specialized subclass ofSwingForester.LazyNode
displaying a map.protected void
Add a specialized subclass ofSwingForester.LazyNode
displaying a multimap.protected void
Add a specialized subclass ofSwingForester.LazyNode
displaying a sequence.protected void
Add a specialized subclass ofSwingForester.LazyNode
displaying a set.final Enumeration<? extends TreeNode>
children()
Overridden from TreeNode for to trigger evaluation.protected final void
demand()
Aux method called whenever swing runtime system inquires the node.protected abstract void
eval()
Creation of subtrees, as overridden by the user.final boolean
Overridden from TreeNode for to trigger evaluation.final TreeNode
getChildAt
(int index) Overridden from TreeNode for to trigger evaluation.final int
Overridden from TreeNode for to trigger evaluation.final int
Overridden from TreeNode for to trigger evaluation.final boolean
isLeaf()
Overridden from TreeNode for to trigger evaluation.Returnsroot
for display as a subtree name.Methods inherited from class eu.bandm.tools.graficUtils.SwingForester.TreeProxy
getLabel, getParent, getSource, toString
-
Field Details
-
root
The displayed name (of a field of a type constructor.) -
children
List of subtrees.
-
-
Constructor Details
-
LazyNode
Only constructor.- Parameters:
parent
- the parent nodelabel
- describes the role of the object in its context, eg. the "UML associaton" pointing to a subtree, or the field name of a (class or primitive type) field value.source
- is the data object represented by this GUI node.root
- name of the type constructor represented by this subtree.
-
-
Method Details
-
valueToString
Returnsroot
for display as a subtree name.- Specified by:
valueToString
in classSwingForester.TreeProxy
-
demand
protected final void demand()Aux method called whenever swing runtime system inquires the node. (Probably to paint it, therefore this triggers the evaluation.) -
eval
protected abstract void eval()Creation of subtrees, as overridden by the user. -
addSEQ
Add a specialized subclass ofSwingForester.LazyNode
displaying a sequence. Service for the user code overridingeval()
. -
addSET
Add a specialized subclass ofSwingForester.LazyNode
displaying a set. Service for the user code overridingeval()
. -
addMAP
Add a specialized subclass ofSwingForester.LazyNode
displaying a map. Service for the user code overridingeval()
. -
addREL
Add a specialized subclass ofSwingForester.LazyNode
displaying a multimap. Service for the user code overridingeval()
. -
add
Add aSwingForester.TreeProxy
displaying an object. Service for the user code overridingeval()
. The overridden methodSwingForester.growBranch(TreeNode, String, Object)
is consulted whether a complexSwingForester.LazyNode
representation is wanted. Otherwise aSwingForester.Leaf
is created.- Parameters:
label
- shown as field name (/role/association name)x
- the object to display
-
add
Add aSwingForester.Leaf
displaying one primitive field of an object. Service for the user code overridingeval()
.- Parameters:
label
- shown as field name (/role/association name)x
- the value to display
-
add
Add aSwingForester.Leaf
displaying one primitive field of an object. Service for the user code overridingeval()
.- Parameters:
label
- shown as field name (/role/association name)b
- the value to display
-
addChild
Add a just created sub-node to the list of children. -
getChildAt
Overridden from TreeNode for to trigger evaluation. -
getChildCount
public final int getChildCount()Overridden from TreeNode for to trigger evaluation. -
getIndex
Overridden from TreeNode for to trigger evaluation. -
getAllowsChildren
public final boolean getAllowsChildren()Overridden from TreeNode for to trigger evaluation. -
isLeaf
public final boolean isLeaf()Overridden from TreeNode for to trigger evaluation. -
children
Overridden from TreeNode for to trigger evaluation.
-