us.zuercher.gpx2map
Class MainArgumentParser

java.lang.Object
  extended by us.zuercher.gpx2map.MainArgumentParser

public class MainArgumentParser
extends Object

MainArgumentParser uses "argslib" to configure and parse Gpx2Map's command line arguments.

Author:
Stephan Zuercher

Nested Class Summary
private static class MainArgumentParser.Exit
           
 class MainArgumentParser.HelperTarget
          HelperTarget accepts MapSource name information from an ArgumentParser.
 
Field Summary
private static String BOUNDING_ARG
          Argument name.
private  us.zuercher.argslib.Argument boundingArg
          Argument.
(package private) static us.zuercher.argslib.ArgumentChoice boundingByAll
          Argument choice.
(package private) static us.zuercher.argslib.ArgumentChoice boundingByCoords
          Argument choice.
(package private) static us.zuercher.argslib.ArgumentChoice boundingByRoutes
          Argument choice.
(package private) static us.zuercher.argslib.ArgumentChoice boundingByTracks
          Argument choice.
(package private) static us.zuercher.argslib.ArgumentChoice boundingByWayPoints
          Argument choice.
private static String CACHE_DIR_ARG
          Argument name.
private  us.zuercher.argslib.Argument cacheDirArg
          Argument.
private static List<us.zuercher.argslib.ArgumentChoice> colorChoices
          Available color choices.
static Color DEFAULT_COLOR
          Default color.
static boolean DEFAULT_JOIN_TRACK_SEGMENTS
          Default join track segments flag.
static String DEFAULT_MAP_SOURCE
          Default map source name.
static String DEFAULT_OUTPUT
          Default output file.
static boolean DEFAULT_ROUTE_LABELING
          Default route labeling flag.
static MarkerStyle DEFAULT_STYLE
          Default marker style.
static int DEFAULT_STYLE_RADIUS
          Default marker style radius.
static boolean DEFAULT_TRACK_LABELING
          Default track labeling flag.
private static String FONT_NAME_ARG
          Argument name.
private static String FONT_SIZE_ARG
          Argument name.
private  us.zuercher.argslib.Argument fontNameArg
          Argument.
private  us.zuercher.argslib.Argument fontSizeArg
          Argument.
private static String GPSDATA_ARG
          Argument name.
private static String HELP_ARG
          Argument name.
private static String HELP_USAGE
          Help usage detail.
private  us.zuercher.argslib.Argument helpArg
          Argument.
private static String IGNORE_ROUTES_ARG
          Argument name.
private static String IGNORE_TRACKS_ARG
          Argument name.
private static String IGNORE_WAYPOINTS_ARG
          Argument name.
private  us.zuercher.argslib.Argument ignoreRoutesArg
          Argument.
private  us.zuercher.argslib.Argument ignoreTracksArg
          Argument.
private  us.zuercher.argslib.Argument ignoreWayPointsArg
          Argument.
private static String JOIN_TRACK_SEGMENTS_ARG
          Argument name.
private  us.zuercher.argslib.Argument joinTrackSegmentsArg
          Argument.
private  String locale
          If set, the GUI locale to display.
private static String LOCALE_ARG
          Argument name.
private  us.zuercher.argslib.Argument localeArg
          Argument.
private  Gpx2Map main
          Map plotter object.
(package private) static String MAP_PROPERTY_ARG_PREFIX
          Prefix for map source property arguments.
private static String MAP_SOURCE_ARG
          Argument name.
private static String MAP_SOURCE_DESC
          Map source description.
private static String MAP_SOURCE_USAGE
          Map source usage detail.
private static String MARGIN_ARG
          Argument name.
private  us.zuercher.argslib.Argument marginArg
          Argument.
(package private) static us.zuercher.argslib.ArgumentChoice marginMetersChoice
          Argument choice.
(package private) static us.zuercher.argslib.ArgumentChoice marginPixelsChoice
          Argument choice.
private static String OUTPUT_ARG
          Argument name.
private  us.zuercher.argslib.Argument outputArg
          Argument.
private static String PRINT_COLORS_ARG
          Argument name.
