com.esri.arcgis.controls
Class EngineNetworkAnalystEnvironment

java.lang.Object
  extended bycom.esri.arcgis.controls.EngineNetworkAnalystEnvironment
All Implemented Interfaces:
IConnectionPointContainer, IEngineNetworkAnalystEnvironment, IEngineNetworkAnalystHelper, ISupportErrorInfo, IToolSelectedLayer, java.io.Serializable

public class EngineNetworkAnalystEnvironment
extends java.lang.Object
implements IEngineNetworkAnalystEnvironment, IEngineNetworkAnalystHelper, ISupportErrorInfo, IConnectionPointContainer, IToolSelectedLayer

A singleton object representing Engine Network Analyst environment.

Product Availability

Available with ArcGIS Engine.

Description

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

See Also:
Serialized Form

Constructor Summary
EngineNetworkAnalystEnvironment()
          Constructs a EngineNetworkAnalystEnvironment using ArcGIS Engine.
EngineNetworkAnalystEnvironment(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
 
Method Summary
 void addIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
           
 void addNetworkLocation(IPoint pPoint, java.lang.String name)
          Add a named point as a network location.
 void deleteAllNetworkLocations()
          Delete all network locations of active category for active analysis.
 void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
          Supported Platforms
 boolean equals(java.lang.Object o)
          Compare this object with another
 void findConnectionPoint(GUID riid, IConnectionPoint[] ppCP)
          Supported Platforms
 IConnectionPointContainer getAsIConnectionPointContainer()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IEngineNetworkAnalystEnvironment getAsIEngineNetworkAnalystEnvironment()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IEngineNetworkAnalystHelper getAsIEngineNetworkAnalystHelper()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ISupportErrorInfo getAsISupportErrorInfo()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IToolSelectedLayer getAsIToolSelectedLayer()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
static java.lang.String getClsid()
           
 INetworkLayer getCurrentNetworkLayer()
          The current network layer.
 INAStreetDirectionsContainer getDirections()
          Get directions after solving.
 int getLayerIndex()
          The index of selected layer.
 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)
          Supported Platforms
 boolean isZoomToResultAfterSolve()
          Indicates if the window should zoom the map to show results after solving.
 void removeIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
           
 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 solve()
          Solve for current network locations.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EngineNetworkAnalystEnvironment

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

Throws:
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems

EngineNetworkAnalystEnvironment

public EngineNetworkAnalystEnvironment(java.lang.Object obj)
                                throws java.io.IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.

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.
EngineNetworkAnalystEnvironment theEngineNetworkAnalystEnvironment = (EngineNetworkAnalystEnvironment) obj;

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

getClsid

public static java.lang.String getClsid()

getAsIEngineNetworkAnalystEnvironment

public IEngineNetworkAnalystEnvironment getAsIEngineNetworkAnalystEnvironment()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIEngineNetworkAnalystHelper

public IEngineNetworkAnalystHelper getAsIEngineNetworkAnalystHelper()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsISupportErrorInfo

public ISupportErrorInfo getAsISupportErrorInfo()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIConnectionPointContainer

public IConnectionPointContainer getAsIConnectionPointContainer()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIToolSelectedLayer

public IToolSelectedLayer getAsIToolSelectedLayer()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


equals

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


hashCode

public int hashCode()
the hashcode for this object


addIEngineNetworkAnalystEnvironmentEventsListener

public void addIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
                                                       throws java.io.IOException
Throws:
java.io.IOException

removeIEngineNetworkAnalystEnvironmentEventsListener

public void removeIEngineNetworkAnalystEnvironmentEventsListener(IEngineNetworkAnalystEnvironmentEvents theListener)
                                                          throws java.io.IOException
Throws:
java.io.IOException

getNAWindow

public IEngineNAWindow getNAWindow()
                            throws java.io.IOException,
                                   AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
The network analysis window.

Description

Returns the Engine Network Analyst Window.

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

getNetworkLayerCount

public int getNetworkLayerCount()
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
The number of network layers.

Description

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

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

getNetworkLayer

public INetworkLayer getNetworkLayer(int index)
                              throws java.io.IOException,
                                     AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
The network layer by index.

Description

Returns the INetworkLayer object referencing a NetworkDataset at the specified index in the range 0 to NetworkLayerCount - 1.

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

getCurrentNetworkLayer

public INetworkLayer getCurrentNetworkLayer()
                                     throws java.io.IOException,
                                            AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
The current network layer.

Description

The currently selected INetworkLayer object. 

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

setCurrentNetworkLayer

public void setCurrentNetworkLayer(INetworkLayer layer)
                            throws java.io.IOException,
                                   AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
The current network layer.

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

isZoomToResultAfterSolve

public boolean isZoomToResultAfterSolve()
                                 throws java.io.IOException,
                                        AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
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.

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

setZoomToResultAfterSolve

public void setZoomToResultAfterSolve(boolean flag)
                               throws java.io.IOException,
                                      AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
Indicates if the window should zoom the map to show results after solving.

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

getShowAnalysisMessagesAfterSolve

public int getShowAnalysisMessagesAfterSolve()
                                      throws java.io.IOException,
                                             AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
The types of messages that are displayed after solving.

Description

The type of messages displayed when a solve completes.

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

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

setShowAnalysisMessagesAfterSolve

public void setShowAnalysisMessagesAfterSolve(int messageTypes)
                                       throws java.io.IOException,
                                              AutomationException
Description copied from interface: IEngineNetworkAnalystEnvironment
The types of messages that are displayed after solving.

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

addNetworkLocation

public void addNetworkLocation(IPoint pPoint,
                               java.lang.String name)
                        throws java.io.IOException,
                               AutomationException
Description copied from interface: IEngineNetworkAnalystHelper
Add a named point as a network location.

Description

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

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

deleteAllNetworkLocations

public void deleteAllNetworkLocations()
                               throws java.io.IOException,
                                      AutomationException
Description copied from interface: IEngineNetworkAnalystHelper
Delete all network locations of active category for active analysis.

Description

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

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

getDirections

public INAStreetDirectionsContainer getDirections()
                                           throws java.io.IOException,
                                                  AutomationException
Description copied from interface: IEngineNetworkAnalystHelper
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.

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

solve

public void solve()
           throws java.io.IOException,
                  AutomationException
Description copied from interface: IEngineNetworkAnalystHelper
Solve for current network locations.

Description

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

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

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws java.io.IOException,
                                       AutomationException
Description copied from interface: ISupportErrorInfo

Supported Platforms

Windows, Solaris, Linux

Description

Indicates whether the interface supports IErrorInfo.

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

enumConnectionPoints

public void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
                          throws java.io.IOException,
                                 AutomationException
Description copied from interface: IConnectionPointContainer

Supported Platforms

Windows, Solaris, Linux

Description

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

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

findConnectionPoint

public void findConnectionPoint(GUID riid,
                                IConnectionPoint[] ppCP)
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: IConnectionPointContainer

Supported Platforms

Windows, Solaris, Linux

Description

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

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:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

setLayerIndex

public void setLayerIndex(int layerIndex)
                   throws java.io.IOException,
                          AutomationException
Description copied from interface: IToolSelectedLayer
The index of selected layer.

Supported Platforms

Windows, Solaris, Linux

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

getLayerIndex

public int getLayerIndex()
                  throws java.io.IOException,
                         AutomationException
Description copied from interface: IToolSelectedLayer
The index of selected layer.

Supported Platforms

Windows, Solaris, Linux

Description

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

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