Class ZoomEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class ZoomEvent
    extends java.util.EventObject
    Class for notifications of zoom-factor changes sourced by a PECanvas.
    Since:
    jpicedt 1.3.2
    Version:
    $Id: ZoomEvent.java,v 1.5.2.1 2007/09/02 11:56:18 reynal Exp $
    Author:
    Sylvain Reynal
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      ZoomEvent​(PECanvas source, double oldZoom, double newZoom, PicPoint ptCenter)
      a new ZoomEvent sourced from the given PECanvas
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
      java.lang.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 java.lang.String toString()
        a textual representation of this event
        Overrides:
        toString in class java.util.EventObject