private static String PRINT_STYLES_ARG
          Argument name.
private  boolean printColors
          If true, print colors.
private  us.zuercher.argslib.Argument printColorsArg
          Argument.
private  boolean printHelp
          If true, print help.
private  boolean printStyles
          If true, print styles.
private  us.zuercher.argslib.Argument printStylesArg
          Argument.
private static String ROUTE_COLOR_ARG
          Argument name.
private static String ROUTE_LABEL_ARG
          Argument name.
private  us.zuercher.argslib.Argument routeColorArg
          Argument.
private  us.zuercher.argslib.Argument routeLabelArg
          Argument.
private static String ROUTEPOINT_RADIUS_ARG
          Argument name.
private static String ROUTEPOINT_STYLE_ARG
          Argument name.
private  us.zuercher.argslib.Argument routePointRadiusArg
          Argument.
private  us.zuercher.argslib.Argument routePointStyleArg
          Argument.
private static List<us.zuercher.argslib.ArgumentChoice> sourceChoices
          Available map source choices.
private static String STYLE_VALUE_FILE
          Prefix for "file" marker style arguments.
private static List<us.zuercher.argslib.ArgumentChoice> styleChoices
          Available marker style choices.
private static String TRACK_COLOR_ARG
          Argument name.
private static String TRACK_LABEL_ARG
          Argument name.
private  us.zuercher.argslib.Argument trackColorArg
          Argument.
private  us.zuercher.argslib.Argument trackLabelArg
          Argument.
private static String TRACKPOINT_RADIUS_ARG
          Argument name.
private static String TRACKPOINT_STYLE_ARG
          Argument name.
private  us.zuercher.argslib.Argument trackPointRadiusArg
          Argument.
private  us.zuercher.argslib.Argument trackPointStyleArg
          Argument.
private static String WAYPOINT_COLOR_ARG
          Argument name.
private static String WAYPOINT_RADIUS_ARG
          Argument name.
private static String WAYPOINT_STYLE_ARG
          Argument name.
private  us.zuercher.argslib.Argument wayPointColorArg
          Argument.
private  us.zuercher.argslib.Argument wayPointRadiusArg
          Argument.
private  us.zuercher.argslib.Argument wayPointStyleArg
          Argument.
 
Constructor Summary
MainArgumentParser(Gpx2Map main)
          Constructs a new MainArgumentParser with the given Gpx2Map.
 
Method Summary
 void addGpsdata(String gpsDataArg)
          Mutator called by ArgumentParser for the GPX data file Argument.
private  us.zuercher.argslib.ArgumentSetParser configureArgumentParser(String... args)
          Configure an ArgumentSetParser for the given arguments.
private  Color getColor(String colorName, int error)
          Look up the given color name.
private static List<us.zuercher.argslib.ArgumentChoice> getColorChoices()
          Creates a List or ArgumentChoice objects for use in initializing Color-based Arguments.
private static List<us.zuercher.argslib.ArgumentChoice> getSourceChoices()
          Creates a List or ArgumentChoice objects for use in initializing the MapSource selection Argument.
private  MarkerStyle getStyle(String styleName, int errorStyle)
          Look up the given style name.
private static List<us.zuercher.argslib.ArgumentChoice> getStyleChoices()
          Creates a List or ArgumentChoice objects for use in initializing style-based Arguments.
 int parseArgs(String... args)
          Parse the given arguments and apply them to the Gpx2Map object given in the constructor for this instance.
private  void printColors()
          Prints the available Colors to System.out.
 void printHelp(String... args)
          Output help information for the given arguments.
private  void printStyles()
          Prints the available styles to System.out.
