|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITOCControl2
Provides access to members that control the TOCControl.
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.
Method Summary | |
---|---|
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 |
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 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 |
Method Detail |
---|
boolean isEnableLayerDragDrop() throws IOException, AutomationException
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.
Layers can not be dragged and dropped in the following cases:
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setEnableLayerDragDrop(boolean newVal) throws IOException, AutomationException
newVal
- The newVal (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void getSelectedItem(int[] itemType, IBasicMap[] basicMap, ILayer[] layer, Object[] unk, Object[] data) throws IOException, AutomationException
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.
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void selectItem(Object unk, Object data) throws IOException, AutomationException
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.
unk
- A reference to another Object (IUnknown) (in)data
- A Variant (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |