qflib 0.98.1

de.qfs.lib.option
Class TreeOptionGroup

java.lang.Object
  |
  +--de.qfs.lib.option.OptionGroup
        |
        +--de.qfs.lib.option.TreeOptionGroup

public class TreeOptionGroup
extends OptionGroup

This OptionGroup builds a tree structure from the resources. Each node of the tree can have a set of child nodes and/or an associated OptionGroup that is displayed to the right of the tree. It uses the following resoureces:

Resource name Usage
option.group.groupname.type A TreeOptionGroup is designated by the type tree.
option.name.disabled If true, the group will be disabled and remain so even if setEnabled(true) is called (optional, default false).
option.group.groupname.title Title to display for the tree (optional, default none).
option.group.groupname.mnemonic Keyboard accelerator for the title (optional, default none).
option.group.groupname.divider Initial setting for the divider of the split pane. A double between 0 and 1 designates a relative position, an integer designates an absolute position (optional, default none).
option.group.groupname.configure If true, create a ConfigWrapper for the split pane of the group and register it under the name groupname.splitpane (optional, default false).
option.group.groupname.root The identifier of the root node of the tree (optional, default "root").
option.group.groupname.rootvisible Whether to display the root node of the tree (optional, default false).
option.group.groupname.roothandles Whether to show handles for the toplevel nodes of the tree (optional, default (! rootvisible)).
option.group.lines.roothandles Whether to show lines for metal look and feel (optional, default false).
option.group.groupname.path.name The name to display in the tree for the node at path.
option.group.groupname.path.icon The icon to display in the tree for the node at path.
option.group.groupname.path.children Whitespace separated list of children of the node at path (optional, default none).
option.group.groupname.path.group The name of the OptionGroup to display for the node at path (optional, default none).
option.group.groupname.path.title The title for the OptionGroup of the node at path (optional, default none).

Since:
0.98.1
Version:
$Revision: 1.7 $
Author:
Gregor Schmid

Inner Class Summary
protected  class TreeOptionGroup.Listener
          Delayed listener for changes in the tree selection.
protected  class TreeOptionGroup.Node
          These elements of the tree model are simple structures.
protected  class TreeOptionGroup.Renderer
          The Renderer for the tree.
protected  class TreeOptionGroup.Tree
          A straightforward tree, implemented in terms of the Node class and the TreeAdapter concept.
 
Fields inherited from class de.qfs.lib.option.OptionGroup
disabled, enabled, members, name, options, parent, title, titleBorder
 
Constructor Summary
protected TreeOptionGroup()
          No arg constructor for customized OptionGroups.
  TreeOptionGroup(java.lang.String name, OptionSet options)
          Create a new TreeOptionGroup.
 
Method Summary
 java.awt.Component getComponent()
          Get the AWT Component for the OptionGroup.
protected  void makePane()
          Create the split pane component.
protected  void makeTree()
          Create the tree component.
protected  void nodeChanged(TreeOptionGroup.Node node)
          Notify the group that the selected node in the tree has changed.
 void seledtNode(java.lang.String path)
          Select a node.
 
Methods inherited from class de.qfs.lib.option.OptionGroup
checkValues, createMembers, findEdit, findGroup, getBoolean, getGroup, getIndexOfMember, getInt, getMember, getMemberCount, getName, getParentGroup, getString, isDisabled, makeBorder, makeGroup, notifyOptionObservers, readValues, setDisabled, setEnabled, setParentGroup, setTitle, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeOptionGroup

protected TreeOptionGroup()
No arg constructor for customized OptionGroups.

TreeOptionGroup

public TreeOptionGroup(java.lang.String name,
                       OptionSet options)
Create a new TreeOptionGroup.
Parameters:
name - The name of the group.
options - The Options to edit.
Method Detail

getComponent

public java.awt.Component getComponent()
Get the AWT Component for the OptionGroup.
Overrides:
getComponent in class OptionGroup
Returns:
The Component.

seledtNode

public void seledtNode(java.lang.String path)
Select a node.
Parameters:
path - The path of the node. Null to select nothing.

makePane

protected void makePane()
Create the split pane component.

makeTree

protected void makeTree()
Create the tree component.

nodeChanged

protected void nodeChanged(TreeOptionGroup.Node node)
Notify the group that the selected node in the tree has changed. If there is an option group displayed for the old selected node, check its values and don't allow the selection to change, if the values aren't legal.
Parameters:
node - The new node.

qflib 0.98.1