GeoSoft API

no.geosoft.cc.graphics
Class ZoomInteraction

Object
  extended byZoomInteraction
All Implemented Interfaces:
ActionListener, EventListener, GInteraction

public class ZoomInteraction
extends Object
implements GInteraction, ActionListener

A default zoom interaction. The following actions are implemented:

  1. Button 1 click at a point in the scene: The scene is zoomed in a certain factor with that point fixed.
  2. Button 1 press and keep pressed: The scene is zoomed in continously until the button is released.
  3. Button 3 click at a point in the scene: The scene is zoomed out a certain factor with that point fixed.
  4. Button 3 press and keep pressed: The scene is zoomed out continously until the button is released.
  5. Button 2 click: Unzoom.
  6. Button 1 press, drag and release: User creates a rubber band and the scene is zoomed to the specified area.
The ZoomInteraction class lacks the G prefix as it is an optional extension to G and not part of the core classes.

Author:
GeoSoft

Constructor Summary
ZoomInteraction(GScene scene)
          Create a new zoom interaction on the specifed scene.
ZoomInteraction(GScene scene, GStyle style)
          Create a new zoom interaction on the specifed scene.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Timer trigged event when the user keeps pressing a mouse button.
 void event(GScene scene, int eventType, int x, int y)
          Handle mouse events in the canvas.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZoomInteraction

public ZoomInteraction(GScene scene,
                       GStyle style)
Create a new zoom interaction on the specifed scene. The interaction is activated by GWindow.setInteraction().

Parameters:
scene - Scene of this zoom interaction.
style - Style for the interaction rubber band
See Also:
GWindow.startInteraction(GInteraction), GWindow.stopInteraction()

ZoomInteraction

public ZoomInteraction(GScene scene)
Create a new zoom interaction on the specifed scene.

Parameters:
scene - Scene of this zoom interaction.
See Also:
GWindow.startInteraction(GInteraction), GWindow.stopInteraction()
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Timer trigged event when the user keeps pressing a mouse button.

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - Not used.

event

public void event(GScene scene,
                  int eventType,
                  int x,
                  int y)
Handle mouse events in the canvas.

Specified by:
event in interface GInteraction
Parameters:
eventType - Event trigging this method.
scene - The scene of this event.
x - X position of cursor.
y - Y position of cursor.
See Also:
GWindow

GeoSoft API

Copyright © 2004 - Geotechnical Software Services     geosoft.no