    001    /* ===========================================================
    002     * JFreeChart : a free chart library for the Java(tm) platform
    003     * ===========================================================
    004     *
    005     * (C) Copyright 2000-2011, 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     * [Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    025     * Other names may be trademarks of their respective owners.]
    026     *
    027     * -------------------
    028     * XYItemRenderer.java
    029     * -------------------
    030     * (C) Copyright 2001-2011, by Object Refinery Limited and Contributors.
    031     *
    032     * Original Author:  David Gilbert (for Object Refinery Limited);
    033     * Contributor(s):   Mark Watson (www.markwatson.com);
    034     *                   Sylvain Vieujot;
    035     *                   Focus Computer Services Limited;
    036     *                   Richard Atkinson;
    037     *
    038     * Changes
    039     * -------
    040     * 19-Oct-2001 : Version 1, based on code by Mark Watson (DG);
    041     * 22-Oct-2001 : Renamed DataSource.java --> Dataset.java etc. (DG);
    042     * 13-Dec-2001 : Changed return type of drawItem from void --> Shape.  The area
    043     *               returned can be used as the tooltip region.
    044     * 23-Jan-2002 : Added DrawInfo parameter to drawItem() method (DG);
    045     * 28-Mar-2002 : Added a property change listener mechanism.  Now renderers do
    046     *               not have to be immutable (DG);
    047     * 04-Apr-2002 : Added the initialise() method (DG);
    048     * 09-Apr-2002 : Removed the translated zero from the drawItem method, it can
    049     *               be calculated inside the initialise method if it is required.
    050     *               Added a new getToolTipGenerator() method.  Changed the return
    051     *               type for drawItem() to void (DG);
    052     * 24-May-2002 : Added ChartRenderingInfo the initialise method API (DG);
    053     * 25-Jun-2002 : Removed redundant import (DG);
    054     * 20-Aug-2002 : Added get/setURLGenerator methods to interface (DG);
    055     * 02-Oct-2002 : Fixed errors reported by Checkstyle (DG);
    056     * 18-Nov-2002 : Added methods for drawing grid lines (DG);
    057     * 17-Jan-2003 : Moved plot classes into a separate package (DG);
    058     * 27-Jan-2003 : Added shape lookup table (DG);
    059     * 05-Jun-2003 : Added domain and range grid bands (sponsored by Focus Computer
    060     *               Services Ltd) (DG);
    061     * 27-Jul-2003 : Added getRangeType() to support stacked XY area charts (RA);
    062     * 16-Sep-2003 : Changed ChartRenderingInfo --> PlotRenderingInfo (DG);
    063     * 25-Feb-2004 : Replaced CrosshairInfo with CrosshairState.  Renamed
    064     *               XYToolTipGenerator --> XYItemLabelGenerator (DG);
    065     * 26-Feb-2004 : Added lots of new methods (DG);
    066     * 30-Apr-2004 : Added getRangeExtent() method (DG);
    067     * 06-May-2004 : Added methods for controlling item label visibility (DG);
    068     * 13-May-2004 : Removed property change listener mechanism (DG);
    069     * 18-May-2004 : Added item label font and paint methods (DG);
    070     * 10-Sep-2004 : Removed redundant getRangeType() method (DG);
    071     * 06-Oct-2004 : Replaced getRangeExtent() with findRangeBounds() and added
    072     *               findDomainBounds (DG);
    073     * 23-Nov-2004 : Changed drawRangeGridLine() --> drawRangeLine() (DG);
    074     * 07-Jan-2005 : Removed deprecated method (DG);
    075     * 24-Feb-2005 : Now extends LegendItemSource (DG);
    076     * 20-Apr-2005 : Renamed XYLabelGenerator --> XYItemLabelGenerator (DG);
    077     * ------------- JFREECHART 1.0.x ---------------------------------------------
    078     * 19-Apr-2007 : Deprecated seriesVisible and seriesVisibleInLegend flags (DG);
    079     * 20-Apr-2007 : Deprecated paint, fillPaint, outlinePaint, stroke,
    080     *               outlineStroke, shape, itemLabelsVisible, itemLabelFont,
    081     *               itemLabelPaint, positiveItemLabelPosition,
    082     *               negativeItemLabelPosition and createEntities override
    083     *               fields (DG);
    084     *
    085     */
    086
    087    package org.jfree.chart.renderer.xy;
    088
    089    import java.awt.Font;
    090    import java.awt.Graphics2D;
    091    import java.awt.Paint;
    092    import java.awt.Shape;
    093    import java.awt.Stroke;
    094    import java.awt.geom.Rectangle2D;
    095
    096    import org.jfree.chart.LegendItem;
    097    import org.jfree.chart.LegendItemSource;
    098    import org.jfree.chart.annotations.XYAnnotation;
    099    import org.jfree.chart.axis.ValueAxis;
    100    import org.jfree.chart.event.RendererChangeEvent;
    101    import org.jfree.chart.event.RendererChangeListener;
    102    import org.jfree.chart.labels.ItemLabelPosition;
    103    import org.jfree.chart.labels.XYItemLabelGenerator;
    104    import org.jfree.chart.labels.XYSeriesLabelGenerator;
    105    import org.jfree.chart.labels.XYToolTipGenerator;
    106    import org.jfree.chart.plot.CrosshairState;
    107    import org.jfree.chart.plot.Marker;
    108    import org.jfree.chart.plot.PlotRenderingInfo;
    109    import org.jfree.chart.plot.XYPlot;
    110    import org.jfree.chart.urls.XYURLGenerator;
    111    import org.jfree.data.Range;
    112    import org.jfree.data.xy.XYDataset;
    113    import org.jfree.ui.Layer;
    114
    115    /**
    116     * Interface for rendering the visual representation of a single (x, y) item on
    117     * an {@link XYPlot}.
    118     * <p>
    119     * To support cloning charts, it is recommended that renderers implement both
    120     * the {@link Cloneable} and <code>PublicCloneable</code> interfaces.
    121     */
    122    public interface XYItemRenderer extends LegendItemSource {
    123
    124        /**
    125         * Returns the plot that this renderer has been assigned to.
    126         *
    127         * @return The plot.
    128         */
    129        public XYPlot getPlot();
    130
    131        /**
    132         * Sets the plot that this renderer is assigned to.  This method will be
    133         * called by the plot class...you do not need to call it yourself.
    134         *
    135         * @param plot  the plot.
    136         */
    137        public void setPlot(XYPlot plot);
    138
    139        /**
    140         * Returns the number of passes through the data required by the renderer.
    141         *
    142         * @return The pass count.
    143         */
    144        public int getPassCount();
    145
    146        /**
    147         * Returns the lower and upper bounds (range) of the x-values in the
    148         * specified dataset.
    149         *
    150         * @param dataset  the dataset (<code>null</code> permitted).
    151         *
    152         * @return The range.
    153         */
    154        public Range findDomainBounds(XYDataset dataset);
    155
    156        /**
    157         * Returns the lower and upper bounds (range) of the y-values in the
    158         * specified dataset.  The implementation of this method will take
    159         * into account the presentation used by the renderers (for example,
    160         * a renderer that "stacks" values will return a bigger range than
    161         * a renderer that doesn't).
    162         *
    163         * @param dataset  the dataset (<code>null</code> permitted).
    164         *
    165         * @return The range (or <code>null</code> if the dataset is
    166         *         <code>null</code> or empty).
    167         */
    168        public Range findRangeBounds(XYDataset dataset);
    169
    170        /**
    171         * Add a renderer change listener.
    172         *
    173         * @param listener  the listener.
    174         *
    175         * @see #removeChangeListener(RendererChangeListener)
    176         */
    177        public void addChangeListener(RendererChangeListener listener);
    178
    179        /**
    180         * Removes a change listener.
    181         *
    182         * @param listener  the listener.
    183         *
    184         * @see #addChangeListener(RendererChangeListener)
    185         */
    186        public void removeChangeListener(RendererChangeListener listener);
    187
    188
    189        //// VISIBLE //////////////////////////////////////////////////////////////
    190
    191        /**
    192         * Returns a boolean that indicates whether or not the specified item
    193         * should be drawn (this is typically used to hide an entire series).
    194         *
    195         * @param series  the series index.
    196         * @param item  the item index.
    197         *
    198         * @return A boolean.
    199         */
    200        public boolean getItemVisible(int series, int item);
    201
    202        /**
    203         * Returns a boolean that indicates whether or not the specified series
    204         * should be drawn (this is typically used to hide an entire series).
    205         *
    206         * @param series  the series index.
    207         *
    208         * @return A boolean.
    209         */
    210        public boolean isSeriesVisible(int series);
    211
    212        /**
    213         * Returns the flag that controls whether a series is visible.
    214         *
    215         * @param series  the series index (zero-based).
    216         *
    217         * @return The flag (possibly <code>null</code>).
    218         *
    219         * @see #setSeriesVisible(int, Boolean)
    220         */
    221        public Boolean getSeriesVisible(int series);
    222
    223        /**
    224         * Sets the flag that controls whether a series is visible and sends a
    225         * {@link RendererChangeEvent} to all registered listeners.
    226         *
    227         * @param series  the series index (zero-based).
    228         * @param visible  the flag (<code>null</code> permitted).
    229         *
    230         * @see #getSeriesVisible(int)
    231         */
    232        public void setSeriesVisible(int series, Boolean visible);
    233
    234        /**
    235         * Sets the flag that controls whether a series is visible and, if
    236         * requested, sends a {@link RendererChangeEvent} to all registered
    237         * listeners.
    238         *
    239         * @param series  the series index.
    240         * @param visible  the flag (<code>null</code> permitted).
    241         * @param notify  notify listeners?
    242         *
    243         * @see #getSeriesVisible(int)
    244         */
    245        public void setSeriesVisible(int series, Boolean visible, boolean notify);
    246
    247        /**
    248         * Returns the base visibility for all series.
    249         *
    250         * @return The base visibility.
    251         *
    252         * @see #setBaseSeriesVisible(boolean)
    253         */
    254        public boolean getBaseSeriesVisible();
    255
    256        /**
    257         * Sets the base visibility and sends a {@link RendererChangeEvent} to all
    258         * registered listeners.
    259         *
    260         * @param visible  the flag.
    261         *
    262         * @see #getBaseSeriesVisible()
    263         */
    264        public void setBaseSeriesVisible(boolean visible);
    265
    266        /**
    267         * Sets the base visibility and, if requested, sends
    268         * a {@link RendererChangeEvent} to all registered listeners.
    269         *
    270         * @param visible  the visibility.
    271         * @param notify  notify listeners?
    272         *
    273         * @see #getBaseSeriesVisible()
    274         */
    275        public void setBaseSeriesVisible(boolean visible, boolean notify);
    276
    277        // SERIES VISIBLE IN LEGEND (not yet respected by all renderers)
    278
    279        /**
    280         * Returns <code>true</code> if the series should be shown in the legend,
    281         * and <code>false</code> otherwise.
    282         *
    283         * @param series  the series index.
    284         *
    285         * @return A boolean.
    286         */
    287        public boolean isSeriesVisibleInLegend(int series);
    288
    289        /**
    290         * Returns the flag that controls whether a series is visible in the
    291         * legend.  This method returns only the "per series" settings - to
    292         * incorporate the override and base settings as well, you need to use the
    293         * {@link #isSeriesVisibleInLegend(int)} method.
    294         *
    295         * @param series  the series index (zero-based).
    296         *
    297         * @return The flag (possibly <code>null</code>).
    298         *
    299         * @see #setSeriesVisibleInLegend(int, Boolean)
    300         */
    301        public Boolean getSeriesVisibleInLegend(int series);
    302
    303        /**
    304         * Sets the flag that controls whether a series is visible in the legend
    305         * and sends a {@link RendererChangeEvent} to all registered listeners.
    306         *
    307         * @param series  the series index (zero-based).
    308         * @param visible  the flag (<code>null</code> permitted).
    309         *
    310         * @see #getSeriesVisibleInLegend(int)
    311         */
    312        public void setSeriesVisibleInLegend(int series, Boolean visible);
    313
    314        /**
    315         * Sets the flag that controls whether a series is visible in the legend
    316         * and, if requested, sends a {@link RendererChangeEvent} to all registered
    317         * listeners.
    318         *
    319         * @param series  the series index.
    320         * @param visible  the flag (<code>null</code> permitted).
    321         * @param notify  notify listeners?
    322         *
    323         * @see #getSeriesVisibleInLegend(int)
    324         */
    325        public void setSeriesVisibleInLegend(int series, Boolean visible,
    326                                             boolean notify);
    327
    328        /**
    329         * Returns the base visibility in the legend for all series.
    330         *
    331         * @return The base visibility.
    332         *
    333         * @see #setBaseSeriesVisibleInLegend(boolean)
    334         */
    335        public boolean getBaseSeriesVisibleInLegend();
    336
    337        /**
    338         * Sets the base visibility in the legend and sends a
    339         * {@link RendererChangeEvent} to all registered listeners.
    340         *
    341         * @param visible  the flag.
    342         *
    343         * @see #getBaseSeriesVisibleInLegend()
    344         */
    345        public void setBaseSeriesVisibleInLegend(boolean visible);
    346
    347        /**
    348         * Sets the base visibility in the legend and, if requested, sends
    349         * a {@link RendererChangeEvent} to all registered listeners.
    350         *
    351         * @param visible  the visibility.
    352         * @param notify  notify listeners?
    353         *
    354         * @see #getBaseSeriesVisibleInLegend()
    355         */
    356        public void setBaseSeriesVisibleInLegend(boolean visible, boolean notify);
    357
    358
    359        //// PAINT ////////////////////////////////////////////////////////////////
    360
    361        /**
    362         * Returns the paint used to fill data items as they are drawn.
    363         *
    364         * @param row  the row (or series) index (zero-based).
    365         * @param column  the column (or category) index (zero-based).
    366         *
    367         * @return The paint (never <code>null</code>).
    368         */
    369        public Paint getItemPaint(int row, int column);
    370
    371        /**
    372         * Returns the paint used to fill an item drawn by the renderer.
    373         *
    374         * @param series  the series index (zero-based).
    375         *
    376         * @return The paint (possibly <code>null</code>).
    377         *
    378         * @see #setSeriesPaint(int, Paint)
    379         */
    380        public Paint getSeriesPaint(int series);
    381
    382        /**
    383         * Sets the paint used for a series and sends a {@link RendererChangeEvent}
    384         * to all registered listeners.
    385         *
    386         * @param series  the series index (zero-based).
    387         * @param paint  the paint (<code>null</code> permitted).
    388         *
    389         * @see #getSeriesPaint(int)
    390         */
    391        public void setSeriesPaint(int series, Paint paint);
    392
    393        // FIXME: add setSeriesPaint(int, Paint, boolean)?
    394
    395        /**
    396         * Returns the base paint.
    397         *
    398         * @return The base paint (never <code>null</code>).
    399         *
    400         * @see #setBasePaint(Paint)
    401         */
    402        public Paint getBasePaint();
    403
    404        /**
    405         * Sets the base paint and sends a {@link RendererChangeEvent} to all
    406         * registered listeners.
    407         *
    408         * @param paint  the paint (<code>null</code> not permitted).
    409         *
    410         * @see #getBasePaint()
    411         */
    412        public void setBasePaint(Paint paint);
    413
    414        // FIXME: add setBasePaint(int, Paint, boolean)?
    415
    416    //    // FILL PAINT
    417    //
    418    //    /**
    419    //     * Returns the paint used to fill data items as they are drawn.
    420    //     *
    421    //     * @param row  the row (or series) index (zero-based).
    422    //     * @param column  the column (or category) index (zero-based).
    423    //     *
    424    //     * @return The paint (never <code>null</code>).
    425    //     */
    426    //    public Paint getItemFillPaint(int row, int column);
    427    //
    428    //    /**
    429    //     * Returns the paint used to fill an item drawn by the renderer.
    430    //     *
    431    //     * @param series  the series index (zero-based).
    432    //     *
    433    //     * @return The paint (possibly <code>null</code>).
    434    //     */
    435    //    public Paint getSeriesFillPaint(int series);
    436    //
    437    //    /**
    438    //     * Sets the paint used for a series and sends a
    439    //     * {@link RendererChangeEvent} to all registered listeners.
    440    //     *
    441    //     * @param series  the series index (zero-based).
    442    //     * @param paint  the paint (<code>null</code> permitted).
    443    //     */
    444    //    public void setSeriesFillPaint(int series, Paint paint);
    445    //
    446    //    // FIXME: add setSeriesFillPaint(int, Paint, boolean)?
    447    //
    448    //    /**
    449    //     * Returns the base paint.
    450    //     *
    451    //     * @return The base paint (never <code>null</code>).
    452    //     */
    453    //    public Paint getBaseFillPaint();
    454    //
    455    //    /**
    456    //     * Sets the base paint and sends a {@link RendererChangeEvent} to all
    457    //     * registered listeners.
    458    //     *
    459    //     * @param paint  the paint (<code>null</code> not permitted).
    460    //     */
    461    //    public void setBaseFillPaint(Paint paint);
    462    //
    463    //    // FIXME: add setBaseFillPaint(int, Paint, boolean)?
    464
    465        //// OUTLINE PAINT ////////////////////////////////////////////////////////
    466
    467        /**
    468         * Returns the paint used to outline data items as they are drawn.
    469         *
    470         * @param row  the row (or series) index (zero-based).
    471         * @param column  the column (or category) index (zero-based).
    472         *
    473         * @return The paint (never <code>null</code>).
    474         */
    475        public Paint getItemOutlinePaint(int row, int column);
    476
    477        /**
    478         * Returns the paint used to outline an item drawn by the renderer.
    479         *
    480         * @param series  the series (zero-based index).
    481         *
    482         * @return The paint (possibly <code>null</code>).
    483         *
    484         * @see #setSeriesOutlinePaint(int, Paint)
    485         */
    486        public Paint getSeriesOutlinePaint(int series);
    487
    488        /**
    489         * Sets the paint used for a series outline and sends a
    490         * {@link RendererChangeEvent} to all registered listeners.
    491         *
    492         * @param series  the series index (zero-based).
    493         * @param paint  the paint (<code>null</code> permitted).
    494         *
    495         * @see #getSeriesOutlinePaint(int)
    496         */
    497        public void setSeriesOutlinePaint(int series, Paint paint);
    498
    499        // FIXME: add setSeriesOutlinePaint(int, Paint, boolean)?
    500
    501        /**
    502         * Returns the base outline paint.
    503         *
    504         * @return The paint (never <code>null</code>).
    505         *
    506         * @see #setBaseOutlinePaint(Paint)
    507         */
    508        public Paint getBaseOutlinePaint();
    509
    510        /**
    511         * Sets the base outline paint and sends a {@link RendererChangeEvent} to
    512         * all registered listeners.
    513         *
    514         * @param paint  the paint (<code>null</code> not permitted).
    515         *
    516         * @see #getBaseOutlinePaint()
    517         */
    518        public void setBaseOutlinePaint(Paint paint);
    519
    520        // FIXME: add setBaseOutlinePaint(Paint, boolean)?
    521
    522        //// STROKE ///////////////////////////////////////////////////////////////
    523
    524        /**
    525         * Returns the stroke used to draw data items.
    526         *
    527         * @param row  the row (or series) index (zero-based).
    528         * @param column  the column (or category) index (zero-based).
    529         *
    530         * @return The stroke (never <code>null</code>).
    531         */
    532        public Stroke getItemStroke(int row, int column);
    533
    534        /**
    535         * Returns the stroke used to draw the items in a series.
    536         *
    537         * @param series  the series (zero-based index).
    538         *
    539         * @return The stroke (possibly <code>null</code>).
    540         *
    541         * @see #setSeriesStroke(int, Stroke)
    542         */
    543        public Stroke getSeriesStroke(int series);
    544
    545        /**
    546         * Sets the stroke used for a series and sends a
    547         * {@link RendererChangeEvent} to all registered listeners.
    548         *
    549         * @param series  the series index (zero-based).
    550         * @param stroke  the stroke (<code>null</code> permitted).
    551         *
    552         * @see #getSeriesStroke(int)
    553         */
    554        public void setSeriesStroke(int series, Stroke stroke);
    555
    556        // FIXME: add setSeriesStroke(int, Stroke, boolean) ?
    557
    558        /**
    559         * Returns the base stroke.
    560         *
    561         * @return The base stroke (never <code>null</code>).
    562         *
    563         * @see #setBaseStroke(Stroke)
    564         */
    565        public Stroke getBaseStroke();
    566
    567        /**
    568         * Sets the base stroke and sends a {@link RendererChangeEvent} to all
    569         * registered listeners.
    570         *
    571         * @param stroke  the stroke (<code>null</code> not permitted).
    572         *
    573         * @see #getBaseStroke()
    574         */
    575        public void setBaseStroke(Stroke stroke);
    576
    577        // FIXME: add setBaseStroke(Stroke, boolean) ?
    578
    579        //// OUTLINE STROKE ///////////////////////////////////////////////////////
    580
    581        /**
    582         * Returns the stroke used to outline data items.  The default
    583         * implementation passes control to the lookupSeriesOutlineStroke method.
    584         * You can override this method if you require different behaviour.
    585         *
    586         * @param row  the row (or series) index (zero-based).
    587         * @param column  the column (or category) index (zero-based).
    588         *
    589         * @return The stroke (never <code>null</code>).
    590         */
    591        public Stroke getItemOutlineStroke(int row, int column);
    592
    593        /**
    594         * Returns the stroke used to outline the items in a series.
    595         *
    596         * @param series  the series (zero-based index).
    597         *
    598         * @return The stroke (possibly <code>null</code>).
    599         *
    600         * @see #setSeriesOutlineStroke(int, Stroke)
    601         */
    602        public Stroke getSeriesOutlineStroke(int series);
    603
    604        /**
    605         * Sets the outline stroke used for a series and sends a
    606         * {@link RendererChangeEvent} to all registered listeners.
    607         *
    608         * @param series  the series index (zero-based).
    609         * @param stroke  the stroke (<code>null</code> permitted).
    610         *
    611         * @see #getSeriesOutlineStroke(int)
    612         */
    613        public void setSeriesOutlineStroke(int series, Stroke stroke);
    614
    615        // FIXME: add setSeriesOutlineStroke(int, Stroke, boolean) ?
    616
    617        /**
    618         * Returns the base outline stroke.
    619         *
    620         * @return The stroke (never <code>null</code>).
    621         *
    622         * @see #setBaseOutlineStroke(Stroke)
    623         */
    624        public Stroke getBaseOutlineStroke();
    625
    626        /**
    627         * Sets the base outline stroke and sends a {@link RendererChangeEvent} to
    628         * all registered listeners.
    629         *
    630         * @param stroke  the stroke (<code>null</code> not permitted).
    631         *
    632         * @see #getBaseOutlineStroke()
    633         */
    634        public void setBaseOutlineStroke(Stroke stroke);
    635
    636        // FIXME: add setBaseOutlineStroke(Stroke, boolean) ?
    637
    638        //// SHAPE ////////////////////////////////////////////////////////////////
    639
    640        /**
    641         * Returns a shape used to represent a data item.
    642         *
    643         * @param row  the row (or series) index (zero-based).
    644         * @param column  the column (or category) index (zero-based).
    645         *
    646         * @return The shape (never <code>null</code>).
    647         */
    648        public Shape getItemShape(int row, int column);
    649
    650        /**
    651         * Returns a shape used to represent the items in a series.
    652         *
    653         * @param series  the series (zero-based index).
    654         *
    655         * @return The shape (possibly <code>null</code>).
    656         *
    657         * @see #setSeriesShape(int, Shape)
    658         */
    659        public Shape getSeriesShape(int series);
    660
    661        /**
    662         * Sets the shape used for a series and sends a {@link RendererChangeEvent}
    663         * to all registered listeners.
    664         *
    665         * @param series  the series index (zero-based).
    666         * @param shape  the shape (<code>null</code> permitted).
    667         *
    668         * @see #getSeriesShape(int)
    669         */
    670        public void setSeriesShape(int series, Shape shape);
    671
    672        // FIXME: add setSeriesShape(int, Shape, boolean) ?
    673
    674        /**
    675         * Returns the base shape.
    676         *
    677         * @return The shape (never <code>null</code>).
    678         *
    679         * @see #setBaseShape(Shape)
    680         */
    681        public Shape getBaseShape();
    682
    683        /**
    684         * Sets the base shape and sends a {@link RendererChangeEvent} to all
    685         * registered listeners.
    686         *
    687         * @param shape  the shape (<code>null</code> not permitted).
    688         *
    689         * @see #getBaseShape()
    690         */
    691        public void setBaseShape(Shape shape);
    692
    693        // FIXME: add setBaseShape(Shape, boolean) ?
    694
    695
    696        //// LEGEND ITEMS /////////////////////////////////////////////////////////
    697
    698        /**
    699         * Returns a legend item for a series from a dataset.
    700         *
    701         * @param datasetIndex  the dataset index.
    702         * @param series  the series (zero-based index).
    703         *
    704         * @return The legend item (possibly <code>null</code>).
    705         */
    706        public LegendItem getLegendItem(int datasetIndex, int series);
    707
    708
    709        //// LEGEND ITEM LABEL GENERATOR //////////////////////////////////////////
    710
    711        /**
    712         * Returns the legend item label generator.
    713         *
    714         * @return The legend item label generator (never <code>null</code>).
    715         *
    716         * @see #setLegendItemLabelGenerator(XYSeriesLabelGenerator)
    717         */
    718        public XYSeriesLabelGenerator getLegendItemLabelGenerator();
    719
    720        /**
    721         * Sets the legend item label generator and sends a
    722         * {@link RendererChangeEvent} to all registered listeners.
    723         *
    724         * @param generator  the generator (<code>null</code> not permitted).
    725         */
    726        public void setLegendItemLabelGenerator(XYSeriesLabelGenerator generator);
    727
    728
    729        //// TOOL TIP GENERATOR ///////////////////////////////////////////////////
    730
    731        /**
    732         * Returns the tool tip generator for a data item.
    733         *
    734         * @param row  the row index (zero based).
    735         * @param column  the column index (zero based).
    736         *
    737         * @return The generator (possibly <code>null</code>).
    738         */
    739        public XYToolTipGenerator getToolTipGenerator(int row, int column);
    740
    741        /**
    742         * Returns the tool tip generator for a series.
    743         *
    744         * @param series  the series index (zero based).
    745         *
    746         * @return The generator (possibly <code>null</code>).
    747         *
    748         * @see #setSeriesToolTipGenerator(int, XYToolTipGenerator)
    749         */
    750        public XYToolTipGenerator getSeriesToolTipGenerator(int series);
    751
    752        /**
    753         * Sets the tool tip generator for a series and sends a
    754         * {@link RendererChangeEvent} to all registered listeners.
    755         *
    756         * @param series  the series index (zero based).
    757         * @param generator  the generator (<code>null</code> permitted).
    758         *
    759         * @see #getSeriesToolTipGenerator(int)
    760         */
    761        public void setSeriesToolTipGenerator(int series,
    762                                              XYToolTipGenerator generator);
    763
    764        /**
    765         * Returns the base tool tip generator.
    766         *
    767         * @return The generator (possibly <code>null</code>).
    768         *
    769         * @see #setBaseToolTipGenerator(XYToolTipGenerator)
    770         */
    771        public XYToolTipGenerator getBaseToolTipGenerator();
    772
    773        /**
    774         * Sets the base tool tip generator and sends a {@link RendererChangeEvent}
    775         * to all registered listeners.
    776         *
    777         * @param generator  the generator (<code>null</code> permitted).
    778         *
    779         * @see #getBaseToolTipGenerator()
    780         */
    781        public void setBaseToolTipGenerator(XYToolTipGenerator generator);
    782
    783        //// URL GENERATOR ////////////////////////////////////////////////////////
    784
    785
    786        /**
    787         * Returns the URL generator for HTML image maps.
    788         *
    789         * @return The URL generator (possibly null).
    790         */
    791        public XYURLGenerator getURLGenerator();
    792
    793        /**
    794         * Sets the URL generator for HTML image maps.
    795         *
    796         * @param urlGenerator the URL generator (null permitted).
    797         */
    798        public void setURLGenerator(XYURLGenerator urlGenerator);
    799
    800        //// ITEM LABELS VISIBLE //////////////////////////////////////////////////
    801
    802        /**
    803         * Returns <code>true</code> if an item label is visible, and
    804         * <code>false</code> otherwise.
    805         *
    806         * @param row  the row index (zero-based).
    807         * @param column  the column index (zero-based).
    808         *
    809         * @return A boolean.
    810         */
    811        public boolean isItemLabelVisible(int row, int column);
    812
    813        /**
    814         * Returns <code>true</code> if the item labels for a series are visible,
    815         * and <code>false</code> otherwise.
    816         *
    817         * @param series  the series index (zero-based).
    818         *
    819         * @return A boolean.
    820         */
    821        public boolean isSeriesItemLabelsVisible(int series);
    822
    823        /**
    824         * Sets a flag that controls the visibility of the item labels for a
    825         * series and sends a {@link RendererChangeEvent} to all registered
    826         * listeners.
    827         *
    828         * @param series  the series index (zero-based).
    829         * @param visible  the flag.
    830         *
    831         * @see #isSeriesItemLabelsVisible(int)
    832         */
    833        public void setSeriesItemLabelsVisible(int series, boolean visible);
    834
    835        /**
    836         * Sets a flag that controls the visibility of the item labels for a series.
    837         *
    838         * @param series  the series index (zero-based).
    839         * @param visible  the flag (<code>null</code> permitted).
    840         *
    841         * @see #isSeriesItemLabelsVisible(int)
    842         */
    843        public void setSeriesItemLabelsVisible(int series, Boolean visible);
    844
    845        /**
    846         * Sets the visibility of item labels for a series and, if requested,
    847         * sends a {@link RendererChangeEvent} to all registered listeners.
    848         *
    849         * @param series  the series index (zero-based).
    850         * @param visible  the visible flag.
    851         * @param notify  a flag that controls whether or not listeners are
    852         *                notified.
    853         *
    854         * @see #isSeriesItemLabelsVisible(int)
    855         */
    856        public void setSeriesItemLabelsVisible(int series, Boolean visible,
    857                                               boolean notify);
    858
    859        /**
    860         * Returns the base setting for item label visibility.
    861         *
    862         * @return A flag (possibly <code>null</code>).
    863         *
    864         * @see #setBaseItemLabelsVisible(boolean)
    865         */
    866        public Boolean getBaseItemLabelsVisible();
    867
    868        /**
    869         * Sets the base flag that controls whether or not item labels are visible.
    870         *
    871         * @param visible  the flag.
    872         *
    873         * @see #getBaseItemLabelsVisible()
    874         */
    875        public void setBaseItemLabelsVisible(boolean visible);
    876
    877        /**
    878         * Sets the base setting for item label visibility.
    879         *
    880         * @param visible  the flag (<code>null</code> permitted).
    881         *
    882         * @see #getBaseItemLabelsVisible()
    883         */
    884        public void setBaseItemLabelsVisible(Boolean visible);
    885
    886        /**
    887         * Sets the base visibility for item labels and, if requested, sends a
    888         * {@link RendererChangeEvent} to all registered listeners.
    889         *
    890         * @param visible  the visibility flag.
    891         * @param notify  a flag that controls whether or not listeners are
    892         *                notified.
    893         *
    894         * @see #getBaseItemLabelsVisible()
    895         */
    896        public void setBaseItemLabelsVisible(Boolean visible, boolean notify);
    897
    898
    899        //// ITEM LABEL GENERATOR /////////////////////////////////////////////////
    900
    901        /**
    902         * Returns the item label generator for a data item.
    903         *
    904         * @param row  the row index (zero based).
    905         * @param column  the column index (zero based).
    906         *
    907         * @return The generator (possibly <code>null</code>).
    908         */
    909        public XYItemLabelGenerator getItemLabelGenerator(int row, int column);
    910
    911        /**
    912         * Returns the item label generator for a series.
    913         *
    914         * @param series  the series index (zero based).
    915         *
    916         * @return The generator (possibly <code>null</code>).
    917         *
    918         * @see #setSeriesItemLabelGenerator(int, XYItemLabelGenerator)
    919         */
    920        public XYItemLabelGenerator getSeriesItemLabelGenerator(int series);
    921
    922        /**
    923         * Sets the item label generator for a series and sends a
    924         * {@link RendererChangeEvent} to all registered listeners.
    925         *
    926         * @param series  the series index (zero based).
    927         * @param generator  the generator (<code>null</code> permitted).
    928         *
    929         * @see #getSeriesItemLabelGenerator(int)
    930         */
    931        public void setSeriesItemLabelGenerator(int series,
    932                                                XYItemLabelGenerator generator);
    933
    934        // FIXME:
    935
    936        /**
    937         * Returns the base item label generator.
    938         *
    939         * @return The generator (possibly <code>null</code>).
    940         *
    941         * @see #setBaseItemLabelGenerator(XYItemLabelGenerator)
    942         */
    943        public XYItemLabelGenerator getBaseItemLabelGenerator();
    944
    945        /**
    946         * Sets the base item label generator and sends a
    947         * {@link RendererChangeEvent} to all registered listeners.
    948         *
    949         * @param generator  the generator (<code>null</code> permitted).
    950         *
    951         * @see #getBaseItemLabelGenerator()
    952         */
    953        public void setBaseItemLabelGenerator(XYItemLabelGenerator generator);
    954
    955        //// ITEM LABEL FONT ///////////////////////////////////////////////////////
    956
    957        /**
    958         * Returns the font for an item label.
    959         *
    960         * @param row  the row index (zero-based).
    961         * @param column  the column index (zero-based).
    962         *
    963         * @return The font (never <code>null</code>).
    964         */
    965        public Font getItemLabelFont(int row, int column);
    966
    967        /**
    968         * Returns the font for all the item labels in a series.
    969         *
    970         * @param series  the series index (zero-based).
    971         *
    972         * @return The font (possibly <code>null</code>).
    973         */
    974        public Font getSeriesItemLabelFont(int series);
    975
    976        /**
    977         * Sets the item label font for a series and sends a
    978         * {@link RendererChangeEvent} to all registered listeners.
    979         *
    980         * @param series  the series index (zero-based).
    981         * @param font  the font (<code>null</code> permitted).
    982         *
    983         * @see #getSeriesItemLabelFont(int)
    984         */
    985        public void setSeriesItemLabelFont(int series, Font font);
    986
    987        /**
    988         * Returns the base item label font (this is used when no other font
    989         * setting is available).
    990         *
    991         * @return The font (<code>never</code> null).
    992         *
    993         * @see #setBaseItemLabelFont(Font)
    994         */
    995        public Font getBaseItemLabelFont();
    996
    997        /**
    998         * Sets the base item label font and sends a {@link RendererChangeEvent}
    999         * to all registered listeners.
    1000         *
    1001         * @param font  the font (<code>null</code> not permitted).
    1002         *
    1003         * @see #getBaseItemLabelFont()
    1004         */
    1005        public void setBaseItemLabelFont(Font font);
    1006
    1007        //// ITEM LABEL PAINT  /////////////////////////////////////////////////////
    1008
    1009        /**
    1010         * Returns the paint used to draw an item label.
    1011         *
    1012         * @param row  the row index (zero based).
    1013         * @param column  the column index (zero based).
    1014         *
    1015         * @return The paint (never <code>null</code>).
    1016         */
    1017        public Paint getItemLabelPaint(int row, int column);
    1018
    1019        /**
    1020         * Returns the paint used to draw the item labels for a series.
    1021         *
    1022         * @param series  the series index (zero based).
    1023         *
    1024         * @return The paint (possibly <code>null</code>).
    1025         *
    1026         * @see #setSeriesItemLabelPaint(int, Paint)
    1027         */
    1028        public Paint getSeriesItemLabelPaint(int series);
    1029
    1030        /**
    1031         * Sets the item label paint for a series and sends a
    1032         * {@link RendererChangeEvent} to all registered listeners.
    1033         *
    1034         * @param series  the series (zero based index).
    1035         * @param paint  the paint (<code>null</code> permitted).
    1036         *
    1037         * @see #getSeriesItemLabelPaint(int)
    1038         */
    1039        public void setSeriesItemLabelPaint(int series, Paint paint);
    1040
    1041        /**
    1042         * Returns the base item label paint.
    1043         *
    1044         * @return The paint (never <code>null</code>).
    1045         */
    1046        public Paint getBaseItemLabelPaint();
    1047
    1048        /**
    1049         * Sets the base item label paint and sends a {@link RendererChangeEvent}
    1050         * to all registered listeners.
    1051         *
    1052         * @param paint  the paint (<code>null</code> not permitted).
    1053         */
    1054        public void setBaseItemLabelPaint(Paint paint);
    1055
    1056        // POSITIVE ITEM LABEL POSITION...
    1057
    1058        /**
    1059         * Returns the item label position for positive values.
    1060         *
    1061         * @param row  the row index (zero-based).
    1062         * @param column  the column index (zero-based).
    1063         *
    1064         * @return The item label position (never <code>null</code>).
    1065         */
    1066        public ItemLabelPosition getPositiveItemLabelPosition(int row, int column);
    1067
    1068        /**
    1069         * Returns the item label position for all positive values in a series.
    1070         *
    1071         * @param series  the series index (zero-based).
    1072         *
    1073         * @return The item label position (never <code>null</code>).
    1074         */
    1075        public ItemLabelPosition getSeriesPositiveItemLabelPosition(int series);
    1076
    1077        /**
    1078         * Sets the item label position for all positive values in a series and
    1079         * sends a {@link RendererChangeEvent} to all registered listeners.
    1080         *
    1081         * @param series  the series index (zero-based).
    1082         * @param position  the position (<code>null</code> permitted).
    1083         */
    1084        public void setSeriesPositiveItemLabelPosition(int series,
    1085                                                       ItemLabelPosition position);
    1086
    1087        /**
    1088         * Sets the item label position for all positive values in a series and (if
    1089         * requested) sends a {@link RendererChangeEvent} to all registered
    1090         * listeners.
    1091         *
    1092         * @param series  the series index (zero-based).
    1093         * @param position  the position (<code>null</code> permitted).
    1094         * @param notify  notify registered listeners?
    1095         */
    1096        public void setSeriesPositiveItemLabelPosition(int series,
    1097                                                       ItemLabelPosition position,
    1098                                                       boolean notify);
    1099
    1100        /**
    1101         * Returns the base positive item label position.
    1102         *
    1103         * @return The position (never <code>null</code>).
    1104         */
    1105        public ItemLabelPosition getBasePositiveItemLabelPosition();
    1106
    1107        /**
    1108         * Sets the base positive item label position.
    1109         *
    1110         * @param position  the position (<code>null</code> not permitted).
    1111         */
    1112        public void setBasePositiveItemLabelPosition(ItemLabelPosition position);
    1113
    1114        /**
    1115         * Sets the base positive item label position and, if requested, sends a
    1116         * {@link RendererChangeEvent} to all registered listeners.
    1117         *
    1118         * @param position  the position (<code>null</code> not permitted).
    1119         * @param notify  notify registered listeners?
    1120         */
    1121        public void setBasePositiveItemLabelPosition(ItemLabelPosition position,
    1122                                                     boolean notify);
    1123
    1124
    1125        // NEGATIVE ITEM LABEL POSITION...
    1126
    1127        /**
    1128         * Returns the item label position for negative values.  This method can be
    1129         * overridden to provide customisation of the item label position for
    1130         * individual data items.
    1131         *
    1132         * @param row  the row index (zero-based).
    1133         * @param column  the column (zero-based).
    1134         *
    1135         * @return The item label position (never <code>null</code>).
    1136         */
    1137        public ItemLabelPosition getNegativeItemLabelPosition(int row, int column);
    1138
    1139        /**
    1140         * Returns the item label position for all negative values in a series.
    1141         *
    1142         * @param series  the series index (zero-based).
    1143         *
    1144         * @return The item label position (never <code>null</code>).
    1145         */
    1146        public ItemLabelPosition getSeriesNegativeItemLabelPosition(int series);
    1147
    1148        /**
    1149         * Sets the item label position for negative values in a series and sends a
    1150         * {@link RendererChangeEvent} to all registered listeners.
    1151         *
    1152         * @param series  the series index (zero-based).
    1153         * @param position  the position (<code>null</code> permitted).
    1154         */
    1155        public void setSeriesNegativeItemLabelPosition(int series,
    1156                                                       ItemLabelPosition position);
    1157
    1158        /**
    1159         * Sets the item label position for negative values in a series and (if
    1160         * requested) sends a {@link RendererChangeEvent} to all registered
    1161         * listeners.
    1162         *
    1163         * @param series  the series index (zero-based).
    1164         * @param position  the position (<code>null</code> permitted).
    1165         * @param notify  notify registered listeners?
    1166         */
    1167        public void setSeriesNegativeItemLabelPosition(int series,
    1168                                                       ItemLabelPosition position,
    1169                                                       boolean notify);
    1170
    1171        /**
    1172         * Returns the base item label position for negative values.
    1173         *
    1174         * @return The position (never <code>null</code>).
    1175         */
    1176        public ItemLabelPosition getBaseNegativeItemLabelPosition();
    1177
    1178        /**
    1179         * Sets the base item label position for negative values and sends a
    1180         * {@link RendererChangeEvent} to all registered listeners.
    1181         *
    1182         * @param position  the position (<code>null</code> not permitted).
    1183         */
    1184        public void setBaseNegativeItemLabelPosition(ItemLabelPosition position);
    1185
    1186        /**
    1187         * Sets the base negative item label position and, if requested, sends a
    1188         * {@link RendererChangeEvent} to all registered listeners.
    1189         *
    1190         * @param position  the position (<code>null</code> not permitted).
    1191         * @param notify  notify registered listeners?
    1192         */
    1193        public void setBaseNegativeItemLabelPosition(ItemLabelPosition position,
    1194                                                     boolean notify);
    1195
    1196
    1197        // CREATE ENTITIES
    1198        // FIXME:  these methods should be defined
    1199
    1200    //    public boolean getItemCreateEntity(int series, int item);
    1201    //
    1202    //    public Boolean getSeriesCreateEntities(int series);
    1203    //
    1204    //    public void setSeriesCreateEntities(int series, Boolean create);
    1205    //
    1206    //    public void setSeriesCreateEntities(int series, Boolean create,
    1207    //            boolean notify);
    1208    //
    1209    //    public boolean getBaseCreateEntities();
    1210    //
    1211    //    public void setBaseCreateEntities(boolean create);
    1212    //
    1213    //    public void setBaseCreateEntities(boolean create, boolean notify);
    1214
    1215        //// ANNOTATIONS //////////////////////////////////////////////////////////
    1216
    1217        /**
    1218         * Adds an annotation and sends a {@link RendererChangeEvent} to all
    1219         * registered listeners.  The annotation is added to the foreground
    1220         * layer.
    1221         *
    1222         * @param annotation  the annotation (<code>null</code> not permitted).
    1223         */
    1224        public void addAnnotation(XYAnnotation annotation);
    1225
    1226        /**
    1227         * Adds an annotation to the specified layer.
    1228         *
    1229         * @param annotation  the annotation (<code>null</code> not permitted).
    1230         * @param layer  the layer (<code>null</code> not permitted).
    1231         */
    1232        public void addAnnotation(XYAnnotation annotation, Layer layer);
    1233
    1234        /**
    1235         * Removes the specified annotation and sends a {@link RendererChangeEvent}
    1236         * to all registered listeners.
    1237         *
    1238         * @param annotation  the annotation to remove (<code>null</code> not
    1239         *                    permitted).
    1240         *
    1241         * @return A boolean to indicate whether or not the annotation was
    1242         *         successfully removed.
    1243         */
    1244        public boolean removeAnnotation(XYAnnotation annotation);
    1245
    1246        /**
    1247         * Removes all annotations and sends a {@link RendererChangeEvent}
    1248         * to all registered listeners.
    1249         */
    1250        public void removeAnnotations();
    1251
    1252        /**
    1253         * Draws all the annotations for the specified layer.
    1254         *
    1255         * @param g2  the graphics device.
    1256         * @param dataArea  the data area.
    1257         * @param domainAxis  the domain axis.
    1258         * @param rangeAxis  the range axis.
    1259         * @param layer  the layer.
    1260         * @param info  the plot rendering info.
    1261         */
    1262        public void drawAnnotations(Graphics2D g2,
    1263                                    Rectangle2D dataArea,
    1264                                    ValueAxis domainAxis,
    1265                                    ValueAxis rangeAxis,
    1266                                    Layer layer,
    1267                                    PlotRenderingInfo info);
    1268
    1269        //// DRAWING //////////////////////////////////////////////////////////////
    1270
    1271        /**
    1272         * Initialises the renderer then returns the number of 'passes' through the
    1273         * data that the renderer will require (usually just one).  This method
    1274         * will be called before the first item is rendered, giving the renderer
    1275         * an opportunity to initialise any state information it wants to maintain.
    1276         * The renderer can do nothing if it chooses.
    1277         *
    1278         * @param g2  the graphics device.
    1279         * @param dataArea  the area inside the axes.
    1280         * @param plot  the plot.
    1281         * @param dataset  the dataset.
    1282         * @param info  an optional info collection object to return data back to
    1283         *              the caller.
    1284         *
    1285         * @return The number of passes the renderer requires.
    1286         */
    1287        public XYItemRendererState initialise(Graphics2D g2,
    1288                                              Rectangle2D dataArea,
    1289                                              XYPlot plot,
    1290                                              XYDataset dataset,
    1291                                              PlotRenderingInfo info);
    1292
    1293        /**
    1294         * Called for each item to be plotted.
    1295         * <p>
    1296         * The {@link XYPlot} can make multiple passes through the dataset,
    1297         * depending on the value returned by the renderer's initialise() method.
    1298         *
    1299         * @param g2  the graphics device.
    1300         * @param state  the renderer state.
    1301         * @param dataArea  the area within which the data is being rendered.
    1302         * @param info  collects drawing info.
    1303         * @param plot  the plot (can be used to obtain standard color
    1304         *              information etc).
    1305         * @param domainAxis  the domain axis.
    1306         * @param rangeAxis  the range axis.
    1307         * @param dataset  the dataset.
    1308         * @param series  the series index (zero-based).
    1309         * @param item  the item index (zero-based).
    1310         * @param crosshairState  crosshair information for the plot
    1311         *                        (<code>null</code> permitted).
    1312         * @param pass  the pass index.
    1313         */
    1314        public void drawItem(Graphics2D g2,
    1315                             XYItemRendererState state,
    1316                             Rectangle2D dataArea,
    1317                             PlotRenderingInfo info,
    1318                             XYPlot plot,
    1319                             ValueAxis domainAxis,
    1320                             ValueAxis rangeAxis,
    1321                             XYDataset dataset,
    1322                             int series,
    1323                             int item,
    1324                             CrosshairState crosshairState,
    1325                             int pass);
    1326
    1327        /**
    1328         * Fills a band between two values on the axis.  This can be used to color
    1329         * bands between the grid lines.
    1330         *
    1331         * @param g2  the graphics device.
    1332         * @param plot  the plot.
    1333         * @param axis  the domain axis.
    1334         * @param dataArea  the data area.
    1335         * @param start  the start value.
    1336         * @param end  the end value.
    1337         */
    1338        public void fillDomainGridBand(Graphics2D g2,
    1339                                       XYPlot plot,
    1340                                       ValueAxis axis,
    1341                                       Rectangle2D dataArea,
    1342                                       double start, double end);
    1343
    1344        /**
    1345         * Fills a band between two values on the range axis.  This can be used to
    1346         * color bands between the grid lines.
    1347         *
    1348         * @param g2  the graphics device.
    1349         * @param plot  the plot.
    1350         * @param axis  the range axis.
    1351         * @param dataArea  the data area.
    1352         * @param start  the start value.
    1353         * @param end  the end value.
    1354         */
    1355        public void fillRangeGridBand(Graphics2D g2,
    1356                                      XYPlot plot,
    1357                                      ValueAxis axis,
    1358                                      Rectangle2D dataArea,
    1359                                      double start, double end);
    1360
    1361        /**
    1362         * Draws a grid line against the domain axis.
    1363         *
    1364         * @param g2  the graphics device.
    1365         * @param plot  the plot.
    1366         * @param axis  the value axis.
    1367         * @param dataArea  the area for plotting data (not yet adjusted for any
    1368         *                  3D effect).
    1369         * @param value  the value.
    1370         */
    1371        public void drawDomainGridLine(Graphics2D g2,
    1372                                       XYPlot plot,
    1373                                       ValueAxis axis,
    1374                                       Rectangle2D dataArea,
    1375                                       double value);
    1376
    1377        /**
    1378         * Draws a line perpendicular to the range axis.
    1379         *
    1380         * @param g2  the graphics device.
    1381         * @param plot  the plot.
    1382         * @param axis  the value axis.
    1383         * @param dataArea  the area for plotting data.
    1384         * @param value  the data value.
    1385         * @param paint  the paint (<code>null</code> not permitted).
    1386         * @param stroke  the stroke (<code>null</code> not permitted).
    1387         */
    1388        public void drawRangeLine(Graphics2D g2, XYPlot plot, ValueAxis axis,
    1389                Rectangle2D dataArea, double value, Paint paint, Stroke stroke);
    1390
    1391        /**
    1392         * Draws the specified <code>marker</code> against the domain axis.
    1393         *
    1394         * @param g2  the graphics device.
    1395         * @param plot  the plot.
    1396         * @param axis  the value axis.
    1397         * @param marker  the marker.
    1398         * @param dataArea  the axis data area.
    1399         */
    1400        public void drawDomainMarker(Graphics2D g2, XYPlot plot, ValueAxis axis,
    1401                Marker marker, Rectangle2D dataArea);
    1402
    1403        /**
    1404         * Draws a horizontal line across the chart to represent a 'range marker'.
    1405         *
    1406         * @param g2  the graphics device.
    1407         * @param plot  the plot.
    1408         * @param axis  the value axis.
    1409         * @param marker  the marker line.
    1410         * @param dataArea  the axis data area.
    1411         */
    1412        public void drawRangeMarker(Graphics2D g2, XYPlot plot, ValueAxis axis,
    1413                Marker marker, Rectangle2D dataArea);
    1414
    1415        // DEPRECATED METHODS
    1416
    1417        /**
    1418         * Returns the flag that controls the visibility of ALL series.  This flag
    1419         * overrides the per series and default settings - you must set it to
    1420         * <code>null</code> if you want the other settings to apply.
    1421         *
    1422         * @return The flag (possibly <code>null</code>).
    1423         *
    1424         * @deprecated This method should no longer be used (as of version 1.0.6).
    1425         *     It is sufficient to rely on {@link #getSeriesVisible(int)} and
    1426         *     {@link #getBaseSeriesVisible()}.
    1427         */
    1428        public Boolean getSeriesVisible();
    1429
    1430        /**
    1431         * Sets the flag that controls the visibility of ALL series and sends a
    1432         * {@link RendererChangeEvent} to all registered listeners.  This flag
    1433         * overrides the per series and default settings - you must set it to
    1434         * <code>null</code> if you want the other settings to apply.
    1435         *
    1436         * @param visible  the flag (<code>null</code> permitted).
    1437         *
    1438         * @deprecated This method should no longer be used (as of version 1.0.6).
    1439         *     It is sufficient to rely on {@link #setSeriesVisible(int, Boolean)}
    1440         *     and {@link #setBaseSeriesVisible(boolean)}.
    1441         */
    1442        public void setSeriesVisible(Boolean visible);
    1443
    1444        /**
    1445         * Sets the flag that controls the visibility of ALL series and sends a
    1446         * {@link RendererChangeEvent} to all registered listeners.  This flag
    1447         * overrides the per series and default settings - you must set it to
    1448         * <code>null</code> if you want the other settings to apply.
    1449         *
    1450         * @param visible  the flag (<code>null</code> permitted).
    1451         * @param notify  notify listeners?
    1452         *
    1453         * @deprecated This method should no longer be used (as of version 1.0.6).
    1454         *     It is sufficient to rely on {@link #setSeriesVisible(int, Boolean,
    1455         *     boolean)} and {@link #setBaseSeriesVisible(boolean, boolean)}.
    1456         */
    1457        public void setSeriesVisible(Boolean visible, boolean notify);
    1458
    1459        /**
    1460         * Returns the flag that controls the visibility of ALL series in the
    1461         * legend.  This flag overrides the per series and default settings - you
    1462         * must set it to <code>null</code> if you want the other settings to
    1463         * apply.
    1464         *
    1465         * @return The flag (possibly <code>null</code>).
    1466         *
    1467         * @deprecated This method should no longer be used (as of version 1.0.6).
    1468         *     It is sufficient to rely on {@link #getSeriesVisibleInLegend(int)}
    1469         *     and {@link #getBaseSeriesVisibleInLegend()}.
    1470         */
    1471        public Boolean getSeriesVisibleInLegend();
    1472
    1473        /**
    1474         * Sets the flag that controls the visibility of ALL series in the legend
    1475         * and sends a {@link RendererChangeEvent} to all registered listeners.
    1476         * This flag overrides the per series and default settings - you must set
    1477         * it to <code>null</code> if you want the other settings to apply.
    1478         *
    1479         * @param visible  the flag (<code>null</code> permitted).
    1480         *
    1481         * @deprecated This method should no longer be used (as of version 1.0.6).
    1482         *     It is sufficient to rely on {@link #setSeriesVisibleInLegend(int,
    1483         *     Boolean)} and {@link #setBaseSeriesVisibleInLegend(boolean)}.
    1484         */
    1485        public void setSeriesVisibleInLegend(Boolean visible);
    1486
    1487        /**
    1488         * Sets the flag that controls the visibility of ALL series in the legend
    1489         * and sends a {@link RendererChangeEvent} to all registered listeners.
    1490         * This flag overrides the per series and default settings - you must set
    1491         * it to <code>null</code> if you want the other settings to apply.
    1492         *
    1493         * @param visible  the flag (<code>null</code> permitted).
    1494         * @param notify  notify listeners?
    1495         *
    1496         * @deprecated This method should no longer be used (as of version 1.0.6).
    1497         *     It is sufficient to rely on {@link #setSeriesVisibleInLegend(int,
    1498         *     Boolean, boolean)} and {@link #setBaseSeriesVisibleInLegend(boolean,
    1499         *     boolean)}.
    1500         */
    1501        public void setSeriesVisibleInLegend(Boolean visible, boolean notify);
    1502
    1503        /**
    1504         * Sets the paint to be used for ALL series, and sends a
    1505         * {@link RendererChangeEvent} to all registered listeners.  If this is
    1506         * <code>null</code>, the renderer will use the paint for the series.
    1507         *
    1508         * @param paint  the paint (<code>null</code> permitted).
    1509         *
    1510         * @deprecated This method should no longer be used (as of version 1.0.6).
    1511         *     It is sufficient to rely on {@link #setSeriesPaint(int, Paint)} and
    1512         *     {@link #setBasePaint(Paint)}.
    1513         */
    1514        public void setPaint(Paint paint);
    1515
    1516        /**
    1517         * Sets the outline paint for ALL series (optional).
    1518         *
    1519         * @param paint  the paint (<code>null</code> permitted).
    1520         *
    1521         * @deprecated This method should no longer be used (as of version 1.0.6).
    1522         *     It is sufficient to rely on {@link #setSeriesOutlinePaint(int,
    1523         *     Paint)} and {@link #setBaseOutlinePaint(Paint)}.
    1524         */
    1525        public void setOutlinePaint(Paint paint);
    1526
    1527        /**
    1528         * Sets the stroke for ALL series and sends a {@link RendererChangeEvent}
    1529         * to all registered listeners.
    1530         *
    1531         * @param stroke  the stroke (<code>null</code> permitted).
    1532         *
    1533         * @deprecated This method should no longer be used (as of version 1.0.6).
    1534         *     It is sufficient to rely on {@link #setSeriesStroke(int, Stroke)}
    1535         *     and {@link #setBaseStroke(Stroke)}.
    1536         */
    1537        public void setStroke(Stroke stroke);
    1538
    1539        /**
    1540         * Sets the outline stroke for ALL series and sends a
    1541         * {@link RendererChangeEvent} to all registered listeners.
    1542         *
    1543         * @param stroke  the stroke (<code>null</code> permitted).
    1544         *
    1545         * @deprecated This method should no longer be used (as of version 1.0.6).
    1546         *     It is sufficient to rely on {@link #setSeriesOutlineStroke(int,
    1547         *     Stroke)} and {@link #setBaseOutlineStroke(Stroke)}.
    1548         */
    1549        public void setOutlineStroke(Stroke stroke);
    1550
    1551        /**
    1552         * Sets the shape for ALL series (optional) and sends a
    1553         * {@link RendererChangeEvent} to all registered listeners.
    1554         *
    1555         * @param shape  the shape (<code>null</code> permitted).
    1556         *
    1557         * @deprecated This method should no longer be used (as of version 1.0.6).
    1558         *     It is sufficient to rely on {@link #setSeriesShape(int, Shape)} and
    1559         *     {@link #setBaseShape(Shape)}.
    1560         */
    1561        public void setShape(Shape shape);
    1562
    1563        /**
    1564         * Sets a flag that controls whether or not the item labels for ALL series
    1565         * are visible.
    1566         *
    1567         * @param visible  the flag.
    1568         *
    1569         * @deprecated This method should no longer be used (as of version 1.0.6).
    1570         *     It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int,
    1571         *     Boolean)} and {@link #setBaseItemLabelsVisible(boolean)}.
    1572         */
    1573        public void setItemLabelsVisible(boolean visible);
    1574
    1575        /**
    1576         * Sets a flag that controls whether or not the item labels for ALL series
    1577         * are visible.
    1578         *
    1579         * @param visible  the flag (<code>null</code> permitted).
    1580         *
    1581         * @deprecated This method should no longer be used (as of version 1.0.6).
    1582         *     It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int,
    1583         *     Boolean)} and {@link #setBaseItemLabelsVisible(boolean)}.
    1584         */
    1585        public void setItemLabelsVisible(Boolean visible);
    1586
    1587        /**
    1588         * Sets the visibility of item labels for ALL series and, if requested,
    1589         * sends a {@link RendererChangeEvent} to all registered listeners.
    1590         *
    1591         * @param visible  a flag that controls whether or not the item labels are
    1592         *                 visible (<code>null</code> permitted).
    1593         * @param notify  a flag that controls whether or not listeners are
    1594         *                notified.
    1595         *
    1596         * @deprecated This method should no longer be used (as of version 1.0.6).
    1597         *     It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int,
    1598         *     Boolean, boolean)} and {@link #setBaseItemLabelsVisible(Boolean,
    1599         *     boolean)}.
    1600         */
    1601        public void setItemLabelsVisible(Boolean visible, boolean notify);
    1602
    1603        /**
    1604         * Sets the item label generator for ALL series and sends a
    1605         * {@link RendererChangeEvent} to all registered listeners.
    1606         *
    1607         * @param generator  the generator (<code>null</code> permitted).
    1608         *
    1609         * @deprecated As of version 1.0.6, this override setting should not be
    1610         *     used.  You can use the base setting instead
    1611         *     ({@link #setBaseItemLabelGenerator(XYItemLabelGenerator)}).
    1612         */
    1613        public void setItemLabelGenerator(XYItemLabelGenerator generator);
    1614
    1615        /**
    1616         * Sets the tool tip generator for ALL series and sends a
    1617         * {@link RendererChangeEvent} to all registered listeners.
    1618         *
    1619         * @param generator  the generator (<code>null</code> permitted).
    1620         *
    1621         * @deprecated As of version 1.0.6, this override setting should not be
    1622         *     used.  You can use the base setting instead
    1623         *     ({@link #setBaseToolTipGenerator(XYToolTipGenerator)}).
    1624         */
    1625        public void setToolTipGenerator(XYToolTipGenerator generator);
    1626
    1627        /**
    1628         * Returns the font used for all item labels.  This may be
    1629         * <code>null</code>, in which case the per series font settings will apply.
    1630         *
    1631         * @return The font (possibly <code>null</code>).
    1632         *
    1633         * @deprecated This method should no longer be used (as of version 1.0.6).
    1634         *     It is sufficient to rely on {@link #getSeriesItemLabelFont(int)} and
    1635         *     {@link #getBaseItemLabelFont()}.
    1636         */
    1637        public Font getItemLabelFont();
    1638
    1639        /**
    1640         * Sets the item label font for ALL series and sends a
    1641         * {@link RendererChangeEvent} to all registered listeners.  You can set
    1642         * this to <code>null</code> if you prefer to set the font on a per series
    1643         * basis.
    1644         *
    1645         * @param font  the font (<code>null</code> permitted).
    1646         *
    1647         * @deprecated This method should no longer be used (as of version 1.0.6).
    1648         *     It is sufficient to rely on {@link #setSeriesItemLabelFont(int,
    1649         *     Font)} and {@link #setBaseItemLabelFont(Font)}.
    1650         */
    1651        public void setItemLabelFont(Font font);
    1652
    1653        /**
    1654         * Returns the paint used for all item labels.  This may be
    1655         * <code>null</code>, in which case the per series paint settings will
    1656         * apply.
    1657         *
    1658         * @return The paint (possibly <code>null</code>).
    1659         *
    1660         * @deprecated This method should no longer be used (as of version 1.0.6).
    1661         *     It is sufficient to rely on {@link #getSeriesItemLabelPaint(int)}
    1662         *     and {@link #getBaseItemLabelPaint()}.
    1663         */
    1664        public Paint getItemLabelPaint();
    1665
    1666        /**
    1667         * Sets the item label paint for ALL series and sends a
    1668         * {@link RendererChangeEvent} to all registered listeners.
    1669         *
    1670         * @param paint  the paint (<code>null</code> permitted).
    1671         *
    1672         * @deprecated This method should no longer be used (as of version 1.0.6).
    1673         *     It is sufficient to rely on {@link #setSeriesItemLabelPaint(int,
    1674         *     Paint)} and {@link #setBaseItemLabelPaint(Paint)}.
    1675         */
    1676        public void setItemLabelPaint(Paint paint);
    1677
    1678        /**
    1679         * Returns the item label position for positive values in ALL series.
    1680         *
    1681         * @return The item label position (possibly <code>null</code>).
    1682         *
    1683         * @deprecated This method should no longer be used (as of version 1.0.6).
    1684         *     It is sufficient to rely on
    1685         *     {@link #getSeriesPositiveItemLabelPosition(int)}
    1686         *     and {@link #getBasePositiveItemLabelPosition()}.
    1687         */
    1688        public ItemLabelPosition getPositiveItemLabelPosition();
    1689
    1690        /**
    1691         * Sets the item label position for positive values in ALL series, and
    1692         * sends a {@link RendererChangeEvent} to all registered listeners.  You
    1693         * need to set this to <code>null</code> to expose the settings for
    1694         * individual series.
    1695         *
    1696         * @param position  the position (<code>null</code> permitted).
    1697         *
    1698         * @deprecated This method should no longer be used (as of version 1.0.6).
    1699         *     It is sufficient to rely on
    1700         *     {@link #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition)}
    1701         *     and {@link #setBasePositiveItemLabelPosition(ItemLabelPosition)}.
    1702         */
    1703        public void setPositiveItemLabelPosition(ItemLabelPosition position);
    1704
    1705        /**
    1706         * Sets the positive item label position for ALL series and (if requested)
    1707         * sends a {@link RendererChangeEvent} to all registered listeners.
    1708         *
    1709         * @param position  the position (<code>null</code> permitted).
    1710         * @param notify  notify registered listeners?
    1711         *
    1712         * @deprecated This method should no longer be used (as of version 1.0.6).
    1713         *     It is sufficient to rely on
    1714         *     {@link #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition,
    1715         *     boolean)} and {@link #setBasePositiveItemLabelPosition(
    1716         *     ItemLabelPosition, boolean)}.
    1717         */
    1718        public void setPositiveItemLabelPosition(ItemLabelPosition position,
    1719                                                 boolean notify);
    1720
    1721        /**
    1722         * Returns the item label position for negative values in ALL series.
    1723         *
    1724         * @return The item label position (possibly <code>null</code>).
    1725         *
    1726         * @deprecated This method should no longer be used (as of version 1.0.6).
    1727         *     It is sufficient to rely on
    1728         *     {@link #getSeriesNegativeItemLabelPosition(int)}
    1729         *     and {@link #getBaseNegativeItemLabelPosition()}.
    1730         */
    1731        public ItemLabelPosition getNegativeItemLabelPosition();
    1732
    1733        /**
    1734         * Sets the item label position for negative values in ALL series, and
    1735         * sends a {@link RendererChangeEvent} to all registered listeners.  You
    1736         * need to set this to <code>null</code> to expose the settings for
    1737         * individual series.
    1738         *
    1739         * @param position  the position (<code>null</code> permitted).
    1740         *
    1741         * @deprecated This method should no longer be used (as of version 1.0.6).
    1742         *     It is sufficient to rely on
    1743         *     {@link #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition)}
    1744         *     and {@link #setBaseNegativeItemLabelPosition(ItemLabelPosition)}.
    1745         */
    1746        public void setNegativeItemLabelPosition(ItemLabelPosition position);
    1747
    1748        /**
    1749         * Sets the item label position for negative values in ALL series and (if
    1750         * requested) sends a {@link RendererChangeEvent} to all registered
    1751         * listeners.
    1752         *
    1753         * @param position  the position (<code>null</code> permitted).
    1754         * @param notify  notify registered listeners?
    1755         *
    1756         * @deprecated This method should no longer be used (as of version 1.0.6).
    1757         *     It is sufficient to rely on
    1758         *     {@link #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition,
    1759         *     boolean)} and {@link #setBaseNegativeItemLabelPosition(
    1760         *     ItemLabelPosition, boolean)}.
    1761         */
    1762        public void setNegativeItemLabelPosition(ItemLabelPosition position,
    1763                                                 boolean notify);
    1764
    1765    }