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.Font
arrowFont
A font for the buttons.private java.util.List<java.awt.Component>
componentList
Helper container for the abstract API functions.private javax.swing.JPanel
panel
The 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 boolean
initializeUnitButtons()
Initialize the unit buttons.private javax.swing.JButton
makeButton(java.lang.String direction, java.lang.String arrow)
Makes aJButton
for 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
- TheFreeColClient
for the game.
-
-
Method Detail
-
makeButton
private javax.swing.JButton makeButton(java.lang.String direction, java.lang.String arrow)
Makes aJButton
for 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 theMap
to 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:
initializeUnitButtons
in 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:
getComponentsToAdd
in classMapControls
- Parameters:
newSize
- TheDimension
of the canvas.- Returns:
- A list of
Component
s 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:
getComponentsPresent
in classMapControls
- Returns:
- A list of
Component
s to remove from the canvas.
-
-