com.moximedia.ows.acetate
Class AcetateLayer

java.lang.Object
  extended bycom.moximedia.ows.acetate.AcetateLayer
All Implemented Interfaces:
java.lang.Cloneable, GeometryType, Layer, LayerIdentifyType, LayerType, java.io.Serializable

public class AcetateLayer
extends java.lang.Object
implements Layer, LayerType, GeometryType, LayerIdentifyType, java.lang.Cloneable, java.io.Serializable

Implementation of a graphic layer for drawing on a map.

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

Field Summary
 
Fields inherited from interface com.moximedia.ows.types.LayerType
LAYER_TYPE_ACETATE, LAYER_TYPE_WFS, LAYER_TYPE_WMS
 
Fields inherited from interface com.moximedia.ows.types.GeometryType
GEOMETRY_TYPE_COLLECTION, GEOMETRY_TYPE_ENVELOPE, GEOMETRY_TYPE_LINE, GEOMETRY_TYPE_MULTILINE, GEOMETRY_TYPE_MULTIPOINT, GEOMETRY_TYPE_MULTIPOLYGON, GEOMETRY_TYPE_POINT, GEOMETRY_TYPE_POLYGON, GEOMETRY_TYPE_UNKNOWN
 
Fields inherited from interface com.moximedia.ows.types.LayerIdentifyType
LAYER_IDENTIFY_TYPE_DEFAULT, LAYER_IDENTIFY_TYPE_NONE, LAYER_IDENTIFY_TYPE_URL_APPEND_FIELD_VALUE, LAYER_IDENTIFY_TYPE_URL_FIELD_VALUES, LAYER_IDENTIFY_TYPE_URL_INSERT_FIELD_VALUE, LAYER_IDENTIFY_TYPE_URL_MULTIPLE_FIELD_VALUES
 
Constructor Summary
AcetateLayer()
          Creates new AcetateLayer
AcetateLayer(java.lang.String name)
          Creates new AcetateLayer
 
Method Summary
 void add(AcetateObject object)
           
 void clear()
           
 java.lang.Object clone()
           
 void draw(java.awt.Graphics2D graphics, java.awt.geom.AffineTransform pageTransform, java.util.Locale locale)
           
 boolean getCanClear()
          Reports whether the user can clear the layer using the clear tool.
 boolean getCanCopy()
           
 boolean getCanDrillIdentify()
          Gets a boolean value indicating whether the layer can be identified using the drill down identify tool.
 boolean getCanEdit()
           
 boolean getCanIdentify()
          Returns an indicator of whether the layer can be identified.
 boolean getCanSetVisibility()
          Gets a boolean value indicating whether the layer can be turned on and off by the user.
 boolean getCanSnapTo()
           
 int getGeometryType()
          Gets the geometry type enumerator, if one is set for this layer.
 java.lang.String getHighlightedLayerName()
           
 java.lang.String getId()
          Gets the user defined id for this layer.
 java.lang.String getIdentifyHandler()
          Gets the identify handler script used for this layer.
 java.lang.String getIdentifySuffix()
          Gets the suffix used in the append type of identify handler.
 int getIdentifyType()
          Gets the identify type enumerator.
 boolean getIdentifyWindow()
          Returns whether the identify report should open in a popup window.
 boolean getImmediateRefresh()
          Returns an indicator of whether the map should immediately refresh when the layer's visibility is changed.
 LayerListLegends getLayerListLegends()
          Gets the layer list legends object for this layer, or null if there are no layer list legends.
 int getLayerType()
          Get the layer type enumerator.
 java.lang.String getLegendUrl()
          Gets the URL to the legend for this layer.
 double getMaxScale()
          Gets the maximum scale at which the layer will be displayed.
 java.lang.String getMetadataUrl()
          Gets the URL for metadata associated with this layer.
 double getMinScale()
          Gets the minimum scale at which the layer will be displayed.
 java.lang.String getName()
          Gets the name of this layer.
 AcetateObject getObject(int index)
           
 int getObjectId()
          Returns the IMF internal id for this layer.
 java.util.ArrayList getObjects()
           
 java.lang.Object getObjectTag()
          Gets the object tag.
 java.lang.String getProperty(java.lang.String name)
          Gets the value of a property set in the configuration XML using a <PROPERTY> element.
 Recordset getRecordset()
          Gets this layer's recordset containing query results.
 Service getService()
          Gets the service supporting this layer,
 java.lang.String getTitle()
          Gets the user displayed title for this layer.
 int getTransparency()
          Gets the transparency of this layer, as a percentage.
 boolean getTransparent()
          Reports whether the layer should be drawn transparent.
 boolean getVisible()
          Returns an indicator of whether this layer is visible.
 boolean hasGeometry()
           
 boolean isHighlightLayer()
           
 boolean isNamed(java.lang.String name)
          Checks to see if the name of this layer is that specified.
 boolean isObjectId(int id)
          Checks to see if the object id of this layer is that specified.
 boolean isTitled(java.lang.String title)
          Checks to see if the title of this layer is that specified.
 boolean isWithinScaleThreshold(double scale)
          Returns whether this layer is within threshold tolerance.
 void remove(int index)
          Removes the objects with the specified index.
 void remove(java.lang.String name)
          Removes all objects with the specified name.
 void removeProperty(java.lang.String name)
          Removes the specified property.
 void setCanClear(boolean canClear)
          Sets whether the user can clear the layer using the clear tool.
 void setCanDrillIdentify(boolean flag)
          Sets whether the layer can be identified.
 void setCanIdentify(boolean flag)
          Sets whether the layer can be identified.
 void setHighlightedLayerName(java.lang.String name)
           
 void setId(java.lang.String id)
          Sets the user defined id for this layer.
 void setLayerListLegends(LayerListLegends legends)
          Sets the layer list legends object for this layer.
 void setMaxScale(double scale)
          Sets the maximum scale that this layer is visible.
 void setMinScale(double scale)
          Sets the minimum scale that this layer is visible.
 void setName(java.lang.String name)
           
 void setObjectTag(java.lang.Object tag)
          Sets an object tag for this object.
 void setProjection(Projection projection)
          Sets the projection for this layer.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the value of a property (programmer defined).
 void setSrs(java.lang.String srs)
          Sets the spatial reference system SRS of this layer.
 void setTransparency(int percentTransparent)
          Sets the transparency of this layer, as a percentage.
 void setTransparent(boolean isTransparent)
          Sets whether the layer should be drawn transparent.
 void setVisible(boolean isVisible)
          Returns an indicator of whether the acetate layer is visible
 void setXmlAttribute(Map map, java.lang.String element, java.lang.String name, java.lang.String value, java.lang.String frameworkPath, java.lang.String mapConfigPath)
          Sets one of the attributes of this object using a string value.
 int size()
          Returns the number of objects in the layer.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcetateLayer

