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, 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
|
Field Summary |
static java.lang.String |
id
|
| Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
| 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 |
| Methods inherited from class net.sf.freecol.client.gui.action.FreeColAction |
addImageIcons, clone, getAccelerator, getFreeColClient, getId, getKeyStrokeText, getMenuKeyListener, getMnemonic, getName, getShortDescription, getValue, getXMLElementTagName, hasOrderButtons, readFromXML, readFromXMLImpl, setAccelerator, setMnemonic, setValue, toString, toXML, toXMLImpl, update |
| Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
id
public static final java.lang.String id
- See Also:
- Constant Field Values
ScaleMapAction
ScaleMapAction(FreeColClient freeColClient,
GUI gui)
- Creates a new
ScaleMapAction.
- Parameters:
freeColClient - The main controller object for the client.gui -
shouldBeEnabled
protected boolean shouldBeEnabled()
- Checks if this action should be enabled.
- Overrides:
shouldBeEnabled in class FreeColAction
- Returns:
false if there is no active map.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Applies this action.
- Parameters:
e - The ActionEvent.
showMapSizeDialog
private ScaleMapAction.MapSize showMapSizeDialog()
- Displays a dialog for choosing the new map size.
- Returns:
- The size of the new map.
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.