com.moximedia.aims
Class AimsLayers

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended bycom.moximedia.aims.AimsLayers
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class AimsLayers
extends java.util.Vector
implements java.io.Serializable, java.lang.Cloneable

The AimsLayers class is an ordered collection of AimsLayer objects.

See Also:
Serialized Form

Field Summary
protected static int NEXT_LAYER_ID
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AimsLayers()
          Creates a new AimsLayers object.
AimsLayers(AimsMap map)
          Creates a new AimsLayers object with an associated map.
 
Method Summary
 void addBufferLayer(AimsFeatureLayer layer, AimsBuffer buffer, AimsRenderer renderer)
           
 void addHighlightLayer(AimsFeatureLayer layer)
          Adds a highlight layer so that it is positioned directly above the base layer in the layers list.
 boolean addLayer(AimsLayer layer)
          Adds a Layer to the end of the collection
 void addLayerManagerLayer(AimsLayer lyr)
          Adds the specified layer to the layers list in a position determined by the layer type.
 void adjustScaleFactors(double multiplier)
          Adjusts the scale factors for this layer.
 void adjustScaleFactors(java.lang.String inUnits, java.lang.String outUnits)
          Adjusts the scale factors for this layer.
 boolean canFindByAttribute()
          Gets a boolean value indicating whether the layers list contains any layers that can be queried using the find location by attribute tool.
 void clear()
          Clears the Layers (removes all layers from the collection).
 java.lang.Object clone()
          Creates a copy of this object.
 boolean extract()
          Performs an extract of all visible extractable layers in the visible area.
 AimsLayers getAcetateLayers()
          Gets the AimsAcetate Layers in a AimsLayers object.
 AimsLayer getActiveIdentifyLayer()
          Gets the AimsFeatureLayer that is the active identify layer.
 AimsLayer getActiveIdentifyLayer(AimsPoint pt)
          Gets the AimsFeatureLayer that is the active identify layer, using a point to locate the active layer in a group, if applicable.
 AimsLayerGroup getActiveIdentifyLayerGroup()
          Gets the AimsLayerGroup that is the active identify layer.
 AimsFeatureLayer getActiveSelectLayer()
          Gets the AimsFeatureLayer that is the active select layer.
 AimsFeatureLayer getActiveSelectLayer(AimsPoint pt)
          Gets the AimsFeatureLayer that is the active select layer, using a point to locate the active select in a group, if applicable.
 AimsLayerGroup getActiveSelectLayerGroup()
          Gets the AimsLayerGroup that is the active select layer.
 AimsRecordset getBufferLayerRecordset(AimsFeatureLayer layer, AimsBuffer buffer)
           
 AimsLayers getCloneLayers()
           
 AimsFeatureLayer getCopyLayer()
          Gets the current copy layer, or null if no copy layer is set.
 AimsLayers getDynamicLayers()
           
 AimsFeatureLayer getEditLayer()
          Gets the current edit layer, or null if no edit layer is set.
 AimsLayers getEditLayers()
          Gets the edit layers in a AimsLayers object.
 java.lang.String getExtractFile()
          Gets the path to the extract file created by the extract() method.
 AimsLayers getExtractLayers()
          Gets the extract Layers in a AimsLayers object.
 java.lang.String getExtractUrl()
          Gets the url of the extract file created by the extract() method.
 AimsLayers getFeatureLayers()
          Gets the AimsFeature Layers in a AimsLayers object.
 AimsLayers getFindByAttributeLayers()
          Gets the layers that support the find by attribute routine.
 AimsLayer getLayer(int index)
          get Layer at the specified index position
 AimsLayer getLayer(java.lang.String layerNameAliasOrId)
          Returns a layer matching a name or alias or ID, or null if not found.
 AimsLayer getLayerByObjectId(int objectId)
           
 AimsLayers getNonServiceLayers()
          Gets the layers added by the user in a AimsLayers object.
 AimsLayers getSelectByAttributeLayers()
          Gets the layers that support the select by attribute routine.
 AimsLayers getServiceLayers()
          Gets the service layers in a AimsLayers object.
 AimsFeatureLayer getSnapLayer()
          Gets the current snap layer, or null if no snap layer is set.
 AimsLayers getWmsLayers()
          Gets the WMS Layers in a AimsLayers object.
 boolean hasClonedLayers()
           
 boolean hasDynamicLayers()
           
 boolean hasVisibleWmsLayers()
           
 boolean hasWmsLayers()
           
 boolean insertLayer(AimsLayer layer, int index)
          Insert a layer at a specified position
 void moveTo(AimsLayer layer, int toIndex)
          Moves a layer to the specified position in the layers list.
 void moveTo(int fromIndex, int toIndex)
          Moves a layer to a new position.
 void moveToBottom(AimsLayer layer)
          Moves a layer to a the bottom of the layers list.
 void moveToBottom(int layerIndex)
          Moves a layer to a the bottom of the layers list.
 void moveToBottom(java.lang.String layerNameAliasOrId)
          Moves a layer to a the bottom of the layers list.
 void moveToTop(AimsLayer layer)
          Moves a layer to a the top of the layers list.
 void moveToTop(int layerIndex)
          Moves a layer to a the top of the layers list.
 void moveToTop(java.lang.String layerNameAliasOrId)
          Moves a layer to a the top of the layers list.
 void removeBufferLayers()
          Removes the specified highlight layers from the layers object.
 void removeHighlightLayer(java.lang.String layerId)
          Removes the specified highlight layers from the layers object.
 void removeHighlightLayers()
          Removes all highlight layers from the layers object.
 boolean removeLayer(int index)
          remove the layer at specified index
 boolean removeLayer(java.lang.String layerNameOrId)
          remove the layer with the specified name
 void setActiveIdentifyLayer(AimsLayer layer)
          Sets the AimsFeatureLayer that is the active identify layer.
 void setActiveIdentifyLayerGroup(AimsLayerGroup layerGroup)
          Sets the AimsLayerGroup that is the active identify layer.
 void setActiveSelectLayer(AimsFeatureLayer layer)
          Sets the AimsFeatureLayer that is the active select layer.
 void setActiveSelectLayerGroup(AimsLayerGroup layerGroup)
          Sets the AimsLayerGroup that is the active select layer.
 void setAxlAttribute(java.lang.String tag, java.lang.String name, java.lang.String value)
          Sets one of the attributes of this object using a string value.
 void setCopyLayer(AimsFeatureLayer layer)
          Sets the current copy layer.
 void setEditLayer(AimsFeatureLayer layer)
          Sets the current edit layer.
 void setModified(boolean isModified)
          Sets the modification flags for all service layers to the specified value.
 void setSnapLayer(AimsFeatureLayer layer)
          Sets the current snap layer.
 void setVisible(java.lang.String layerNameAliasOrId, boolean isVisible)
          Set the visibility of a named layer
 java.lang.String toAxlString(java.lang.String requestType)
          Returns the AXL string to refresh this object.
 java.lang.String toString()
          Returns a text representation of of this object.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

