Package eu.bandm.tools.util.ui
Class SwingForester.LazyNode
java.lang.Object
eu.bandm.tools.util.ui.SwingForester.TreeProxy
eu.bandm.tools.util.ui.SwingForester.LazyNode
- All Implemented Interfaces:
TreeNode
- 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.ui.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.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 aSwingForester.Leafdisplaying one primitive field of 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().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 boolean.final TreeNodegetChildAt(int index) .final int.final int.final booleanisLeaf()Returnsrootfor display as a subtree name.Methods inherited from class eu.bandm.tools.util.ui.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- Returns:
- the string representation (to be shown in the gui) of the value of the represented field.
-
demand
protected final void demand()Aux method called whenever swing runtime system inquires the node. (Probably to paint it, therefore this method 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. (This is a call-back for the user code which overrideseval().)- Parameters:
label- the label to display before the datai- the list of data objects to display
-
addSET
Add a specialized subclass ofSwingForester.LazyNodedisplaying a set. (This is a call-back for the user code which overrideseval().)- Parameters:
label- the label to display before the datai- the collection of data objects to display
-
addMAP
Add a specialized subclass ofSwingForester.LazyNodedisplaying a map. (This is a call-back for the user code which overrideseval().)- Parameters:
label- the label to display before the datai- the collection of data objects to display
-
addREL
Add a specialized subclass ofSwingForester.LazyNodedisplaying a multimap. (This is a call-back for the user code which overrideseval().)- Parameters:
label- the label to display before the datai- the collection of data objects to display
-
add
Add aSwingForester.TreeProxydisplaying an object. (This is a call-back for the user code which overrideseval().)Indirectly. the overridden method
SwingForester.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. (This is a call-back for the user code which overrideseval().)- Parameters:
label- shown as field name (/role/association name)x- the value to display
-
add
Add aSwingForester.Leafdisplaying one primitive field of an object. (This is a call-back for the user code which overrideseval().)- 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
-
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)s- 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)c- the value to display
-
addChild
Add a just created sub-node to the list of children.- Parameters:
child- the node to add
-
isLeaf
public final boolean isLeaf() -
getChildAt
. Overridden to trigger the evaluation/expansion. -
getChildCount
public final int getChildCount(). Overridden to trigger the evaluation/expansion. -
getIndex
. Overridden to trigger the evaluation/expansion. -
getAllowsChildren
public final boolean getAllowsChildren(). Overridden to trigger the evaluation/expansion. -
children
. Overridden to trigger the evaluation/expansion.
-