com.esri.arcgis.controls
Class ITOCControlProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.controls.ITOCControlProxy
All Implemented Interfaces:
ITOCControl, Externalizable, Serializable
Direct Known Subclasses:
ITOCControl2Proxy

public class ITOCControlProxy
extends com.esri.arcgis.interop.Dispatch
implements ITOCControl, Serializable

Provides access to members that control the TOCControl.

Superseded By

ITOCControl2

Description

The ITOCControl interface is a starting point for any tasks related to the TOCControl such as setting the general appearance, setting the Buddy control, and managing layer visibility and label editing.

Product Availability

Available with ArcGIS Engine.

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  ITOCControlProxy()
           
  ITOCControlProxy(Object obj)
           
protected ITOCControlProxy(Object obj, String iid)
           
 
Method Summary
 void aboutBox()
          Displays a dialog of information about the TOCControl.
 void addListener(String iidStr, Object theListener, Object theSource)
           
 boolean esri_isEnabled()
          Indicates whether the TOCControl can respond to user generated events.
 void esri_setEnabled(boolean enabled)
          Indicates whether the TOCControl can respond to user generated events.
 IActiveView getActiveView()
          The ActiveView used to populate the TOCControl.
 int getAppearance()
          The appearance of the TOCControl.
 int getBorderStyle()
          The border style of the TOCControl.
 Object getBuddy()
          The object whose ActiveView is used to populate the TOCControl.
 Object getCustomProperty()
          A property to associate data with a control.
 int getHWnd()
          Handle to the window associated with the TOCControl.
 int getKeyIntercept()
          A property that specifies interception of key strokes that are normally handled by the container.
 int getLabelEdit()
          Label editing state.
 int getLayerVisibilityEdit()
          Layer visibility editing state.
 Picture getMouseIcon()
          Custom mouse icon used if MousePointer is 99.
 int getMousePointer()
          The mouse pointer displayed over the TOCControl.
 Object getObject()
          A property that returns the underlying control.
 void hitTest(int x, int y, int[] itemType, IBasicMap[] basicMap, ILayer[] layer, Object[] unk, Object[] data)
          Returns the item in the TOCControl at the specified coordinates.
 void removeListener(String iidStr, Object theListener)
           
 void setActiveView(IActiveView activeView)
          Sets the ActiveView used to populate the TOCControl.
 void setAppearance(int appearance)
          The appearance of the TOCControl.
 void setBorderStyle(int borderStyle)
          The border style of the TOCControl.
 void setBuddyControl(Object pTOCBuddy)
          Sets a control to be a buddy of the toolbar, this control must support ITOCBuddy.
 void setCustomProperty(Object pVal)
          A property to associate data with a control.
 void setKeyIntercept(int pVal)
          A property that specifies interception of key strokes that are normally handled by the container.
 void setLabelEdit(int labelEdit)
          Label editing state.
 void setLayerVisibilityEdit(int layerVisibilityEdit)
          Layer visibility editing state.
 void setMouseIconByRef(Picture mouseIcon)
          Custom mouse icon used if MousePointer is 99.
 void setMousePointer(int mousePointer)
          The mouse pointer displayed over the TOCControl.
 void update()
          Updates the contents of the TOCControl to match its ActiveView.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

ITOCControlProxy

public ITOCControlProxy()

ITOCControlProxy

public ITOCControlProxy(Object obj)
                 throws IOException
Throws:
IOException

ITOCControlProxy

protected ITOCControlProxy(Object obj,
                           String iid)
                    throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

esri_setEnabled

public void esri_setEnabled(boolean enabled)
                     throws IOException,
                            AutomationException
Indicates whether the TOCControl can respond to user generated events.

Product Availability

Available with ArcGIS Engine.

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

esri_isEnabled

public boolean esri_isEnabled()
                       throws IOException,
                              AutomationException
Indicates whether the TOCControl can respond to user generated events.

Product Availability

Available with ArcGIS Engine.

Specified by:
esri_isEnabled in interface ITOCControl
Returns:
The enabled
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHWnd

public int getHWnd()
            throws IOException,
                   AutomationException
Handle to the window associated with the TOCControl.

Description

The operating environment identifies each window, form and control in an application by assigning it a handle, or hWnd. Many ArcObjects methods and Windows API calls require the hWnd as an argument.

