com.esri.arcgis.controls
Class EngineNetworkAnalystEnvironment

java.lang.Object
  extended by com.esri.arcgis.controls.EngineNetworkAnalystEnvironment
All Implemented Interfaces:
IEngineNetworkAnalystEnvironment, IEngineNetworkAnalystHelper, IEngineNetworkAnalystHelper2, IConnectionPointContainer, com.esri.arcgis.interop.RemoteObjRef, IExtension, ISupportErrorInfo, IToolSelectedLayer, Serializable

public class EngineNetworkAnalystEnvironment
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IEngineNetworkAnalystEnvironment, IEngineNetworkAnalystHelper, IEngineNetworkAnalystHelper2, ISupportErrorInfo, IConnectionPointContainer, IToolSelectedLayer, IExtension

A singleton object representing Engine Network Analyst environment.

Description

The EngineNetworkAnalystEnvironment object is a singleton object (only one instance of the EngineNetworkAnalystEnvironment object is supported per thread) that manages the INetworkLayer objects and the NAWindow.

The EngineNetworkAnalystEnvironment object implements the IEngineNetworkAnalystEnvironment, IEngineNetworkAnalystEnvironmentEvents, and IEngineNetworkAnalystHelper interfaces. The members of these interfaces manage the collection of network layers, the current network layer, solving and getting directions.

Product Availability

Available with ArcGIS Engine.

Singleton:

This type is a singleton.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.system.IExtension
IID, IID7f657ec9_dbf1_11d2_9f2f_00c04f6bc69e, xxDummy
 
Constructor Summary
EngineNetworkAnalystEnvironment()
          Constructs a EngineNetworkAnalystEnvironment using ArcGIS Engine.
