com.esri.arcgis.controls
Class SceneHookHelper

java.lang.Object
  extended by com.esri.arcgis.controls.SceneHookHelper
All Implemented Interfaces:
ISceneHookHelper, IConnectionPointContainer, com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, Serializable

public class SceneHookHelper
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ISceneHookHelper, IConnectionPointContainer, ISupportErrorInfo

Helps commands work with the SceneControl, ArcScene, and custom controls and applications.

Description

The SceneHookHelper is designed to help developers write custom commands that will work with some ArcGIS Engine Controls and applications.

When creating a custom command the ICommand::OnCreate event is passed a hook to the control or application that the command will work with. The command needs to determine the type of hook that is passed so it knows how to handle itself. Rather than adding code into the ICommand::OnCreate event to determine the type of hook a SceneHookHelper object can do this. The SceneHookHelper is used to hold the hook and return the IScene, ISceneGraph, ISceneViewer and ICamera objects regardless of whether the hook is a SceneControl, ToolbarControl (with a 'buddy' SceneControl), the ArcScene application or a custom control or application implementing ISceneCommandHook.

When using the SceneHookHelper in the ICommand::OnCreate event of custom commands the following must be considered:

Product Availability

Available with ArcGIS Engine.

See Also:
Serialized Form

Constructor Summary
SceneHookHelper()
          Constructs a SceneHookHelper using ArcGIS Engine.
SceneHookHelper(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
SceneHookHelper theSceneHookHelper = (SceneHookHelper) obj;
 
Method Summary
 void addIHookHelperEventsListener(IHookHelperEvents theListener)
          addIHookHelperEventsListener.
 void enumConnectionPoints(IEnumConnectionPoints[] ppEnum)
          enumConnectionPoints
 boolean equals(Object o)
          Compare this object with another
 void findConnectionPoint(GUID riid, IConnectionPoint[] ppCP)
          findConnectionPoint
 ISceneViewer getActiveViewer()
          Active scene viewer of hooked control or application.
 ICamera getCamera()
          Camera of hooked control or application.
static String getClsid()
          getClsid.
 Object getHook()
          Hook object that should be the same as the hook object passed in ICommand::OnCreate.
 IScene getScene()
          Scene of hooked control or application.
 ISceneGraph getSceneGraph()
          SceneGraph of hooked control or application.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void removeIHookHelperEventsListener(IHookHelperEvents theListener)
          removeIHookHelperEventsListener.
 void setHookByRef(Object ppHook)
          Hook object that should be the same as the hook object passed in ICommand::OnCreate.
 
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

SceneHookHelper

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

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

SceneHookHelper

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

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

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

addIHookHelperEventsListener

public void addIHookHelperEventsListener(IHookHelperEvents theListener)
                                  throws IOException
addIHookHelperEventsListener. Listen to events generated by this class.

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

removeIHookHelperEventsListener

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

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

setHookByRef

public void setHookByRef(Object ppHook)
                  throws IOException,
                         AutomationException
Hook object that should be the same as the hook object passed in ICommand::OnCreate.

Product Availability

Available with ArcGIS Engine.

Specified by:
setHookByRef in interface ISceneHookHelper
Parameters:
ppHook - A reference to another Automation Object (IDispatch) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHook

public Object getHook()
               throws IOException,
                      AutomationException
Hook object that should be the same as the hook object passed in ICommand::OnCreate.

Description

The hook that is passed to the ICommand::OnCreate event. The hook is a SceneControl, ToolbarControl or ArcScene.

Product Availability

Available with ArcGIS Engine.

Specified by:
getHook in interface ISceneHookHelper
Returns:
A reference to another Automation Object (IDispatch)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getScene

public IScene getScene()
                throws IOException,
                       AutomationException
Scene of hooked control or application.

Description

The IScene object of the hook passed to the ICommand::OnCreate event. The Scene is returned regardless of whether the hook is a SceneControl, ToolbarControl (with a 'buddy' SceneControl) or ArcScene.

Product Availability

Available with ArcGIS Engine.

Specified by:
getScene in interface ISceneHookHelper
Returns:
A reference to a com.esri.arcgis.analyst3d.IScene
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSceneGraph

public ISceneGraph getSceneGraph()
                          throws IOException,
                                 AutomationException
SceneGraph of hooked control or application.

Description

The ISceneGraph object of the hook passed to the ICommand::OnCreate event. The SceneGraph is returned regardless of whether the hook is a SceneControl, ToolbarControl (with a 'buddy' SceneControl) or ArcScene.

Product Availability

Available with ArcGIS Engine.

Specified by:
getSceneGraph in interface ISceneHookHelper
Returns:
A reference to a com.esri.arcgis.analyst3d.ISceneGraph
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getActiveViewer

public ISceneViewer getActiveViewer()
                             throws IOException,
                                    AutomationException
Active scene viewer of hooked control or application.

Description

The ISceneViewer object of the hook passed to the ICommand::OnCreate event. The ActiveViewer is returned regardless of whether the hook is a SceneControl, ToolbarControl (with a 'buddy' SceneControl) or ArcScene.

Product Availability

Available with ArcGIS Engine.

Specified by:
getActiveViewer in interface ISceneHookHelper
Returns:
A reference to a com.esri.arcgis.analyst3d.ISceneViewer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCamera

public ICamera getCamera()
                  throws IOException,
                         AutomationException
Camera of hooked control or application.

Description

The ICamera object of the hook passed to the ICommand::OnCreate event. The ActiveViewer is returned regardless of whether the hook is a SceneControl, ToolbarControl (with a 'buddy' SceneControl) or ArcScene.

Product Availability

Available with ArcGIS Engine.

Specified by:
getCamera in interface ISceneHookHelper
Returns:
A reference to a com.esri.arcgis.analyst3d.ICamera
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.

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.