001    /* ===========================================================
002     * JFreeChart : a free chart library for the Java(tm) platform
003     * ===========================================================
004     *
005     * (C) Copyright 2000-2009, by Object Refinery Limited and Contributors.
006     *
007     * Project Info:  http://www.jfree.org/jfreechart/index.html
008     *
009     * This library is free software; you can redistribute it and/or modify it
010     * under the terms of the GNU Lesser General Public License as published by
011     * the Free Software Foundation; either version 2.1 of the License, or
012     * (at your option) any later version.
013     *
014     * This library is distributed in the hope that it will be useful, but
015     * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
016     * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
017     * License for more details.
018     *
019     * You should have received a copy of the GNU Lesser General Public
020     * License along with this library; if not, write to the Free Software
021     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
022     * USA.
023     *
024     * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
025     * in the United States and other countries.]
026     *
027     * -------------
028     * Pannable.java
029     * -------------
030     *
031     * (C) Copyright 2009, by Object Refinery Limited and Contributors.
032     *
033     * Original Author:  Ulrich Voigt - patch 2686040;
034     * Contributor(s):   David Gilbert (for Object Refinery Limited);
035     *
036     * Changes
037     * -------
038     * 19-Mar-2009 : Version 1, with modifications from patch by UV (DG);
039     *
040     */
041    
042    package org.jfree.chart.plot;
043    
044    import java.awt.geom.Point2D;
045    
046    import org.jfree.chart.ChartPanel;
047    
048    /**
049     * An interface that the {@link ChartPanel} class uses to communicate with
050     * plots that support panning.
051     *
052     * @since 1.0.13
053     */
054    public interface Pannable {
055    
056        /**
057         * Returns the orientation of the plot.
058         *
059         * @return The orientation (never <code>null</code>).
060         */
061        public PlotOrientation getOrientation();
062    
063        /**
064         * Evaluates if the domain axis can be panned.
065         *
066         * @return <code>true</code> if the domain axis is pannable.
067         */
068        public boolean isDomainPannable();
069    
070        /**
071         * Evaluates if the range axis can be panned.
072         *
073         * @return <code>true</code> if the range axis is pannable.
074         */
075        public boolean isRangePannable();
076    
077        /**
078         * Pans the domain axes by the specified percentage.
079         *
080         * @param percent  the distance to pan (as a percentage of the axis length).
081         * @param info the plot info
082         * @param source the source point where the pan action started.
083         */
084        public void panDomainAxes(double percent, PlotRenderingInfo info,
085                Point2D source);
086    
087        /**
088         * Pans the range axes by the specified percentage.
089         *
090         * @param percent  the distance to pan (as a percentage of the axis length).
091         * @param info the plot info
092         * @param source the source point where the pan action started.
093         */
094        public void panRangeAxes(double percent, PlotRenderingInfo info,
095                Point2D source);
096    
097    }