01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, Geotools Project Managment Committee (PMC)
05: * (C) 2001, Institut de Recherche pour le Développement
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package org.geotools.gui.swing.event;
18:
19: // Dependencies
20: import java.util.EventObject;
21: import java.awt.geom.AffineTransform;
22:
23: /**
24: * An event which indicates that a zoom occurred in a component.
25: * This event is usually fired by {@link org.geotools.gui.swing.ZoomPane}.
26: *
27: * @since 2.0
28: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/widgets-swing/src/main/java/org/geotools/gui/swing/event/ZoomChangeEvent.java $
29: * @version $Id: ZoomChangeEvent.java 22482 2006-10-31 02:58:00Z desruisseaux $
30: * @author Martin Desruisseaux
31: */
32: public class ZoomChangeEvent extends EventObject {
33: /**
34: * An affine transform indicating the zoom change. If {@code oldZoom} and {@code newZoom}
35: * are the affine transforms before and after the change respectively, then the following
36: * relation must hold (within the limits of rounding error):
37: *
38: * <code>newZoom = oldZoom.{@link AffineTransform#concatenate concatenate}(change)</code>
39: */
40: private final AffineTransform change;
41:
42: /**
43: * Constructs a new event. If {@code oldZoom} and {@code newZoom} are the affine transforms
44: * before and after the change respectively, then the following relation must hold (within
45: * the limits of rounding error):
46: *
47: * <code>newZoom = oldZoom.{@link AffineTransform#concatenate concatenate}(change)</code>
48: *
49: * @param source The event source (usually a {@link org.geotools.gui.swing.ZoomPane}).
50: * @param change An affine transform indicating the zoom change.
51: */
52: public ZoomChangeEvent(final Object source,
53: final AffineTransform change) {
54: super (source);
55: this .change = change;
56: }
57:
58: /**
59: * Returns the affine transform indicating the zoom change.
60: * <strong>Note:</strong> for performance reasons, this method does not clone
61: * the returned transform. Do not change!
62: */
63: public AffineTransform getChange() {
64: return change;
65: }
66: }
|