private  void quit(int resultCode)
          Force parseArgs(String[]) to return with the given result code.
 void set(String mapSourceProperty, String value)
          Mutator called by ArgumentParser for the MapSource properties Arguments.
 void setBounding(String choice)
          Mutator called by ArgumentParser for the boundingArg Argument.
 void setCacheDir(String cacheDir)
          Mutator called by ArgumentParser for the cacheDirArg Argument.
 void setFontName(String fontName)
          Mutator call by ArgumentParser for the fontNameArg Argument.
 void setFontSize(float size)
          Mutator call by ArgumentParser for the fontSizeArg Argument.
 void setHelp()
          Mutator called by ArgumentParser via helpArg.
 void setIgnoreRoutes()
          Mutator called by ArgumentParser for the ignoreRoutesArg Argument.
 void setIgnoreTracks()
          Mutator called by ArgumentParser for the ignoreTracksArg Argument.
 void setIgnoreWaypoints()
          Mutator called by ArgumentParser for the ignoreWayPointsArg Argument.
 void setJoinTrackSegments(boolean join)
          Mutator call by ArgumentParser for the joinTrackSegmentsArg Argument.
 void setLocale(String locale)
          Mutator called by ArgumentSetParser via localeArg.
 void setMapSource(String mapSourceName)
          Mutator called by ArgumentParser for the MapSource name Argument.
 void setMargin(String margin)
          Mutator called by ArgumentParser for the marginArg Argument.
 void setOutput(String output)
          Mutator called by ArgumentParser for the outputArg Argument.
 void setPrintColors()
          Mutator called by ArgumentParser via printColorsArg.
 void setPrintStyles()
          Mutator called by ArgumentParser via printStylesArg.
 void setRouteColor(String color)
          Mutator called by ArgumentParser for the routeColorArg Argument.
 void setRouteLabel(boolean label)
          Mutator called by ArgumentParser for the routeLabelArg Argument.
 void setRoutepointRadius(int radius)
          Mutator call by ArgumentParser for the routePointRadiusArg Argument.
 void setRoutepointStyle(String style)
          Mutator called by ArgumentParser for the routePointStyleArg Argument.
 void setTrackColor(String color)
          Mutator called by ArgumentParser for the trackColorArg Argument.
 void setTrackLabel(boolean label)
          Mutator called by ArgumentParser for the trackLabelArg Argument.
 void setTrackpointRadius(int radius)
          Mutator call by ArgumentParser for the trackPointRadiusArg Argument.
 void setTrackpointStyle(String style)
          Mutator called by ArgumentParser for the trackPointStyleArg Argument.
 void setWaypointColor(String color)
          Mutator called by ArgumentParser for the wayPointColorArg Argument.
 void setWaypointRadius(int radius)
          Mutator call by ArgumentParser for the wayPointRadiusArg Argument.
 void setWaypointStyle(String style)
          Mutator called by ArgumentParser for the wayPointStyleArg Argument.
private  String toHexString(int value, int minDigits)
          Helper method that converts an integer to a hexadecimal string with at least the given number of digits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAP_SOURCE

public static final String DEFAULT_MAP_SOURCE
Default map source name.

See Also:
Constant Field Values

DEFAULT_COLOR

public static final Color DEFAULT_COLOR
Default color.


DEFAULT_STYLE

public static final MarkerStyle DEFAULT_STYLE
Default marker style.


DEFAULT_OUTPUT

public static final String DEFAULT_OUTPUT
Default output file.

See Also:
Constant Field Values

DEFAULT_TRACK_LABELING

public static final boolean DEFAULT_TRACK_LABELING
Default track labeling flag.

See Also:
Constant Field Values

DEFAULT_ROUTE_LABELING

public static final boolean DEFAULT_ROUTE_LABELING
Default route labeling flag.

See Also:
Constant Field Values

DEFAULT_STYLE_RADIUS

public static final int DEFAULT_STYLE_RADIUS
Default marker style radius.

See Also:
Constant Field Values

DEFAULT_JOIN_TRACK_SEGMENTS

public static final boolean DEFAULT_JOIN_TRACK_SEGMENTS
Default join track segments flag.

See Also:
Constant Field Values

STYLE_VALUE_FILE

private static final String STYLE_VALUE_FILE
Prefix for "file" marker style arguments.

See Also:
Constant Field Values

HELP_ARG

private static final String HELP_ARG
Argument name.

See Also:
Constant Field Values

PRINT_STYLES_ARG

private static final String PRINT_STYLES_ARG
Argument name.

See Also:
Constant Field Values

PRINT_COLORS_ARG

