Package net.sf.freecol.client.gui.action
Class UnloadAction
- 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.UnloadAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,ObjectWithId
,Option<FreeColAction>
public class UnloadAction extends MapboardAction
An action for unloading a unit.- 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 static java.lang.String
id
private Unit
unit
-
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 UnloadAction(FreeColClient freeColClient)
Creates an action for unloading the currently selected unit.UnloadAction(FreeColClient freeColClient, Unit unit)
Creates an action for unloading theUnit
provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent ae)
private Unit
getUnit()
protected boolean
shouldBeEnabled()
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
-
id
public static final java.lang.String id
- See Also:
- Constant Field Values
-
unit
private Unit unit
-
-
Constructor Detail
-
UnloadAction
public UnloadAction(FreeColClient freeColClient)
Creates an action for unloading the currently selected unit.- Parameters:
freeColClient
- TheFreeColClient
for the game.
-
UnloadAction
public UnloadAction(FreeColClient freeColClient, Unit unit)
Creates an action for unloading theUnit
provided. If theUnit
isnull
, then the currently selected unit is used instead.- Parameters:
freeColClient
- TheFreeColClient
for the game.unit
- TheUnit
to unload.
-
-
Method Detail
-
getUnit
private Unit getUnit()
-
shouldBeEnabled
protected boolean shouldBeEnabled()
Checks if this action should be enabled.- Overrides:
shouldBeEnabled
in classMapboardAction
- Returns:
- True if the
ClientOptionsDialog
is not visible.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
-
-