net.sf.freecol.client.gui.panel
Class MapControls

java.lang.Object
  extended by net.sf.freecol.client.gui.panel.MapControls
Direct Known Subclasses:
ClassicMapControls, CornerMapControls

public abstract class MapControls
extends java.lang.Object

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. The MapControls are useless by themselves, this object needs to be placed on a JComponent in order to be usable.


Field Summary
static int CONTROLS_LAYER
           
private  FreeColClient freeColClient
           
private  GUI gui
           
private  InfoPanel infoPanel
           
private  MiniMap miniMap
           
private  java.util.List<UnitButton> unitButtons
           
 
Constructor Summary
MapControls(FreeColClient freeColClient, GUI gui, boolean useSkin)
          The basic constructor.
 
Method Summary
abstract  void addToComponent(Canvas component)
          Adds the map controls to the given component.
 FreeColClient getFreeColClient()
          Returns the FreeColClient.
 InfoPanel getInfoPanel()
          Returns the info panel.
 MiniMap getMiniMap()
          Returns the mini map.
 java.util.List<UnitButton> getUnitButtons()
          Returns a list of unit buttons.
abstract  boolean isShowing()
           
abstract  void removeFromComponent(Canvas canvas)
          Removes the map controls from the parent canvas component.
 void update()
          Updates this MapControls.
 void update(MapEditorTransformPanel.MapTransform mapTransform)
          Updates this InfoPanel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

freeColClient

private final FreeColClient freeColClient

infoPanel

private final InfoPanel infoPanel

miniMap

private final MiniMap miniMap

unitButtons

private final java.util.List<UnitButton> unitButtons

gui

private GUI gui

CONTROLS_LAYER

public static final int CONTROLS_LAYER
Constructor Detail

MapControls

public MapControls(FreeColClient freeColClient,
                   GUI gui,
                   boolean useSkin)
The basic constructor.

Parameters:
freeColClient - The main controller object for the client
gui -
Method Detail

getMiniMap

public MiniMap getMiniMap()
Returns the mini map.

Returns:
a MiniMap value

getInfoPanel

public InfoPanel getInfoPanel()
Returns the info panel.

Returns:
an InfoPanel value

getUnitButtons

public java.util.List<UnitButton> getUnitButtons()
Returns a list of unit buttons.

Returns:
an List value

getFreeColClient

public FreeColClient getFreeColClient()
Returns the FreeColClient.

Returns:
a FreeColClient value

update

public void update(MapEditorTransformPanel.MapTransform mapTransform)
Updates this InfoPanel.

Parameters:
mapTransform - The current MapTransform.

addToComponent

public abstract void addToComponent(Canvas component)
Adds the map controls to the given component.

Parameters:
component - The component to add the map controls to.

removeFromComponent

public abstract void removeFromComponent(Canvas canvas)
Removes the map controls from the parent canvas component.

Parameters:
canvas - Canvas parent

isShowing

public abstract boolean isShowing()

update

public void update()
Updates this MapControls.