|
GeoSoft API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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
break;
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.
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)
scene - The scene of this event.event - Event typex - X position of cursor.y - Y position of cursor.GWindow
|
GeoSoft API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||