ucar.unidata.gis.maps
Class MapData

java.lang.Object
  extended by ucar.unidata.gis.maps.MapData
Direct Known Subclasses:
MapDisplayControl.MapState

public class MapData
extends Object

Holds basic map information


Field Summary
static String ATTR_COLOR
          attribute identifier
static String ATTR_FASTRENDERING
          attribute identifier
static String ATTR_LINESTYLE
          attribute identifier
static String ATTR_LINEWIDTH
          attribute identifier
static String ATTR_VISIBLE
          attribute identifier
protected  String category
          The category of this map
protected  String description
          The description of the map
protected  boolean fastRendering
          fast rendering flag
protected  int lineStyle
          The line style
protected  float lineWidth
          The line width
protected  Color mapColor
          The color
protected  MapLines myMap
          The MapLines displayable
protected  String source
          The file, url or java resource of the map
protected  float spacing
          spacing
protected  boolean visible
          Is the map visible
 
Constructor Summary
MapData()
          ctor for bundles
MapData(Element mapNode, String source)
          Create this MapData from the state in the given xml element
MapData(MapData that)
          A copy constructor
MapData(String source, MapLines map)
          Create this object with the given soruce and state held in the map lines
MapData(String mapPath, String description, Color mapColor, float lineWidth, int lineStyle)
          Construct this MapData.
 
Method Summary
 boolean equals(Object o)
          Use the source as the .equals
 String getCategory()
          Get the Category property.
 Color getColor()
          Get the Color
 String getDescription()
          Get the description
 boolean getFastRendering()
          Get the FastRendering property.
 int getLineStyle()
          Get the line style
 float getLineWidth()
          Get the line width
 MapLines getMap()
          Get the MapLines
 String getSource()
          Get the source of this map
 float getSpacing()
          Get the spacing
 boolean getVisible()
          Is this map visible
 int hashCode()
          Use the source as the hashcode
 void setCategory(String value)
          Set the Category property.
 void setColor(Color v)
          Set the color
 void setDescription(String v)
          Set the description
 void setFastRendering(boolean value)
          Set the FastRendering property.
 void setLineStyle(int v)
          Set the line style
 void setLineWidth(float v)
          Set the line width
 void setSource(String v)
          Set the map source
 void setSpacing(float v)
          Set the spacing
 void setVisible(boolean v)
          Set the visibility
protected  void stateChanged()
          A method that allows derived classes to be told when the state has changed.
 String toString()
          Overwrite toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_COLOR

public static final String ATTR_COLOR
attribute identifier

See Also:
Constant Field Values

ATTR_LINEWIDTH

public static final String ATTR_LINEWIDTH
attribute identifier

See Also:
Constant Field Values

ATTR_LINESTYLE

public static final String ATTR_LINESTYLE
attribute identifier

See Also:
Constant Field Values

ATTR_FASTRENDERING

public static final String ATTR_FASTRENDERING
attribute identifier

See Also:
Constant Field Values

ATTR_VISIBLE

public static final String ATTR_VISIBLE
attribute identifier

See Also:
Constant Field Values

source

protected String source
The file, url or java resource of the map


category

protected String category
The category of this map


description

protected String description
The description of the map


mapColor

protected Color mapColor
The color


visible

protected boolean visible
Is the map visible


lineWidth

protected float lineWidth
The line width


lineStyle

protected int lineStyle
The line style


spacing

protected float spacing
spacing


myMap

protected MapLines myMap
The MapLines displayable


fastRendering

protected boolean fastRendering
fast rendering flag

Constructor Detail

MapData

public MapData()
ctor for bundles


MapData

public MapData(Element mapNode,
               String source)
Create this MapData from the state in the given xml element

Parameters:
mapNode - The xml element
source - default source

MapData

public MapData(MapData that)
A copy constructor

Parameters:
that - The MapData to initialize from

MapData

public MapData(String mapPath,
               String description,
               Color mapColor,
               float lineWidth,
               int lineStyle)
Construct this MapData.

Parameters:
mapPath - File path, resource path or url of the map file.
description - Map description
mapColor - The initial color to use
lineWidth - The initial line width to use
lineStyle - The initial line style to use

MapData

public MapData(String source,
               MapLines map)
Create this object with the given soruce and state held in the map lines

Parameters:
source - The source
map - The map lines
Method Detail

stateChanged

protected void stateChanged()
A method that allows derived classes to be told when the state has changed.


getMap

public MapLines getMap()
Get the MapLines

Returns:
The map lines

getColor

public Color getColor()
Get the Color

Returns:
The color_

setColor

public void setColor(Color v)
Set the color

Parameters:
v - the new color

getVisible

public boolean getVisible()
Is this map visible

Returns:
Visibility

setVisible

public void setVisible(boolean v)
Set the visibility

Parameters:
v - The new visibility

getSource

public String getSource()
Get the source of this map

Returns:
The map source

setSource

public void setSource(String v)
Set the map source

Parameters:
v - The new map source

getDescription

public String getDescription()
Get the description

Returns:
The description

setDescription

public void setDescription(String v)
Set the description

Parameters:
v - The new description

getLineWidth

public float getLineWidth()
Get the line width

Returns:
The line width

setLineWidth

public void setLineWidth(float v)
Set the line width

Parameters:
v - The new line width

getLineStyle

public int getLineStyle()
Get the line style

Returns:
The line style

setLineStyle

public void setLineStyle(int v)
Set the line style

Parameters:
v - The new line style

getSpacing

public float getSpacing()
Get the spacing

Returns:
The spacing

setSpacing

public void setSpacing(float v)
Set the spacing

Parameters:
v - The new value for the spacing

hashCode

public int hashCode()
Use the source as the hashcode

Overrides:
hashCode in class Object
Returns:
The hashcode

equals

public boolean equals(Object o)
Use the source as the .equals

Overrides:
equals in class Object
Parameters:
o - The other object
Returns:
Is equals

toString

public String toString()
Overwrite toString

Overrides:
toString in class Object
Returns:
The string representation of this object

setFastRendering

public void setFastRendering(boolean value)
Set the FastRendering property.

Parameters:
value - The new value for FastRendering

getFastRendering

public boolean getFastRendering()
Get the FastRendering property.

Returns:
The FastRendering

setCategory

public void setCategory(String value)
Set the Category property.

Parameters:
value - The new value for Category

getCategory

public String getCategory()
Get the Category property.

Returns:
The Category