Package net.sf.freecol.client.gui.action
Class ScaleMapAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- net.sf.freecol.client.gui.action.FreeColAction
-
- net.sf.freecol.client.gui.action.ScaleMapAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,ObjectWithId,Option<FreeColAction>
public class ScaleMapAction extends FreeColAction
An action for scaling a map. This action is a part of the map editor.- 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.Stringid-
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 ScaleMapAction(FreeColClient freeColClient)Creates a newScaleMapAction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ae)private voidscaleMapTo(int width, int height)Scales the current map into the specified size.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
-
id
public static final java.lang.String id
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ScaleMapAction
public ScaleMapAction(FreeColClient freeColClient)
Creates a newScaleMapAction.- Parameters:
freeColClient- TheFreeColClientfor the game.
-
-
Method Detail
-
scaleMapTo
private void scaleMapTo(int width, int height)Scales the current map into the specified size. The current map is given by freeColClient.getGame().getMap().- Parameters:
width- The width of the resulting map.height- The height of the resulting map.
-
shouldBeEnabled
protected boolean shouldBeEnabled()
Checks if this action should be enabled.- Overrides:
shouldBeEnabledin classFreeColAction- Returns:
- True if the
ClientOptionsDialogis not visible.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
-
-