com.esri.arcgis.controls
Class CommandsEnvironment

java.lang.Object
  extended by com.esri.arcgis.controls.CommandsEnvironment
All Implemented Interfaces:
IGraphicProperties, ILayerEffectProperties, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class CommandsEnvironment
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IGraphicProperties, ILayerEffectProperties

Defines the commands environment.

Description

The CommandsEnvironment object is a singleton object (only one instance of the CommandsEnvironment object is supported per thread) for managing the graphic properties and layer effect properties used by the controls commands, and can be used by any custom commands you develop.

Product Availability

Available with ArcGIS Engine.

Singleton:

This type is a singleton.

See Also:
Serialized Form

Constructor Summary
CommandsEnvironment()
          Constructs a CommandsEnvironment using ArcGIS Engine.
CommandsEnvironment(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
CommandsEnvironment theCommandsEnvironment = (CommandsEnvironment) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 IFormattedTextSymbol getCallout()
          The callout symbol used by the CommandsEnvironment singleton.
static String getClsid()
          getClsid.
 IFillSymbol getFillSymbol()
          The fill symbol used by the CommandsEnvironment singleton.
 ILayer getFlickerLayer()
          The layer the Flicker command uses.
 int getFlickerRate()
          Rate in milliseconds used to Flicker the screen with the Flicker command.
 ILineSymbol getLineSymbol()
          The line symbol used by the CommandsEnvironment singleton.
 IMarkerSymbol getMarkerSymbol()
          The marker symbol used by the CommandsEnvironment singleton.
 ILayer getSwipeLayer()
          The layer the Swipe command uses.
 ITextSymbol getTextSymbol()
          The text symbol used by the CommandsEnvironment singleton.
 ILayer getTransparencyLayer()
          The layer the Transparency command uses.
 int hashCode()
          the hashcode for this object
 void setCallout(IFormattedTextSymbol ppCallout)
          The callout symbol used by the CommandsEnvironment singleton.
 void setFillSymbol(IFillSymbol ppFillSymbol)
          The fill symbol used by the CommandsEnvironment singleton.
 void setFlickerLayerByRef(ILayer ppFlickerLayer)
          The layer the Flicker command uses.
 void setFlickerRate(int lRate)
          Rate in milliseconds used to Flicker the screen with the Flicker command.
 void setLineSymbol(ILineSymbol ppLineSymbol)
          The line symbol used by the CommandsEnvironment singleton.
 void setMarkerSymbol(IMarkerSymbol ppMarkerSymbol)
          The marker symbol used by the CommandsEnvironment singleton.
 void setSwipeLayerByRef(ILayer ppSwiperLayer)
          The layer the Swipe command uses.
 void setTextSymbol(ITextSymbol ppTextSymbol)
          The text symbol used by the CommandsEnvironment singleton.
 void setTransparencyLayerByRef(ILayer ppLayer)
          The layer the Transparency command uses.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

CommandsEnvironment

public CommandsEnvironment()
                    throws IOException,
                           UnknownHostException
Constructs a CommandsEnvironment using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

CommandsEnvironment

public CommandsEnvironment(Object obj)
                    throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
CommandsEnvironment theCommandsEnvironment = (CommandsEnvironment) obj;

Construct a CommandsEnvironment using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to CommandsEnvironment.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

setMarkerSymbol

public void setMarkerSymbol(IMarkerSymbol ppMarkerSymbol)
                     throws IOException,
                            AutomationException
The marker symbol used by the CommandsEnvironment singleton.

Product Availability

Available with ArcGIS Engine.

Specified by:
setMarkerSymbol in interface IGraphicProperties
Parameters:
ppMarkerSymbol - A reference to a com.esri.arcgis.display.IMarkerSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMarkerSymbol

public IMarkerSymbol getMarkerSymbol()
                              throws IOException,
                                     AutomationException
The marker symbol used by the CommandsEnvironment singleton.

Description

The MarkerSymbol used by the ControlsNewMarkerTool, ControlsRouteCommand and the IHookActions methods. By default the IMarkerSymbol::Size is 2, and the IMarkerSymbol::Color is black.

The IMarkerSymbol::Color returns a clone, so to change the default color set an IColor object into IMarkerSymbol::Color.

Product Availability

Available with ArcGIS Engine.

Specified by:
getMarkerSymbol in interface IGraphicProperties
Returns:
A reference to a com.esri.arcgis.display.IMarkerSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLineSymbol

public void setLineSymbol(ILineSymbol ppLineSymbol)
                   throws IOException,
                          AutomationException
The line symbol used by the CommandsEnvironment singleton.

Product Availability

Available with ArcGIS Engine.

Specified by:
setLineSymbol in interface IGraphicProperties
Parameters:
ppLineSymbol - A reference to a com.esri.arcgis.display.ILineSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLineSymbol

public ILineSymbol getLineSymbol()
                          throws IOException,
                                 AutomationException
The line symbol used by the CommandsEnvironment singleton.

Description

The LineSymbol used by the ControlsNewCurveTool, ControlsNewFreeHandTool, ControlsNewLineTool, ControlsInkGenericDrawTool, ControlsInkHighlightTool, ControlsInkPenTool and the IHookActions methods. By default the Size is 2, and the ILineSymbol::Color is black.

The ILineSymbol::Color returns a clone, so to change the default color set an IColor object into ILineSymbol::Color.

Product Availability

Available with ArcGIS Engine.

Specified by:
getLineSymbol in interface IGraphicProperties
Returns:
A reference to a com.esri.arcgis.display.ILineSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFillSymbol

public void setFillSymbol(IFillSymbol ppFillSymbol)
                   throws IOException,
                          AutomationException
The fill symbol used by the CommandsEnvironment singleton.

Product Availability

Available with ArcGIS Engine.

Specified by:
setFillSymbol in interface IGraphicProperties
Parameters:
ppFillSymbol - A reference to a com.esri.arcgis.display.IFillSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFillSymbol

public IFillSymbol getFillSymbol()
                          throws IOException,
                                 AutomationException
The fill symbol used by the CommandsEnvironment singleton.

Description

The FillSymbol used by the ControlsNewCircleTool, ControlsNewEllipseTool, ControlsNewPolygonTool, ControlsNewRectangleTool and the IHookActions methods. By default the IFillSymbol::Color is yellow and the IFillSymbol::Outline is black with a width of 1.

The IFillSymbol::Color and IFillSymbol::Outline return clones, so to change the default color and outline set an IColor object into IFillSymbol::Color and an ILineSymbol into IFillSymbol::Outline.

Product Availability

Available with ArcGIS Engine.

Specified by:
getFillSymbol in interface IGraphicProperties
Returns:
A reference to a com.esri.arcgis.display.IFillSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTextSymbol

public void setTextSymbol(ITextSymbol ppTextSymbol)
                   throws IOException,
                          AutomationException
The text symbol used by the CommandsEnvironment singleton.

Product Availability

Available with ArcGIS Engine.

Specified by:
setTextSymbol in interface IGraphicProperties
Parameters:
ppTextSymbol - A reference to a com.esri.arcgis.display.ITextSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTextSymbol

public ITextSymbol getTextSymbol()
                          throws IOException,
                                 AutomationException
The text symbol used by the CommandsEnvironment singleton.

Description

The TextSymbol used by the ControlsInkFinishSketchCommand, ControlsRouteCommand and the IHookActions methods. By default the TextSymbol is black, and size 10 using the 'Arial' font.

Product Availability

Available with ArcGIS Engine.

Specified by:
getTextSymbol in interface IGraphicProperties
Returns:
A reference to a com.esri.arcgis.display.ITextSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCallout

public void setCallout(IFormattedTextSymbol ppCallout)
                throws IOException,
                       AutomationException
The callout symbol used by the CommandsEnvironment singleton.

Product Availability

Available with ArcGIS Engine.

Specified by:
setCallout in interface IGraphicProperties
Parameters:
ppCallout - A reference to a com.esri.arcgis.display.IFormattedTextSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCallout

public IFormattedTextSymbol getCallout()
                                throws IOException,
                                       AutomationException
The callout symbol used by the CommandsEnvironment singleton.

Description

The Callout used by the IHookActions methods. By default the Callout is black, and size 10 using the 'Arial' font.

Product Availability

Available with ArcGIS Engine.

Specified by:
getCallout in interface IGraphicProperties
Returns:
A reference to a com.esri.arcgis.display.IFormattedTextSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSwipeLayerByRef

public void setSwipeLayerByRef(ILayer ppSwiperLayer)
                        throws IOException,
                               AutomationException
The layer the Swipe command uses.

Product Availability

Available with ArcGIS Engine.

Specified by:
setSwipeLayerByRef in interface ILayerEffectProperties
Parameters:
ppSwiperLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSwipeLayer

public ILayer getSwipeLayer()
                     throws IOException,
                            AutomationException
The layer the Swipe command uses.

Description

The layer used by the ControlsMapSwipeTool and ControlsGlobeSwipeTool. The SwipeLayer can be set programmatically or interactively by the end user selecting a layer using ControlsLayerListToolControl or ControlsGlobeLayerListToolControl.

Product Availability

Available with ArcGIS Engine.

Specified by:
getSwipeLayer in interface ILayerEffectProperties
Returns:
A reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFlickerLayerByRef

public void setFlickerLayerByRef(ILayer ppFlickerLayer)
                          throws IOException,
                                 AutomationException
The layer the Flicker command uses.

Product Availability

Available with ArcGIS Engine.

Specified by:
setFlickerLayerByRef in interface ILayerEffectProperties
Parameters:
ppFlickerLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFlickerLayer

public ILayer getFlickerLayer()
                       throws IOException,
                              AutomationException
The layer the Flicker command uses.

Description

The layer used by the ControlsMapFlickerCommand and ControlsGlobeFlickerCommand. The FlickerLayer can be set programmatically or interactively by the end user selecting a layer using ControlsLayerListToolControl or ControlsGlobeLayerListToolControl.

Product Availability

Available with ArcGIS Engine.

Specified by:
getFlickerLayer in interface ILayerEffectProperties
Returns:
A reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTransparencyLayerByRef

public void setTransparencyLayerByRef(ILayer ppLayer)
                               throws IOException,
                                      AutomationException
The layer the Transparency command uses.

Product Availability

Available with ArcGIS Engine.

Specified by:
setTransparencyLayerByRef in interface ILayerEffectProperties
Parameters:
ppLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTransparencyLayer

public ILayer getTransparencyLayer()
                            throws IOException,
                                   AutomationException
The layer the Transparency command uses.

Description

The layer used by the ControlsLayerTransparencyCommand. The TransparencyLayer can be set programmatically or interactively by the end user selecting a layer using ControlsLayerListToolControl or ControlsGlobeLayerListToolControl.

Product Availability

Available with ArcGIS Engine.

Specified by:
getTransparencyLayer in interface ILayerEffectProperties
Returns:
A reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFlickerRate

public void setFlickerRate(int lRate)
                    throws IOException,
                           AutomationException
Rate in milliseconds used to Flicker the screen with the Flicker command.

Product Availability

Available with ArcGIS Engine.

Specified by:
setFlickerRate in interface ILayerEffectProperties
Parameters:
lRate - The lRate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFlickerRate

public int getFlickerRate()
                   throws IOException,
                          AutomationException
Rate in milliseconds used to Flicker the screen with the Flicker command.

Description

The flicker rate in milliseconds used by the ControlsMapFlickerCommand and ControlsGlobeFlickerCommand. The FlickerRate can be set programmatically or interactively by the end user selecting a rate using ControlsFlickerRateToolControl. By default the FlickerRate is 500.

Product Availability

Available with ArcGIS Engine.

Specified by:
getFlickerRate in interface ILayerEffectProperties
Returns:
The lRate
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.