com.esri.arcgis.controls
Class IMapControlEvents2Adapter

java.lang.Object
  extended by com.esri.arcgis.controls.IMapControlEvents2Adapter
All Implemented Interfaces:
IMapControlEvents2, Serializable, EventListener

public class IMapControlEvents2Adapter
extends Object
implements IMapControlEvents2

See Also:
Serialized Form

Constructor Summary
IMapControlEvents2Adapter()
           
 
Method Summary
 void onAfterDraw(IMapControlEvents2OnAfterDrawEvent theEvent)
          Fires after the Map draws a specified view phase.
 void onAfterScreenDraw(IMapControlEvents2OnAfterScreenDrawEvent theEvent)
          Fires after the Map contained by the MapControl has finished drawing.
 void onBeforeScreenDraw(IMapControlEvents2OnBeforeScreenDrawEvent theEvent)
          Fires before the Map contained by the MapControl starts to draw.
 void onDoubleClick(IMapControlEvents2OnDoubleClickEvent theEvent)
          Fires when the user presses and releases the mouse button twice in quick succession.
 void onExtentUpdated(IMapControlEvents2OnExtentUpdatedEvent theEvent)
          Fires after the extent (visible bounds) of the MapControl is changed.
 void onFullExtentUpdated(IMapControlEvents2OnFullExtentUpdatedEvent theEvent)
          Fires after the full extent (bounds) of the MapControl has changed.
 void onKeyDown(IMapControlEvents2OnKeyDownEvent theEvent)
          Fires after a key is pressed on the keyboard.
 void onKeyUp(IMapControlEvents2OnKeyUpEvent theEvent)
          Fires after a pressed key is released.
 void onMapReplaced(IMapControlEvents2OnMapReplacedEvent theEvent)
          Fires after the Map contained by the MapControl has been replaced.
 void onMouseDown(IMapControlEvents2OnMouseDownEvent theEvent)
          Fires when the user presses any mouse button while over the MapControl.
 void onMouseMove(IMapControlEvents2OnMouseMoveEvent theEvent)
          Fires when the user moves the mouse over the MapControl.
 void onMouseUp(IMapControlEvents2OnMouseUpEvent theEvent)
          Fires when the user releases a mouse button while over the MapControl.
 void onOleDrop(IMapControlEvents2OnOleDropEvent theEvent)
          Fires when an OLE drop action occurs on the MapControl.
 void onSelectionChanged(IMapControlEvents2OnSelectionChangedEvent theEvent)
          Fires when the current selection changes.
 void onViewRefreshed(IMapControlEvents2OnViewRefreshedEvent theEvent)
          Fires when the view is refreshed before drawing occurs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IMapControlEvents2Adapter

public IMapControlEvents2Adapter()
Method Detail

onMouseDown

public void onMouseDown(IMapControlEvents2OnMouseDownEvent theEvent)
                 throws IOException,
                        AutomationException
Fires when the user presses any mouse button while over the MapControl.

Description

