Package net.sf.freecol.client.gui.action
Class ActionManager
- java.lang.Object
-
- net.sf.freecol.common.model.FreeColObject
-
- net.sf.freecol.common.model.FreeColSpecObject
-
- net.sf.freecol.common.option.AbstractOption<OptionGroup>
-
- net.sf.freecol.common.option.OptionGroup
-
- net.sf.freecol.client.gui.action.ActionManager
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Comparable<FreeColObject>,ObjectWithId,Option<OptionGroup>,OptionContainer
public class ActionManager extends OptionGroup
Stores allFreeColActionsand retrieves them by identifier.
-
-
Field Summary
Fields Modifier and Type Field Description private FreeColClientfreeColClientprivate static java.util.logging.Loggerlogger-
Fields inherited from class net.sf.freecol.common.option.OptionGroup
TAG
-
Fields inherited from class net.sf.freecol.common.option.AbstractOption
ACTION_TAG, DEFAULT_VALUE_TAG, isDefined
-
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE_TAG, DEFAULT_CLASS_INDEX, fcoComparator, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE_TAG, VALUE_TAG
-
-
Constructor Summary
Constructors Constructor Description ActionManager(FreeColClient freeColClient)Creates a newActionManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSpecificationActions(Specification spec)Adds theFreeColActionsthat are provided by theSpecification.FreeColActiongetFreeColAction(java.lang.String id)Gets theFreeColActionspecified by the given identifier.voidinitializeActions(InGameController inGameController, ConnectController connectController)This method adds all FreeColActions to the OptionGroup.java.util.List<UnitButton>makeMiniMapButtons()Make the buttons needed by the map controls for the mini map.java.util.List<UnitButton>makeUnitActionButtons(Specification spec)Make the buttons needed by the map controls for unit actions.voidrefreshResources()voidupdate()Updates everyFreeColActionthis object keeps.-
Methods inherited from class net.sf.freecol.common.option.OptionGroup
add, cloneOption, generateChoices, getName, getOption, getOption, getOptions, getShortDescription, getValue, getXMLTagName, hasOption, hasOptionGroup, isEditable, isNullValueOK, isVisible, load, load, loadOptionGroup, merge, readAttributes, readChild, readChildren, remove, removeAll, save, setEditable, setValue, setValue, toString, writeAttributes, writeChildren
-
Methods inherited from class net.sf.freecol.common.option.AbstractOption
getEnabledBy, getGroup, readOption, setGroup, setValues
-
Methods inherited from class net.sf.freecol.common.model.FreeColSpecObject
copyIn, getSpecification, setSpecification
-
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addAbility, addFeatures, addModifier, addPropertyChangeListener, addPropertyChangeListener, apply, apply, applyModifiers, applyModifiers, arrayKey, compareIds, compareTo, containsAbilityKey, containsModifierKey, copy, copy, copy, copy, copyInCast, dumpObject, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAbilities, getAbilities, getAbilities, getAbilities, getClassIndex, getDefenceModifiers, getDisplayObject, getFeatureContainer, getFreeColObjectClass, getFreeColObjectClassByName, getGame, getId, getIdNumber, getIdType, getIdTypeByName, getModifiers, getModifiers, getModifiers, getModifiers, getObjectClassIndex, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getSortedAbilities, getSortedModifiers, getSuffix, getSuffix, hasAbility, hasAbility, hasAbility, hashCode, hasListeners, hasModifier, hasModifier, hasModifier, idEquals, invokeMethod, logFreeColObjects, readFromXML, readFromXMLPartial, removeAbilities, removeAbility, removeFeatures, removeModifier, removeModifiers, removePropertyChangeListener, removePropertyChangeListener, save, save, save, serialize, serialize, serialize, serialize, setGame, setId, toXML, toXML, toXMLPartial, toXMLPartial
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.freecol.common.ObjectWithId
getId
-
Methods inherited from interface net.sf.freecol.common.option.Option
readFromXML, toXML
-
Methods inherited from interface net.sf.freecol.common.option.OptionContainer
getBoolean, getFile, getInteger, getIntegerMinimum, getModList, getOptionGroup, getPercentage, getPercentageMultiplier, getRange, getSelection, getSelectionName, getString, getText, getUnitList, setBoolean, setFile, setInteger, setIntegerMinimum, setString, setText
-
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
freeColClient
private final FreeColClient freeColClient
-
-
Constructor Detail
-
ActionManager
public ActionManager(FreeColClient freeColClient)
Creates a newActionManager.- Parameters:
freeColClient- TheFreeColClientfor the game.
-
-
Method Detail
-
initializeActions
public void initializeActions(InGameController inGameController, ConnectController connectController)
This method adds all FreeColActions to the OptionGroup. If you implement a newFreeColAction, then you need to add it in this method. Localization and a possible accelerator need to be added to the strings file.- Parameters:
inGameController- The clientInGameController.connectController- The clientConnectController.
-
addSpecificationActions
public void addSpecificationActions(Specification spec)
Adds theFreeColActionsthat are provided by theSpecification. At the moment, this includes onlyTileImprovements.- Parameters:
spec- TheSpecificationto refer to.
-
getFreeColAction
public FreeColAction getFreeColAction(java.lang.String id)
Gets theFreeColActionspecified by the given identifier.- Parameters:
id- The object identifier.- Returns:
- The
FreeColActionor null if not present.
-
update
public void update()
Updates everyFreeColActionthis object keeps.- See Also:
FreeColAction
-
makeMiniMapButtons
public java.util.List<UnitButton> makeMiniMapButtons()
Make the buttons needed by the map controls for the mini map.- Returns:
- A list of
UnitButtons.
-
makeUnitActionButtons
public java.util.List<UnitButton> makeUnitActionButtons(Specification spec)
Make the buttons needed by the map controls for unit actions.- Parameters:
spec- TheSpecificationto query.- Returns:
- A list of
UnitButtons.
-
refreshResources
public void refreshResources()
-
-