net.sf.freecol.client.gui.action
Class ImprovementAction
java.lang.Object
javax.swing.AbstractAction
net.sf.freecol.client.gui.action.FreeColAction
net.sf.freecol.client.gui.action.MapboardAction
net.sf.freecol.client.gui.action.UnitAction
net.sf.freecol.client.gui.action.ImprovementAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, Option
public class ImprovementAction
- extends UnitAction
An action for using the active unit to plow/clear a forest.
- See Also:
- Serialized Form
| 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 |
|
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
Applies this action. |
protected boolean |
shouldBeEnabled()
Checks if this action should be enabled. |
void |
update()
Updates the "enabled"-status with the value returned by
shouldBeEnabled() and updates the name of the action. |
private void |
updateValues(int newActionID)
Updates this action to one of the possible actions for this ImprovementAction. |
| 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 |
iaType
public ImprovementActionType iaType
actionID
int actionID
ImprovementAction
public ImprovementAction(FreeColClient freeColClient,
ImprovementActionType iaType)
- Creates this action.
- Parameters:
freeColClient - The main controller object for the client.
updateValues
private void updateValues(int newActionID)
- Updates this action to one of the possible actions for this ImprovementAction.
- Parameters:
newActionID - The new action.
update
public void update()
- Updates the "enabled"-status with the value returned by
shouldBeEnabled() and updates the name of the action.
- Overrides:
update in class FreeColAction
shouldBeEnabled
protected boolean shouldBeEnabled()
- Checks if this action should be enabled.
- Overrides:
shouldBeEnabled in class UnitAction
- Returns:
false if there is no active unit or if the unit
cannot plow/clear forest.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Applies this action.
- Parameters:
e - The ActionEvent.