com.esri.arcgis.beans.TOC
Class TOCBean

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.esri.arcgis.beans.TOC.TOCBean
All Implemented Interfaces:
ITOCControl, ITOCControlDefault, IConnectionPointContainer, IPersistStreamInit, com.esri.arcgis.interop.RemoteObjRef, IPersist, ISupportErrorInfo, ImageObserver, MenuContainer, Serializable

public class TOCBean
extends JComponent
implements com.esri.arcgis.interop.RemoteObjRef, ITOCControlDefault, ITOCControl, IConnectionPointContainer, IPersistStreamInit, IPersist, ISupportErrorInfo

The TOCBean is a wrapper class of TOCControl to facilitate the use of TOCControl at the design time. Users could access the actual control by getTOCControl method.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  TOCControl m_tocControl
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TOCBean()
          Default constructor
 
Method Summary
 void aboutBox()
          Displays a dialog of information about the TOCControl.
 void addITOCControlEventsListener(ITOCControlEventsAdapter theListener)
           
 void enumConnectionPoints(IEnumConnectionPoints[] iEnumConnectionPointsArray)
          enumConnectionPoints
 boolean esri_isEnabled()
          Indicates whether the TOCControl can respond to user generated events.
 void esri_setEnabled(boolean rhs1)
          Indicates whether the TOCControl can respond to user generated events.
 void findConnectionPoint(GUID gUID, IConnectionPoint[] iConnectionPointArray)
          findConnectionPoint
 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.
 BuddyControl getBuddyControl()
           
 void getClassID(GUID[] gUIDArray)
          getClassID
 Object getCustomProperty()
          A property to associate data with a control.
 int getHWnd()
          Handle to the window associated with the TOCControl.
 com.esri.arcgis.interop.Dispatch getJintegraDispatch()
           
 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 getSelectedItem(int[] intArray, IBasicMap[] iBasicMapArray, ILayer[] iLayerArray, Object[] objectArray, Object[] objectArray4)
          Returns the selected item in the TOCControl.
 void getSizeMax(_ULARGE_INTEGER[] _ULARGE_INTEGERArray)
          getSizeMax
 TOCControl getTOCControl()
          Returns the actual TOCControl;
 void hitTest(int _int, int _int1, int[] intArray, IBasicMap[] iBasicMapArray, ILayer[] iLayerArray, Object[] objectArray, Object[] objectArray6)
          Returns the item in the TOCControl at the specified coordinates.
 void initNew()
          initNew
 void interfaceSupportsErrorInfo(GUID gUID)
          interfaceSupportsErrorInfo
 void isDirty()
          isDirty
 boolean isEnableLayerDragDrop()
          Indicates if layers can be dragged and dropped in the control.
 void load(IStream pStm)
          load
 void paint(Graphics g)
          Paints this component.
 void release()
           
 void removeITOCControlEventsListener(ITOCControlEventsAdapter theListener)
           
 void save(IStream pStm, int fClearDirty)
          save
 void selectItem(Object object, Object object1)
          Sets the selected item in the TOCControl.
 void setActiveView(IActiveView activeView)
          Sets the ActiveView used to populate the TOCControl.
 void setAppearance(int appearance)
          The appearance of the TOCControl.
 void setBorderStyle(int rhs1)
          The border style of the TOCControl.
 void setBuddyControl(BuddyControl buddy)
           
 void setBuddyControl(Object pTOCBuddy)
          Sets a control to be a buddy of the toolbar, this control must support ITOCBuddy.
 void setCustomProperty(Object rhs1)
          A property to associate data with a control.
 void setEnableLayerDragDrop(boolean _boolean)
          Indicates if layers can be dragged and dropped in the control.
 void setKeyIntercept(int key)
          A property that specifies interception of key strokes that are normally handled by the container.
 void setLabelEdit(int label)
          Label editing state.
 void setLayerVisibilityEdit(int edit)
          Layer visibility editing state.
 void setLayout(LayoutManager layout)
          Overrides the setLayout method of super class.
 void setMouseIconByRef(Picture picture)
          Custom mouse icon used if MousePointer is 99.
 void setMousePointer(int pointer)
          The mouse pointer displayed over the TOCControl.
 void update()
          Updates the contents of the TOCControl to match its ActiveView.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_tocControl

protected TOCControl m_tocControl
Constructor Detail

TOCBean

public TOCBean()
Default constructor

Method Detail

setLayout

public void setLayout(LayoutManager layout)
Overrides the setLayout method of super class.

Overrides:
setLayout in class Container
Parameters:
layout - LayoutManager - a LayoutManager object.

getTOCControl

public TOCControl getTOCControl()
Returns the actual TOCControl;

Returns:
TOCControl

paint

public void paint(Graphics g)
Paints this component.

Overrides:
paint in class JComponent
Parameters:
g - the graphics context to use for painting

getAppearance

public int getAppearance()
                  throws IOException
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
Specified by:
getAppearance in interface ITOCControlDefault
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
The appearance of the TOCControl.

Product Availability

Available with ArcGIS Engine.

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

getBorderStyle

public int getBorderStyle()
                   throws IOException
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
Specified by:
getBorderStyle in interface ITOCControlDefault
Returns:
A com.esri.arcgis.controls.esriControlsBorderStyle constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBorderStyle

