com.esri.arcgis.controls
Class ITOCControl2Proxy

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

public class ITOCControl2Proxy
extends ITOCControlProxy
implements ITOCControl2, Serializable

Provides access to members that control the TOCControl.

Description

The ITOCControl2 interface provides additional members for tasks related to the TOCControl, such as enabling the drag and drop of layers and working with selected items.

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
  ITOCControl2Proxy()
           
  ITOCControl2Proxy(Object obj)
           
protected ITOCControl2Proxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void getSelectedItem(int[] itemType, IBasicMap[] basicMap, ILayer[] layer, Object[] unk, Object[] data)
          Returns the selected item in the TOCControl.
 boolean isEnableLayerDragDrop()
          Indicates if layers can be dragged and dropped in the control.
 void removeListener(String iidStr, Object theListener)
           
 void selectItem(Object unk, Object data)
          Sets the selected item in the TOCControl.
 void setEnableLayerDragDrop(boolean newVal)
          Indicates if layers can be dragged and dropped in the control.
 
Methods inherited from class com.esri.arcgis.controls.ITOCControlProxy
aboutBox, esri_isEnabled, esri_setEnabled, getActiveView, getAppearance, getBorderStyle, getBuddy, getCustomProperty, getHWnd, getKeyIntercept, getLabelEdit, getLayerVisibilityEdit, getMouseIcon, getMousePointer, getObject, hitTest, setActiveView, setAppearance, setBorderStyle, setBuddyControl, setCustomProperty, setKeyIntercept, setLabelEdit, setLayerVisibilityEdit, setMouseIconByRef, setMousePointer, update
 
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
 
Methods inherited from interface com.esri.arcgis.controls.ITOCControl
aboutBox, esri_isEnabled, esri_setEnabled, getActiveView, getAppearance, getBorderStyle, getBuddy, getCustomProperty, getHWnd, getKeyIntercept, getLabelEdit, getLayerVisibilityEdit, getMouseIcon, getMousePointer, getObject, hitTest, setActiveView, setAppearance, setBorderStyle, setBuddyControl, setCustomProperty, setKeyIntercept, setLabelEdit, setLayerVisibilityEdit, setMouseIconByRef, setMousePointer, update
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

ITOCControl2Proxy

public ITOCControl2Proxy()

ITOCControl2Proxy

public ITOCControl2Proxy(Object obj)
                  throws IOException
Throws:
IOException

ITOCControl2Proxy

protected ITOCControl2Proxy(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 ITOCControlProxy
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class ITOCControlProxy
Throws:
IOException

isEnableLayerDragDrop

public boolean isEnableLayerDragDrop()
                              throws IOException,
                                     AutomationException
Indicates if layers can be dragged and dropped in the control.

Description

Determines whether layers can be dragged and dropped in the TOCControl. This property if false by default. When EnableLayerDragDrap is true, layers can be dragged and dropped as follows:

By default when dragging and dropping a layer within a map, the layer will be moved within the map to the drop location. To copy the layer, rather than move it press the CTRL key while dragging and dropping.

By default when dragging and dropping a layer between maps, a copy of the layer will be added into the map the layer is dropped into. To move the dragged layer, rather than copy it press the CTRL key while dragging and dropping.

Remarks

Layers can not be dragged and dropped in the following cases:

Product Availability

Available with ArcGIS Engine.

Specified by:
isEnableLayerDragDrop in interface ITOCControl2
Returns:
The newVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setEnableLayerDragDrop

public void setEnableLayerDragDrop(boolean newVal)
                            throws IOException,
                                   AutomationException
Indicates if layers can be dragged and dropped in the control.

Product Availability

Available with ArcGIS Engine.

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

getSelectedItem

public void getSelectedItem(int[] itemType,
                            IBasicMap[] basicMap,
                            ILayer[] layer,
                            Object[] unk,
                            Object[] data)
                     throws IOException,
                            AutomationException
Returns the selected item in the TOCControl.

Description

Returns the selected item in the TOCControl. The selected item may have been selected interactively by the end user clicking on the TOCControl or programmatically using the SelectItem method.

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:
getSelectedItem in interface ITOCControl2
Parameters:
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.

selectItem

public void selectItem(Object unk,
                       Object data)
                throws IOException,
                       AutomationException
Sets the selected item in the TOCControl.

Description

Selects the specified item in the TOCControl. The selected item will appear blue when the TOCControl has keyboard focus and grey when the TOCControl does not have keyboard focus.

Unk specifies an IMap object, and ILayer object or and 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.

To select an ILegendGroup::Heading either just pass an ILegendGroup object or pass an ILegendGroup object with an index of -1. To select a legend class within the LegendGroup pass an ILegendGroup object with a valid index.

Product Availability

Available with ArcGIS Engine.

Specified by:
selectItem in interface ITOCControl2
Parameters:
unk - A reference to another Object (IUnknown) (in)
data - A Variant (in, optional, pass null if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.