qflib 0.98.0

de.qfs.lib.option
Class NestedOptionGroup

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

public class NestedOptionGroup
extends OptionGroup

A NestedOptionGroup represents a NestedOption in an OptionSet. It is used to edit hierarchies of Options.

See the package documentation for details about the necessary resources.

Version:
$Revision: 1.9 $
Author:
Gregor Schmid

Field Summary
protected  OptionGroup nested
          The nested OptionGroup.
protected  Option option
          The option holding the nested OptionSet.
 
Fields inherited from class de.qfs.lib.option.OptionGroup
disabled, enabled, members, name, options, parent, title, titleBorder
 
Constructor Summary
protected NestedOptionGroup()
          No arg constructor for customized OptionGroups.
  NestedOptionGroup(java.lang.String name, OptionSet options)
          Create a new NestedOptionGroup.
 
Method Summary
 boolean checkValues()
          Check whether all members of the nested group contain valid values.
 java.awt.Component getComponent()
          Get the AWT Component for the OptionGroup.
 int getIndexOfMember(java.lang.Object member)
          Find a member of the OptionGroup and get its index.
 java.lang.Object getMember(int index)
          Get a member of the group.
 int getMemberCount()
          Get the number of members of the OptionGroup.
 OptionGroup getParentGroup()
          Get the parent of the OptionGroup.
 void notifyOptionObservers()
          Notify the option's Observers.
 void readValues()
          Read the values from the nested group components and store them into the Options.
 void setEnabled(boolean enabled)
          Set the enabled state for the nested group.
 void setParentGroup(OptionGroup parent)
          Set the parent of the OptionGroup.
 void setTitle(java.lang.String title)
          Set the title of the OptionGroup.
 void update(OptionSet options)
          Update display for possibly new Options.
 
Methods inherited from class de.qfs.lib.option.OptionGroup
createMembers, findEdit, findGroup, getGroup, getName, isDisabled, makeBorder, makeGroup, setDisabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

option

protected Option option
The option holding the nested OptionSet.

nested

protected OptionGroup nested
The nested OptionGroup.
Constructor Detail

NestedOptionGroup

protected NestedOptionGroup()
No arg constructor for customized OptionGroups.

NestedOptionGroup

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

checkValues

public boolean checkValues()
Check whether all members of the nested group contain valid values.
Overrides:
checkValues in class OptionGroup
Returns:
True, if everything is OK.

readValues

public void readValues()
Read the values from the nested group components and store them into the Options. Should only be called after checkValues succeeded.
Overrides:
readValues in class OptionGroup

notifyOptionObservers

public void notifyOptionObservers()
Notify the option's Observers.
Overrides:
notifyOptionObservers in class OptionGroup

update

public void update(OptionSet options)
Update display for possibly new Options. The name and type of the Options in the OptionSet must be the same as before.
Overrides:
update in class OptionGroup
Parameters:
options - The new OptionSet.

setEnabled

public void setEnabled(boolean enabled)
Set the enabled state for the nested group.
Overrides:
setEnabled in class OptionGroup
Parameters:
enabled - The enabled state to set.

getComponent

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

setTitle

public void setTitle(java.lang.String title)
Set the title of the OptionGroup. Overrides the value read from the .title property. Only useful if the group has a frame.
Overrides:
setTitle in class OptionGroup
Parameters:
title - The title to set.
Since:
0.98.0

getParentGroup

public OptionGroup getParentGroup()
Get the parent of the OptionGroup.
Overrides:
getParentGroup in class OptionGroup
Returns:
The OptionGroup's parent.
Since:
0.98.0

setParentGroup

public void setParentGroup(OptionGroup parent)
Set the parent of the OptionGroup.
Overrides:
setParentGroup in class OptionGroup
Parameters:
parent - The parent to set.
Since:
0.98.0

getMemberCount

public int getMemberCount()
Get the number of members of the OptionGroup.
Overrides:
getMemberCount in class OptionGroup
Returns:
The number of the OptionGroup's members.
Since:
0.98.0

getMember

public java.lang.Object getMember(int index)
Get a member of the group.
Overrides:
getMember in class OptionGroup
Parameters:
index - The index of the member.
Returns:
The member, either an OptionGroup or an OptionEdit.
Since:
0.98.0

getIndexOfMember

public int getIndexOfMember(java.lang.Object member)
Find a member of the OptionGroup and get its index.
Overrides:
getIndexOfMember in class OptionGroup
Parameters:
member - The member to look for.
Returns:
The member's index or -1.
Since:
0.98.0

qflib 0.98.0