us.zuercher.gpx2map.plotter
Class WayPointPlotter

java.lang.Object
  extended by us.zuercher.gpx2map.plotter.AbstractPlotter
      extended by us.zuercher.gpx2map.plotter.AbstractTextPlotter
          extended by us.zuercher.gpx2map.plotter.WayPointPlotter
Direct Known Subclasses:
TrackPlotter

public class WayPointPlotter
extends AbstractTextPlotter

WayPointPlotter extends AbstractTextPlotter to draw way-points with optional labels.

Author:
Stephan Zuercher

Field Summary
private static int INITIAL_WPT_Z_ORDERING
          Initial Z-ordering for way-points.
 
Fields inherited from class us.zuercher.gpx2map.plotter.AbstractTextPlotter
DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE
 
Constructor Summary
WayPointPlotter(File netpbmFile, MapSource mapSource)
          Constructs a new WayPointPlotter for the given Netpbm file and the MapSource that generated it.
 
Method Summary
 void add(WayPoint wayPoint, Color color, MarkerStyle style, int styleRadius, boolean drawLabel)
          Adds a WayPoint to the plotter.
protected  void add(WayPoint wayPoint, Color color, MarkerStyle style, int styleRadius, boolean drawLabel, int initialZOrdering)
          Adds a WayPoint to the plotter with a specific initial Z-ordering.
protected  int computeDistance(MarkerStyle style, int styleRadius)
          Computes the distance from the center of the way-point marker to its label.
 
Methods inherited from class us.zuercher.gpx2map.plotter.AbstractTextPlotter
drawLabel, execute, setFontName, setFontSize
 
Methods inherited from class us.zuercher.gpx2map.plotter.AbstractPlotter
addLine, addShape, getCroppingRectangle, mapLocationToPixel, setCropping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_WPT_Z_ORDERING

private static final int INITIAL_WPT_Z_ORDERING
Initial Z-ordering for way-points. Way-points are drawn above track- and route- points, but below text. Within the set of all way-points, earlier way-points are rendered above later ones.

See Also:
Constant Field Values
Constructor Detail

WayPointPlotter

public WayPointPlotter(File netpbmFile,
                       MapSource mapSource)
Constructs a new WayPointPlotter for the given Netpbm file and the MapSource that generated it.

Parameters:
netpbmFile - the Netpbm file to plot on
mapSource - the MapSource that generated the Netpbm file.
Method Detail

add

public void add(WayPoint wayPoint,
                Color color,
                MarkerStyle style,
                int styleRadius,
                boolean drawLabel)
Adds a WayPoint to the plotter.

Parameters:
wayPoint - the WayPoint to plot.
color - color to plot the way-point's marker
style - style to plot the way-point's marker
styleRadius - size of the way-point's marker, if applicable
drawLabel - if true, the way-points name is rendered beside its marker.

add

protected void add(WayPoint wayPoint,
                   Color color,
                   MarkerStyle style,
                   int styleRadius,
                   boolean drawLabel,
                   int initialZOrdering)
Adds a WayPoint to the plotter with a specific initial Z-ordering.

Parameters:
wayPoint - the WayPoint to plot.
color - color to plot the way-point's marker
style - style to plot the way-point's marker
styleRadius - size of the way-point's marker, if applicable
drawLabel - if true, the way-points name is rendered beside its marker.
initialZOrdering - initial Z-ordering

computeDistance

protected int computeDistance(MarkerStyle style,
                              int styleRadius)
Computes the distance from the center of the way-point marker to its label.

Parameters:
style - the marker's style
styleRadius - the style's size, if applicable
Returns:
the distance away from the way-point's center to render text