|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectus.zuercher.gpx2map.plotter.AbstractPlotter
us.zuercher.gpx2map.plotter.AbstractTextPlotter
abstract class AbstractTextPlotter
AbstractTextPlotter extends AbstractPlotter to provide marker labelling capabilities.
| Field Summary | |
|---|---|
static String |
DEFAULT_FONT_NAME
Default font name. |
static float |
DEFAULT_FONT_SIZE
Default font size. |
private Font |
font
Java AWT Font instance. |
private String |
fontname
Configured font name. |
private float |
fontsize
Configured font size. |
private static int |
INITIAL_TEXT_Z_ORDERING
Initial Z-ordering for text. |
private List<Label> |
labels
List of Labels to be applied to the image. |
private static String |
SAFE_FONT_NAME
Fallback font name if the default cannot be loaded. |
| Constructor Summary | |
|---|---|
protected |
AbstractTextPlotter(File netpbmFile,
MapSource mapSource)
Constructs an AbstractTextPlotter for the given Netpbm file and map source. |
| Method Summary | |
|---|---|
private void |
addTextShapes()
Generates Shape instance for each label. |
protected void |
drawLabel(String labelString,
Point adjacentTo,
int distance,
Color color)
Add a new label to the plotter. |
void |
execute(ProgressMeter meter)
Convert the configured Labels and plot them along with
all other configured AbstractShapes on the
image. |
void |
setFontName(String fontname)
Changes the configured font name. |
void |
setFontSize(float fontsize)
Changes the configured font size. |
| 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 |
|---|
private static final int INITIAL_TEXT_Z_ORDERING
public static final String DEFAULT_FONT_NAME
private static final String SAFE_FONT_NAME
public static final float DEFAULT_FONT_SIZE
private String fontname
private float fontsize
private Font font
private List<Label> labels
Labels to be applied to the image.
| Constructor Detail |
|---|
protected AbstractTextPlotter(File netpbmFile,
MapSource mapSource)
netpbmFile - the Netpbm file to plot onmapSource - the map source that generated the image file.| Method Detail |
|---|
public void setFontSize(float fontsize)
drawLabel(String, Point, int, Color).
fontsize - new font size.public void setFontName(String fontname)
drawLabel(String, Point, int, Color).
fontname - the new font name
protected void drawLabel(String labelString,
Point adjacentTo,
int distance,
Color color)
labelString - label's textadjacentTo - location of the markerdistance - distance the text should be from the markercolor - text color
public void execute(ProgressMeter meter)
throws IOException
Labels and plot them along with
all other configured AbstractShapes on the
image.
execute in class AbstractPlottermeter - progress indicator
IOException - if there's an error reading the source image
or writing the target image.private void addTextShapes()
Shape instance for each label.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||