com.partnersoft.maps.ephemera
Class AbstractUpdatingTextEphemeron

java.lang.Object
  extended by com.partnersoft.maps.ephemera.TextEphemeron
      extended by com.partnersoft.maps.ephemera.AbstractUpdatingTextEphemeron
All Implemented Interfaces:
Ephemeron
Direct Known Subclasses:
AngleDistanceTextEphemeron

public abstract class AbstractUpdatingTextEphemeron
extends TextEphemeron

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Rich Stepanski

Field Summary
 
Fields inherited from class com.partnersoft.maps.ephemera.TextEphemeron
alignment, isPixels, mapset, offsetX, offsetY, rotation, text, textStyle
 
Constructor Summary
AbstractUpdatingTextEphemeron(MapSet mapset, XyPoint anchor, java.lang.String textStyle)
           
AbstractUpdatingTextEphemeron(XyPoint anchor, java.lang.String textStyle)
           
 
Method Summary
 void draw(DrawingSurface surface, MapViewFrame frame, XyPoint mousePosition)
          Draw appropriate graphics on the given surface with the given frame, mouse position, and any implementation-specific internal state.
abstract  void mangleText(DrawingSurface surface, MapViewFrame frame, XyPoint anchor, XyPoint mousePosition)
          Called from each draw cycle.
 void setAlignment(int align)
           
 void setOffsetX(int x)
          X Offset from mouse position in map units.
 void setOffsetX(int x, boolean isPixels)
          X offset for text from mouse position.
 void setOffsetY(int y)
          Y Offset from mouse position in map units.
 void setOffsetY(int y, boolean isPixels)
          Y offset for text from mouse position.
 void setRotation(int rotate)
           
 void setText(java.lang.String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractUpdatingTextEphemeron

public AbstractUpdatingTextEphemeron(MapSet mapset,
                                     XyPoint anchor,
                                     java.lang.String textStyle)
Parameters:
mapset - - Mapset containing style.
anchor - - Point to find distance and angle from.
textStyle - - TextStyle name to use.

AbstractUpdatingTextEphemeron

public AbstractUpdatingTextEphemeron(XyPoint anchor,
                                     java.lang.String textStyle)
Parameters:
anchor - - Point to find distance and angle from.
textStyle - - TextStyle name to use. Must exist in Ephemeron mapset.
Method Detail

mangleText

public abstract void mangleText(DrawingSurface surface,
                                MapViewFrame frame,
                                XyPoint anchor,
                                XyPoint mousePosition)
Called from each draw cycle. Text can be mangled in anyway fit by super class. Default x,y is mousePosition. All offsets are done relative to it.

Parameters:
surface -
frame -
mousePosition -

setText

public void setText(java.lang.String text)

setOffsetX

public void setOffsetX(int x)
X Offset from mouse position in map units.

Parameters:
x -

setOffsetY

public void setOffsetY(int y)
Y Offset from mouse position in map units.

Parameters:
y -

setOffsetX

public void setOffsetX(int x,
                       boolean isPixels)
X offset for text from mouse position.

Parameters:
x -
isPixels - - true if x is in pixels.

setOffsetY

public void setOffsetY(int y,
                       boolean isPixels)
Y offset for text from mouse position.

Parameters:
y -
isPixels - - true if y is in pixels.

setAlignment

public void setAlignment(int align)

setRotation

public void setRotation(int rotate)

draw

public void draw(DrawingSurface surface,
                 MapViewFrame frame,
                 XyPoint mousePosition)
Description copied from interface: Ephemeron
Draw appropriate graphics on the given surface with the given frame, mouse position, and any implementation-specific internal state. The drawing surface is set up with the given frame, and is in map coordinates (not pixels).

Specified by:
draw in interface Ephemeron
Overrides:
draw in class TextEphemeron