EngineNetworkAnalystEnvironment(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
EngineNetworkAnalystEnvironment theEngineNetworkAnalystEnvironment = (EngineNetworkAnalystEnvironment) obj;
 
Method Summary
 void addIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
          addIEngineNetworkAnalystEnvironmentEventsListener.
 void addNetworkLocation(IPoint pPoint, String name)
          Adds a network location to the NAWindow at the specified point.
 void addNetworkLocationEx(IGeometry pGeometry, String name)
          Adds a network location to the NAWindow at the specified geometry.
 void deleteAllNetworkLocations()
          Delete all network locations of active category for active analysis.
 void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
          enumConnectionPoints
 boolean equals(Object o)
          Compare this object with another
 void findConnectionPoint(GUID riid, IConnectionPoint[] ppCP)
          findConnectionPoint
static String getClsid()
          getClsid.
 INetworkLayer getCurrentNetworkLayer()
          The current network layer.
 INAStreetDirectionsContainer getDirections()
          Get directions after solving.
 int getLayerIndex()
          The index of selected layer.
 String getName()
          The name of the extension.
 IEngineNAWindow getNAWindow()
          The network analysis window.
 INetworkLayer getNetworkLayer(int index)
          The network layer by index.
 int getNetworkLayerCount()
          The number of network layers.
 int getShowAnalysisMessagesAfterSolve()
          The types of messages that are displayed after solving.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isCanAddNetworkLocation()
          Indicates if a network location can be added to the NAWindow at the specified geometry.
 boolean isCanMoveNetworkLocation()
          Indicates if the network location of the selected item in the NAWindow can be moevd to the specified geometry.
 boolean isZoomToResultAfterSolve()
          Indicates if the window should zoom the map to show results after solving.
 void moveNetworkLocation(IPoint pPoint, String name)
          Moves the network location of the selected item in the NAWindow to the specified point.
 void moveNetworkLocationEx(IGeometry pGeometry, String name)
          Moves the network location of the selected item in the NAWindow to the specified geometry.
 void removeIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
          removeIEngineNetworkAnalystEnvironmentEventsListener.
 void setCurrentNetworkLayer(INetworkLayer layer)
          The current network layer.
 void setLayerIndex(int layerIndex)
          The index of selected layer.
 void setShowAnalysisMessagesAfterSolve(int messageTypes)
          The types of messages that are displayed after solving.
 void setZoomToResultAfterSolve(boolean flag)
          Indicates if the window should zoom the map to show results after solving.
 void shutdown()
          Shuts down the extension.
 void solve()
          Solve for current network locations.
 void startup(Object initializationData)
          Starts up the extension with the given initialization data.
 
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

EngineNetworkAnalystEnvironment

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

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

EngineNetworkAnalystEnvironment

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

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

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

addIEngineNetworkAnalystEnvironmentEventsListener

public void addIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
                                                       throws IOException
addIEngineNetworkAnalystEnvironmentEventsListener. Listen to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.controls.IEngineNetworkAnalystEnvironmentEvents interface.
Throws:
IOException - If there are communications problems.

removeIEngineNetworkAnalystEnvironmentEventsListener

public void removeIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
                                                          throws IOException
removeIEngineNetworkAnalystEnvironmentEventsListener. Stop listening to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.controls.IEngineNetworkAnalystEnvironmentEvents interface.
Throws:
IOException - If there are communications problems.

getNAWindow

public IEngineNAWindow getNAWindow()
                            throws IOException,
                                   AutomationException
The network analysis window.

Description

Returns the Engine Network Analyst Window.

Product Availability

Available with ArcGIS Engine.

Specified by:
getNAWindow in interface IEngineNetworkAnalystEnvironment
Returns:
A reference to a com.esri.arcgis.controls.IEngineNAWindow
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetworkLayerCount

public int getNetworkLayerCount()
                         throws IOException,
                                AutomationException
The number of network layers.

Description

Returns the number of INetworkLayer objects referencing NetworkDataset objects in the map.

Product Availability

Available with ArcGIS Engine.

Specified by:
getNetworkLayerCount in interface IEngineNetworkAnalystEnvironment
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetworkLayer

public INetworkLayer getNetworkLayer(int index)
                              throws IOException,
                                     AutomationException
The network layer by index.

Product Availability

Available with ArcGIS Engine.

Specified by:
getNetworkLayer in interface IEngineNetworkAnalystEnvironment
Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.carto.INetworkLayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCurrentNetworkLayer

public INetworkLayer getCurrentNetworkLayer()
                                     throws IOException,
                                            AutomationException
The current network layer.

Description

The currently selected INetworkLayer object.

Product Availability

Available with ArcGIS Engine.

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

setCurrentNetworkLayer

public void setCurrentNetworkLayer(INetworkLayer layer)
                            throws IOException,
                                   AutomationException
The current network layer.

Product Availability

Available with ArcGIS Engine.

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

isZoomToResultAfterSolve

public boolean isZoomToResultAfterSolve()
                                 throws IOException,
                                        AutomationException
Indicates if the window should zoom the map to show results after solving.

Description

Indicates if the display will automatically zoom to the extent of the analysis results once the network analysis is complete. By deafult this property is false.

Product Availability

Available with ArcGIS Engine.

Specified by:
isZoomToResultAfterSolve in interface IEngineNetworkAnalystEnvironment
Returns:
The flag
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setZoomToResultAfterSolve

public void setZoomToResultAfterSolve(boolean flag)
                               throws IOException,
                                      AutomationException
Indicates if the window should zoom the map to show results after solving.

Product Availability

Available with ArcGIS Engine.

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

getShowAnalysisMessagesAfterSolve

public int getShowAnalysisMessagesAfterSolve()
                                      throws IOException,
                                             AutomationException
The types of messages that are displayed after solving.

Description

The type of messages displayed when a solve completes.

For example, esriEngineNAMessageTypeNone (0) means you do not want to see any messages after solve and esriEngineNAMessageTypeError + esriEngineNAMessageTypeWarning (6) means you just want to see errors and warnings.

Product Availability

Available with ArcGIS Engine.

Specified by:
getShowAnalysisMessagesAfterSolve in interface IEngineNetworkAnalystEnvironment
Returns:
The messageTypes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setShowAnalysisMessagesAfterSolve

public void setShowAnalysisMessagesAfterSolve(int messageTypes)
                                       throws IOException,
                                              AutomationException
The types of messages that are displayed after solving.

Product Availability

Available with ArcGIS Engine.

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

addNetworkLocation

public void addNetworkLocation(IPoint pPoint,
                               String name)
                        throws IOException,
                               AutomationException
Adds a network location to the NAWindow at the specified point.

Description

Adds the specified point to the IEngineNAWindow::ActiveCategory of the IEngineNAWindow::ActiveAnalysis layer as a network location.

Product Availability

Available with ArcGIS Engine.

Specified by:
addNetworkLocation in interface IEngineNetworkAnalystHelper
Parameters:
pPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteAllNetworkLocations

public void deleteAllNetworkLocations()
                               throws IOException,
                                      AutomationException
Delete all network locations of active category for active analysis.

Description

Deletes all network locations in the IEngineNAWindow::ActiveCategory of the IEngineNAWindow::ActiveAnalysis layer.

Product Availability

Available with ArcGIS Engine.

Specified by:
deleteAllNetworkLocations in interface IEngineNetworkAnalystHelper
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDirections

public INAStreetDirectionsContainer getDirections()
                                           throws IOException,
                                                  AutomationException
Get directions after solving.

Description

Use the GetDirections method after using the Solve method to return directions contents in XML format. Using GetDirections before the Solve method will return nothing.

Product Availability

Available with ArcGIS Engine.

Specified by:
getDirections in interface IEngineNetworkAnalystHelper
Returns:
A reference to a com.esri.arcgis.networkanalyst.INAStreetDirectionsContainer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

solve

public void solve()
           throws IOException,
                  AutomationException
Solve for current network locations.

Description

Solve performs network analysis based upon the IEngineNAWindow::ActiveAnalysis layer and the NAContext.

Product Availability

Available with ArcGIS Engine.

Specified by:
solve in interface IEngineNetworkAnalystHelper
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addNetworkLocationEx

public void addNetworkLocationEx(IGeometry pGeometry,
                                 String name)
                          throws IOException,
                                 AutomationException
Adds a network location to the NAWindow at the specified geometry.

Product Availability

Available with ArcGIS Engine.

Specified by:
addNetworkLocationEx in interface IEngineNetworkAnalystHelper2
Parameters:
pGeometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCanAddNetworkLocation

public boolean isCanAddNetworkLocation()
                                throws IOException,
                                       AutomationException
Indicates if a network location can be added to the NAWindow at the specified geometry.

Product Availability

Available with ArcGIS Engine.

Specified by:
isCanAddNetworkLocation in interface IEngineNetworkAnalystHelper2
Returns:
The pEnabled
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

moveNetworkLocation

public void moveNetworkLocation(IPoint pPoint,
                                String name)
                         throws IOException,
                                AutomationException
Moves the network location of the selected item in the NAWindow to the specified point.

Product Availability

Available with ArcGIS Engine.

Specified by:
moveNetworkLocation in interface IEngineNetworkAnalystHelper2
Parameters:
pPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

moveNetworkLocationEx

public void moveNetworkLocationEx(IGeometry pGeometry,
                                  String name)
                           throws IOException,
                                  AutomationException
Moves the network location of the selected item in the NAWindow to the specified geometry.

Product Availability

Available with ArcGIS Engine.

Specified by:
moveNetworkLocationEx in interface IEngineNetworkAnalystHelper2
Parameters:
pGeometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCanMoveNetworkLocation

public boolean isCanMoveNetworkLocation()
                                 throws IOException,
                                        AutomationException
Indicates if the network location of the selected item in the NAWindow can be moevd to the specified geometry.

Product Availability

Available with ArcGIS Engine.

Specified by:
isCanMoveNetworkLocation in interface IEngineNetworkAnalystHelper2
Returns:
The pEnabled
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

enumConnectionPoints

public void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
                          throws IOException,
                                 AutomationException
enumConnectionPoints

Description

IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
enumConnectionPoints in interface IConnectionPointContainer
Parameters:
ppEnum - A reference to a com.esri.arcgis.display.IEnumConnectionPoints (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findConnectionPoint

public void findConnectionPoint(GUID riid,
                                IConnectionPoint[] ppCP)
                         throws IOException,
                                AutomationException
findConnectionPoint

Description

IConnectionPointContainer is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
findConnectionPoint in interface IConnectionPointContainer
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
ppCP - A reference to a com.esri.arcgis.display.IConnectionPoint (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLayerIndex

public void setLayerIndex(int layerIndex)
                   throws IOException,
                          AutomationException
The index of selected layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

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

getLayerIndex

public int getLayerIndex()
                  throws IOException,
                         AutomationException
The index of selected layer.

Description

The index of the currently 'selected' layer that the Command operates with.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getLayerIndex in interface IToolSelectedLayer
Returns:
The layerIndex
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the extension.

Specified by:
getName in interface IExtension
Returns:
The extensionName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startup

public void startup(Object initializationData)
             throws IOException,
                    AutomationException
Starts up the extension with the given initialization data.

Specified by:
startup in interface IExtension
Parameters:
initializationData - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

shutdown

public void shutdown()
              throws IOException,
                     AutomationException
Shuts down the extension.

Specified by:
shutdown in interface IExtension
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.