The OnMouseDown event is triggered when the user presses a mouse button on the MapControl. Use the event to specify actions that will occur when a given mouse button is pressed.

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (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 MapControl (the top left hand corner).

mapX is the X coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits.

mapY is the Y coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits

Remarks

Use the win32 SetCapture function to continue receiving mouse events (until the mouse is released) when the mouse is moved outside the control's display area. The win32 ReleaseCapture function releases the mouse.

Product Availability

Available with ArcGIS Engine.

Specified by:
onMouseDown in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onMouseUp

public void onMouseUp(IMapControlEvents2OnMouseUpEvent theEvent)
               throws IOException,
                      AutomationException
Fires when the user releases a mouse button while over the MapControl.

Description

The OnMouseUp event is triggered when the user releases a mouse button on the MapControl. Use the event to specify actions that will occur when a given mouse button is released.

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in device units, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (the top left hand corner).

y is the Y coordinate, in device units, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (the top left hand corner).

mapX is the X coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits.

mapY is the Y coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits

Remarks

Use the win32 SetCapture function to continue receiving mouse events (until the mouse is released) when the mouse is moved outside the control's display area. The win32 ReleaseCapture function releases the mouse.

Product Availability

Available with ArcGIS Engine.

Specified by:
onMouseUp in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onMouseMove

public void onMouseMove(IMapControlEvents2OnMouseMoveEvent theEvent)
                 throws IOException,
                        AutomationException
Fires when the user moves the mouse over the MapControl.

Description

The OnMouseMove event is triggered continually as the mouse moves over the MapControl.

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in device units, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (the top left hand corner).

y is the Y coordinate, in device units, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (the top left hand corner).

mapX is the X coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits.

mapY is the Y coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits

Product Availability

Available with ArcGIS Engine.

Specified by:
onMouseMove in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onDoubleClick

public void onDoubleClick(IMapControlEvents2OnDoubleClickEvent theEvent)
                   throws IOException,
                          AutomationException
Fires when the user presses and releases the mouse button twice in quick succession.

Description

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (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 MapControl (the top left hand corner).

mapX is the X coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits.

mapY is the Y coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::Units

Remarks

The OnDoubleClick event is triggered when the user releases and presses a mouse button and then presses and releases it again on the MapControl. If the double click does not occur within the system's double click time limit, the MapControl will recognise another OnMouseDown event. Otherwise the event sequence is as follows:

OnMouseDown
OnMouseUp
OnDoubleClick
OnMouseUp

Product Availability

Available with ArcGIS Engine.

Specified by:
onDoubleClick in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onSelectionChanged

public void onSelectionChanged(IMapControlEvents2OnSelectionChangedEvent theEvent)
                        throws IOException,
                               AutomationException
Fires when the current selection changes.

Description

OnSelectionChanged is triggered when the geographic selection of features in the IMapControl2::Map layers change.

Product Availability

Available with ArcGIS Engine.

Specified by:
onSelectionChanged in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onViewRefreshed

public void onViewRefreshed(IMapControlEvents2OnViewRefreshedEvent theEvent)
                     throws IOException,
                            AutomationException
Fires when the view is refreshed before drawing occurs.

Description

The OnViewRefreshed event is based upon the IActiveViewEvents::ViewRefreshed event. The event is triggered when the IMapContro2::Map is refreshed before the OnAfterDraw events.

Product Availability

Available with ArcGIS Engine.

Specified by:
onViewRefreshed in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onBeforeScreenDraw

public void onBeforeScreenDraw(IMapControlEvents2OnBeforeScreenDrawEvent theEvent)
                        throws IOException,
                               AutomationException
Fires before the Map contained by the MapControl starts to draw.

Description

OnBeforeScreenDraw is triggered before the IDisplayEvents::DisplayStarted event is called on the map's screen display. The hdc represents the device context on the screen display.

Product Availability

Available with ArcGIS Engine.

Specified by:
onBeforeScreenDraw in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onAfterScreenDraw

public void onAfterScreenDraw(IMapControlEvents2OnAfterScreenDrawEvent theEvent)
                       throws IOException,
                              AutomationException
Fires after the Map contained by the MapControl has finished drawing.

Description

OnAfterScreenDraw is triggered after the IDisplayEvents::DisplayFinished event is called on the map's screen display. The hdc represents the device context on the screen display.

Product Availability

Available with ArcGIS Engine.

Specified by:
onAfterScreenDraw in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onAfterDraw

public void onAfterDraw(IMapControlEvents2OnAfterDrawEvent theEvent)
                 throws IOException,
                        AutomationException
Fires after the Map draws a specified view phase.

Description

The OnAfterDraw event is fired after a specified phase has been drawn on the Map's screen display and is based upon the IActiveViewEvents::AfterDraw event. You must query interface for the IDisplay interface and base the viewDrawPhase on the esriViewDrawPhase constants.

Remarks

In some circumstances there maybe a need to execute some code after each individual layer in a map has drawn. To do this you need to set the IViewManager::VerboseEvents property to true and use the IActiveViewEvents::AfterItemDraw event.

Product Availability

Available with ArcGIS Engine.

Specified by:
onAfterDraw in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onExtentUpdated

public void onExtentUpdated(IMapControlEvents2OnExtentUpdatedEvent theEvent)
                     throws IOException,
                            AutomationException
Fires after the extent (visible bounds) of the MapControl is changed.

Description

OnExtentUpdated is triggered whenever the IMapControl2::Extent property is changed. Setting the extent explicitly, zooming, panning or using the IMapControl2::CenterAt method will change the extent.

The envelope that gets passed into the newEnvelope event parameter is identical to the envelope returned by the IDisplayTransformation::VisibleBounds property. In the context of the ControlsMapZoomInTool or ControlsMapZoomOutTool commands, this is the extent of the rectangle drawn by the user. When the zoom action is performed, the digitized extent is modified to match the aspect ratio of the display. Both the IMapControl2::Extent or IDisplayTransformation::FittedBounds properties return the true visible extent of the display.

Product Availability

Available with ArcGIS Engine.

Specified by:
onExtentUpdated in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onFullExtentUpdated

public void onFullExtentUpdated(IMapControlEvents2OnFullExtentUpdatedEvent theEvent)
                         throws IOException,
                                AutomationException
Fires after the full extent (bounds) of the MapControl has changed.

Description

OnFullExtentUpdated is triggered whenever IMapControl2::FullExtent is set. For example, the event is triggered when a layer is added to the map's layer collection and its data extent is greater than any of the other layers in the layer collection.

Product Availability

Available with ArcGIS Engine.

Specified by:
onFullExtentUpdated in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onOleDrop

public void onOleDrop(IMapControlEvents2OnOleDropEvent theEvent)
               throws IOException,
                      AutomationException
Fires when an OLE drop action occurs on the MapControl.

Description

If the IMapControl2::OleDropEnabled property is set to False the OnOleDrop event will not be triggered, and the esriDragDropNone effect will display when data is dragged over the control.

If the IMapControl2::OleDropEnabled property is set to True the esriControlsDragDropEffect must be set each time the OnOleDrop event is triggered.

Use the esriControlsDropAction constant to determine whether the data is entering or leaving the control, or whether data is being dragged over or dropped onto the MapControl.

Remarks

Use the esriDropOver dropAction to display mouse coordinates while data is being dragged over the MapControl from another application, as the OnMouseMove event will not be triggered.

Product Availability

Available with ArcGIS Engine.

Specified by:
onOleDrop in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onKeyDown

public void onKeyDown(IMapControlEvents2OnKeyDownEvent theEvent)
               throws IOException,
                      AutomationException
Fires after a key is pressed on the keyboard.

Description

The OnKeyDown event is triggered when the user presses a key whilst the MapControl has focus.

keyCode specifies a virtual key code value of the key pressed on the keyboard. For alpha-numeric keys this corresponds to the ASCII value, for example "A" key returns 65 which is the ASCII value for capital A. Other key codes are F1 to F12 are 112 to 123 respectively.

Shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

Remarks

Some development environments will filter out keystrokes. Typically the arrow keys are used to change control focus and will not fire the OnKeyDown event. To intercept these keys use the KeyIntercept property.

Product Availability

Available with ArcGIS Engine.

Specified by:
onKeyDown in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onKeyUp

public void onKeyUp(IMapControlEvents2OnKeyUpEvent theEvent)
             throws IOException,
                    AutomationException
Fires after a pressed key is released.

Description

The OnKeyUp event is triggered when when the user releases a key whilst the MapControl has focus.

keyCode specifies a virtual key code value of the key pressed on the keyboard. For alpha-numeric keys this corresponds to the ASCII value, for example "A" key returns 65 which is the ASCII value for capital A. Other key codes are F1 to F12 are 112 to 123 respectively.

Shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

Remarks

Some development environments will filter out keystrokes. Typically the arrow keys are used to change control focus and will not fire the OnKeyUp event. To intercept these keys use the KeyIntercept property.

Product Availability

Available with ArcGIS Engine.

Specified by:
onKeyUp in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onMapReplaced

public void onMapReplaced(IMapControlEvents2OnMapReplacedEvent theEvent)
                   throws IOException,
                          AutomationException
Fires after the Map contained by the MapControl has been replaced.

Description

The OnMapReplaced event is triggered whenever the IMapControl2::Map is replaced by another map, such as when the IMapControl2::LoadMxFile method is used or when the map property is explicitly replaced. Use this event to keep in synch with the current map.

Product Availability

Available with ArcGIS Engine.

Specified by:
onMapReplaced in interface IMapControlEvents2
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.