INTViewer APIs for Events

This sections reviews the handling of events in the INTViewer platform, including how to send and receive events. We also review the major types of event supported.

The utility class com.interactive.intviewerapi.events.EventBroadcaster implements a singleton that keeps track of all the listeners that have been registered for event notification. It also has a send method which can be used to post an event.

When you customize INTViewer, you create your own components that "listen" to specific event types. By customizing your listener component (as opposed to customizing your event handler), you make sure that all components have a common set of events to react to. For example, the RectangularEvent event is common to all components that react to a completed rubberband selection. You could have several panels in your INTViewer application displaying various information about that rectangular selection.

To draw shapes on a 2D layer, or if you need to detect that the mouse was clicked in a 2D layer, go to 2D Layer Event Handlers. Synchronization settings are discussed in the Synchronization section.

The main event types

Below is a list of the main types of events supported by INTViewer:

  • WindowPositionEvent - to track window scrolling.
  • WindowScaleEvent - to track when a window scale has changed (after a zoom for example)
  • WindowEvent - to be notified if a window has been added or removed
  • ViewerWindowEvent - to be notified if a visual has been added, deleted or selected
  • CursorPositionEvent - to track cursor movement.
  • DataChangeEvent - to track when a calculator formula has changed
  • DataSynchronizeEvent - for synchronizing the ranges of data displayed in the viewer.
  • RectangularEvent - to track a rectangular rubberband selection within a layer.
  • PointDataEvent - to track horizon, fault and pointset editing
  • PropertyProviderEvent - to track change of named properties
  • TraceAxisEvent - to track changes to horizontal axes
  • SeismicProcessorEvent - to track changes to seismic processors

Other less used events are:

  • ShapeCreatedEvent - notification when a new 2D shape has been created in a window.
  • ShapePropertyChangedEvent - notification when a shape property has changed.
  • WorkflowTaskEvent - notification when a workflow task has been started or completed.
  • SeismicVolumeObject3DSliceEvent - to be notified if a 3D seismic volume slice has been added, deleted or selected
  • SeismicVolumeObject3DProbeEvent - to be notified if a 3D seismic volume probe has been added, deleted or selected

How to send events

INTViewer EventBroadcaster utility class provides a simple static method to post an event:

EventBroadcaster.getInstance().send(myEvent);

where myEvent must be a subclass of java.util.EventObject.

How to receive events

Typically, a simple static method can be used to subscribe to events:

EventBroadcaster.getInstance().subscribe(MyEvent.class, this, true); // true means weak subscription

In this example, we assume that "this" is a IEventSubscriber, meaning that a "onEvent" method is implemented:

public void onEvent(MyEvent event)

To explicitely unsubscribe, use the unsubscribe method. Example:

EventBroadcaster.getInstance().unsubscribe(MyEvent.class, this)