|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IActiveViewEvents
Provides access to events that occur when the state of the active view changes.
Use this interface to listen for specific events related to the active view, such as AfterDraw and SelectionChanged. Many CoClasses implement this interface and each fires events differently. For example, the Map object does not fire the FocusMapChanged event, whereas the PageLayout object does. Similarly, the Map object fires the ItemDeleted event when a layer is removed from the Map and the PageLayout fires the same event when elements such as a map frame or graphic are deleted.
Be aware of the specific object's events to which you are listening. For example, writing code to listen for the SelectionChanged event on just the FocusMap object will not fire an event by changing the selection in layout view. Also, if the focus map changes you must reset the client.
The AfterItemDraw event will only be fired when the IViewManager::VerboseEvents property is set to True. By default, this property is set to False.
Method Summary | |
---|---|
void |
afterDraw(IActiveViewEventsAfterDrawEvent theEvent)
Fired after the specified phase is drawn. |
void |
afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent)
Fired after an individual view item is drawn. |
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 |
focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent)
Fired when a new map is made active. |
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 |
selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent)
Call this function to fire the selection changed event. |
void |
spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent)
Fired when the spatial reference is changed. |
void |
viewRefreshed(IActiveViewEventsViewRefreshedEvent theEvent)
Fired when view is refreshed before draw happens. |
Method Detail |
---|
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.
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IActiveView.contentsChanged()
void contentsCleared(IActiveViewEventsContentsClearedEvent theEvent) throws IOException, AutomationException
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.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.
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.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.
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.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.
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent) throws IOException, AutomationException
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.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.
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void afterDraw(IActiveViewEventsAfterDrawEvent theEvent) throws IOException, AutomationException
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.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.
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent) throws IOException, AutomationException
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent) throws IOException, AutomationException
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 |