org.opa.core
Interface OPAOptionManager

All Superinterfaces:
OPAManager
All Known Implementing Classes:
OPADefaultOptionManager

public interface OPAOptionManager
extends OPAManager


Method Summary
 void addOption(OPAOptionPanel optionPanel)
          Adds an OPAOptionPanel to the system.
 void addOption(java.util.Properties moduleDefaults)
          Adds a default Properties object to the system option manager.
 void addOptionListener(OPAOptionListener listener)
          regsiters an OPAOptionListener object with OPAOptionManager.
 java.lang.String get(java.lang.String key)
          retrieves an options value.
 boolean getBoolean(java.lang.String key)
          Convenience method to simplify the handling of boolean values
 java.awt.Color getColor(java.lang.String key)
          Convenience method to simplify the handling of Color values
 int getInt(java.lang.String key)
          Convenience method to simplify the handling of int values
 void removeOptionListener(OPAOptionListener listener)
          Removes an OPAOptionListener.
 void set(java.lang.String key, java.lang.String value)
          Sets an options value.
 void setAndSignal(java.lang.String key, java.lang.String value)
          Sets a single option AND signals an option change to listening code.
 void setAndSignalBoolean(java.lang.String key, boolean value)
          Convenience method to simplify the handling of boolean values
 void setAndSignalColor(java.lang.String key, java.awt.Color value)
          Convenience method to simplify the handling of Color values
 void setAndSignalHexInt(java.lang.String key, int value)
          Convenience method to simplify the handling of int values
 void setAndSignalOctInt(java.lang.String key, int value)
          Convenience method to simplify the handling of int values
 void setBoolean(java.lang.String key, boolean value)
          Convenience method to simplify the handling of boolean values
 void setColor(java.lang.String key, java.awt.Color value)
          Convenience method to simplify the handling of Color values
 void setHexInt(java.lang.String key, int value)
          Convenience method to simplify the handling of int values
 void setOctInt(java.lang.String key, int value)
          Convenience method to simplify the handling of int values
 void showOptions(java.lang.String panelName)
          Displays the options panel specified.
 void signal()
          Notifies listeners that options have been changed.
 
Methods inherited from interface org.opa.core.OPAManager
load, start, stop
 

Method Detail

addOption

public void addOption(java.util.Properties moduleDefaults)
Adds a default Properties object to the system option manager. This is called by each modules 'Loader' object at boot time. These properties are static and options selected by each user are layed over these to create the in-use system options.


addOption

public void addOption(OPAOptionPanel optionPanel)
Adds an OPAOptionPanel to the system. OPAOptionManager instances are then responsible go for collecting the Properties from the OPAOptionPanels and creating a single Properties file.


showOptions

public void showOptions(java.lang.String panelName)
Displays the options panel specified. If null or invalid, opens to the first OPAOptionPanel.


get

public java.lang.String get(java.lang.String key)
retrieves an options value. The key must begin with the module name to avoid naming conflicts within the entire application.


set

public void set(java.lang.String key,
                java.lang.String value)
Sets an options value. This DOES NOT SIGNAL a change. This is best used to increase performance when there are MANY option changes. After calling this (multiple times), signal() must be called to notify listeners that options have been changed.


signal

public void signal()
Notifies listeners that options have been changed. If nothing has changed no signal is sent.


setAndSignal

public void setAndSignal(java.lang.String key,
                         java.lang.String value)
Sets a single option AND signals an option change to listening code. This is a convenience method. It is the same as calling set(key, value) THEN calling signal().


addOptionListener

public void addOptionListener(OPAOptionListener listener)
regsiters an OPAOptionListener object with OPAOptionManager. OPAOptionListener objects are notified when an option changes - more specifically, when a change is signalled. Multiple changes may occur BEFORE a signal is sent. This is for efficiency.


getBoolean

public boolean getBoolean(java.lang.String key)
                   throws java.lang.Throwable
Convenience method to simplify the handling of boolean values

Throws:
java.lang.Throwable

setBoolean

public void setBoolean(java.lang.String key,
                       boolean value)
                throws java.lang.Throwable
Convenience method to simplify the handling of boolean values

Throws:
java.lang.Throwable

setAndSignalBoolean

public void setAndSignalBoolean(java.lang.String key,
                                boolean value)
                         throws java.lang.Throwable
Convenience method to simplify the handling of boolean values

Throws:
java.lang.Throwable

getInt

public int getInt(java.lang.String key)
           throws java.lang.Throwable
Convenience method to simplify the handling of int values

Throws:
java.lang.Throwable

setOctInt

public void setOctInt(java.lang.String key,
                      int value)
               throws java.lang.Throwable
Convenience method to simplify the handling of int values

Throws:
java.lang.Throwable

setAndSignalOctInt

public void setAndSignalOctInt(java.lang.String key,
                               int value)
                        throws java.lang.Throwable
Convenience method to simplify the handling of int values

Throws:
java.lang.Throwable

setHexInt

public void setHexInt(java.lang.String key,
                      int value)
               throws java.lang.Throwable
Convenience method to simplify the handling of int values

Throws:
java.lang.Throwable

setAndSignalHexInt

public void setAndSignalHexInt(java.lang.String key,
                               int value)
                        throws java.lang.Throwable
Convenience method to simplify the handling of int values

Throws:
java.lang.Throwable

getColor

public java.awt.Color getColor(java.lang.String key)
                        throws java.lang.Throwable
Convenience method to simplify the handling of Color values

Throws:
java.lang.Throwable

setColor

public void setColor(java.lang.String key,
                     java.awt.Color value)
              throws java.lang.Throwable
Convenience method to simplify the handling of Color values

Throws:
java.lang.Throwable

setAndSignalColor

public void setAndSignalColor(java.lang.String key,
                              java.awt.Color value)
                       throws java.lang.Throwable
Convenience method to simplify the handling of Color values

Throws:
java.lang.Throwable

removeOptionListener

public void removeOptionListener(OPAOptionListener listener)
Removes an OPAOptionListener.