com.moximedia.ows.acetate
Class AcetateTextMarker

java.lang.Object
  extended bycom.moximedia.ows.acetate.AcetateTextMarker
All Implemented Interfaces:
AcetateObject, java.lang.Cloneable, java.io.Serializable

public class AcetateTextMarker
extends java.lang.Object
implements AcetateObject, java.io.Serializable, java.lang.Cloneable

Implementation of a TrueType text marker symbol. TODO: enable rotation.

Author:
Doug Cates - www.moximedia.com
See Also:
Serialized Form

Constructor Summary
AcetateTextMarker()
          Creates new AcetateTextMarker
AcetateTextMarker(double x, double y)
          Creates new AcetateTextMarker with a position.
AcetateTextMarker(double x, double y, double rotation)
          Creates new AcetateTextMarker with a position and a rotation.
AcetateTextMarker(Point position)
          Creates new AcetateTextMarker with a position.
AcetateTextMarker(Point position, double rotation)
          Creates new AcetateTextMarker with a position and a rotation.
 
Method Summary
 java.lang.Object clone()
          Creates a clone of this object.
 void draw(java.awt.Graphics2D graphics, java.awt.geom.AffineTransform pageTransform, java.util.Locale locale)
          Draws the graphic on the specified graphics device.
 AcetateTextMarker getCopy()
          Creates a copy of this object.
 java.lang.String getName()
          Gets the progammer specified name for this object.
 java.lang.Object getObjectTag()
          Gets the object tag.
 int getObjectType()
          Returns the object type.
 java.lang.String getProperty(java.lang.String name)
          Gets the value of a property.
 java.lang.String[] getPropertyNames()
          Returns a Set containing the property names.
 Geometry getShape()
          Returns the object geometry.
 boolean hasProperties()
          Returns an indicator of whether the object has programmer defined properties.
 boolean isNamed(java.lang.String name)
          Returns an indicator of whether this object is named the same as the parameter.
 void setCharacter(char character)
          Sets the character used for this marker.
 void setColor(java.awt.Color color)
          Sets the marker color.
 void setFont(java.awt.Font font)
          Sets the font used for the marker.
 void setName(java.lang.String name)
          Sets a name for this object.
 void setObjectTag(java.lang.Object tag)
          Sets an object tag for this object.
 void setPosition(double x, double y)
          Sets the position of the object.
 void setPosition(Point point)
          Sets the position of the object.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the value of a property (programmer defined).
 void setRotation(double degrees)
          Sets the angle of the marker.
 void setUnits(int units)
          Sets the units of the acetate object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcetateTextMarker

public AcetateTextMarker()
Creates new AcetateTextMarker


AcetateTextMarker

public AcetateTextMarker(Point position)
Creates new AcetateTextMarker with a position.

Parameters:
position - The marker position.

AcetateTextMarker

public AcetateTextMarker(Point position,
                         double rotation)
Creates new AcetateTextMarker with a position and a rotation.

Parameters:
position - The marker position.
rotation - The marker angle.

AcetateTextMarker

public AcetateTextMarker(double x,
                         double y)
Creates new AcetateTextMarker with a position.

Parameters:
x - The x coordinate value.
y - The y coordinate value.

AcetateTextMarker

public AcetateTextMarker(double x,
                         double y,
                         double rotation)
Creates new AcetateTextMarker with a position and a rotation.

Parameters:
x - The x coordinate value.
y - The y coordinate value.
Method Detail

setCharacter

public void setCharacter(char character)
Sets the character used for this marker.

Parameters:
character - The character.

clone

public java.lang.Object clone()
Creates a clone of this object. Must be cast back to the correct object type before using. Consider using getCopy() instead.

Specified by:
clone in interface AcetateObject
Returns:
The clone of this object.

getCopy

public AcetateTextMarker getCopy()
Creates a copy of this object.

Returns:
The copy of this object.

setColor

public void setColor(java.awt.Color color)
Sets the marker color.

Parameters:
color - The color.

draw

public void draw(java.awt.Graphics2D graphics,
                 java.awt.geom.AffineTransform pageTransform,
                 java.util.Locale locale)
Draws the graphic on the specified graphics device.

Specified by:
draw in interface AcetateObject
Parameters:
graphics - The graphics.
pageTransform - The page to map coordinate transformation matrix.
locale - The locale, null OK, not used by this routine.

setFont

public void setFont(java.awt.Font font)
Sets the font used for the marker.

Parameters:
font - The font.

isNamed

public boolean isNamed(java.lang.String name)
Returns an indicator of whether this object is named the same as the parameter.

Specified by:
isNamed in interface AcetateObject
Parameters:
name - The name.
Returns:
True if the name is the same, otherwise false.

setName

public void setName(java.lang.String name)
Sets a name for this object.

Parameters:
name - A programmer specified name for this object.

getName

public java.lang.String getName()
Gets the progammer specified name for this object.

Specified by:
getName in interface AcetateObject
Returns:
The name, or "unnamed" if there isn't one set.

setObjectTag

public void setObjectTag(java.lang.Object tag)
Sets an object tag for this object.

Specified by:
setObjectTag in interface AcetateObject
Parameters:
tag - A programmer specified object to associate to this object.

getObjectTag

public java.lang.Object getObjectTag()
Gets the object tag.

Specified by:
getObjectTag in interface AcetateObject
Returns:
The object tag, or null if there isn't one set.

getObjectType

public int getObjectType()
Returns the object type.

Specified by:
getObjectType in interface AcetateObject
Returns:
Always returns ACETATE_OBJECT_TYPE_TEXT_MARKER

setPosition

public void setPosition(Point point)
Sets the position of the object.

Parameters:
point - The position.

setPosition

public void setPosition(double x,
                        double y)
Sets the position of the object.

Parameters:
x - The X coordinate value.
y - The Y coordinate value.

getProperty

public java.lang.String getProperty(java.lang.String name)
Gets the value of a property.

Specified by:
getProperty in interface AcetateObject
Parameters:
name - The property name
Returns:
The property value, or null.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Sets the value of a property (programmer defined).

Specified by:
setProperty in interface AcetateObject
Parameters:
name - The property name
value - The property value.

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns a Set containing the property names.

Specified by:
getPropertyNames in interface AcetateObject
Returns:
The set containing the names, or null.

hasProperties

public boolean hasProperties()
Returns an indicator of whether the object has programmer defined properties.

Specified by:
hasProperties in interface AcetateObject
Returns:
True if properties exist, otherwise false.

setRotation

public void setRotation(double degrees)
Sets the angle of the marker.

Parameters:
degrees - The angle in degrees.

getShape

public Geometry getShape()
Returns the object geometry.

Specified by:
getShape in interface AcetateObject
Returns:
The geometry, a point.

setUnits

public void setUnits(int units)
Sets the units of the acetate object.

Parameters:
units - The units of the acetate object, either ACETATE_OBJECT_UNITS_PIXEL or ACETATE_OBJECT_UNITS_DATABASE.


Internet Mapping Framework for OpenGIS Java Object Model API (v1.3.007)
Copyright © 2005 Moxi Media Inc. and Province of British Columbia. All Rights Reserved.