private static final String PRINT_COLORS_ARG
Argument name.

See Also:
Constant Field Values

LOCALE_ARG

private static final String LOCALE_ARG
Argument name.

See Also:
Constant Field Values

MAP_SOURCE_ARG

private static final String MAP_SOURCE_ARG
Argument name.

See Also:
Constant Field Values

CACHE_DIR_ARG

private static final String CACHE_DIR_ARG
Argument name.

See Also:
Constant Field Values

MAP_PROPERTY_ARG_PREFIX

static final String MAP_PROPERTY_ARG_PREFIX
Prefix for map source property arguments.

See Also:
Constant Field Values

OUTPUT_ARG

private static final String OUTPUT_ARG
Argument name.

See Also:
Constant Field Values

GPSDATA_ARG

private static final String GPSDATA_ARG
Argument name.

See Also:
Constant Field Values

IGNORE_TRACKS_ARG

private static final String IGNORE_TRACKS_ARG
Argument name.

See Also:
Constant Field Values

IGNORE_WAYPOINTS_ARG

private static final String IGNORE_WAYPOINTS_ARG
Argument name.

See Also:
Constant Field Values

IGNORE_ROUTES_ARG

private static final String IGNORE_ROUTES_ARG
Argument name.

See Also:
Constant Field Values

TRACK_COLOR_ARG

private static final String TRACK_COLOR_ARG
Argument name.

See Also:
Constant Field Values

WAYPOINT_COLOR_ARG

private static final String WAYPOINT_COLOR_ARG
Argument name.

See Also:
Constant Field Values

ROUTE_COLOR_ARG

private static final String ROUTE_COLOR_ARG
Argument name.

See Also:
Constant Field Values

TRACKPOINT_STYLE_ARG

private static final String TRACKPOINT_STYLE_ARG
Argument name.

See Also:
Constant Field Values

TRACKPOINT_RADIUS_ARG

private static final String TRACKPOINT_RADIUS_ARG
Argument name.

See Also:
Constant Field Values

WAYPOINT_STYLE_ARG

private static final String WAYPOINT_STYLE_ARG
Argument name.

See Also:
Constant Field Values

WAYPOINT_RADIUS_ARG

private static final String WAYPOINT_RADIUS_ARG
Argument name.

See Also:
Constant Field Values

ROUTEPOINT_STYLE_ARG

private static final String ROUTEPOINT_STYLE_ARG
Argument name.

See Also:
Constant Field Values

ROUTEPOINT_RADIUS_ARG

private static final String ROUTEPOINT_RADIUS_ARG
Argument name.

See Also:
Constant Field Values

TRACK_LABEL_ARG

private static final String TRACK_LABEL_ARG
Argument name.

See Also:
Constant Field Values

ROUTE_LABEL_ARG

private static final String ROUTE_LABEL_ARG
Argument name.

See Also:
Constant Field Values

FONT_SIZE_ARG

private static final String FONT_SIZE_ARG
Argument name.

See Also:
Constant Field Values

FONT_NAME_ARG

private static final String FONT_NAME_ARG
Argument name.

See Also:
Constant Field Values

BOUNDING_ARG

private static final String BOUNDING_ARG
Argument name.

See Also:
Constant Field Values

MARGIN_ARG

private static final String MARGIN_ARG
Argument name.

See Also:
Constant Field Values

JOIN_TRACK_SEGMENTS_ARG

private static final String JOIN_TRACK_SEGMENTS_ARG
Argument name.

See Also:
Constant Field Values

MAP_SOURCE_USAGE

private static final String MAP_SOURCE_USAGE
Map source usage detail.

See Also:
Constant Field Values

MAP_SOURCE_DESC

private static final String MAP_SOURCE_DESC
Map source description.

See Also:
Constant Field Values

HELP_USAGE

private static final String HELP_USAGE
Help usage detail.

See Also:
Constant Field Values

colorChoices

private static List<us.zuercher.argslib.ArgumentChoice> colorChoices
Available color choices.


styleChoices

private static List<us.zuercher.argslib.ArgumentChoice> styleChoices
Available marker style choices.


sourceChoices