public AcetateLayer()
Creates new AcetateLayer


AcetateLayer

public AcetateLayer(java.lang.String name)
Creates new AcetateLayer

Parameters:
name - The name of the acetate layer.
Method Detail

clone

public java.lang.Object clone()

getHighlightedLayerName

public java.lang.String getHighlightedLayerName()

setHighlightedLayerName

public void setHighlightedLayerName(java.lang.String name)

add

public void add(AcetateObject object)

clear

public void clear()

getId

public java.lang.String getId()
Gets the user defined id for this layer.

Specified by:
getId in interface Layer
Returns:
The user defined id.

setId

public void setId(java.lang.String id)
Sets the user defined id for this layer.

Specified by:
setId in interface Layer
Parameters:
id - The user defined id.

getLayerListLegends

public LayerListLegends getLayerListLegends()
Gets the layer list legends object for this layer, or null if there are no layer list legends.

Specified by:
getLayerListLegends in interface Layer
Returns:
The layer list legends object for this layer.

setLayerListLegends

public void setLayerListLegends(LayerListLegends legends)
Sets the layer list legends object for this layer.

Specified by:
setLayerListLegends in interface Layer
Parameters:
legends - The layer list legends object to set for this layer.

setObjectTag

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

Specified by:
setObjectTag in interface Layer
Parameters:
tag - A programmer defined element to associate with this object.

getObjectTag

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

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

getProperty

public java.lang.String getProperty(java.lang.String name)
Gets the value of a property set in the configuration XML using a <PROPERTY> element.

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

removeProperty

public void removeProperty(java.lang.String name)
Removes the specified property.

Specified by:
removeProperty in interface Layer
Parameters:
name - The name of the property.

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 Layer
Parameters:
name - The property name
value - The property value.

remove

public void remove(java.lang.String name)
Removes all objects with the specified name. Note: cannot be used to remove unnamed objects.

Parameters:
name - The name of the objects that you want to remove.

remove

public void remove(int index)
Removes the objects with the specified index.


draw

public void draw(java.awt.Graphics2D graphics,
                 java.awt.geom.AffineTransform pageTransform,
                 java.util.Locale locale)

getCanClear

public boolean getCanClear()
Reports whether the user can clear the layer using the clear tool.