NEXT_LAYER_ID

protected static int NEXT_LAYER_ID
Constructor Detail

AimsLayers

public AimsLayers()
Creates a new AimsLayers object.


AimsLayers

public AimsLayers(AimsMap map)
Creates a new AimsLayers object with an associated map.

Parameters:
map - The map containing the layers.
Method Detail

getExtractUrl

public java.lang.String getExtractUrl()
Gets the url of the extract file created by the extract() method.

Returns:
The url to the last zip file created by the extract() method

getExtractFile

public java.lang.String getExtractFile()
Gets the path to the extract file created by the extract() method.

Returns:
The path to the last image file created by the extract() method

extract

public boolean extract()
Performs an extract of all visible extractable layers in the visible area. This method extracts from the same map service as the map image is served from.

Returns:
True if the operation was successful, otherwise false.

clone

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

Returns:
An object that is a copy of this object. The object must be cast to an AimsLayers before use.

getCopyLayer

public AimsFeatureLayer getCopyLayer()
Gets the current copy layer, or null if no copy layer is set.

Returns:
The current copy layer, or null if no copy layer is set.

setCopyLayer

public void setCopyLayer(AimsFeatureLayer layer)
Sets the current copy layer.

Parameters:
layer - The copy layer to set.

getEditLayer

public AimsFeatureLayer getEditLayer()
Gets the current edit layer, or null if no edit layer is set.

