GeoSoft API
Interface GInteraction

All Known Implementing Classes:

public interface GInteraction

Common interface for all graphics interactions.

Typical usage:

    public class DrawInteraction implements GInteraction
       private GObject   interaction_;
       private GSegment  line_;

       public void event (GScene scene, int event, int x, int y)
          switch (event) {
             case GWindow.BUTTON1_DOWN :
               // Create interaction object and segment and add to scene
             case GWindow.BUTTON1.DRAG :
                // extend segment with new x,y
                // and refresh graphics
             case ...
The interaction is started by installing it in the GWindow:
    GInteraction drawInteraction = new DrawInteraction();
    window.startInteraction (drawInteraction);
The interaction is stopped if another interaction is started or if it is explicitly stopped by GWindow.stopInteraction(). Before the interaction is stopped a GWindow.ABORT event is passed to the interaction.

See Also:
GWindow.startInteraction(GInteraction), GWindow.stopInteraction(), ZoomInteraction

Method Summary
 void event(GScene scene, int event, int x, int y)
          Trigged by mouse events within the canvas.

Method Detail


public void event(GScene scene,
                  int event,
                  int x,
                  int y)
Trigged by mouse events within the canvas.

scene - The scene of this event.
event - Event type
x - X position of cursor.
y - Y position of cursor.
See Also:

GeoSoft API

Copyright © 2004 - Geotechnical Software Services