http://www.jpicedt.org

jpicedt.graphic.event
Class ZoomEvent

java.lang.Object
  extended by java.util.EventObject
      extended by jpicedt.graphic.event.ZoomEvent
All Implemented Interfaces:
Serializable

public class ZoomEvent
extends EventObject

Class for notifications of zoom-factor changes sourced by a PECanvas.

Since:
jpicedt 1.3.2
Version:
$Id: ZoomEvent.java,v 1.7 2013/03/27 07:05:42 vincentb1 Exp $
Author:
Sylvain Reynal
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ZoomEvent(PECanvas source, double oldZoom, double newZoom, PicPoint ptCenter)
          a new ZoomEvent sourced from the given PECanvas
 
Method Summary
 PicPoint getCenterPoint()
          Return the coordinates of the point that was at the center of the canvas before the zoom changed.
 double getNewZoomValue()
          Return the new zoom factor value
 double getOldZoomValue()
          Return the old zoom factor value
 String toString()
          a textual representation of this event
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZoomEvent

public ZoomEvent(PECanvas source,
                 double oldZoom,
                 double newZoom,
                 PicPoint ptCenter)
a new ZoomEvent sourced from the given PECanvas

Parameters:
source - the originator of the event
oldZoom - the previous zoom value
newZoom - the new zoom value
ptCenter - the point (in model-coordinates) that is expected to be at the center of the view-port. Can be null.
Method Detail

getOldZoomValue

public double getOldZoomValue()
Return the old zoom factor value


getNewZoomValue

public double getNewZoomValue()
Return the new zoom factor value


getCenterPoint

public PicPoint getCenterPoint()
Return the coordinates of the point that was at the center of the canvas before the zoom changed. This is aimed at allowing javax.swing.ViewPort, javax.swing.Scrollpane, etc... to update their view accordingly.


toString

public String toString()
a textual representation of this event

Overrides:
toString in class EventObject

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org