Package 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,ObjectWithId,Option<FreeColAction>
public class ImprovementAction extends UnitAction
An action for using the active unit to add a tile improvement to the unit's tile, possibly changing the tile type in the process. In the original game, artificial tile improvements were clearing, plowing and building a road.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.freecol.client.gui.action.FreeColAction
FreeColAction.InnerMenuKeyListener
-
-
Field Summary
Fields Modifier and Type Field Description private TileImprovementTypeimprovement-
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, logger, TAG
-
-
Constructor Summary
Constructors Constructor Description ImprovementAction(FreeColClient freeColClient, TileImprovementType improvement)Creates this action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ae)protected booleanshouldBeEnabled()Checks if this action should be enabled.-
Methods inherited from class net.sf.freecol.client.gui.action.FreeColAction
addImageIcons, cloneOption, getAccelerator, getActionManager, getClientOptions, getConnectController, getEnabledBy, getFreeColClient, getGame, getGroup, getGUI, getId, getMap, getMenuKeyListener, getMnemonic, getName, getShortDescription, getValue, getXMLTagName, hasOrderButtons, igc, readFromXML, setAccelerator, setGroup, setMnemonic, setValue, toString, toXML, update, updateRegisteredImageIcons
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
improvement
private final TileImprovementType improvement
-
-
Constructor Detail
-
ImprovementAction
public ImprovementAction(FreeColClient freeColClient, TileImprovementType improvement)
Creates this action.- Parameters:
freeColClient- TheFreeColClientfor the game.improvement- TheTileImprovementTypeto make.
-
-
Method Detail
-
shouldBeEnabled
protected boolean shouldBeEnabled()
Checks if this action should be enabled.- Overrides:
shouldBeEnabledin classUnitAction- Returns:
- True if the
ClientOptionsDialogis not visible.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
-
-