private static List<us.zuercher.argslib.ArgumentChoice> sourceChoices
Available map source choices.


helpArg

private us.zuercher.argslib.Argument helpArg
Argument.


printStylesArg

private us.zuercher.argslib.Argument printStylesArg
Argument.


printColorsArg

private us.zuercher.argslib.Argument printColorsArg
Argument.


localeArg

private us.zuercher.argslib.Argument localeArg
Argument.


outputArg

private us.zuercher.argslib.Argument outputArg
Argument.


ignoreWayPointsArg

private us.zuercher.argslib.Argument ignoreWayPointsArg
Argument.


ignoreTracksArg

private us.zuercher.argslib.Argument ignoreTracksArg
Argument.


ignoreRoutesArg

private us.zuercher.argslib.Argument ignoreRoutesArg
Argument.


cacheDirArg

private us.zuercher.argslib.Argument cacheDirArg
Argument.


boundingByTracks

static us.zuercher.argslib.ArgumentChoice boundingByTracks
Argument choice.


boundingByWayPoints

static us.zuercher.argslib.ArgumentChoice boundingByWayPoints
Argument choice.


boundingByRoutes

static us.zuercher.argslib.ArgumentChoice boundingByRoutes
Argument choice.


boundingByCoords

static us.zuercher.argslib.ArgumentChoice boundingByCoords
Argument choice.


boundingByAll

static us.zuercher.argslib.ArgumentChoice boundingByAll
Argument choice.


boundingArg

private us.zuercher.argslib.Argument boundingArg
Argument.


marginMetersChoice

static us.zuercher.argslib.ArgumentChoice marginMetersChoice
Argument choice.


marginPixelsChoice

static us.zuercher.argslib.ArgumentChoice marginPixelsChoice
Argument choice.


marginArg

private us.zuercher.argslib.Argument marginArg
Argument.


trackColorArg

private us.zuercher.argslib.Argument trackColorArg
Argument.


trackLabelArg

private us.zuercher.argslib.Argument trackLabelArg
Argument.


trackPointStyleArg

private us.zuercher.argslib.Argument trackPointStyleArg
Argument.


trackPointRadiusArg

private us.zuercher.argslib.Argument trackPointRadiusArg
Argument.


wayPointColorArg

private us.zuercher.argslib.Argument wayPointColorArg
Argument.


wayPointStyleArg

private us.zuercher.argslib.Argument wayPointStyleArg
Argument.


wayPointRadiusArg

private us.zuercher.argslib.Argument wayPointRadiusArg
Argument.


routeColorArg

private us.zuercher.argslib.Argument routeColorArg
Argument.


routeLabelArg

private us.zuercher.argslib.Argument routeLabelArg
Argument.


routePointStyleArg

private us.zuercher.argslib.Argument routePointStyleArg
Argument.


routePointRadiusArg

private us.zuercher.argslib.Argument routePointRadiusArg
Argument.


fontNameArg

private us.zuercher.argslib.Argument fontNameArg
Argument.


fontSizeArg

private us.zuercher.argslib.Argument fontSizeArg
Argument.


joinTrackSegmentsArg

private us.zuercher.argslib.Argument joinTrackSegmentsArg
Argument.


main

private final Gpx2Map main
Map plotter object.


printHelp

private boolean printHelp
If true, print help.


printColors

private boolean printColors
If true, print colors.


printStyles

private boolean printStyles
If true, print styles.


locale

private String locale
If set, the GUI locale to display.

Constructor Detail

MainArgumentParser

public MainArgumentParser(Gpx2Map main)
Constructs a new MainArgumentParser with the given Gpx2Map.

Parameters:
main - a Gpx2Map
Method Detail

parseArgs

public int parseArgs(String... args)
Parse the given arguments and apply them to the Gpx2Map object given in the constructor for this instance. Arguments may be parsed multiple times. See configureArgumentParser(String[]) and know that this method itself parses arguments twice. First, arguments are parsed with a this class as a target to determine if the user requested help information, the printing of styles, or the printing of colors. If none of those is true, arguments are parsed again with the Gpx2Map object given in the constructor as the argument parser target.