Returns:
True if the user can clear it, otherwize false.

setCanClear

public void setCanClear(boolean canClear)
Sets whether the user can clear the layer using the clear tool.

Parameters:
canClear - True if the user can clear it, otherwize false.

getCanCopy

public boolean getCanCopy()

getCanEdit

public boolean getCanEdit()

getCanDrillIdentify

public boolean getCanDrillIdentify()
Gets a boolean value indicating whether the layer can be identified using the drill down identify tool.

Specified by:
getCanDrillIdentify in interface Layer
Returns:
True if the layer can be identified using the drill down identify tool, otherwise false.

setCanDrillIdentify

public void setCanDrillIdentify(boolean flag)
Sets whether the layer can be identified.

Parameters:
flag - True if the layer can be identified, otherwise false.

getCanIdentify

public boolean getCanIdentify()
Returns an indicator of whether the layer can be identified.

Specified by:
getCanIdentify in interface Layer
Returns:
True if the layer can be identified, otherwise false.

setCanIdentify

public void setCanIdentify(boolean flag)
Sets whether the layer can be identified.

Parameters:
flag - True if the layer can be identified, otherwise false.

getCanSetVisibility

public boolean getCanSetVisibility()
Gets a boolean value indicating whether the layer can be turned on and off by the user.

Specified by:
getCanSetVisibility in interface Layer
Returns:
True if the layer can be controlled, otherwise false.

getCanSnapTo

public boolean getCanSnapTo()

getGeometryType

public int getGeometryType()
Description copied from interface: Layer
Gets the geometry type enumerator, if one is set for this layer.

Specified by:
getGeometryType in interface Layer
Returns:
The geometry type enumerator.

getIdentifyHandler

public java.lang.String getIdentifyHandler()
Description copied from interface: Layer
Gets the identify handler script used for this layer.

Specified by:
getIdentifyHandler in interface Layer
Returns:
The URL of the handler script.

getIdentifySuffix

public java.lang.String getIdentifySuffix()
Description copied from interface: Layer
Gets the suffix used in the append type of identify handler. The suffix is added to the URL created.

Specified by:
getIdentifySuffix in interface Layer
Returns:
The suffix, if any.

getIdentifyType

public int getIdentifyType()
Description copied from interface: Layer
Gets the identify type enumerator. See com.moximedia.ows.types.LayerIdentifyType.

Specified by:
getIdentifyType in interface Layer
Returns:
The identify type enumerator.

getIdentifyWindow

public boolean getIdentifyWindow()
Description copied from interface: Layer
Returns whether the identify report should open in a popup window.

Specified by:
getIdentifyWindow in interface Layer
Returns:
True if it should open in a popup, otherwise false.

getImmediateRefresh

public boolean getImmediateRefresh()
Description copied from interface: Layer
Returns an indicator of whether the map should immediately refresh when the layer's visibility is changed.

Specified by:
getImmediateRefresh in interface Layer
Returns:
True if it should refresh immediately, otherwise false.

getMaxScale

public double getMaxScale()
Gets the maximum scale at which the layer will be displayed.

Specified by:
getMaxScale in interface Layer
Returns:
The maximum scale at which the layer will be displayed.

getMetadataUrl

public java.lang.String getMetadataUrl()
Description copied from interface: Layer
Gets the URL for metadata associated with this layer.

Specified by:
getMetadataUrl in interface Layer
Returns:
The URL of the metadata, or null.

getMinScale

public double getMinScale()
Gets the minimum scale at which the layer will be displayed.

Specified by:
getMinScale in interface Layer
Returns:
The minimum scale at which the layer will be displayed.

getObjectId

public int getObjectId()
Description copied from interface: Layer
Returns the IMF internal id for this layer.

Specified by:
getObjectId in interface Layer
Returns:
The internal id for the layer.

getObject

public AcetateObject getObject(int index)

getObjects

public java.util.ArrayList getObjects()

getLayerType

public int getLayerType()
Description copied from interface: Layer
Get the layer type enumerator.

Specified by:
getLayerType in interface Layer
Returns:
An enumerator of com.moximedia.ows.types.LayerType.

getLegendUrl

public java.lang.String getLegendUrl()
Description copied from interface: Layer
Gets the URL to the legend for this layer.

Specified by:
getLegendUrl in interface Layer
Returns:
The URL of the legend, if any.

getName

public java.lang.String getName()
Description copied from interface: Layer
Gets the name of this layer.

Specified by:
getName in interface Layer
Returns:
The name of the layer.

setName

public void setName(java.lang.String name)

getRecordset

