org.mars_sim.msp.ui.standard.tool.map
Class CannedMarsMap

java.lang.Object
  extended by org.mars_sim.msp.ui.standard.tool.map.CannedMarsMap
All Implemented Interfaces:
Map
Direct Known Subclasses:
SurfMarsMap, TopoMarsMap

public abstract class CannedMarsMap
extends java.lang.Object
implements Map

The CannedMarsMap class reads in data from files in the map_data jar file in order to generate a map image.


Field Summary
static double HALF_MAP_ANGLE
           
static int MAP_HEIGHT
           
static int MAP_WIDTH
           
static double PIXEL_RHO
           
protected  java.util.List<int[]> surfaceColors
           
 
Fields inherited from interface org.mars_sim.msp.ui.standard.tool.map.Map
DISPLAY_HEIGHT, DISPLAY_WIDTH
 
Constructor Summary
CannedMarsMap(javax.swing.JComponent displayArea, java.util.List<int[]> surfaceColors)
          Constructor with surface colors array list parameter.
CannedMarsMap(javax.swing.JComponent displayArea, java.lang.String dataFile, java.lang.String indexFile, java.util.List<int[]> mapColors)
          Constructor with data file parameters.
 
Method Summary
 void drawMap(Coordinates newCenter)
          Creates a 2D map at a given center point.
 java.awt.Image getMapImage()
          Gets the constructed map image.
 boolean isImageDone()
          Checks if a requested map is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HALF_MAP_ANGLE

public static final double HALF_MAP_ANGLE
See Also:
Constant Field Values

MAP_HEIGHT

public static final int MAP_HEIGHT
See Also:
Constant Field Values

MAP_WIDTH

public static final int MAP_WIDTH
See Also:
Constant Field Values

PIXEL_RHO

public static final double PIXEL_RHO
See Also:
Constant Field Values

surfaceColors

protected java.util.List<int[]> surfaceColors
Constructor Detail

CannedMarsMap

public CannedMarsMap(javax.swing.JComponent displayArea,
                     java.util.List<int[]> surfaceColors)
Constructor with surface colors array list parameter.

Parameters:
displayArea - the display component.
surfaceColors - the ArrayList containing all of the cached map colors.

CannedMarsMap

public CannedMarsMap(javax.swing.JComponent displayArea,
                     java.lang.String dataFile,
                     java.lang.String indexFile,
                     java.util.List<int[]> mapColors)
Constructor with data file parameters.

Parameters:
displayArea - the display component.
dataFile - the map data filename within map_data.jar.
indexFile - the map index filename within map_data.jar.
Method Detail

drawMap

public void drawMap(Coordinates newCenter)
Creates a 2D map at a given center point.

Specified by:
drawMap in interface Map
Parameters:
newCenter - the new center location

isImageDone

public boolean isImageDone()
Checks if a requested map is complete.

Specified by:
isImageDone in interface Map
Returns:
true if requested map is complete

getMapImage

public java.awt.Image getMapImage()
Gets the constructed map image.

Specified by:
getMapImage in interface Map
Returns:
constructed map image