com.moximedia.aims
Class AimsNorthArrowObject

java.lang.Object
  extended bycom.moximedia.aims.AimsNorthArrowObject
All Implemented Interfaces:
AimsAcetateObject, java.lang.Cloneable, java.io.Serializable

public class AimsNorthArrowObject
extends java.lang.Object
implements AimsAcetateObject, java.io.Serializable, java.lang.Cloneable

Implementation of an ArcIMS north arrow acetate object which can be placed in an Acetate layer of a map. Note that custom arrow objects cannot be defined with this object, but you can use a point object to add custom north arrows instead, and set the angle of the symbol using the static method getMapAngle(AimsMap map).

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

Field Summary
 
Fields inherited from interface com.moximedia.aims.AimsAcetateObject
ACETATE_OBJECT_TYPE_ENVELOPE, ACETATE_OBJECT_TYPE_LABELLEDPOINT, ACETATE_OBJECT_TYPE_LINE, ACETATE_OBJECT_TYPE_NORTHARROW, ACETATE_OBJECT_TYPE_POINT, ACETATE_OBJECT_TYPE_POLYGON, ACETATE_OBJECT_TYPE_POLYLINE, ACETATE_OBJECT_TYPE_SCALEBAR, ACETATE_OBJECT_TYPE_TEXT, ACETATE_OBJECT_UNITS_DATABASE, ACETATE_OBJECT_UNITS_PIXEL
 
Constructor Summary
AimsNorthArrowObject()
          Creates new AimsNorthArrowObject
AimsNorthArrowObject(AimsMap map)
          Creates new AimsNorthArrowObject for a specified map.
AimsNorthArrowObject(AimsMap map, int size)
          Creates new AimsNorthArrowObject for a specified map.
AimsNorthArrowObject(AimsMap map, Projection prj, int size)
           
 
Method Summary
 java.lang.Object clone()
          Creates a copy of this object.
 int getAcetateObjectType()
          Gets the acetate object type.
 AimsEnvelope getExtent()
          Always returns null.
static double getMapAngle(AimsMap map)
          Gets the map angle of the specified map centre.
static double getMapAngle(AimsMap map, Projection prj)
          Gets the map angle of the specified map centre.
 double getMaxScale()
          Returns the maximum scale that the object will be displayed.
 double getMinScale()
          Returns the minimum scale that the object will be displayed.
 java.lang.Object getObjectTag()
          Gets the object tag.
 java.lang.String getProperty(java.lang.String name)
          Gets the value of a property.
 java.util.Set getPropertyNames()
          Returns a Set containing the property names.
 int getUnits()
           
 java.lang.String getUnitsString()
           
 boolean hasProperties()
          Returns an indicator of whether the object has programmer defined properties.
 void setAngle(double angle)
          Sets the value of attribute angle.
 void setAntialiasing(boolean antialiasing)
          Sets the value of attribute antialising.
 void setCoordsys(AimsCoordsys coordsys)
          Sets the coordsys for this object.
 void setLocation(double x, double y)
          Sets the location of the north arrow.
 void setMapAngle(AimsMap map)
          Sets the north arrow angle to the angle of the specified map centre.
 void setMaxScale(double scale, AimsMap map)
           
 void setMaxScaleFactor(double unitsPerPixel)
           
 void setMinScale(double scale, AimsMap map)
           
 void setMinScaleFactor(double unitsPerPixel)
           
 void setObjectTag(java.lang.Object tag)
          Sets an object tag for this object.
 void setOutline(AimsColor color)
          Sets the value of attribute outline.
 void setOverlap(boolean overlap)
          Sets the value of attribute overlap.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the value of a property (programmer defined).
 void setShadow(AimsColor color)
          Sets the value of attribute shadow.
 void setSize(int size)
          Sets the size of the north arrow.
 void setTransparency(double transparency)
          Sets the value of this object's transparency.
 void setType(int arrowType)
          Sets the value of the north arrow's arrow type.
 void setUnits(int units)
          Sets the units of the acetate object.
 void setUnits(java.lang.String units)
          Sets the units of the acetate object.
 java.lang.String toAxlString()
          Returns the AXL string to refresh this object, using the default environment coordinate separators.
 java.lang.String toAxlString(AimsEnvironment env)
          Returns the AXL string to refresh this object, using the coordinate separators in the specified environnment setting.
 java.lang.String toString()
          Returns a string containing a text description of this object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AimsNorthArrowObject

public AimsNorthArrowObject()
Creates new AimsNorthArrowObject


AimsNorthArrowObject

public AimsNorthArrowObject(AimsMap map)
Creates new AimsNorthArrowObject for a specified map. This method assumes that the coordinates are in BCAlbers. The north arrow is placed at a fixed position on the map.

Parameters:
map - The map to use to position the north arrow.

AimsNorthArrowObject

public AimsNorthArrowObject(AimsMap map,
                            int size)
Creates new AimsNorthArrowObject for a specified map. This method assumes that the coordinates are in BCAlbers. The north arrow is placed at a fixed position on the map.

Parameters:
map - The map to use to position the north arrow.
size - The size of the north arrow

AimsNorthArrowObject

public AimsNorthArrowObject(AimsMap map,
                            Projection prj,
                            int size)