Product Availability

Available with ArcGIS Engine.

Specified by:
getHWnd in interface ITOCControl
Returns:
The hWnd
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMousePointer

public void setMousePointer(int mousePointer)
                     throws IOException,
                            AutomationException
The mouse pointer displayed over the TOCControl.

Product Availability

Available with ArcGIS Engine.

Specified by:
setMousePointer in interface ITOCControl
Parameters:
mousePointer - A com.esri.arcgis.controls.esriControlsMousePointer constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMousePointer

public int getMousePointer()
                    throws IOException,
                           AutomationException
The mouse pointer displayed over the TOCControl.

Description

Use this property when you want to indicate changes in functionality as the mouse pointer passes over the TOCControl. The esriPointerArrowHourglass setting (11) is useful for indicating that the user should wait for a process or operation to finish.

Product Availability

Available with ArcGIS Engine.

Specified by:
getMousePointer in interface ITOCControl
Returns:
A com.esri.arcgis.controls.esriControlsMousePointer constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMouseIconByRef

public void setMouseIconByRef(Picture mouseIcon)
                       throws IOException,
                              AutomationException
Custom mouse icon used if MousePointer is 99.

Product Availability

Available with ArcGIS Engine.

Specified by:
setMouseIconByRef in interface ITOCControl
Parameters:
mouseIcon - A reference to a com.esri.arcgis.support.ms.stdole.Picture (A com.esri.arcgis.support.ms.stdole.Picture COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMouseIcon

public Picture getMouseIcon()
                     throws IOException,
                            AutomationException
Custom mouse icon used if MousePointer is 99.

Description

The MouseIcon property provides a custom icon that is used when the MousePointer property is set to esriPointerArrowHourglass (99).

Remarks

In most development evironments the control's property pages can be used to load either a cursor (.cur) or icon (.ico) file. A cursor contains a custom 'hotspot' location and can be any size. The 'hotspot' location for an icon file defaults to the center of the icon. This property cannot be used to load animated cursor (.ani) files.

To programatically create an object implementing IPictureDisp there is the win32 function OleLoadPicture or helper methods depending on the development environment.

Product Availability

Available with ArcGIS Engine.

Specified by:
getMouseIcon in interface ITOCControl
Returns:
A reference to a com.esri.arcgis.support.ms.stdole.Picture (A com.esri.arcgis.support.ms.stdole.Picture COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAppearance

public int getAppearance()
                  throws IOException,
                         AutomationException
The appearance of the TOCControl.

Description

Returns or sets the paint style of a TOCControl to either Flat or 3D. By default the appearance is flat.

Product Availability

Available with ArcGIS Engine.

Specified by:
getAppearance in interface ITOCControl
Returns:
A com.esri.arcgis.controls.esriControlsAppearance constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAppearance

public void setAppearance(int appearance)
                   throws IOException,
                          AutomationException
The appearance of the TOCControl.

Product Availability

Available with ArcGIS Engine.

Specified by:
setAppearance in interface ITOCControl
Parameters:
appearance - A com.esri.arcgis.controls.esriControlsAppearance constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBorderStyle

public void setBorderStyle(int borderStyle)
                    throws IOException,
                           AutomationException
The border style of the TOCControl.

Product Availability

Available with ArcGIS Engine.

Specified by:
setBorderStyle in interface ITOCControl
Parameters:
borderStyle - A com.esri.arcgis.controls.esriControlsBorderStyle constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBorderStyle

public int getBorderStyle()
                   throws IOException,
                          AutomationException
The border style of the TOCControl.

Description

Returns or sets the border style of a TOCControl. By default a border is drawn.

Product Availability

Available with ArcGIS Engine.

Specified by:
getBorderStyle in interface ITOCControl
Returns:
A com.esri.arcgis.controls.esriControlsBorderStyle constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

aboutBox

public void aboutBox()
              throws IOException,
                     AutomationException
Displays a dialog of information about the TOCControl.

Description

The AboutBox method causes a modal dialog box to display on top of the TOCControl, containing information about the version and creation date of the TOCControl as well as listing relevant legal and copyright information from ESRI.

Product Availability

Available with ArcGIS Engine.

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

getActiveView

public IActiveView getActiveView()
                          throws IOException,
                                 AutomationException
The ActiveView used to populate the TOCControl.

Description

This is the ActiveView of the Buddy that is used by the TOCControl to populate itself with maps, layers and symbols. The ActiveView is set by the SetBuddyControl or SetActiveView methods.

Product Availability

Available with ArcGIS Engine.

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

getBuddy

public Object getBuddy()
                throws IOException,
                       AutomationException
The object whose ActiveView is used to populate the TOCControl.

Description

The Buddy returns the object implementing ITOCBuddy that was passed to the SetBuddyControl method. The Buddy is responsible for handling the ActiveView, and enables the TOCControl to populate itself with maps, layers and symbols.

The SetBuddyControl method will remove any wrapper object that a development environment has added to the control passed to it. As such, the object passed into the SetBuddyControl method may be different from the object returned by the Buddy.

Product Availability

Available with ArcGIS Engine.

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

hitTest

public void hitTest(int x,
                    int y,
                    int[] itemType,
                    IBasicMap[] basicMap,
                    ILayer[] layer,
                    Object[] unk,
                    Object[] data)
             throws IOException,
                    AutomationException
Returns the item in the TOCControl at the specified coordinates.

Description

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

y is the Y coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the TOCControl (the top left hand corner).

ItemType specifies an enumeration indicating the type of item (none, map, layer, heading or legend class).

Map specifies an IMap object.

Layer specifies an ILayer object.

Unk specifies an ILegendGroup object.

Data specifies a long indicating the index of the legend class within the legend group. Use this index in conjunction with the legend group to obtain a particular legend class. An index of -1 refers to the heading if it is present.

Product Availability

Available with ArcGIS Engine.

Specified by:
hitTest in interface ITOCControl
Parameters:
x - The x (in)
y - The y (in)
itemType - A com.esri.arcgis.controls.esriTOCControlItem constant (in/out: use single element array)
basicMap - A reference to a com.esri.arcgis.carto.IBasicMap (in/out: use single element array)
layer - A reference to a com.esri.arcgis.carto.ILayer (in/out: use single element array)
unk - A reference to another Object (IUnknown) (in/out: use single element array)
data - A Variant (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

update

public void update()
            throws IOException,
                   AutomationException
Updates the contents of the TOCControl to match its ActiveView.

Description

Updates the contents of the TOCControl based upon the ActiveView. Use the Update method after programmatically changing layer visibility and names, or changing any legend settings.

Remarks

The TOCControl will automatically update its contents in response to IActiveViewEvents fired from the Buddy and the ITOCBuddyEvents::ActiveViewReplaced event that indicates a new document has been loaded into the Buddy or the object encapsulated by the Buddy has been replaced.

Use the Update method to update a Map which is not the FocusMap, as the IActiveViewEvents will only be triggered for the FocusMap.

Product Availability

Available with ArcGIS Engine.

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

setActiveView

public void setActiveView(IActiveView activeView)
                   throws IOException,
                          AutomationException
Sets the ActiveView used to populate the TOCControl.

Description

Use the method to set the ActiveView used by the TOCControl to populate itself with maps, layers and symbols. The ActiveView can be set to IMapControl2::ActiveView, IPageLayoutControl::ActiveView, ISceneControl::Scene or IGlobeControl::Globe. The SetActiveView method causes the Buddy to be set to Nothing.

Remarks

If a Buddy has been set the TOCControl will populate itself based on the ActiveView of the Buddy.

Product Availability

Available with ArcGIS Engine.

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

getLayerVisibilityEdit

public int getLayerVisibilityEdit()
                           throws IOException,
                                  AutomationException
Layer visibility editing state.

Description

Use LabelVisibilityEdit to determine whether layer visibility is controlled programmatically or through user interaction with the check boxes. By default LayerVisibility is automatic.

Set the property to automatic to toggle layer visibility through user interaction with the check boxes.

Set the property to manual to toggle layer visibility programmatcially.

Remarks

If a layer has MinimumScale and MaximumScale thresholds set, its check box will become disabled when the layer is not displayed.

Product Availability

Available with ArcGIS Engine.

Specified by:
getLayerVisibilityEdit in interface ITOCControl
Returns:
A com.esri.arcgis.controls.esriTOCControlEdit constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLayerVisibilityEdit

public void setLayerVisibilityEdit(int layerVisibilityEdit)
                            throws IOException,
                                   AutomationException
Layer visibility editing state.

Product Availability

Available with ArcGIS Engine.

Specified by:
setLayerVisibilityEdit in interface ITOCControl
Parameters:
layerVisibilityEdit - A com.esri.arcgis.controls.esriTOCControlEdit constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLabelEdit

public int getLabelEdit()
                 throws IOException,
                        AutomationException
Label editing state.

Description

Use LabelEdit to determine whether label editing is controlled programmatically or through user interaction. By default label editing is automatic. To edit a map, layer, heading or legend class label, click on it at runtime, and then click on it a second time to invoke label editing. The ESC key on the keyboard can be used during the edit to cancel the LabelEdit.

Set the property to automatic to edit labels unchecked, and set to manual to trigger the OnBeginLabelEdit and OnEndLabelEdit events.

Product Availability

Available with ArcGIS Engine.

Specified by:
getLabelEdit in interface ITOCControl
Returns:
A com.esri.arcgis.controls.esriTOCControlEdit constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLabelEdit

public void setLabelEdit(int labelEdit)
                  throws IOException,
                         AutomationException
Label editing state.

Product Availability

Available with ArcGIS Engine.

Specified by:
setLabelEdit in interface ITOCControl
Parameters:
labelEdit - A com.esri.arcgis.controls.esriTOCControlEdit constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCustomProperty

public Object getCustomProperty()
                         throws IOException,
                                AutomationException
A property to associate data with a control.

Description

Use the CustomProperty to associate any useful data with the TOCControl. This is similar to a 'Tag' property, and can be use to store strings, numbers and objects.

Product Availability

Available with ArcGIS Engine.

Specified by:
getCustomProperty in interface ITOCControl
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCustomProperty

public void setCustomProperty(Object pVal)
                       throws IOException,
                              AutomationException
A property to associate data with a control.

Product Availability

Available with ArcGIS Engine.

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

setBuddyControl

public void setBuddyControl(Object pTOCBuddy)
                     throws IOException,
                            AutomationException
Sets a control to be a buddy of the toolbar, this control must support ITOCBuddy.

Description

Pass the SetBuddyControl method a MapControl, PageLayoutControl, SceneControl, GlobeControl or object implementing ITOCBuddy whose ActiveView is passed to the TOCControl to enable it to populate itself with maps, layers and symbols. By default no buddy is set. To clear the Buddy set the property to Nothing.

Product Availability

Available with ArcGIS Engine.

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

getObject

public Object getObject()
                 throws IOException,
                        AutomationException
A property that returns the underlying control. This can be used when the control is inside a wrapper object that has been added by a development environment.

Description

In some development environments it is not possible to query interface directly on the control to other COM interfaces, beacuse the control is contained within a wrapper object. To get the real control use the Object property.

Product Availability

Available with ArcGIS Engine.

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

getKeyIntercept

public int getKeyIntercept()
                    throws IOException,
                           AutomationException
A property that specifies interception of key strokes that are normally handled by the container. When intercepted the OnKeyDown and OnKeyUp events will be called. This value can be a combined bit mask of esriKeyIntercept enum values.

Description

Returns or sets keys on the keyboard that will be intercepted by the TOCControl, triggering the OnKeyDown and OnKeyUp events when pressed. These keys are often hidden from the TOCControl by the development environment container. By default the KeyIntercept is set to esriKeyInterceptNone.

Many development environment containers use the up, down, left and right arrow keys to change control focus on a form. These keys can also be useful for navigating around the display. To intercept the arrow keys and the Tab key combine the enum values using a logical OR operation (esriKeyInterceptArrowKeys OR esriKeyInterceptTabKey, which is 1 OR 4 = 5).

Product Availability

Available with ArcGIS Engine.

Specified by:
getKeyIntercept in interface ITOCControl
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setKeyIntercept

public void setKeyIntercept(int pVal)
                     throws IOException,
                            AutomationException
A property that specifies interception of key strokes that are normally handled by the container. When intercepted the OnKeyDown and OnKeyUp events will be called. This value can be a combined bit mask of esriKeyIntercept enum values.

Product Availability

Available with ArcGIS Engine.

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