    001/* ===========================================================
    002 * Orson Charts : a 3D chart library for the Java(tm) platform
    003 * ===========================================================
    004 *
    005 * (C)opyright 2013-2022, by David Gilbert.  All rights reserved.
    006 *
    007 * https://github.com/jfree/orson-charts
    008 *
    009 * This program is free software: you can redistribute it and/or modify
    010 * it under the terms of the GNU General Public License as published by
    011 * the Free Software Foundation, either version 3 of the License, or
    012 * (at your option) any later version.
    013 *
    014 * This program is distributed in the hope that it will be useful,
    015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    017 * GNU General Public License for more details.
    018 *
    019 * You should have received a copy of the GNU General Public License
    020 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    021 *
    022 * [Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    023 * Other names may be trademarks of their respective owners.]
    024 *
    025 * If you do not wish to be bound by the terms of the GPL, an alternative
    026 * commercial license can be purchased.  For details, please see visit the
    027 * Orson Charts home page:
    028 *
    029 * http://www.object-refinery.com/orsoncharts/index.html
    030 *
    031 */
    032
    033package org.jfree.chart3d.axis;
    034
    035import java.awt.Graphics2D;
    036import java.awt.geom.Point2D;
    037import java.util.List;
    038import org.jfree.chart3d.marker.MarkerData;
    039import org.jfree.chart3d.marker.ValueMarker;
    040import org.jfree.chart3d.plot.CategoryPlot3D;
    041import org.jfree.chart3d.plot.XYZPlot;
    042
    043/**
    044 * An axis that displays a range of continuous values.  These can be used
    045 * for the value axis in a {@link CategoryPlot3D}, and for the X, Y or Z
    046 * axes in an {@link XYZPlot}.
    047 */
    048public interface ValueAxis3D extends Axis3D {
    049
    050    /**
    051     * Returns the type of use that the axis has been configured for.
    052     *
    053     * @return The type (or {@code null} if the axis has not yet been
    054     *     configured).
    055     *
    056     * @since 1.3
    057     */
    058    ValueAxis3DType getConfiguredType();
    059
    060    /**
    061     * Configure the axis as a value axis for the specified plot.
    062     *
    063     * @param plot  the plot ({@code null} not permitted).
    064     */
    065    void configureAsValueAxis(CategoryPlot3D plot);
    066
    067    /**
    068     * Configure the axis as an x-axis for the specified plot.
    069     *
    070     * @param plot  the plot ({@code null} not permitted).
    071     */
    072    void configureAsXAxis(XYZPlot plot);
    073
    074    /**
    075     * Configure the axis as a y-axis for the specified plot.
    076     *
    077     * @param plot  the plot ({@code null} not permitted).
    078     */
    079    void configureAsYAxis(XYZPlot plot);
    080
    081    /**
    082     * Configure the axis as an z-axis for the specified plot.
    083     *
    084     * @param plot  the plot ({@code null} not permitted).
    085     */
    086    void configureAsZAxis(XYZPlot plot);
    087
    088    /**
    089     * Selects an appropriate tick size and format for the axis based on
    090     * the axis being rendered from {@code pt0} to {@code pt1}.
    091     *
    092     * @param g2  the graphics target.
    093     * @param pt0  the starting point.
    094     * @param pt1  the ending point.
    095     * @param opposingPt  a point on the opposite side of the axis from the
    096     *     labels.
    097     *
    098     * @return The tick size.
    099     */
    100    double selectTick(Graphics2D g2, Point2D pt0, Point2D pt1,
    101            Point2D opposingPt);
    102
    103    /**
    104     * Generates a list of tick data items for the specified tick unit.  This
    105     * data will be passed to the 3D engine and will be updated with a 2D
    106     * projection that can later be used to write the axis tick labels in the
    107     * appropriate places.
    108     * <br><br>
    109     * If {@code tickUnit} is {@code Double.NaN}, then tick data is
    110     * generated for just the bounds of the axis.
    111     *
    112     * @param tickUnit  the tick unit.
    113     *
    114     * @return A list of tick data (never {@code null}).
    115     */
    116    List<TickData> generateTickData(double tickUnit);
    117
    118    /**
    119     * Returns a list of marker data instances for the markers that fall
    120     * within the current axis range.
    121     *
    122     * @return A list of marker data.
    123     */
    124    List<MarkerData> generateMarkerData();
    125
    126    /**
    127     * Returns the marker with the specified key, if there is one.
    128     *
    129     * @param key  the key ({@code null} not permitted).
    130     *
    131     * @return The marker (possibly {@code null}).
    132     *
    133     * @since 1.2
    134     */
    135    ValueMarker getMarker(String key);
    136
    137}