public Recordset getRecordset()
Description copied from interface: Layer
Gets this layer's recordset containing query results.

Specified by:
getRecordset in interface Layer
Returns:
The recordset object.

getService

public Service getService()
Description copied from interface: Layer
Gets the service supporting this layer,

Specified by:
getService in interface Layer
Returns:
The service.

getTitle

public java.lang.String getTitle()
Description copied from interface: Layer
Gets the user displayed title for this layer. Use getName() for the internal name used in the service requests.

Specified by:
getTitle in interface Layer
Returns:
The title.

getVisible

public boolean getVisible()
Description copied from interface: Layer
Returns an indicator of whether this layer is visible.

Specified by:
getVisible in interface Layer
Returns:
True if it is visible, otherwise false.

hasGeometry

public boolean hasGeometry()

isWithinScaleThreshold

public boolean isWithinScaleThreshold(double scale)
Returns whether this layer is within threshold tolerance.

Specified by:
isWithinScaleThreshold in interface Layer
Parameters:
scale - The scale threshold.
Returns:
True if the layer is shown at the present scale, otherwise false.

setMaxScale

public void setMaxScale(double scale)
Description copied from interface: Layer
Sets the maximum scale that this layer is visible.

Specified by:
setMaxScale in interface Layer
Parameters:
scale - The maximum scale.

setMinScale

public void setMinScale(double scale)
Description copied from interface: Layer
Sets the minimum scale that this layer is visible.

Specified by:
setMinScale in interface Layer
Parameters:
scale - The minimum scale.

isHighlightLayer

public boolean isHighlightLayer()

isObjectId

public boolean isObjectId(int id)
Description copied from interface: Layer
Checks to see if the object id of this layer is that specified.

Specified by:
isObjectId in interface Layer
Parameters:
id - The id to check.
Returns:
True if the object id matches, otherwise false.

isNamed

public boolean isNamed(java.lang.String name)
Description copied from interface: Layer
Checks to see if the name of this layer is that specified.

Specified by:
isNamed in interface Layer
Parameters:
name - The name to check.
Returns:
True if the name matches, otherwise false.

setProjection

public void setProjection(Projection projection)
Description copied from interface: Layer
Sets the projection for this layer. Does not set the SRS.

Specified by:
setProjection in interface Layer
Parameters:
projection - The projection.

setSrs

public void setSrs(java.lang.String srs)
Description copied from interface: Layer
Sets the spatial reference system SRS of this layer. Does not set the projection.

Specified by:
setSrs in interface Layer
Parameters:
srs - The SRS code.

isTitled

public boolean isTitled(java.lang.String title)
Description copied from interface: Layer
Checks to see if the title of this layer is that specified.

Specified by:
isTitled in interface Layer
Parameters:
title - The title to check.
Returns:
True if the title matches, otherwise false.

setTransparent

public void setTransparent(boolean isTransparent)
Sets whether the layer should be drawn transparent.

Parameters:
isTransparent - True if the layer should be drawn transparent, otherwise false.

getTransparent

public boolean getTransparent()
Reports whether the layer should be drawn transparent.

Specified by:
getTransparent in interface Layer
Returns:
True if the layer is drawn transparent, otherwise false.

setVisible

public void setVisible(boolean isVisible)
Returns an indicator of whether the acetate layer is visible

Specified by:
setVisible in interface Layer
Parameters:
isVisible - True if the layer is visible, otherwise false.

setXmlAttribute

public void setXmlAttribute(Map map,
                            java.lang.String element,
                            java.lang.String name,
                            java.lang.String value,
                            java.lang.String frameworkPath,
                            java.lang.String mapConfigPath)
Description copied from interface: Layer
Sets one of the attributes of this object using a string value. This method should only be called from the SAX event handler.

Specified by:
setXmlAttribute in interface Layer
Parameters:
map - The map that contains this layer.
element - The XML element tag containing this attribute.
name - The XML attribute name.
value - The XML attribute value.
frameworkPath - The URL path to the IMF.
mapConfigPath - The URL path to the location of the map configuration file.

size

public int size()
Returns the number of objects in the layer.

Returns:
The number of objects.

setTransparency

public void setTransparency(int percentTransparent)
Sets the transparency of this layer, as a percentage. Zero is fully opaque, one hundred is fully transparent.

Specified by:
setTransparency in interface Layer

getTransparency

public int getTransparency()
Gets the transparency of this layer, as a percentage. Zero is fully opaque, one hundred is fully transparent.

Specified by:
getTransparency in interface Layer
Returns:
The transparency percent.


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.