Returns:
The current edit layer, or null if no edit layer is set.

setEditLayer

public void setEditLayer(AimsFeatureLayer layer)
Sets the current edit layer.

Parameters:
layer - The edit layer to set.

getSnapLayer

public AimsFeatureLayer getSnapLayer()
Gets the current snap layer, or null if no snap layer is set.

Returns:
The current snap layer, or null if no snap layer is set.

setSnapLayer

public void setSnapLayer(AimsFeatureLayer layer)
Sets the current snap layer.

Parameters:
layer - The snap layer to set.

moveTo

public void moveTo(AimsLayer layer,
                   int toIndex)
Moves a layer to the specified position in the layers list.

Parameters:
layer - The layer to move.
toIndex - The location to move to.

moveToBottom

public void moveToBottom(AimsLayer layer)
Moves a layer to a the bottom of the layers list.

Parameters:
layer - The layer to move.

moveToBottom

public void moveToBottom(int layerIndex)
Moves a layer to a the bottom of the layers list.

Parameters:
layerIndex - The original position.

moveToBottom

public void moveToBottom(java.lang.String layerNameAliasOrId)
Moves a layer to a the bottom of the layers list.


moveToTop

public void moveToTop(AimsLayer layer)
Moves a layer to a the top of the layers list.

Parameters:
layer - The layer to move.

moveToTop

public void moveToTop(java.lang.String layerNameAliasOrId)
Moves a layer to a the top of the layers list.


moveToTop

public void moveToTop(int layerIndex)
Moves a layer to a the top of the layers list.

Parameters:
layerIndex - The original position.

moveTo

public void moveTo(int fromIndex,
                   int toIndex)
Moves a layer to a new position.

Parameters:
fromIndex - The original position.
toIndex - The new position.

getActiveIdentifyLayer

public AimsLayer getActiveIdentifyLayer()
Gets the AimsFeatureLayer that is the active identify layer.

Returns:
The AimsFeatureLayer that is active, or null if no layer is active.

getActiveIdentifyLayer

public AimsLayer getActiveIdentifyLayer(AimsPoint pt)
Gets the AimsFeatureLayer that is the active identify layer, using a point to locate the active layer in a group, if applicable.

Parameters:
pt - The point to use to find the right identify layer.
Returns:
The AimsFeatureLayer that is active, or null if no layer is active.

setActiveIdentifyLayer

public void setActiveIdentifyLayer(AimsLayer layer)
Sets the AimsFeatureLayer that is the active identify layer.

Parameters:
layer - An AimsFeatureLayer object to make active.

getActiveIdentifyLayerGroup

public AimsLayerGroup getActiveIdentifyLayerGroup()
Gets the AimsLayerGroup that is the active identify layer.

Returns:
The active AimsLayerLayerGroup object, or null if no layer group is active.

setActiveIdentifyLayerGroup

public void setActiveIdentifyLayerGroup(AimsLayerGroup layerGroup)
Sets the AimsLayerGroup that is the active identify layer.

Parameters:
layerGroup - An AimsLayerLayerGroup object to make active.

getActiveSelectLayer

public AimsFeatureLayer getActiveSelectLayer()
Gets the AimsFeatureLayer that is the active select layer.

Returns:
The AimsFeatureLayer that is active, or null if no layer is active.