Parameters:
args - command-line arguments
Returns:
result code

printHelp

public void printHelp(String... args)
Output help information for the given arguments. Attempts to configure a MapSource in order to provide information about map source properties.

Parameters:
args - command-line arguments.

configureArgumentParser

private us.zuercher.argslib.ArgumentSetParser configureArgumentParser(String... args)
Configure an ArgumentSetParser for the given arguments. This method parses arguments the given arguments. It uses a dummy target to determine the requested map source name, configures that MapSource and then queries it for property information. Then it uses that information to construct another ArgumentSetParser will all available arguments.

Parameters:
args - command-line arguments
Returns:
an ArgumentSetParser for parsing the command-line arguments

printColors

private void printColors()
Prints the available Colors to System.out.


printStyles

private void printStyles()
Prints the available styles to System.out.


toHexString

private String toHexString(int value,
                           int minDigits)
Helper method that converts an integer to a hexadecimal string with at least the given number of digits. First converts the integer to a hexadecimal string. If the result does not have enough digits to satisfy the requirements, zeroes (0) are pre-pended to the string until it has minDigits digits.

Parameters:
value - integer to convert
minDigits - minimum number of hex digits
Returns:
hexadecimal representation of value with at least minDigits digits.

getStyleChoices

private static List<us.zuercher.argslib.ArgumentChoice> getStyleChoices()
Creates a List or ArgumentChoice objects for use in initializing style-based Arguments.

Returns:
a List or ArgumentChoice objects

getColorChoices

private static List<us.zuercher.argslib.ArgumentChoice> getColorChoices()
Creates a List or ArgumentChoice objects for use in initializing Color-based Arguments.

Returns:
a List or ArgumentChoice objects

getSourceChoices

private static List<us.zuercher.argslib.ArgumentChoice> getSourceChoices()
Creates a List or ArgumentChoice objects for use in initializing the MapSource selection Argument.

Returns:
a List or ArgumentChoice objects

quit

private void quit(int resultCode)
Force parseArgs(String[]) to return with the given result code.

Parameters:
resultCode - error result code

getColor

private Color getColor(String colorName,
                       int error)
Look up the given color name. If the color cannot be found, quits with the given result code.

Parameters:
colorName - color name
error - error result code
Returns:
the Color specified by colorName
Throws:
MainArgumentParser.Exit - if there's an error.

getStyle

private MarkerStyle getStyle(String styleName,
                             int errorStyle)
Look up the given style name. If the Style cannot be found, quits with the given result code.

