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

java.lang.Object
  extended by net.sf.freecol.client.gui.panel.MapControls

public final 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
private  javax.swing.JLabel compassRose
           
private static int CONTROLS_LAYER
           
private  FreeColClient freeColClient
           
private  InfoPanel infoPanel
           
private  MiniMap miniMap
           
private  UnitButton[] unitButton
           
 
Constructor Summary
MapControls(FreeColClient freeColClient)
          The basic constructor.
 
Method Summary
 void addToComponent(Canvas component)
          Adds the map controls to the given component.
 boolean canZoomIn()
           
 boolean canZoomOut()
           
 void changeBackgroundColor(java.awt.Color newColor)
           
 int getInfoPanelHeight()
          Returns the height of the InfoPanel.
 int getInfoPanelWidth()
          Returns the width of the InfoPanel.
 boolean isShowing()
           
 void removeFromComponent(Canvas canvas)
          Removes the map controls from the parent component.
 void update()
          Updates this MapControls.
 void update(MapEditorTransformPanel.MapTransform mapTransform)
          Updates this InfoPanel.
 void zoomIn()
          Zooms in the mini map.
 void zoomOut()
          Zooms out the mini map.
 
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

unitButton

private final UnitButton[] unitButton

compassRose

private final javax.swing.JLabel compassRose

CONTROLS_LAYER

private static final int CONTROLS_LAYER
Constructor Detail

MapControls

public MapControls(FreeColClient freeColClient)
The basic constructor.

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

update

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

Parameters:
mapTransform - The current MapTransform.

addToComponent

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

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

getInfoPanelWidth

public int getInfoPanelWidth()
Returns the width of the InfoPanel.

Returns:
an int value

getInfoPanelHeight

public int getInfoPanelHeight()
Returns the height of the InfoPanel.

Returns:
an int value

removeFromComponent

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


isShowing

public boolean isShowing()

zoomIn

public void zoomIn()
Zooms in the mini map.


zoomOut

public void zoomOut()
Zooms out the mini map.


canZoomIn

public boolean canZoomIn()

canZoomOut

public boolean canZoomOut()

changeBackgroundColor

public void changeBackgroundColor(java.awt.Color newColor)
Parameters:
newColor -

update

public void update()
Updates this MapControls.