Class SwingForester.TreeProxy

java.lang.Object
eu.bandm.tools.util.ui.SwingForester.TreeProxy
All Implemented Interfaces:
TreeNode
Direct Known Subclasses:
SwingForester.LazyNode, SwingForester.Leaf
Enclosing class:
SwingForester

public abstract class SwingForester.TreeProxy extends Object implements TreeNode
Common superclass of the two kinds of nodes which are displayed: lazy subtrees or simple leafs.
  • Field Details

  • Constructor Details

    • TreeProxy

      protected TreeProxy(@Opt @Opt TreeNode parent, @Opt @Opt String label, Object source)
      Only constructor.
      Parameters:
      parent - the parent node
      label - 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.
  • Method Details

    • getParent

      @Opt public final @Opt TreeNode getParent()
      Return the tree node one level above. Will only be ==null for "top" node of the graphics.
      Specified by:
      getParent in interface TreeNode
      Returns:
      the parent node, or null if this is the root node.
    • getLabel

      @Opt public final @Opt String getLabel()
      Return the optional label string.
      Returns:
      the optional label string
      See Also:
    • getSource

      public final Object getSource()
      Return the represented object.
      Returns:
      the represented object.
      See Also:
    • toString

      public final String toString()
      Return the visible string representation. Calls valueToString(), prepends the label, if !=null, with the separator, and wraps all in html tags if selected by SwingForester.html.
      Overrides:
      toString in class Object
      Returns:
      the visible string representation.
    • valueToString

      public abstract String valueToString()
      Hook to be overridden by the user: Return the string representation (to be shown in the gui) of the value of the represented field.
      Returns:
      the string representation (to be shown in the gui) of the value of the represented field.