Package eu.bandm.tools.util
Class SwingForester.LazyNode
java.lang.Object
eu.bandm.tools.util.SwingForester.TreeProxy
eu.bandm.tools.util.SwingForester.LazyNode
- All Implemented Interfaces:
TreeNode
- Direct Known Subclasses:
Format.Forester.Inner1
- Enclosing class:
- SwingForester
Lazy node which will display sub-nodes on demand. Must be subclassed by the user
for lazy evaluation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of subtrees.protected final StringThe displayed name (of a field of a type constructor.)Fields inherited from class eu.bandm.tools.util.SwingForester.TreeProxy
label, parent, source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd aSwingForester.Leafdisplaying one primitive field of an object.protected voidAdd aSwingForester.Leafdisplaying one primitive field of an object.protected voidAdd aSwingForester.TreeProxydisplaying an object.protected voidAdd a just created sub-node to the list of children.protected voidAdd a specialized subclass ofSwingForester.LazyNodedisplaying a map.protected voidAdd a specialized subclass ofSwingForester.LazyNodedisplaying a multimap.protected voidAdd a specialized subclass ofSwingForester.LazyNodedisplaying a sequence.protected voidAdd a specialized subclass ofSwingForester.LazyNodedisplaying a set.final Enumeration<? extends TreeNode>children()Overridden from TreeNode for to trigger evaluation.protected final voiddemand()Aux method called whenever swing runtime system inquires the node.protected abstract voideval()Creation of subtrees, as overridden by the user.final booleanOverridden from TreeNode for to trigger evaluation.final TreeNodegetChildAt(int index) Overridden from TreeNode for to trigger evaluation.final intOverridden from TreeNode for to trigger evaluation.final intOverridden from TreeNode for to trigger evaluation.final booleanisLeaf()Overridden from TreeNode for to trigger evaluation.Returnsrootfor display as a subtree name.Methods inherited from class eu.bandm.tools.util.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
Returnsrootfor display as a subtree name.- Specified by:
valueToStringin 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.LazyNodedisplaying a sequence. Service for the user code overridingeval(). -
addSET
Add a specialized subclass ofSwingForester.LazyNodedisplaying a set. Service for the user code overridingeval(). -
addMAP
Add a specialized subclass ofSwingForester.LazyNodedisplaying a map. Service for the user code overridingeval(). -
addREL
Add a specialized subclass ofSwingForester.LazyNodedisplaying a multimap. Service for the user code overridingeval(). -
add
Add aSwingForester.TreeProxydisplaying an object. Service for the user code overridingeval(). The overridden methodSwingForester.growBranch(TreeNode, String, Object)is consulted whether a complexSwingForester.LazyNoderepresentation is wanted. Otherwise aSwingForester.Leafis created.- Parameters:
label- shown as field name (/role/association name)x- the object to display
-
add
Add aSwingForester.Leafdisplaying 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.Leafdisplaying 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.
-