Package net.sf.freecol.client.gui.panel
Class ClassicMapControls
- java.lang.Object
-
- net.sf.freecol.client.control.FreeColClientHolder
-
- net.sf.freecol.client.gui.panel.MapControls
-
- net.sf.freecol.client.gui.panel.ClassicMapControls
-
public final class ClassicMapControls extends MapControls
A collection of panels and buttons that are used to provide the user with a more detailed view of certain elements on the map and also to provide a means of input in case the user can't use the keyboard.
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.FontarrowFontA font for the buttons.private java.util.List<java.awt.Component>componentListHelper container for the abstract API functions.private javax.swing.JPanelpanelThe main panel.-
Fields inherited from class net.sf.freecol.client.gui.panel.MapControls
GAP, infoPanel, MINI_MAP_HEIGHT, MINI_MAP_WIDTH, miniMap, miniMapToggleBorders, miniMapToggleFogOfWarButton, miniMapZoomInButton, miniMapZoomOutButton, unitButtons
-
-
Constructor Summary
Constructors Constructor Description ClassicMapControls(FreeColClient freeColClient)The basic constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.awt.Component>getComponentsPresent()Prepare and return a list of map controls components to remove from the canvas.java.util.List<java.awt.Component>getComponentsToAdd(java.awt.Dimension newSize)Prepare and return a list of map controls components to add to the canvas.protected booleaninitializeUnitButtons()Initialize the unit buttons.private javax.swing.JButtonmakeButton(java.lang.String direction, java.lang.String arrow)Makes aJButtonfor a given arrow direction.-
Methods inherited from class net.sf.freecol.client.gui.panel.MapControls
canZoomInMapControls, canZoomOutMapControls, newInstance, repaint, update, updateLayoutIfNeeded, zoomIn, zoomOut
-
Methods inherited from class net.sf.freecol.client.control.FreeColClientHolder
askServer, currentPlayerIsMyPlayer, getClientOptions, getConnectController, getFreeColClient, getFreeColServer, getGame, getGUI, getMap, getMyPlayer, getSpecification, igc, pgc
-
-
-
-
Constructor Detail
-
ClassicMapControls
public ClassicMapControls(FreeColClient freeColClient)
The basic constructor.- Parameters:
freeColClient- TheFreeColClientfor the game.
-
-
Method Detail
-
makeButton
private javax.swing.JButton makeButton(java.lang.String direction, java.lang.String arrow)Makes aJButtonfor a given arrow direction. By default, the direction and arrow parameters should be the same literal direction, just formatted for a unique context.- Parameters:
direction- The Direction on theMapto movearrow- The Direction of the arrow itself- Returns:
- A JButton with the correct display and action
- Since:
- 0.10.6
-
initializeUnitButtons
protected boolean initializeUnitButtons()
Initialize the unit buttons. Initialization is deferred until in-game and the action manager is available.- Overrides:
initializeUnitButtonsin classMapControls- Returns:
- True if initialization occurs.
-
getComponentsToAdd
public java.util.List<java.awt.Component> getComponentsToAdd(java.awt.Dimension newSize)
Prepare and return a list of map controls components to add to the canvas.- Specified by:
getComponentsToAddin classMapControls- Parameters:
newSize- TheDimensionof the canvas.- Returns:
- A list of
Components to add to the canvas.
-
getComponentsPresent
public java.util.List<java.awt.Component> getComponentsPresent()
Prepare and return a list of map controls components to remove from the canvas.- Specified by:
getComponentsPresentin classMapControls- Returns:
- A list of
Components to remove from the canvas.
-
-