|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.arcmapui.TOCSelectionView
public class TOCSelectionView
Esri TOC Selection View.
Constructor Summary | |
---|---|
TOCSelectionView()
Constructs a TOCSelectionView using ArcGIS Engine. |
|
TOCSelectionView(Object obj)
Construct a TOCSelectionView using a reference to such an object returned from ArcGIS Engine or Server. |
Method Summary | |
---|---|
void |
activate(int parentHWnd,
IMxDocument document)
Activates the contents view. |
void |
activeViewChanged(IDocumentEventsActiveViewChangedEvent theEvent)
Fired when the active view changes. |
void |
addToSelectedItems(Object item)
Adds to the selected items. |
void |
afterDraw(IActiveViewEventsAfterDrawEvent theEvent)
Fired after the specified phase is drawn. |
void |
afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent)
Fired after an individual view item is drawn. |
boolean |
beforeCloseDocument(IDocumentEventsBeforeCloseDocumentEvent theEvent)
Fired before a document is closed. |
void |
closeDocument(IDocumentEventsCloseDocumentEvent theEvent)
Fired when a document is closed. |
void |
contentsChanged(IActiveViewEventsContentsChangedEvent theEvent)
Fired when the contents of the view changes. |
void |
contentsCleared(IActiveViewEventsContentsClearedEvent theEvent)
Fired when the contents of the view is cleared. |
void |
deactivate()
Deactivates the contents view. |
boolean |
equals(Object o)
Compare this object with another |
void |
focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent)
Fired when a new map is made active. |
static String |
getClsid()
getClsid. |
Object |
getContextItem()
The context item (could be an enumerator). |
int |
getHWnd()
The HWND of the contents view. |
String |
getName()
The name of the contents view. |
Object |
getSelectedItem()
The selected item (could be an enumerator). |
int |
hashCode()
the hashcode for this object |
boolean |
isShowLines()
Indicates if lines are shown in the TOC tree. |
boolean |
isVisible()
Indicates if the view is visible. |
void |
itemAdded(IActiveViewEventsItemAddedEvent theEvent)
Fired when an item is added to the view. |
void |
itemDeleted(IActiveViewEventsItemDeletedEvent theEvent)
Fired when an item is deleted from the view. |
void |
itemReordered(IActiveViewEventsItemReorderedEvent theEvent)
Fired when a view item is reordered. |
void |
mapsChanged(IDocumentEventsMapsChangedEvent theEvent)
Fired when a change is made to the map collection. |
void |
newDocument(IDocumentEventsNewDocumentEvent theEvent)
Fired when a new document is created. |
void |
onContextMenu(IDocumentEventsOnContextMenuEvent theEvent)
Indicates if a context menu should be displayed at the given xy location. |
void |
openDocument(IDocumentEventsOpenDocumentEvent theEvent)
Fired when a document is opened. |
void |
refresh(Object item)
Refreshes the contents view. |
void |
removeFromSelectedItems(Object item)
Removes an item from the selected items. |
void |
selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent)
Call this function to fire the selection changed event. |
void |
setContextItem(Object item)
The context item (could be an enumerator). |
void |
setProcessEvents(boolean rhs1)
Indicates if the view is currently responding to events. |
void |
setSelectedItem(Object item)
The selected item (could be an enumerator). |
void |
setShowLines(boolean show)
Indicates if lines are shown in the TOC tree. |
void |
setVisible(boolean vis)
Indicates if the view is visible. |
void |
spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent)
Fired when the spatial reference is changed. |
void |
viewRefreshed(IActiveViewEventsViewRefreshedEvent theEvent)
Fired when view is refreshed before draw happens. |
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 |
---|
public TOCSelectionView() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic TOCSelectionView(Object obj) throws IOException
obj
to TOCSelectionView
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problems
TOCSelectionView theTOCSelectionView = (TOCSelectionView) obj;
Method Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String getName() throws IOException, AutomationException
getName
in interface IContentsView
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getHWnd() throws IOException, AutomationException
getHWnd
in interface IContentsView
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void activate(int parentHWnd, IMxDocument document) throws IOException, AutomationException
You can also activate a contents view by setting IMxDocument::CurrentContentsView (in ArcMap) or ISxDocument::CurrentContentsView (in ArcScene or ArcGlobe).
activate
in interface IContentsView
parentHWnd
- The parentHWnd (A COM typedef) (in)document
- A reference to a com.esri.arcgis.arcmapui.IMxDocument (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void deactivate() throws IOException, AutomationException
deactivate
in interface IContentsView
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void refresh(Object item) throws IOException, AutomationException
refresh
in interface IContentsView
item
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getSelectedItem() throws IOException, AutomationException
This property is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView this property has several usages:
1. The property can be a single object of any of the following types:
IMap
ILayer
ILegendGroup
IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)
2. The property can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so when setting this property using a Set, the Set should contain items of the same type.
3. The property can be an array where the contents of the array represent the hierarchical path to a single selected item. This is common when a single legend class is selected.
For example: If Array(0) = pMap, Array(1) = pLayer, Array(2) = pLegendGroup, and Array(3) = n, then the selected item is the nth legend class in pLegendGroup. When setting or adding to the selection, pass higher-level objects (in this case the IMap and ILayer objects) to improve peformance.
4. The property can be an array which contains an array of the structure explained in 3. This is common when multiple legend classes are selected.
getSelectedItem
in interface IContentsView
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSelectedItem(Object item) throws IOException, AutomationException
setSelectedItem
in interface IContentsView
item
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addToSelectedItems(Object item) throws IOException, AutomationException
This method is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView the item parameter has several usages:
1. The parameter can be a single object of any of the following types:
IMap
ILayer
ILegendGroup
IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)
2. The parameter can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so the Set should contain items of the same type.
3. The parameter can be an array where the contents of the array represent the hierarchical path to a single selected item. Use this to add a single legend class to the selection.
For example: If Array(0) = pMap, Array(1) = pLayer, Array(2) = pLegendGroup, and Array(3) = n, then the method will add the nth legend class in pLegendGroup. When building the array, include higher-level objects (in this case the IMap and ILayer objects) to improve peformance.
4. The parameter can be an array which contains an array of the structure explained in 3. Use this to add multiple legend classes to the selection.
addToSelectedItems
in interface IContentsView
item
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void removeFromSelectedItems(Object item) throws IOException, AutomationException
This method is not functional for TOCSelectionView. When working with a TOCDisplayView or TOCCatalogView the item parameter has several usages:
1. The parameter can be a single object of any of the following types:
IMap
ILayer
ILegendGroup
IWorkspace (source view only)
IDataset (source view only)
IStandaloneTable (source view only)
2. The parameter can be a Set of items of the types listed in 1. Only multiple items of the same type can be selected simultaneously, so the Set should contain items of the same type.
3. The parameter can be an array where the contents of the array represent the hierarchical path to a single selected item. Use this to remove a single legend class from the selection.
For example: If Array(0) = pMap, Array(1) = pLayer, Array(2) = pLegendGroup, and Array(3) = n, then the method will remove the nth legend class in pLegendGroup. When building the array, include higher-level objects (in this case the IMap and ILayer objects) to improve peformance.
4. The parameter can be an array which contains an array of the structure explained in 3. Use this to remove multiple legend classes from the selection.
removeFromSelectedItems
in interface IContentsView
item
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getContextItem() throws IOException, AutomationException
You need at least to write a minimalistic implementation of this property as shown here:
Private m_ContextItem as Variant
Private Property Let IContentsView_ContextItem(ByVal RHS As Variant)
m_ContextItem = RHS
End Property
Private Property Get IContentsView_ContextItem() As Variant
IContentsView_ContextItem = m_ContextItem
End Property
The ContextItem property will contain the item on which the user makes a right-click in the TOC and at this point a context menu may be shown.
At 9.0 a default context menu is shown when the user right-clicks in your custom TOC. If you need to get rid of this menu in order to implement your own you will find the Selectable Layers Tab example valuable.
getContextItem
in interface IContentsView
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setContextItem(Object item) throws IOException, AutomationException
setContextItem
in interface IContentsView
item
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isShowLines() throws IOException, AutomationException
isShowLines
in interface IContentsView
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setShowLines(boolean show) throws IOException, AutomationException
setShowLines
in interface IContentsView
show
- The show (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isVisible() throws IOException, AutomationException
isVisible
in interface IContentsView
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setVisible(boolean vis) throws IOException, AutomationException
setVisible
in interface IContentsView
vis
- The vis (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setProcessEvents(boolean rhs1) throws IOException, AutomationException
This property allows you to temporarily suspend the processing of events by the contents view so that for instance, it doesn't unnecessarily refresh when some routine repeatitively modifies its content.
setProcessEvents
in interface IContentsView
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void contentsChanged(IActiveViewEventsContentsChangedEvent theEvent) throws IOException, AutomationException
The Map object fires this event when a new document is loaded. Adding a new layer to a Map does not trigger this event.
The PageLayout object fires the event when IGraphicsContainer::DeleteAllElements in called and when a new document is loaded.
contentsChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IActiveView.contentsChanged()
public void contentsCleared(IActiveViewEventsContentsClearedEvent theEvent) throws IOException, AutomationException
contentsCleared
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void itemAdded(IActiveViewEventsItemAddedEvent theEvent) throws IOException, AutomationException
The Map fires the event every time a new layer is added.
The PageLayout fires this event whenever a new element is added to the layout. Elements include not only graphics but data frames as well.
itemAdded
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void itemDeleted(IActiveViewEventsItemDeletedEvent theEvent) throws IOException, AutomationException
The PageLayout object fires this event whenever elements are deleted from the layout.
The Map object fires this event when a layer is removed.
itemDeleted
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void itemReordered(IActiveViewEventsItemReorderedEvent theEvent) throws IOException, AutomationException
The Map objects only fire this event whenever IMap::MoveLayer is called. In the ArcMap application, this occurs when you reorder layers in the table of contents. The Map will also fire this event when new layers are added.
The PageLayout object fires this event when changing the order of graphics. For example, IGraphicsContainer::BringToFront, PutElementOrder, SendToBack, SendBackward, and BringForward all fire this event. These functions are on ArcMap's Drawing menu under the Order pull right menu. Although the Map object is also a graphics container, it does not fire this event when its graphics are reordered.
itemReordered
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent) throws IOException, AutomationException
selectionChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void viewRefreshed(IActiveViewEventsViewRefreshedEvent theEvent) throws IOException, AutomationException
Method that gets fired in response to IActiveView::Refresh and IActiveView::PartialRefresh.
This event is useful in the case where you're watching for something to change in the view and there aren't any specific events for that change (e.g. ContentsChanged, ItemAdded). You can always listen for this method as a last resort. Care must be taken however to be very efficient in your implementation of this event because it will be called quite often.
The event parameters directly coincide with the arguments to IActiveView::PartialRefresh. For additional information about the arguments, see the help for that method.
If the event object connects to both the layout and a map, then the view parameter tells you which object initiated the event.
In an implementation of this method you typically want to check the phase and respond to only one. Otherwise, your code will execute multiple times per drawing sequence.
viewRefreshed
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void afterDraw(IActiveViewEventsAfterDrawEvent theEvent) throws IOException, AutomationException
afterDraw
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent) throws IOException, AutomationException
AfterItemDraw can be used to execute after each individual item has drawn. Event firing can be an expensive operation (time consuming) when there are many layers in a map, however. As a result, the AfterItemDraw event is only fired when the IViewManger::VerboseEvents property is set to True. By default this property is False.
afterItemDraw
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent) throws IOException, AutomationException
focusMapChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent) throws IOException, AutomationException
spatialReferenceChanged
in interface IActiveViewEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void activeViewChanged(IDocumentEventsActiveViewChangedEvent theEvent) throws IOException, AutomationException
activeViewChanged
in interface IDocumentEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void mapsChanged(IDocumentEventsMapsChangedEvent theEvent) throws IOException, AutomationException
mapsChanged
in interface IDocumentEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void onContextMenu(IDocumentEventsOnContextMenuEvent theEvent) throws IOException, AutomationException
onContextMenu
in interface IDocumentEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void newDocument(IDocumentEventsNewDocumentEvent theEvent) throws IOException, AutomationException
newDocument
in interface IDocumentEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void openDocument(IDocumentEventsOpenDocumentEvent theEvent) throws IOException, AutomationException
openDocument
in interface IDocumentEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean beforeCloseDocument(IDocumentEventsBeforeCloseDocumentEvent theEvent) throws IOException, AutomationException
beforeCloseDocument
in interface IDocumentEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void closeDocument(IDocumentEventsCloseDocumentEvent theEvent) throws IOException, AutomationException
closeDocument
in interface IDocumentEvents
theEvent
- The event
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 |