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

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.sf.freecol.client.gui.action.FreeColAction
          extended by net.sf.freecol.client.gui.action.MapboardAction
              extended by net.sf.freecol.client.gui.action.SelectableAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, Option
Direct Known Subclasses:
ChangeWindowedModeAction, DisplayBordersAction, DisplayGridAction, DisplayTileTextAction, MapControlsAction

public abstract class SelectableAction
extends MapboardAction

An action for selecting one of several options.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.freecol.client.gui.action.FreeColAction
FreeColAction.InnerMenuKeyListener
 
Field Summary
static java.lang.String id
           
protected  boolean selected
           
 
Fields inherited from class net.sf.freecol.client.gui.action.FreeColAction
ACTION_ID, BUTTON_DISABLED_IMAGE, BUTTON_IMAGE, BUTTON_PRESSED_IMAGE, BUTTON_ROLLOVER_IMAGE, freeColClient, NO_MNEMONIC
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface net.sf.freecol.common.option.Option
NO_ID
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected SelectableAction(FreeColClient freeColClient, java.lang.String id)
          Creates this action.
 
Method Summary
 boolean isSelected()
          Checks if the map controls is selcted.
 void setSelected(boolean b)
           
 void update()
          Updates the "enabled"-status
 
Methods inherited from class net.sf.freecol.client.gui.action.MapboardAction
shouldBeEnabled
 
Methods inherited from class net.sf.freecol.client.gui.action.FreeColAction
addImageIcons, getAccelerator, getFreeColClient, getId, getKeyStrokeText, getMenuKeyListener, getMnemonic, getName, getShortDescription, getXMLElementTagName, isPreviewEnabled, readFromXML, readFromXMLElement, readFromXMLImpl, setAccelerator, setMnemonic, toString, toXML, toXMLElement, toXMLImpl
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.option.Option
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

id

public static final java.lang.String id
See Also:
Constant Field Values

selected

protected boolean selected
Constructor Detail

SelectableAction

protected SelectableAction(FreeColClient freeColClient,
                           java.lang.String id)
Creates this action.

Parameters:
freeColClient - The main controller object for the client
id - a String value
Method Detail

update

public void update()
Updates the "enabled"-status

Overrides:
update in class FreeColAction

isSelected

public boolean isSelected()
Checks if the map controls is selcted.

Returns:
true if the map controls is selected.

setSelected

public void setSelected(boolean b)