Parameters:
styleName - color name
errorStyle - error result code
Returns:
the MarkerStyle specified by styleName
Throws:
MainArgumentParser.Exit - if there's an error.
RuntimeException - if the given style name is not in Style.values() (meaning you probably added a non-Style MakerStyle implementation, provided an ArgumentChoice for it, but aren't detecting it here.)

setLocale

public void setLocale(String locale)
Mutator called by ArgumentSetParser via localeArg.

Parameters:
locale - the locale to display in the GUI

setHelp

public void setHelp()
Mutator called by ArgumentParser via helpArg.


setPrintColors

public void setPrintColors()
Mutator called by ArgumentParser via printColorsArg.


setPrintStyles

public void setPrintStyles()
Mutator called by ArgumentParser via printStylesArg.


setMapSource

public void setMapSource(String mapSourceName)
Mutator called by ArgumentParser for the MapSource name Argument.

Parameters:
mapSourceName - the requested map source name

set

public void set(String mapSourceProperty,
                String value)
Mutator called by ArgumentParser for the MapSource properties Arguments.

Parameters:
mapSourceProperty - the requested map source property
value - the value of the property

addGpsdata

public void addGpsdata(String gpsDataArg)
Mutator called by ArgumentParser for the GPX data file Argument.

Parameters:
gpsDataArg - the requested GPX filename

setOutput

public void setOutput(String output)
Mutator called by ArgumentParser for the outputArg Argument.

Parameters:
output - the requested output filename

setCacheDir

public void setCacheDir(String cacheDir)
Mutator called by ArgumentParser for the cacheDirArg Argument.

Parameters:
cacheDir - the requested cache directory's name

setIgnoreTracks

public void setIgnoreTracks()
Mutator called by ArgumentParser for the ignoreTracksArg Argument.


setIgnoreWaypoints

public void setIgnoreWaypoints()
Mutator called by ArgumentParser for the ignoreWayPointsArg Argument.


setIgnoreRoutes

public void setIgnoreRoutes()
Mutator called by ArgumentParser for the ignoreRoutesArg Argument.


setBounding

public void setBounding(String choice)
Mutator called by ArgumentParser for the boundingArg Argument.

Parameters:
choice - the user's bounding choice
Throws:
MainArgumentParser.Exit - if bounding coordinates for boundingByCoords are invalid
RuntimeException - if there's an internal error (meaning that ArgumentParser felt the given choice was valid, but this method doesn't understand it: e.g., you added a choice and left it out of this method's implementation.)

setMargin

public void setMargin(String margin)
Mutator called by ArgumentParser for the marginArg Argument.

Parameters:
margin - the margin choice

setTrackColor

public void setTrackColor(String color)
Mutator called by ArgumentParser for the trackColorArg Argument.

Parameters:
color - the track color name
Throws:
MainArgumentParser.Exit - if the color name cannot be converted to a Color.

setTrackLabel

public void setTrackLabel(boolean label)
Mutator called by ArgumentParser for the trackLabelArg Argument.

Parameters:
label - the value of the argument

setTrackpointStyle

public void setTrackpointStyle(String style)
Mutator called by ArgumentParser for the trackPointStyleArg Argument.

Parameters:
style - the name of the style
Throws:
MainArgumentParser.Exit - if the style name cannot be converted to a MarkerStyle.
RuntimeException - see getStyle(String, int)

setTrackpointRadius

public void setTrackpointRadius(int radius)
Mutator call by ArgumentParser for the trackPointRadiusArg Argument.

Parameters:
radius - the style radius (size)

setJoinTrackSegments

public void setJoinTrackSegments(boolean join)
Mutator call by ArgumentParser for the joinTrackSegmentsArg Argument.

Parameters:
join - the join track segments flag value

setWaypointColor

public void setWaypointColor(String color)
Mutator called by ArgumentParser for the wayPointColorArg Argument.

Parameters:
color - the way-point color name
Throws:
MainArgumentParser.Exit - if the color name cannot be converted to a Color.

setWaypointStyle

public void setWaypointStyle(String style)
Mutator called by ArgumentParser for the wayPointStyleArg Argument.

Parameters:
style - the name of the style
Throws:
MainArgumentParser.Exit - if the style name cannot be converted to a MarkerStyle.
RuntimeException - see getStyle(String, int)

setWaypointRadius

public void setWaypointRadius(int radius)
Mutator call by ArgumentParser for the wayPointRadiusArg Argument.

Parameters:
radius - the style radius (size)

setRouteColor

public void setRouteColor(String color)
Mutator called by ArgumentParser for the routeColorArg Argument.

Parameters:
color - the route color name
Throws:
MainArgumentParser.Exit - if the color name cannot be converted to a Color.

setRouteLabel

public void setRouteLabel(boolean label)
Mutator called by ArgumentParser for the routeLabelArg Argument.

Parameters:
label - the value of the argument

setRoutepointStyle

public void setRoutepointStyle(String style)
Mutator called by ArgumentParser for the routePointStyleArg Argument.

Parameters:
style - the name of the style
Throws:
MainArgumentParser.Exit - if the style name cannot be converted to a MarkerStyle.
RuntimeException - see getStyle(String, int)

setRoutepointRadius

public void setRoutepointRadius(int radius)
Mutator call by ArgumentParser for the routePointRadiusArg Argument.

Parameters:
radius - the style radius (size)

setFontName

public void setFontName(String fontName)
Mutator call by ArgumentParser for the fontNameArg Argument.

Parameters:
fontName - the font name to use

setFontSize

public void setFontSize(float size)
Mutator call by ArgumentParser for the fontSizeArg Argument.

Parameters:
size - the font size, in points