public void setBorderStyle(int rhs1)
                    throws IOException
The border style of the TOCControl.

Product Availability

Available with ArcGIS Engine.

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

getMousePointer

public int getMousePointer()
                    throws IOException
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
Specified by:
getMousePointer in interface ITOCControlDefault
Returns:
A com.esri.arcgis.controls.esriControlsMousePointer constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMousePointer

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

Product Availability

Available with ArcGIS Engine.

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

setLabelEdit

public void setLabelEdit(int label)
                  throws IOException
Label editing state.

Product Availability

Available with ArcGIS Engine.

Specified by:
setLabelEdit in interface ITOCControl
Specified by:
setLabelEdit in interface ITOCControlDefault
Parameters:
rhs1 - 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
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
Specified by:
getLabelEdit in interface ITOCControlDefault
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 edit)
                            throws IOException
Layer visibility editing state.

Product Availability

Available with ArcGIS Engine.

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

getLayerVisibilityEdit

public int getLayerVisibilityEdit()
                           throws IOException
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
Specified by:
getLayerVisibilityEdit in interface ITOCControlDefault
Returns:
A com.esri.arcgis.controls.esriTOCControlEdit constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_isEnabled

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

Product Availability

Available with ArcGIS Engine.

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

esri_setEnabled

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

Product Availability

Available with ArcGIS Engine.

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

getKeyIntercept

public int getKeyIntercept()
                    throws IOException
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
Specified by:
getKeyIntercept in interface ITOCControlDefault
Returns:
The returnValue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setKeyIntercept

public void setKeyIntercept(int key)
                     throws IOException
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
Specified by:
setKeyIntercept in interface ITOCControlDefault
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBuddyControl

public void setBuddyControl(BuddyControl buddy)
                     throws IOException
Throws:
IOException

getBuddyControl

public BuddyControl getBuddyControl()

addITOCControlEventsListener

public void addITOCControlEventsListener(ITOCControlEventsAdapter theListener)
                                  throws IOException
Throws:
IOException

removeITOCControlEventsListener

public void removeITOCControlEventsListener(ITOCControlEventsAdapter theListener)
                                     throws IOException
Throws:
IOException

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
Specified by:
getObject in interface ITOCControlDefault
Returns:
A reference to another Automation Object (IDispatch)
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
Specified by:
getHWnd in interface ITOCControlDefault
Returns:
The returnValue
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
Specified by:
getActiveView in interface ITOCControlDefault
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
Specified by:
getBuddy in interface ITOCControlDefault
Returns:
A reference to another Automation Object (IDispatch)
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
Specified by:
update in interface ITOCControlDefault
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
Specified by:
setActiveView in interface ITOCControlDefault
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.

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
Specified by:
getCustomProperty in interface ITOCControlDefault
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCustomProperty

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

Product Availability

Available with ArcGIS Engine.

Specified by:
setCustomProperty in interface ITOCControl
Specified by:
setCustomProperty in interface ITOCControlDefault
Parameters:
rhs1 - 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
Specified by:
setBuddyControl in interface ITOCControlDefault
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.

load

public void load(IStream pStm)
          throws IOException,
                 AutomationException
load

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStreamInit
Parameters:
pStm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pStm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStreamInit
Parameters:
pStm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getJintegraDispatch

public com.esri.arcgis.interop.Dispatch getJintegraDispatch()
Specified by:
getJintegraDispatch in interface com.esri.arcgis.interop.RemoteObjRef

release

public void release()
Specified by:
release in interface com.esri.arcgis.interop.RemoteObjRef

setMouseIconByRef

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

Product Availability

Available with ArcGIS Engine.

Specified by:
setMouseIconByRef in interface ITOCControl
Specified by:
setMouseIconByRef in interface ITOCControlDefault
Parameters:
rhs1 - 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
Specified by:
getMouseIcon in interface ITOCControlDefault
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.

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
Specified by:
aboutBox in interface ITOCControlDefault
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

hitTest

public void hitTest(int _int,
                    int _int1,
                    int[] intArray,
                    IBasicMap[] iBasicMapArray,
                    ILayer[] iLayerArray,
                    Object[] objectArray,
                    Object[] objectArray6)
             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
Specified by:
hitTest in interface ITOCControlDefault
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.

enumConnectionPoints

public void enumConnectionPoints(IEnumConnectionPoints[] iEnumConnectionPointsArray)
                          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 gUID,
                                IConnectionPoint[] iConnectionPointArray)
                         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.

getClassID

public void getClassID(GUID[] gUIDArray)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist 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:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (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 gUID)
                                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.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

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

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] _ULARGE_INTEGERArray)
                throws IOException,
                       AutomationException
getSizeMax

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStreamInit
Parameters:
pCbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initNew

public void initNew()
             throws IOException,
                    AutomationException
initNew

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

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

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 ITOCControlDefault
Returns:
The returnValue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setEnableLayerDragDrop

public void setEnableLayerDragDrop(boolean _boolean)
                            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 ITOCControlDefault
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSelectedItem

public void getSelectedItem(int[] intArray,
                            IBasicMap[] iBasicMapArray,
                            ILayer[] iLayerArray,
                            Object[] objectArray,
                            Object[] objectArray4)
                     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 ITOCControlDefault
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 object,
                       Object object1)
                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 ITOCControlDefault
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.