Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.paradoxpoint.libitina.option
Class OptionsContainer  view OptionsContainer download OptionsContainer.java

java.lang.Object
  extended bycom.paradoxpoint.libitina.option.OptionsContainer
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class OptionsContainer
extends java.lang.Object
implements java.awt.event.ActionListener

A Container that can manage multiple options and their associated OptionListeners


Field Summary
protected  java.util.HashMap editorOptions
          maps editors to their options
protected  javax.swing.event.EventListenerList listenerList
          list of OptionListeners
protected  java.util.HashMap optionEditors
          maps options to their editors
protected  OptionEvent optionEvent
          current event fired by invoking fireOptionStateChanged
protected  java.util.HashMap options
          returns a list of Options searchable by the Option's name
 
Constructor Summary
OptionsContainer()
          Creates a new instance of OptionsContainer
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when an action occurs.
 void addOption(AbstractOption option)
           
 void addOption(java.lang.String name)
          Creates a new Option with the given name and adds it to the container
 void addOptionListener(OptionListener l)
          Adds a listener to receive option events when the state of an option is changed.
protected  void fireOptionStateChanged(AbstractOption option)
          Notifies all listeners that have registered interest for notification on this event type.
 AbstractOption getOption(java.lang.String name)
          Return the Option with the given name
 java.lang.Object getOptionState(java.lang.String name)
          Returns the state of the option with the given name in this container
 void removeOption(java.lang.String name)
          Removes the Option with the given name from the container.
 void removeOptionListener(OptionListener l)
          Removes an item listener.
 void setOptionState(java.lang.String name, java.lang.Object state)
          Sets the state of the option with the given name in this container to the given state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected javax.swing.event.EventListenerList listenerList
list of OptionListeners


optionEvent

protected OptionEvent optionEvent
current event fired by invoking fireOptionStateChanged


optionEditors

protected java.util.HashMap optionEditors
maps options to their editors


editorOptions

protected java.util.HashMap editorOptions
maps editors to their options


options

protected java.util.HashMap options
returns a list of Options searchable by the Option's name

Constructor Detail

OptionsContainer

public OptionsContainer()
Creates a new instance of OptionsContainer

Method Detail

addOption

public void addOption(java.lang.String name)
Creates a new Option with the given name and adds it to the container


addOption

public void addOption(AbstractOption option)

getOption

public AbstractOption getOption(java.lang.String name)
Return the Option with the given name


removeOption

public void removeOption(java.lang.String name)
Removes the Option with the given name from the container. NOTE: Does not remove any listeners associated with the Option from the list of OptionListeners maintained by the container


setOptionState

public void setOptionState(java.lang.String name,
                           java.lang.Object state)
Sets the state of the option with the given name in this container to the given state


getOptionState

public java.lang.Object getOptionState(java.lang.String name)
Returns the state of the option with the given name in this container


addOptionListener

public void addOptionListener(OptionListener l)
Adds a listener to receive option events when the state of an option is changed. If l is null, no exception is thrown and no action is performed.


removeOptionListener

public void removeOptionListener(OptionListener l)
Removes an item listener. If l is null, no exception is thrown and no action is performed.


fireOptionStateChanged

protected void fireOptionStateChanged(AbstractOption option)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the option parameter.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener