net.sf.freecol.client.gui.action
Class ActionManager

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.option.AbstractOption<OptionGroup>
          extended by net.sf.freecol.common.option.OptionGroup
              extended by net.sf.freecol.client.gui.action.ActionManager
All Implemented Interfaces:
Option

public class ActionManager
extends OptionGroup

Stores all FreeColActions and retrieves them by ID.


Field Summary
private  FreeColClient freeColClient
           
private static java.util.logging.Logger logger
           
 
Fields inherited from class net.sf.freecol.common.option.AbstractOption
isDefined, previewEnabled
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG
 
Constructor Summary
ActionManager(FreeColClient freeColClient)
          Creates a new ActionManager.
 
Method Summary
 void addSpecificationActions(Specification specification)
          Adds the FreeColActions that are provided by the Specification.
 FreeColAction getFreeColAction(java.lang.String id)
          Gets the FreeColAction specified by the given id.
 void initializeActions()
          This method adds all FreeColActions to the OptionGroup.
 void update()
          Updates every FreeColAction this object keeps.
 
Methods inherited from class net.sf.freecol.common.option.OptionGroup
add, getBoolean, getInteger, getName, getOption, getOptions, getShortDescription, getString, getValue, getXMLElementTagName, iterator, readFromXMLImpl, removeAll, setBoolean, setInteger, setString, setValue, toString, toXMLImpl
 
Methods inherited from class net.sf.freecol.common.option.AbstractOption
getGroup, isPreviewEnabled, readAttributes, setGroup, setPreviewEnabled, setValue
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, dumpObject, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, getSpecification, hasAbility, hasAttribute, hasListeners, readAttributes, readChild, readChild, readChildren, readChildren, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLImpl, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, save, save, setId, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.option.Option
addPropertyChangeListener, getId, readFromXML, readFromXMLElement, removePropertyChangeListener, toXML, toXMLElement
 

Field Detail

logger

private static final java.util.logging.Logger logger

freeColClient

private FreeColClient freeColClient
Constructor Detail

ActionManager

public ActionManager(FreeColClient freeColClient)
Creates a new ActionManager.

Parameters:
freeColClient - The main client controller.
Method Detail

initializeActions

public void initializeActions()
This method adds all FreeColActions to the OptionGroup. If you implement a new FreeColAction, then you need to add it in this method. Localization and a possible accelerator need to be added to the strings file.


addSpecificationActions

public void addSpecificationActions(Specification specification)
Adds the FreeColActions that are provided by the Specification. At the moment, this includes only TileImprovements.

Parameters:
specification - a Specification value

getFreeColAction

public FreeColAction getFreeColAction(java.lang.String id)
Gets the FreeColAction specified by the given id.

Parameters:
id - The string identifying the action.
Returns:
The FreeColAction.

update

public void update()
Updates every FreeColAction this object keeps.

See Also:
FreeColAction