getActiveSelectLayer

public AimsFeatureLayer getActiveSelectLayer(AimsPoint pt)
Gets the AimsFeatureLayer that is the active select layer, using a point to locate the active select in a group, if applicable.

Parameters:
pt - The point to use to find the right select layer.
Returns:
The AimsFeatureLayer that is active, or null if no layer is active.

setActiveSelectLayer

public void setActiveSelectLayer(AimsFeatureLayer layer)
Sets the AimsFeatureLayer that is the active select layer.

Parameters:
layer - An AimsFeatureLayer object to make active.

getActiveSelectLayerGroup

public AimsLayerGroup getActiveSelectLayerGroup()
Gets the AimsLayerGroup that is the active select layer.

Returns:
The active AimsLayerLayerGroup object, or null if no layer group is active.

setActiveSelectLayerGroup

public void setActiveSelectLayerGroup(AimsLayerGroup layerGroup)
Sets the AimsLayerGroup that is the active select layer.

Parameters:
layerGroup - An AimsLayerLayerGroup object to make active.

getEditLayers

public AimsLayers getEditLayers()
Gets the edit layers in a AimsLayers object.

Returns:
An AimsLayers object containing all edit layers in the map.

getAcetateLayers

public AimsLayers getAcetateLayers()
Gets the AimsAcetate Layers in a AimsLayers object.

Returns:
An AimsLayers object containing all acetate layers in the map.

getExtractLayers

public AimsLayers getExtractLayers()
Gets the extract Layers in a AimsLayers object.

Returns:
An AimsLayers object containing all extract layers in the map.

getFeatureLayers

public AimsLayers getFeatureLayers()
Gets the AimsFeature Layers in a AimsLayers object.

Returns:
An AimsLayers object containing all feature layers in the map.

getWmsLayers

public AimsLayers getWmsLayers()
Gets the WMS Layers in a AimsLayers object.

Returns:
An AimsLayers object containing all WMS layers in the map. Note that it is not a reference that is returned, so adding or removing layers from the object will have no effect.

hasWmsLayers

public boolean hasWmsLayers()

hasVisibleWmsLayers

public boolean hasVisibleWmsLayers()

removeHighlightLayers

public void removeHighlightLayers()
Removes all highlight layers from the layers object.


removeHighlightLayer

public void removeHighlightLayer(java.lang.String layerId)
Removes the specified highlight layers from the layers object.

Parameters:
layerId - The layerId of the highlight layer.

removeBufferLayers

public void removeBufferLayers()
Removes the specified highlight layers from the layers object.


addHighlightLayer

public void addHighlightLayer(AimsFeatureLayer layer)
Adds a highlight layer so that it is positioned directly above the base layer in the layers list.


getBufferLayerRecordset

public AimsRecordset getBufferLayerRecordset(AimsFeatureLayer layer,
                                             AimsBuffer buffer)

addBufferLayer

public void addBufferLayer(AimsFeatureLayer layer,
                           AimsBuffer buffer,
                           AimsRenderer renderer)

getServiceLayers

public AimsLayers getServiceLayers()
Gets the service layers in a AimsLayers object. The service layers are the ones that were initialized from the ArcIMS map service.

Returns:
An AimsLayers object containing all service layers in the map.

getNonServiceLayers

public AimsLayers getNonServiceLayers()
Gets the layers added by the user in a AimsLayers object. The service layers are the ones that were initialized from the ArcIMS map service.

Returns:
An AimsLayers object containing all non service layers in the map.

getCloneLayers

public AimsLayers getCloneLayers()

getDynamicLayers

public AimsLayers getDynamicLayers()

hasClonedLayers

public boolean hasClonedLayers()

hasDynamicLayers

public boolean hasDynamicLayers()

addLayer

public boolean addLayer(AimsLayer layer)
Adds a Layer to the end of the collection

Parameters:
layer - An AimsLayer object (AimsFeatureLayer, AimsImageLayer, or AimsAcetateLayer)
Returns:
true if added

