com.moximedia.aims
Class AimsScalebarObject

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

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

Implementation of an ArcIMS scalebar object which can be placed in an Acetate layer of a 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
AimsScalebarObject()
          Creates new AimsScalebar
AimsScalebarObject(AimsMap map)
          Creates new AimsScalebar with a map object.
 
Method Summary
 java.lang.Object clone()
           
 int getAcetateObjectType()
          Gets the acetate object type.
 AimsEnvelope getExtent()
          Always returns null.
 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 setAntialiasing(boolean antialiasing)
          Sets the value of attribute antialising.
 void setBarColor(AimsColor barColor)
          Sets the color of the scalebar.
 void setBarTransparency(double barTransparency)
          Sets the value of the scale bar's transparency.
 void setBarWidth(int barWidth)
          Sets the width of the scale bar.
 void setBestPrecision(double mapUnitsPerPixel)
           
 void setCoordsys(AimsCoordsys coordsys)
          Sets the coordsys for this object.
 void setDistance(double distance)
          Sets the value of attribute distance.
 void setFont(java.lang.String font)
          Sets the value of attribute font.
 void setFontColor(AimsColor color)
          Sets the value of attribute fontColor.
 void setFontSize(int fontSize)
          Sets the value of attribute fontSize.
 void setFontStyle(java.lang.String fontStyle)
          Sets the value of attribute fontStyle.
 void setLocation(double x, double y)
          Sets the location of the scalebar.
 void setMapUnits(java.lang.String mapUnits)
          Sets the mapunits.
 void setMaxScale(double scale, AimsMap map)
           
 void setMaxScaleFactor(double unitsPerPixel)
           
 void setMinScale(double scale, AimsMap map)
           
 void setMinScaleFactor(double unitsPerPixel)
           
 void setMode(java.lang.String mode)
           
 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 setPrecision(int precision)
          Sets the value of attribute precision.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the value of a property (programmer defined).
 void setRound(double round)
          Sets the value of attribute round.
 void setScaleUnits(java.lang.String scaleUnits)
          Sets the value of attribute scaleUnits.
 void setScreenLength(int screenLength)
          Sets the value of attribute screenLength.
 void setTextTransparency(double transparency)
          Sets the value of this object's transparency.
 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

AimsScalebarObject

public AimsScalebarObject()
Creates new AimsScalebar


AimsScalebarObject

public AimsScalebarObject(AimsMap map)
Creates new AimsScalebar with a map object. This method will set the units and precision based on the current map scale.

Parameters:
map - The map to scale the output.
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()
Specified by:
clone in interface AimsAcetateObject

setBestPrecision

public void setBestPrecision(double mapUnitsPerPixel)

setCoordsys

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

Parameters:
coordsys - The coordsys for this object.

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)

setMode

public void setMode(java.lang.String mode)

setLocation

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

Parameters:
x - The x location of the scalebar.
y - The y location of the scalebar.

setAntialiasing

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

Parameters:
antialiasing - The attribute value.

setBarColor

public void setBarColor(AimsColor barColor)
Sets the color of the scalebar.

Parameters:
barColor - The color of the scalebar.

setBarTransparency

public void setBarTransparency(double barTransparency)
Sets the value of the scale bar's transparency.


setBarWidth

public void setBarWidth(int barWidth)
Sets the width of the scale bar.

Parameters:
barWidth - The width of the scale bar (default = 5).

setFont

public void setFont(java.lang.String font)
Sets the value of attribute font.

Parameters:
font - The attribute value.

setFontColor

public void setFontColor(AimsColor color)
Sets the value of attribute fontColor.

Parameters:
color - The attribute value.

setFontSize

public void setFontSize(int fontSize)
Sets the value of attribute fontSize.

Parameters:
fontSize - The attribute value.

setFontStyle

public void setFontStyle(java.lang.String fontStyle)
Sets the value of attribute fontStyle.

Parameters:
fontStyle - The attribute value.

setMapUnits

public void setMapUnits(java.lang.String mapUnits)
Sets the mapunits.

Parameters:
mapUnits - The map units for the map (degrees, meters, or feet).

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.

setPrecision

public void setPrecision(int precision)
Sets the value of attribute precision.

Parameters:
precision - The attribute value.

setRound

public void setRound(double round)
Sets the value of attribute round.

Parameters:
round - The attribute value.

setScaleUnits

public void setScaleUnits(java.lang.String scaleUnits)
Sets the value of attribute scaleUnits.

Parameters:
scaleUnits - The attribute value (miles | feet | meters | kilometers).

setScreenLength

public void setScreenLength(int screenLength)
Sets the value of attribute screenLength.

Parameters:
screenLength - The length of the scalebar object in pixels.

setDistance

public void setDistance(double distance)
Sets the value of attribute distance.

Parameters:
distance - The distance of the scalebar object in mapunits.

setTextTransparency

public void setTextTransparency(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_SCALEBAR.

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.