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.plot;
034
035import java.util.List;
036import org.jfree.chart3d.Chart3D;
037import org.jfree.chart3d.ChartElement;
038import org.jfree.chart3d.data.ItemKey;
039import org.jfree.chart3d.graphics3d.Dimension3D;
040import org.jfree.chart3d.graphics3d.World;
041import org.jfree.chart3d.legend.LegendItemInfo;
042
043/**
044 * A plot for a {@link Chart3D}.  In Orson Charts, the {@code Chart3D} is
045 * the umbrella object for all charts, but it is the {@code Plot3D}
046 * instance that determines the real structure of the chart.  Built-in 
047 * implementations include {@link PiePlot3D}, {@link CategoryPlot3D} and 
048 * {@link XYZPlot}.
049 */
050public interface Plot3D extends ChartElement {
051
052    /**
053     * Returns the chart that the plot is assigned to, if any.
054     * 
055     * @return The chart (possibly {@code null}).
056     * 
057     * @since 1.2
058     */
059    Chart3D getChart();
060    
061    /**
062     * Sets the chart that the plot is assigned to.  This method is intended
063     * for use by the framework, you should not need to call it yourself.
064     * 
065     * @param chart  the chart ({@code null} permitted).
066     * 
067     * @since 1.2
068     */
069    void setChart(Chart3D chart);
070    
071    /**
072     * Returns the dimensions for the plot in the 3D world in which it will 
073     * be composed.
074     * 
075     * @return The dimensions (never {@code null}). 
076     */
077    Dimension3D getDimensions();
078  
079    /**
080     * Adds 3D objects representing the current data for the plot to the 
081     * specified world.  After the world has been populated (or constructed) in
082     * this way, it is ready for rendering.
083     * 
084     * @param world  the world ({@code null} not permitted).
085     * @param xOffset  the x-offset.
086     * @param yOffset  the y-offset.
087     * @param zOffset  the z-offset.
088     */
089    void compose(World world, double xOffset, double yOffset, double zOffset);
090
091    /**
092     * Returns a list containing legend item info, typically one item for
093     * each series in the chart.  This is intended for use in the construction
094     * of a chart legend.  
095     * <br><br>
096     * If you are implementing a new plot type that does not require a legend, 
097     * return an empty list.
098     * 
099     * @return A list containing legend item info (never {@code null}).
100     */
101    List<LegendItemInfo> getLegendInfo();
102    
103    /**
104     * Returns the tool tip text for the specified data item, or 
105     * {@code null} if no tool tip is required.
106     * 
107     * @param itemKey  the item key ({@code null} not permitted).
108     * 
109     * @return The tool tip text (possibly {@code null}).
110     * 
111     * @since 1.3
112     */
113    String generateToolTipText(ItemKey itemKey);
114    
115    /**
116     * Registers a listener to receive notification of changes to the plot.
117     * 
118     * @param listener  the listener ({@code null} not permitted). 
119     */
120    void addChangeListener(Plot3DChangeListener listener);
121  
122    /**
123     * De-registers a listener so that it no longer receives notification of
124     * changes to the plot.
125     * 
126     * @param listener  the listener ({@code null} not permitted).
127     */
128    void removeChangeListener(Plot3DChangeListener listener);
129  
130}