us.zuercher.gpx2map.plotter
Enum Style

java.lang.Object
  extended by java.lang.Enum<Style>
      extended by us.zuercher.gpx2map.plotter.Style
All Implemented Interfaces:
Serializable, Comparable<Style>, MarkerStyle

public enum Style
extends Enum<Style>
implements MarkerStyle

Style is an enumeration of concrete MarkerStyle implementations. Every Style has user-defined (as opposed to constant) dimensions and simply overrides the MarkerStyle.getShape(Point, int, Color) method to render various simple, single-color, markers.

Author:
Stephan Zuercher

Enum Constant Summary
BOX
          A filled square.
DIAMOND
          A filled diamond.
DOT
          A filled circle.
PLUS
          A plus, or cross, shape.
TRIANGLE
          A filled triangle pointing up.
X
          An X shape.
 
Field Summary
private  String name
          Marker style name.
 
Method Summary
 int getHeight()
          Returns -1.
 String getName()
          Returns the style's name.
static Style getStyle(String styleName)
          Returns a Style with the given name.
 int getWidth()
          Returns -1.
 boolean hasConstantDimensions()
          Returns false.
static Style valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Style[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface us.zuercher.gpx2map.plotter.MarkerStyle
getShape
 

Enum Constant Detail

DOT

public static final Style DOT
A filled circle.


BOX

public static final Style BOX
A filled square.


DIAMOND

public static final Style DIAMOND
A filled diamond. Essentially BOX rotated 45 degrees.


X

public static final Style X
An X shape.


TRIANGLE

public static final Style TRIANGLE
A filled triangle pointing up.


PLUS

public static final Style PLUS
A plus, or cross, shape.

Field Detail

name

private final String name
Marker style name.

Method Detail

values

public static final Style[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Style c : Style.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Style valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

getStyle

public static Style getStyle(String styleName)
Returns a Style with the given name.

Parameters:
styleName - a marker style name for style defined in this enumeration.
Returns:
the Style associated with the name or null if not found.

hasConstantDimensions

public boolean hasConstantDimensions()
Returns false.

Specified by:
hasConstantDimensions in interface MarkerStyle
Returns:
false
See Also:
MarkerStyle.hasConstantDimensions()

getHeight

public int getHeight()
Returns -1.

Specified by:
getHeight in interface MarkerStyle
Returns:
-1
See Also:
hasConstantDimensions(), MarkerStyle.hasConstantDimensions(), MarkerStyle.getHeight()

getWidth

public int getWidth()
Returns -1.

Specified by:
getWidth in interface MarkerStyle
Returns:
-1
See Also:
hasConstantDimensions(), MarkerStyle.hasConstantDimensions(), MarkerStyle.getWidth()

getName

public String getName()
Returns the style's name.

Specified by:
getName in interface MarkerStyle
Returns:
the style's name.