com.esri.adf.web.tasks
Class MapToolsTask

java.lang.Object
  extended by com.esri.adf.web.tasks.MapToolsTask
All Implemented Interfaces:
TaskInfoBean, WebContextInitialize, WebContextObserver, Serializable

public class MapToolsTask
extends Object
implements WebContextInitialize, WebContextObserver, TaskInfoBean, Serializable

See Also:
Serialized Form

Field Summary
protected  int layerId
           
protected  boolean panAction
           
static String TOOL_ALL
           
static String TOOL_FULLEXT
           
static String TOOL_IDENTIFY
           
static String TOOL_MEASURE
           
static String TOOL_NEXTEXTENT
           
static String TOOL_PAN
           
static String TOOL_PREEXTENT
           
static String TOOL_ZOOMIN
           
static String TOOL_ZOOMOUT
           
protected  String tools
           
 
Constructor Summary
MapToolsTask()
           
 
Method Summary
 void destroy()
           The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.
 void getArea(MapEvent event)
           
 int getAreaUnitsID()
           
 Map<Integer,String> getAreaUnitsList()
           
 void getDistance(MapEvent event)
           
 int getDistanceUnitsID()
           
 Map<Integer,String> getDistanceUnitsList()
           
 Map<String,String> getIdentifiableLayers()
          Returns the map entry of identifiable layers.
 List<? extends LayerDefinition> getLayerDefinitions()
          Returns the list of LayerDefinition.
 int getLayerId()
          Deprecated. As of ArcGIS Java Server 9.3, instead use getIdentifiableLayers()
 void getLocation(MapEvent event)
           
 String getOutputA()
           
 String getOutputB()
           
 GISResource getResource()
          Deprecated. As of ArcGIS Java Server 9.3, instead get the resource from WebContext.getResourceById(String) based on the resource id.
 double getRoundFactor()
          Returns current rounding factor;
 MapToolsTaskConfig getTaskConfig()
          Deprecated. As of ArcGIS Java Server 9.3, instead use this class to get all properties
 TaskInfo getTaskInfo()
           
 String getTaskName()
           
 String getTools()
          Returns the tool key(s) separated by comma
 WebContext getWebContext()
          Returns the WebContext object
 void identify(MapEvent event)
           
 List<QueryResult> identify(WebContext webContext, WebGeometry webGeometry)
          Identify the map based on the specified context and geometry.
 List<QueryResult> identify(WebGeometry webGeometry)
          Identify the map based on the specified geometry.
 void init(WebContext webContext)
           The initialization chores of attributes of a WebContext should be performed in this method.
 boolean isMapContinousPan()
          Deprecated. As of ArcGIS Java Server 9.3, instead use isMapContinuousPan()
 boolean isMapContinuousPan()
          Returns the pan action to the map tools task.
 boolean isShowInfoWindow()
          Returns true if the task result(s) to be shown in the info window.
 void measure(MapEvent event)
           
 void next(TaskEvent event)
           
 void pan(MapEvent event)
           
 void previous(TaskEvent event)
           
 void setAreaUnitsID(int areaUnitsID)
           
 void setDistanceUnitsID(int distanceUnitsID)
           
 void setIdentifiableLayers(Map<String,String> identifiableLayers)
          Sets the map entry of identifiable layers.
 void setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
          Sets the list of LayerDefinition objects.
 void setLayerId(int layerId)
          Deprecated. As of ArcGIS Java Server 9.3, instead use setIdentifiableLayers(java.util.Map)
 void setMapContinousPan(boolean panAction)
          Deprecated. As of ArcGIS Java Server 9.3, instead use setMapContinuousPan(boolean)
 void setMapContinuousPan(boolean panAction)
          Sets the pan action of map tools task to be continuous.
 void setResource(GISResource resource)
          Deprecated. As of ArcGIS Java Server 9.3, instead use setIdentifiableLayers(java.util.Map)
 void setRoundFactor(double roundFactor)
          Sets the rounding factor, the number is used to set the output precision of measurement.
 void setShowInfoWindow(boolean showInfoWindow)
          Sets whether the task result(s) to be shown in the info window or not.
 void setTaskConfig(MapToolsTaskConfig config)
          Deprecated. As of ArcGIS Java Server 9.3, instead use this class to set all properties
 void setTaskInfo(TaskInfo taskInfo)
           
 void setTaskName(String taskName)
           
 void setTools(String tools)
           Sets the tools order and their visibilities of a map tools task.
 void setWebContext(WebContext webContext)
          Deprecated. As of ArcGIS Java Server 9.3, no replacement
 void update(WebContext webContext, Object arg)
           This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.
 void zoomFullExtent(TaskEvent event)
           
 void zoomIn(MapEvent event)
           
 void zoomOut(MapEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOOL_ZOOMIN

public static final String TOOL_ZOOMIN
See Also:
Constant Field Values

TOOL_ZOOMOUT

public static final String TOOL_ZOOMOUT
See Also:
Constant Field Values

TOOL_PAN

public static final String TOOL_PAN
See Also:
Constant Field Values

TOOL_PREEXTENT

public static final String TOOL_PREEXTENT
See Also:
Constant Field Values

TOOL_NEXTEXTENT

public static final String TOOL_NEXTEXTENT
See Also:
Constant Field Values

TOOL_FULLEXT

public static final String TOOL_FULLEXT
See Also:
Constant Field Values

TOOL_IDENTIFY

public static final String TOOL_IDENTIFY
See Also:
Constant Field Values

TOOL_MEASURE

public static final String TOOL_MEASURE
See Also:
Constant Field Values

TOOL_ALL

public static final String TOOL_ALL
See Also:
Constant Field Values

panAction

protected boolean panAction

tools

protected String tools

layerId

protected int layerId
Constructor Detail

MapToolsTask

public MapToolsTask()
Method Detail

init

public void init(WebContext webContext)
Description copied from interface: WebContextInitialize

The initialization chores of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is initialized. It is important to note that this method is again called by the context when a GISResource is dynamically added to or removed from the context. Classes that implement this method should keep this in mind and adapt the method to react to the callbacks in these circumstances as well.

A WebContext attribute is usable only after this method has been called.

Specified by:
init in interface WebContextInitialize
Parameters:
webContext - WebContext- the WebContext
See Also:
WebContext.init(WebContext), WebContext.addResource(String, GISResource, int), WebContext.removeResource(GISResource)

destroy

public void destroy()
Description copied from interface: WebContextInitialize

The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is destroyed.

The WebContext attribute is unusable after this method has been called.

Specified by:
destroy in interface WebContextInitialize
See Also:
WebContext.destroy()

update

public void update(WebContext webContext,
                   Object arg)
Description copied from interface: WebContextObserver

This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.

To setup an object to be updated by the context, one needs to use the WebContext.addObserver(WebContextObserver) to register itself with the context. All context attributes are wired up to the WebContext. When users change state on any of the attributes and need to intimate other attributes of the context to react to the change they call either the WebContext.refresh() or WebContext.refresh(Object) methods. The context in turns calls the WebContextObserver.update(WebContext, Object) methods on all its registered observers.

Specified by:
update in interface WebContextObserver
Parameters:
webContext - the WebContext that has been refreshed
arg - the argument passed to the WebContext's refresh(arg) method
See Also:
WebContext.refresh(Object), WebContext.addObserver(WebContextObserver), WebContext.removeObserver(WebContextObserver)

getWebContext

public WebContext getWebContext()
Returns the WebContext object

Returns:
the context object

getTaskName

public String getTaskName()

setTaskName

public void setTaskName(String taskName)

getTaskInfo

public TaskInfo getTaskInfo()
Specified by:
getTaskInfo in interface TaskInfoBean

setTaskInfo

public void setTaskInfo(TaskInfo taskInfo)
Specified by:
setTaskInfo in interface TaskInfoBean

zoomFullExtent

public void zoomFullExtent(TaskEvent event)

zoomIn

public void zoomIn(MapEvent event)

zoomOut

public void zoomOut(MapEvent event)

pan

public void pan(MapEvent event)

previous

public void previous(TaskEvent event)

next

public void next(TaskEvent event)

identify

public void identify(MapEvent event)

identify

public List<QueryResult> identify(WebGeometry webGeometry)
Identify the map based on the specified geometry.

Parameters:
webGeometry - the geometry in map coordinates
Returns:
the list of identify result(s)

identify

public List<QueryResult> identify(WebContext webContext,
                                  WebGeometry webGeometry)
Identify the map based on the specified context and geometry.

Parameters:
webContext - the context object, passing null will use the context from this object
webGeometry - the geometry in map coordinates
Returns:
the list of identify result(s)

getLocation

public void getLocation(MapEvent event)

getDistance

public void getDistance(MapEvent event)

getArea

public void getArea(MapEvent event)

measure

public void measure(MapEvent event)

getOutputA

public String getOutputA()

getOutputB

public String getOutputB()

getRoundFactor

public double getRoundFactor()
Returns current rounding factor;

Returns:
an integer

setRoundFactor

public void setRoundFactor(double roundFactor)
Sets the rounding factor, the number is used to set the output precision of measurement. The default value is 100; the input should a value of ten base ‘s n power (n is an ineger); e.g., 0, 10, 100, 1000, etc.

Parameters:
roundFactor - - an integer;

getAreaUnitsID

public int getAreaUnitsID()

setAreaUnitsID

public void setAreaUnitsID(int areaUnitsID)

getDistanceUnitsID

public int getDistanceUnitsID()

setDistanceUnitsID

public void setDistanceUnitsID(int distanceUnitsID)

getAreaUnitsList

public Map<Integer,String> getAreaUnitsList()

getDistanceUnitsList

public Map<Integer,String> getDistanceUnitsList()

setMapContinuousPan

public void setMapContinuousPan(boolean panAction)
Sets the pan action of map tools task to be continuous. By default the pan action is set to hybrid meaning continuous pan for cached services and traditional pan for dynamic services.

Parameters:
panAction - if true, the pan action is continuous

isMapContinuousPan

public boolean isMapContinuousPan()
Returns the pan action to the map tools task.

Returns:
true if continuous pan

setTools

public void setTools(String tools)

Sets the tools order and their visibilities of a map tools task.

   For example setting to "IDENTIFY,ZOOMIN,ZOOMOUT," will display three tools in the map tools task.
     config.setTools(MapToolsTask.TOOL_ZOOMIN + "," + MapToolsTask.TOOL_ZOOMOUT);
 

Parameters:
tools - a String with multi tool key word separated by a comma.

getTools

public String getTools()
Returns the tool key(s) separated by comma

Returns:
the tool key(s) string value

setLayerDefinitions

public void setLayerDefinitions(List<? extends LayerDefinition> layerDefinitions)
Sets the list of LayerDefinition objects.

Parameters:
layerDefinitions - the list of layer definition objects

getLayerDefinitions

public List<? extends LayerDefinition> getLayerDefinitions()
Returns the list of LayerDefinition.

Returns:
the list of layer definition objects

setShowInfoWindow

public void setShowInfoWindow(boolean showInfoWindow)
Sets whether the task result(s) to be shown in the info window or not. By default the value is true

Parameters:
showInfoWindow - if true, info window is shown

isShowInfoWindow

public boolean isShowInfoWindow()
Returns true if the task result(s) to be shown in the info window.

Returns:
true if info window to be shown

setIdentifiableLayers

public void setIdentifiableLayers(Map<String,String> identifiableLayers)
Sets the map entry of identifiable layers. Here key is the resource id and value is the comma separated layer ids.
 For Example,
   java.util.Map<String, Integer> identifiableLayers1 = new java.util.LinkedHashMap<String, Integer>(1);
   identifiableLayers1.put("ags1", "2,3");
   identifiableLayers1.put("aws1", "0");
   identifiableLayers1.put("aims1", "0,5");
 

Parameters:
identifiableLayers - the map entry of identifiable layers

getIdentifiableLayers

public Map<String,String> getIdentifiableLayers()
Returns the map entry of identifiable layers.

Returns:
the map entry of identifiable layers

setWebContext

@Deprecated
public void setWebContext(WebContext webContext)
Deprecated. As of ArcGIS Java Server 9.3, no replacement


setTaskConfig

@Deprecated
public void setTaskConfig(MapToolsTaskConfig config)
Deprecated. As of ArcGIS Java Server 9.3, instead use this class to set all properties

Sets the map tools task config object.

Parameters:
config - the map tools task config object

getTaskConfig

@Deprecated
public MapToolsTaskConfig getTaskConfig()
Deprecated. As of ArcGIS Java Server 9.3, instead use this class to get all properties

Returns the map tools task config object.

Returns:
the map tools task config object

setResource

@Deprecated
public void setResource(GISResource resource)
Deprecated. As of ArcGIS Java Server 9.3, instead use setIdentifiableLayers(java.util.Map)

Set the GISResource object in which the attributes are searched.

Parameters:
resource - the GISResource object.

getResource

@Deprecated
public GISResource getResource()
Deprecated. As of ArcGIS Java Server 9.3, instead get the resource from WebContext.getResourceById(String) based on the resource id.

Returns the GISResource object.

Returns:
the associated resource object with this task

setLayerId

@Deprecated
public void setLayerId(int layerId)
Deprecated. As of ArcGIS Java Server 9.3, instead use setIdentifiableLayers(java.util.Map)

Sets the layer id of a GISResource object in which the identify should be performed. By default identify works with all resource(s) and all layer(s).

Parameters:
layerId - the layer id

getLayerId

@Deprecated
public int getLayerId()
Deprecated. As of ArcGIS Java Server 9.3, instead use getIdentifiableLayers()

Returns the layer id.

Returns:
the layer id

setMapContinousPan

@Deprecated
public void setMapContinousPan(boolean panAction)
Deprecated. As of ArcGIS Java Server 9.3, instead use setMapContinuousPan(boolean)


isMapContinousPan

@Deprecated
public boolean isMapContinousPan()
Deprecated. As of ArcGIS Java Server 9.3, instead use isMapContinuousPan()