Method Detail

getProperty

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

Specified by:
getProperty in interface AimsAcetateObject
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 AimsAcetateObject
Parameters:
name - The property name
value - The property value.

getPropertyNames

public java.util.Set getPropertyNames()
Returns a Set containing the property names.

Specified by:
getPropertyNames in interface AimsAcetateObject
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 AimsAcetateObject
Returns:
True if properties exist, otherwise false.

setObjectTag

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

Specified by:
setObjectTag in interface AimsAcetateObject

getObjectTag

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

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

clone

public java.lang.Object clone()
Creates a copy of this object.

Specified by:
clone in interface AimsAcetateObject
Returns:
An object that is a copy of this object. Note that the returned value is a java.lang.Object that must be cast to an AimsNorthArrowObject before use.

setCoordsys

public void setCoordsys(AimsCoordsys coordsys)
Sets the coordsys for this object.

Parameters:
coordsys - The coordsys for this object.

getMaxScale

public double getMaxScale()
Returns the maximum scale that the object will be displayed.

Returns:
The maximum scale that the object will be displayed.

getMinScale

public double getMinScale()
Returns the minimum scale that the object will be displayed.

Returns:
The minimum scale that the object will be displayed.

getMapAngle

public static double getMapAngle(AimsMap map,
                                 Projection prj)
Gets the map angle of the specified map centre.

Parameters:
map - An AimsMap object for which the angle is requested.
prj - The projection of the map.Note that
Returns:
The map angle.

getMapAngle

public static double getMapAngle(AimsMap map)
Gets the map angle of the specified map centre.

Parameters:
map - An AimsMap object for which the angle is requested. Note that this method should be used on BC Albers projection maps only.

setMapAngle

public void setMapAngle(AimsMap map)
Sets the north arrow angle to the angle of the specified map centre.

Parameters:
map - An AimsMap object for which the angle should apply. Note that this method should be used on BC Albers projection maps only

setMinScale

public void setMinScale(double scale,
                        AimsMap map)

setMinScaleFactor

public void setMinScaleFactor(double unitsPerPixel)

setMaxScale

public void setMaxScale(double scale,
                        AimsMap map)

setMaxScaleFactor

public void setMaxScaleFactor(double unitsPerPixel)

setLocation

public void setLocation(double x,
                        double y)
Sets the location of the north arrow.

Parameters:
x - The x location of the north arrow.
y - The y location of the north arrow.

setType

public void setType(int arrowType)
Sets the value of the north arrow's arrow type.

Parameters:
arrowType - The arrow type (1 - 8).

setAngle

public void setAngle(double angle)
Sets the value of attribute angle.

Parameters:
angle - The attribute value.

setAntialiasing

public void setAntialiasing(boolean antialiasing)
Sets the value of attribute antialising.

Parameters:
antialiasing - The attribute value.

setOutline

public void setOutline(AimsColor color)
Sets the value of attribute outline.

Parameters:
color - The attribute value.

setOverlap

public void setOverlap(boolean overlap)
Sets the value of attribute overlap.

Parameters:
overlap - The attribute value.

setShadow

public void setShadow(AimsColor color)
Sets the value of attribute shadow.

Parameters:
color - The attribute value.

setSize

public void setSize(int size)
Sets the size of the north arrow.

Parameters:
size - The size of the north arrow.

setTransparency

public void setTransparency(double transparency)
Sets the value of this object's transparency.

Parameters:
transparency - The transparency value (0.0 - 1.0).

toString

public java.lang.String toString()
Returns a string containing a text description of this object.

Returns:
A text description of this object.

toAxlString

public java.lang.String toAxlString()
Returns the AXL string to refresh this object, using the default environment coordinate separators. This method is not typically used by the application programmer.

Specified by:
toAxlString in interface AimsAcetateObject
Returns:
The AXL string to refresh this object.

toAxlString

public java.lang.String toAxlString(AimsEnvironment env)
Returns the AXL string to refresh this object, using the coordinate separators in the specified environnment setting. This method is not typically used by the application programmer.

Specified by:
toAxlString in interface AimsAcetateObject
Parameters:
env - The environment object containing coordinate separators.
Returns:
The AXL string to refresh this object.

getAcetateObjectType

public int getAcetateObjectType()
Gets the acetate object type.

Specified by:
getAcetateObjectType in interface AimsAcetateObject
Returns:
AimsAcetateObject.ACETATE_OBJECT_TYPE_NORTHARROW.

setUnits

public void setUnits(java.lang.String units)
Sets the units of the acetate object. Valid values are "pixel" and "database".

Parameters:
units - The units of the acetate object. Valid values are "pixel" and "database".

setUnits

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

Specified by:
setUnits in interface AimsAcetateObject
Parameters:
units - The units of the acetate object. Valid values are AimsAcetateObject.ACETATE_OBJECT_UNITS_DATABASE or AimsAcetateObject.ACETATE_OBJECT_UNITS_PIXEL.

getUnits

public int getUnits()
Specified by:
getUnits in interface AimsAcetateObject

getUnitsString

public java.lang.String getUnitsString()

getExtent

public AimsEnvelope getExtent()
Always returns null.

Specified by:
getExtent in interface AimsAcetateObject


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