|
qflib 0.98.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.qfs.lib.option.OptionGroup
OptionGroups form a hierarchie of nested GUI components in which Options
are grouped together for convenient editing. The hierarchie of the groups,
their layout and labels are determined by the resources set with Option.setResources
. See the package
documentation for details about the resource names used.
The preferred way to create an OptionGroup is through makeGroup
to create a new group, or getGroup
to reuse a
possibly existing group.
The AWT component displaying the OptionGroup can be accessed via getComponent
. The component's name should be set by derived
classes to "OptionGroup-<name>-<options>"
where
<name>
is the resource name of the OptionGroup and
<options>
is the configurable name of the OptionSet
being edited.
Field Summary | |
protected boolean |
disabled
Whether the group is permanently disabled. |
protected boolean |
enabled
The current enabled state of the group. |
protected java.util.List |
members
The members of the OptionGroup. |
protected java.lang.String |
name
The name of the OptionGroup. |
protected OptionSet |
options
The options to group. |
protected OptionGroup |
parent
The parent OptionGroup. |
protected java.lang.String |
title
The title of the FramedOptionGroup's border. |
protected javax.swing.border.TitledBorder |
titleBorder
The TitledBorder of the Frame. |
Constructor Summary | |
protected |
OptionGroup()
No arg constructor for specialized OptionGroups. |
|
OptionGroup(java.lang.String name,
OptionSet options)
Create a new OptionGroup. |
Method Summary | |
boolean |
checkValues()
Check whether all members of the group contain valid values. |
protected void |
createMembers()
Create the members of the OptionGroup. |
OptionEdit |
findEdit(java.lang.String name)
Traverse the OptionGroup members and search for an OptionEdit. |
OptionGroup |
findGroup(java.lang.String name)
Traverse the OptionGroup members and search for an OptionGroup. |
abstract java.awt.Component |
getComponent()
Get the AWT Component for the OptionGroup. |
static OptionGroup |
getGroup(java.lang.String name,
OptionSet options)
Get an OptionGroup for a set of Options. |
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. |
java.lang.String |
getName()
Get the name of the group. |
OptionGroup |
getParentGroup()
Get the parent of the OptionGroup. |
boolean |
isDisabled()
Query whether the OptionGroup is permanently disabled. |
protected void |
makeBorder(javax.swing.JComponent com)
Create the border for the group if the .frame property for the group is set. |
static OptionGroup |
makeGroup(java.lang.String name,
OptionSet options)
Create a new OptionGroup. |
void |
notifyOptionObservers()
Notify the Observers of the Options being edited in this OptionGroup. |
void |
readValues()
Read the values from the edit components and store them into the Options. |
void |
setDisabled(boolean disabled)
Set whether the OptionGroup is permanently disabled. |
void |
setEnabled(boolean enabled)
Set the enabled state for all members of the 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected OptionGroup parent
protected java.util.List members
OptionEdits
.protected java.lang.String name
protected OptionSet options
protected javax.swing.border.TitledBorder titleBorder
protected java.lang.String title
protected boolean disabled
setEnabled
will be forced to disable the group.protected boolean enabled
Constructor Detail |
protected OptionGroup()
public OptionGroup(java.lang.String name, OptionSet options)
name
- The name of the group.options
- The options to edit.Method Detail |
public static OptionGroup getGroup(java.lang.String name, OptionSet options)
name
- The name of the group.options
- The options to edit.public static OptionGroup makeGroup(java.lang.String name, OptionSet options)
Option.setResources
. See the package documentation for details about
the resource names used.
A special case is type custom. The class of the
OptionGroup to create is defined by the
option.group.groupname.class
resource. The class
must have a public constructor of the form
public CustomOptionGroup (String name, OptionSet options)
name
- The name of the group.options
- The options to edit.
public java.lang.String getName()
public boolean checkValues()
public void readValues()
checkValues
succeeded.public void notifyOptionObservers()
public void update(OptionSet options)
options
- The new OptionSet.public void setEnabled(boolean enabled)
enabled
- The enabled state to set.public boolean isDisabled()
setEnabled
to disable the group.public void setDisabled(boolean disabled)
setEnabled
to disable the group.disabled
- True to disable the group. If true,
setEnabled(false)
is
called automatically.public void setTitle(java.lang.String title)
title
- The title to set.public OptionGroup getParentGroup()
public void setParentGroup(OptionGroup parent)
parent
- The parent to set.public int getMemberCount()
public java.lang.Object getMember(int index)
index
- The index of the member.public int getIndexOfMember(java.lang.Object member)
member
- The member to look for.public OptionGroup findGroup(java.lang.String name)
name
- The name of the group to search.public OptionEdit findEdit(java.lang.String name)
name
- The option name of the edit to search.public abstract java.awt.Component getComponent()
protected void createMembers()
protected void makeBorder(javax.swing.JComponent com)
com
- The component to place the border on.
|
qflib 0.98.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |