Source for org.jfree.chart.plot.Zoomable

   1: /* ===========================================================
   2:  * JFreeChart : a free chart library for the Java(tm) platform
   3:  * ===========================================================
   4:  *
   5:  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
   6:  *
   7:  * Project Info:  http://www.jfree.org/jfreechart/index.html
   8:  *
   9:  * This library is free software; you can redistribute it and/or modify it 
  10:  * under the terms of the GNU Lesser General Public License as published by 
  11:  * the Free Software Foundation; either version 2.1 of the License, or 
  12:  * (at your option) any later version.
  13:  *
  14:  * This library is distributed in the hope that it will be useful, but 
  15:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
  16:  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
  17:  * License for more details.
  18:  *
  19:  * You should have received a copy of the GNU Lesser General Public
  20:  * License along with this library; if not, write to the Free Software
  21:  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
  22:  * USA.  
  23:  *
  24:  * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
  25:  * in the United States and other countries.]
  26:  *
  27:  * -------------
  28:  * Zoomable.java
  29:  * -------------
  30:  *
  31:  * (C) Copyright 2004, by Object Refinery Limited and Contributors.
  32:  *
  33:  * Original Author:  David Gilbert (for Object Refinery Limited);
  34:  * Contributor(s):   -;
  35:  *
  36:  * Changes
  37:  * -------
  38:  * 12-Nov-2004 : Version 1 (DG);
  39:  * 26-Jan-2004 : Added getOrientation() method (DG);
  40:  *
  41:  */
  42: 
  43: package org.jfree.chart.plot;
  44: 
  45: import java.awt.geom.Point2D;
  46: 
  47: import org.jfree.chart.ChartPanel;
  48: 
  49: /**
  50:  * A plot that is zoomable must implement this interface to provide a
  51:  * mechanism for the {@link ChartPanel} to control the zooming.
  52:  */
  53: public interface Zoomable {
  54: 
  55:     /**
  56:      * Returns <code>true</code> if the plot's domain is zoomable, and 
  57:      * <code>false</code> otherwise.
  58:      * 
  59:      * @return A boolean.
  60:      */
  61:     public boolean isDomainZoomable();
  62:     
  63:     /**
  64:      * Returns <code>true</code> if the plot's range is zoomable, and 
  65:      * <code>false</code> otherwise.
  66:      * 
  67:      * @return A boolean.
  68:      */
  69:     public boolean isRangeZoomable();
  70: 
  71:     /**
  72:      * Returns the orientation of the plot.
  73:      * 
  74:      * @return The orientation.
  75:      */
  76:     public PlotOrientation getOrientation();
  77:     
  78:     /**
  79:      * Multiplies the range on the domain axis/axes by the specified factor.
  80:      *
  81:      * @param factor  the zoom factor.
  82:      * @param state  the plot state.
  83:      * @param source  the source point (in Java2D coordinates).
  84:      */
  85:     public void zoomDomainAxes(double factor, PlotRenderingInfo state, 
  86:                                Point2D source);
  87: 
  88:     /**
  89:      * Zooms in on the domain axes.
  90:      * 
  91:      * @param lowerPercent  the new lower bound.
  92:      * @param upperPercent  the new upper bound.
  93:      * @param state  the plot state.
  94:      * @param source  the source point (in Java2D coordinates).
  95:      */
  96:     public void zoomDomainAxes(double lowerPercent, double upperPercent, 
  97:                                PlotRenderingInfo state, Point2D source);
  98: 
  99:     /**
 100:      * Multiplies the range on the range axis/axes by the specified factor.
 101:      *
 102:      * @param factor  the zoom factor.
 103:      * @param state  the plot state.
 104:      * @param source  the source point (in Java2D coordinates).
 105:      */
 106:     public void zoomRangeAxes(double factor, PlotRenderingInfo state, 
 107:                               Point2D source);
 108: 
 109:     /**
 110:      * Zooms in on the range axes.
 111:      * 
 112:      * @param lowerPercent  the new lower bound.
 113:      * @param upperPercent  the new upper bound.
 114:      * @param state  the plot state.
 115:      * @param source  the source point (in Java2D coordinates).
 116:      */
 117:     public void zoomRangeAxes(double lowerPercent, double upperPercent, 
 118:                               PlotRenderingInfo state, Point2D source);
 119: 
 120: }