canFindByAttribute

public boolean canFindByAttribute()
Gets a boolean value indicating whether the layers list contains any layers that can be queried using the find location by attribute tool.

Returns:
True if any layer can be queried, otherwise false.

getFindByAttributeLayers

public AimsLayers getFindByAttributeLayers()
Gets the layers that support the find by attribute routine.

Returns:
An AimsLayers object containing the layers that can be found by attribute.

getSelectByAttributeLayers

public AimsLayers getSelectByAttributeLayers()
Gets the layers that support the select by attribute routine.

Returns:
An AimsLayers object containing the layers that can be selected by attribute.

insertLayer

public boolean insertLayer(AimsLayer layer,
                           int index)
Insert a layer at a specified position

Parameters:
layer - Layer to insert
index - The position to insert the layer
Returns:
True if inserted.

clear

public void clear()
Clears the Layers (removes all layers from the collection).

Specified by:
clear in interface java.util.List

getLayer

public AimsLayer getLayer(int index)
get Layer at the specified index position

Parameters:
index - The index position of the layer
Returns:
An AimsLayer. Note that the layer will need to be cast to a specific layer class (e.g. AimsFeatureLayer) before using.

setVisible

public void setVisible(java.lang.String layerNameAliasOrId,
                       boolean isVisible)
Set the visibility of a named layer

Parameters:
layerNameAliasOrId - name or ID of the layer
isVisible - True if the layer should be visible, otherwise false.

getLayer

public AimsLayer getLayer(java.lang.String layerNameAliasOrId)
Returns a layer matching a name or alias or ID, or null if not found. Note that the layer may be of type AimsFeatureLayer, AimsImageLayer, or AcetateLayer, so the return value must be cast to the correct type before using.

Parameters:
layerNameAliasOrId - name or ID of the layer
Returns:
The layer matching the search parameter, or null if a matching layer is not found

getLayerByObjectId

public AimsLayer getLayerByObjectId(int objectId)

setModified

public void setModified(boolean isModified)
Sets the modification flags for all service layers to the specified value.

Parameters:
isModified - True or false.

removeLayer

public boolean removeLayer(int index)
remove the layer at specified index

Parameters:
index - layer index
Returns:
true if removed

removeLayer

public boolean removeLayer(java.lang.String layerNameOrId)
remove the layer with the specified name

Parameters:
layerNameOrId - The layer name or ID to remove
Returns:
true if removed

toString

public java.lang.String toString()
Returns a text representation of of this object.

Returns:
A string describing the object

toAxlString

public java.lang.String toAxlString(java.lang.String requestType)
Returns the AXL string to refresh this object. This method is not typically used by the application programmer.

Parameters:
requestType - The parent tag of the output request.
Returns:
The AXL string to refresh this object.

setAxlAttribute

public void setAxlAttribute(java.lang.String tag,
                            java.lang.String name,
                            java.lang.String value)
Sets one of the attributes of this object using a string value. This method should only be called from the SAX event handler.

Parameters:
tag - The AXL element tag containing this attribute (not used).
name - The AXL attribute name.
value - The AXL attribute value.

addLayerManagerLayer

public void addLayerManagerLayer(AimsLayer lyr)
Adds the specified layer to the layers list in a position determined by the layer type.

Parameters:
lyr - The layer to add.

adjustScaleFactors

public void adjustScaleFactors(java.lang.String inUnits,
                               java.lang.String outUnits)
Adjusts the scale factors for this layer. Used when changing the units of a map.

Parameters:
inUnits - The original units, "METERS", FEET" or "DECIMAL_DEGREES".
outUnits - The target units, "METERS", FEET" or "DECIMAL_DEGREES".

adjustScaleFactors

public void adjustScaleFactors(double multiplier)
Adjusts the scale factors for this layer. Used when changing the units of a map.

Parameters:
multiplier - The multiplication factor for adjusting scale factors.