0001: /* ===========================================================
0002: * JFreeChart : a free chart library for the Java(tm) platform
0003: * ===========================================================
0004: *
0005: * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
0006: *
0007: * Project Info: http://www.jfree.org/jfreechart/index.html
0008: *
0009: * This library is free software; you can redistribute it and/or modify it
0010: * under the terms of the GNU Lesser General Public License as published by
0011: * the Free Software Foundation; either version 2.1 of the License, or
0012: * (at your option) any later version.
0013: *
0014: * This library is distributed in the hope that it will be useful, but
0015: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
0016: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
0017: * License for more details.
0018: *
0019: * You should have received a copy of the GNU Lesser General Public
0020: * License along with this library; if not, write to the Free Software
0021: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
0022: * USA.
0023: *
0024: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
0025: * in the United States and other countries.]
0026: *
0027: * -------------------------
0028: * CategoryItemRenderer.java
0029: * -------------------------
0030: *
0031: * (C) Copyright 2001-2007, by Object Refinery Limited and Contributors.
0032: *
0033: * Original Author: David Gilbert (for Object Refinery Limited);
0034: * Contributor(s): Mark Watson (www.markwatson.com);
0035: *
0036: * $Id: CategoryItemRenderer.java,v 1.10.2.9 2007/06/14 13:13:43 mungady Exp $
0037: *
0038: * Changes
0039: * -------
0040: * 23-Oct-2001 : Version 1 (DG);
0041: * 16-Jan-2002 : Renamed HorizontalCategoryItemRenderer.java
0042: * --> CategoryItemRenderer.java (DG);
0043: * 05-Feb-2002 : Changed return type of the drawCategoryItem method from void
0044: * to Shape, as part of the tooltips implementation (DG)
0045: *
0046: * NOTE (30-May-2002) : this has subsequently been changed back
0047: * to void, tooltips are now collected along with entities in
0048: * ChartRenderingInfo (DG);
0049: *
0050: * 14-Mar-2002 : Added the initialise method, and changed all bar plots to use
0051: * this renderer (DG);
0052: * 23-May-2002 : Added ChartRenderingInfo to the initialise method (DG);
0053: * 29-May-2002 : Added the getAxisArea(Rectangle2D) method (DG);
0054: * 06-Jun-2002 : Updated Javadoc comments (DG);
0055: * 26-Jun-2002 : Added range axis to the initialise method (DG);
0056: * 24-Sep-2002 : Added getLegendItem() method (DG);
0057: * 23-Oct-2002 : Added methods to get/setToolTipGenerator (DG);
0058: * 05-Nov-2002 : Replaced references to CategoryDataset with TableDataset (DG);
0059: * 06-Nov-2002 : Added the domain axis to the drawCategoryItem method. Renamed
0060: * drawCategoryItem() --> drawItem() (DG);
0061: * 20-Nov-2002 : Changed signature of drawItem() method to reflect use of
0062: * TableDataset (DG);
0063: * 26-Nov-2002 : Replaced the isStacked() method with the getRangeType()
0064: * method (DG);
0065: * 08-Jan-2003 : Changed getSeriesCount() --> getRowCount() and
0066: * getCategoryCount() --> getColumnCount() (DG);
0067: * 09-Jan-2003 : Changed name of grid-line methods (DG);
0068: * 21-Jan-2003 : Merged TableDataset with CategoryDataset (DG);
0069: * 10-Apr-2003 : Changed CategoryDataset to KeyedValues2DDataset in
0070: * drawItem() method (DG);
0071: * 29-Apr-2003 : Eliminated Renderer interface (DG);
0072: * 02-Sep-2003 : Fix for bug 790407 (DG);
0073: * 16-Sep-2003 : Changed ChartRenderingInfo --> PlotRenderingInfo (DG);
0074: * 20-Oct-2003 : Added setOutlinePaint() method (DG);
0075: * 06-Feb-2004 : Added missing methods, and moved deprecated methods (DG);
0076: * 19-Feb-2004 : Added extra setXXXLabelsVisible() methods (DG);
0077: * 29-Apr-2004 : Changed Integer --> int in initialise() method (DG);
0078: * 18-May-2004 : Added methods for item label paint (DG);
0079: * 05-Nov-2004 : Added getPassCount() method and 'pass' parameter to drawItem()
0080: * method (DG);
0081: * 07-Jan-2005 : Renamed getRangeExtent() --> findRangeBounds (DG);
0082: * 11-Jan-2005 : Removed deprecated code in preparation for 1.0.0 release (DG);
0083: * 23-Feb-2005 : Now extends LegendItemSource (DG);
0084: * 20-Apr-2005 : Renamed CategoryLabelGenerator
0085: * --> CategoryItemLabelGenerator (DG);
0086: * 20-May-2005 : Added drawDomainMarker() method (DG);
0087: * ------------- JFREECHART 1.0.x ---------------------------------------------
0088: * 20-Feb-2007 : Updated API docs (DG);
0089: * 19-Apr-2007 : Deprecated seriesVisible and seriesVisibleInLegend flags (DG);
0090: * 20-Apr-2007 : Deprecated paint, fillPaint, outlinePaint, stroke,
0091: * outlineStroke, shape, itemLabelsVisible, itemLabelFont,
0092: * itemLabelPaint, positiveItemLabelPosition,
0093: * negativeItemLabelPosition and createEntities override
0094: * fields (DG);
0095: *
0096: */
0097:
0098: package org.jfree.chart.renderer.category;
0099:
0100: import java.awt.Font;
0101: import java.awt.Graphics2D;
0102: import java.awt.Paint;
0103: import java.awt.Shape;
0104: import java.awt.Stroke;
0105: import java.awt.geom.Rectangle2D;
0106:
0107: import org.jfree.chart.LegendItem;
0108: import org.jfree.chart.LegendItemSource;
0109: import org.jfree.chart.axis.CategoryAxis;
0110: import org.jfree.chart.axis.ValueAxis;
0111: import org.jfree.chart.event.RendererChangeEvent;
0112: import org.jfree.chart.event.RendererChangeListener;
0113: import org.jfree.chart.labels.CategoryItemLabelGenerator;
0114: import org.jfree.chart.labels.CategoryToolTipGenerator;
0115: import org.jfree.chart.labels.ItemLabelPosition;
0116: import org.jfree.chart.plot.CategoryMarker;
0117: import org.jfree.chart.plot.CategoryPlot;
0118: import org.jfree.chart.plot.Marker;
0119: import org.jfree.chart.plot.PlotRenderingInfo;
0120: import org.jfree.chart.urls.CategoryURLGenerator;
0121: import org.jfree.data.Range;
0122: import org.jfree.data.category.CategoryDataset;
0123:
0124: /**
0125: * A plug-in object that is used by the {@link CategoryPlot} class to display
0126: * individual data items from a {@link CategoryDataset}.
0127: * <p>
0128: * This interface defines the methods that must be provided by all renderers.
0129: * If you are implementing a custom renderer, you should consider extending the
0130: * {@link AbstractCategoryItemRenderer} class.
0131: * <p>
0132: * Most renderer attributes are defined using a "three layer" approach. When
0133: * looking up an attribute (for example, the outline paint) the renderer first
0134: * checks to see if there is a setting (in layer 0) that applies to ALL items
0135: * that the renderer draws. If there is, that setting is used, but if it is
0136: * <code>null</code> the renderer looks up the next layer, which contains
0137: * "per series" settings for the attribute (many attributes are defined on a
0138: * per series basis, so this is the layer that is most commonly used). If the
0139: * layer 1 setting is <code>null</code>, the renderer will look up the final
0140: * layer, which provides a default or "base" setting. Some attributes allow
0141: * the base setting to be <code>null</code>, while other attributes enforce
0142: * non-<code>null</code> values.
0143: */
0144:
0145: public interface CategoryItemRenderer extends LegendItemSource {
0146:
0147: /**
0148: * Returns the number of passes through the dataset required by the
0149: * renderer. Usually this will be one, but some renderers may use
0150: * a second or third pass to overlay items on top of things that were
0151: * drawn in an earlier pass.
0152: *
0153: * @return The pass count.
0154: */
0155: public int getPassCount();
0156:
0157: /**
0158: * Returns the plot that the renderer has been assigned to (where
0159: * <code>null</code> indicates that the renderer is not currently assigned
0160: * to a plot).
0161: *
0162: * @return The plot (possibly <code>null</code>).
0163: *
0164: * @see #setPlot(CategoryPlot)
0165: */
0166: public CategoryPlot getPlot();
0167:
0168: /**
0169: * Sets the plot that the renderer has been assigned to. This method is
0170: * usually called by the {@link CategoryPlot}, in normal usage you
0171: * shouldn't need to call this method directly.
0172: *
0173: * @param plot the plot (<code>null</code> not permitted).
0174: *
0175: * @see #getPlot()
0176: */
0177: public void setPlot(CategoryPlot plot);
0178:
0179: /**
0180: * Adds a change listener.
0181: *
0182: * @param listener the listener.
0183: *
0184: * @see #removeChangeListener(RendererChangeListener)
0185: */
0186: public void addChangeListener(RendererChangeListener listener);
0187:
0188: /**
0189: * Removes a change listener.
0190: *
0191: * @param listener the listener.
0192: *
0193: * @see #addChangeListener(RendererChangeListener)
0194: */
0195: public void removeChangeListener(RendererChangeListener listener);
0196:
0197: /**
0198: * Returns the range of values the renderer requires to display all the
0199: * items from the specified dataset.
0200: *
0201: * @param dataset the dataset (<code>null</code> permitted).
0202: *
0203: * @return The range (or <code>null</code> if the dataset is
0204: * <code>null</code> or empty).
0205: */
0206: public Range findRangeBounds(CategoryDataset dataset);
0207:
0208: /**
0209: * Initialises the renderer. This method will be called before the first
0210: * item is rendered, giving the renderer an opportunity to initialise any
0211: * state information it wants to maintain. The renderer can do nothing if
0212: * it chooses.
0213: *
0214: * @param g2 the graphics device.
0215: * @param dataArea the area inside the axes.
0216: * @param plot the plot.
0217: * @param rendererIndex the renderer index.
0218: * @param info collects chart rendering information for return to caller.
0219: *
0220: * @return A state object (maintains state information relevant to one
0221: * chart drawing).
0222: */
0223: public CategoryItemRendererState initialise(Graphics2D g2,
0224: Rectangle2D dataArea, CategoryPlot plot, int rendererIndex,
0225: PlotRenderingInfo info);
0226:
0227: /**
0228: * Returns a boolean that indicates whether or not the specified item
0229: * should be drawn (this is typically used to hide an entire series).
0230: *
0231: * @param series the series index.
0232: * @param item the item index.
0233: *
0234: * @return A boolean.
0235: */
0236: public boolean getItemVisible(int series, int item);
0237:
0238: /**
0239: * Returns a boolean that indicates whether or not the specified series
0240: * should be drawn (this is typically used to hide an entire series).
0241: *
0242: * @param series the series index.
0243: *
0244: * @return A boolean.
0245: */
0246: public boolean isSeriesVisible(int series);
0247:
0248: /**
0249: * Returns the flag that controls the visibility of ALL series. This flag
0250: * overrides the per series and default settings - you must set it to
0251: * <code>null</code> if you want the other settings to apply.
0252: *
0253: * @return The flag (possibly <code>null</code>).
0254: *
0255: * @see #setSeriesVisible(Boolean)
0256: *
0257: * @deprecated This method should no longer be used (as of version 1.0.6).
0258: * It is sufficient to rely on {@link #getSeriesVisible(int)} and
0259: * {@link #getBaseSeriesVisible()}.
0260: */
0261: public Boolean getSeriesVisible();
0262:
0263: /**
0264: * Sets the flag that controls the visibility of ALL series and sends a
0265: * {@link RendererChangeEvent} to all registered listeners. This flag
0266: * overrides the per series and default settings - you must set it to
0267: * <code>null</code> if you want the other settings to apply.
0268: *
0269: * @param visible the flag (<code>null</code> permitted).
0270: *
0271: * @see #getSeriesVisible()
0272: *
0273: * @deprecated This method should no longer be used (as of version 1.0.6).
0274: * It is sufficient to rely on {@link #setSeriesVisible(int, Boolean)}
0275: * and {@link #setBaseSeriesVisible(boolean)}.
0276: */
0277: public void setSeriesVisible(Boolean visible);
0278:
0279: /**
0280: * Sets the flag that controls the visibility of ALL series and sends a
0281: * {@link RendererChangeEvent} to all registered listeners. This flag
0282: * overrides the per series and default settings - you must set it to
0283: * <code>null</code> if you want the other settings to apply.
0284: *
0285: * @param visible the flag (<code>null</code> permitted).
0286: * @param notify notify listeners?
0287: *
0288: * @see #getSeriesVisible()
0289: *
0290: * @deprecated This method should no longer be used (as of version 1.0.6).
0291: * It is sufficient to rely on {@link #setSeriesVisible(int, Boolean,
0292: * boolean)} and {@link #setBaseSeriesVisible(boolean, boolean)}.
0293: */
0294: public void setSeriesVisible(Boolean visible, boolean notify);
0295:
0296: /**
0297: * Returns the flag that controls whether a series is visible.
0298: *
0299: * @param series the series index (zero-based).
0300: *
0301: * @return The flag (possibly <code>null</code>).
0302: *
0303: * @see #setSeriesVisible(int, Boolean)
0304: */
0305: public Boolean getSeriesVisible(int series);
0306:
0307: /**
0308: * Sets the flag that controls whether a series is visible and sends a
0309: * {@link RendererChangeEvent} to all registered listeners.
0310: *
0311: * @param series the series index (zero-based).
0312: * @param visible the flag (<code>null</code> permitted).
0313: *
0314: * @see #getSeriesVisible(int)
0315: */
0316: public void setSeriesVisible(int series, Boolean visible);
0317:
0318: /**
0319: * Sets the flag that controls whether a series is visible and, if
0320: * requested, sends a {@link RendererChangeEvent} to all registered
0321: * listeners.
0322: *
0323: * @param series the series index.
0324: * @param visible the flag (<code>null</code> permitted).
0325: * @param notify notify listeners?
0326: *
0327: * @see #getSeriesVisible(int)
0328: */
0329: public void setSeriesVisible(int series, Boolean visible,
0330: boolean notify);
0331:
0332: /**
0333: * Returns the base visibility for all series.
0334: *
0335: * @return The base visibility.
0336: *
0337: * @see #setBaseSeriesVisible(boolean)
0338: */
0339: public boolean getBaseSeriesVisible();
0340:
0341: /**
0342: * Sets the base visibility and sends a {@link RendererChangeEvent} to all
0343: * registered listeners.
0344: *
0345: * @param visible the flag.
0346: *
0347: * @see #getBaseSeriesVisible()
0348: */
0349: public void setBaseSeriesVisible(boolean visible);
0350:
0351: /**
0352: * Sets the base visibility and, if requested, sends
0353: * a {@link RendererChangeEvent} to all registered listeners.
0354: *
0355: * @param visible the visibility.
0356: * @param notify notify listeners?
0357: *
0358: * @see #getBaseSeriesVisible()
0359: */
0360: public void setBaseSeriesVisible(boolean visible, boolean notify);
0361:
0362: // SERIES VISIBLE IN LEGEND (not yet respected by all renderers)
0363:
0364: /**
0365: * Returns <code>true</code> if the series should be shown in the legend,
0366: * and <code>false</code> otherwise.
0367: *
0368: * @param series the series index.
0369: *
0370: * @return A boolean.
0371: */
0372: public boolean isSeriesVisibleInLegend(int series);
0373:
0374: /**
0375: * Returns the flag that controls the visibility of ALL series in the
0376: * legend. This flag overrides the per series and default settings - you
0377: * must set it to <code>null</code> if you want the other settings to
0378: * apply.
0379: *
0380: * @return The flag (possibly <code>null</code>).
0381: *
0382: * @see #setSeriesVisibleInLegend(Boolean)
0383: *
0384: * @deprecated This method should no longer be used (as of version 1.0.6).
0385: * It is sufficient to rely on {@link #getSeriesVisibleInLegend(int)}
0386: * and {@link #getBaseSeriesVisibleInLegend()}.
0387: */
0388: public Boolean getSeriesVisibleInLegend();
0389:
0390: /**
0391: * Sets the flag that controls the visibility of ALL series in the legend
0392: * and sends a {@link RendererChangeEvent} to all registered listeners.
0393: * This flag overrides the per series and default settings - you must set
0394: * it to <code>null</code> if you want the other settings to apply.
0395: *
0396: * @param visible the flag (<code>null</code> permitted).
0397: *
0398: * @see #getSeriesVisibleInLegend()
0399: *
0400: * @deprecated This method should no longer be used (as of version 1.0.6).
0401: * It is sufficient to rely on {@link #setSeriesVisibleInLegend(int,
0402: * Boolean)} and {@link #setBaseSeriesVisibleInLegend(boolean)}.
0403: */
0404: public void setSeriesVisibleInLegend(Boolean visible);
0405:
0406: /**
0407: * Sets the flag that controls the visibility of ALL series in the legend
0408: * and sends a {@link RendererChangeEvent} to all registered listeners.
0409: * This flag overrides the per series and default settings - you must set
0410: * it to <code>null</code> if you want the other settings to apply.
0411: *
0412: * @param visible the flag (<code>null</code> permitted).
0413: * @param notify notify listeners?
0414: *
0415: * @see #getSeriesVisibleInLegend()
0416: *
0417: * @deprecated This method should no longer be used (as of version 1.0.6).
0418: * It is sufficient to rely on {@link #setSeriesVisibleInLegend(int,
0419: * Boolean, boolean)} and {@link #setBaseSeriesVisibleInLegend(boolean,
0420: * boolean)}.
0421: */
0422: public void setSeriesVisibleInLegend(Boolean visible, boolean notify);
0423:
0424: /**
0425: * Returns the flag that controls whether a series is visible in the
0426: * legend. This method returns only the "per series" settings - to
0427: * incorporate the override and base settings as well, you need to use the
0428: * {@link #isSeriesVisibleInLegend(int)} method.
0429: *
0430: * @param series the series index (zero-based).
0431: *
0432: * @return The flag (possibly <code>null</code>).
0433: *
0434: * @see #setSeriesVisibleInLegend(int, Boolean)
0435: */
0436: public Boolean getSeriesVisibleInLegend(int series);
0437:
0438: /**
0439: * Sets the flag that controls whether a series is visible in the legend
0440: * and sends a {@link RendererChangeEvent} to all registered listeners.
0441: *
0442: * @param series the series index (zero-based).
0443: * @param visible the flag (<code>null</code> permitted).
0444: *
0445: * @see #getSeriesVisibleInLegend(int)
0446: */
0447: public void setSeriesVisibleInLegend(int series, Boolean visible);
0448:
0449: /**
0450: * Sets the flag that controls whether a series is visible in the legend
0451: * and, if requested, sends a {@link RendererChangeEvent} to all registered
0452: * listeners.
0453: *
0454: * @param series the series index.
0455: * @param visible the flag (<code>null</code> permitted).
0456: * @param notify notify listeners?
0457: *
0458: * @see #getSeriesVisibleInLegend(int)
0459: */
0460: public void setSeriesVisibleInLegend(int series, Boolean visible,
0461: boolean notify);
0462:
0463: /**
0464: * Returns the base visibility in the legend for all series.
0465: *
0466: * @return The base visibility.
0467: *
0468: * @see #setBaseSeriesVisibleInLegend(boolean)
0469: */
0470: public boolean getBaseSeriesVisibleInLegend();
0471:
0472: /**
0473: * Sets the base visibility in the legend and sends a
0474: * {@link RendererChangeEvent} to all registered listeners.
0475: *
0476: * @param visible the flag.
0477: *
0478: * @see #getBaseSeriesVisibleInLegend()
0479: */
0480: public void setBaseSeriesVisibleInLegend(boolean visible);
0481:
0482: /**
0483: * Sets the base visibility in the legend and, if requested, sends
0484: * a {@link RendererChangeEvent} to all registered listeners.
0485: *
0486: * @param visible the visibility.
0487: * @param notify notify listeners?
0488: *
0489: * @see #getBaseSeriesVisibleInLegend()
0490: */
0491: public void setBaseSeriesVisibleInLegend(boolean visible,
0492: boolean notify);
0493:
0494: //// PAINT /////////////////////////////////////////////////////////////////
0495:
0496: /**
0497: * Returns the paint used to fill data items as they are drawn.
0498: *
0499: * @param row the row (or series) index (zero-based).
0500: * @param column the column (or category) index (zero-based).
0501: *
0502: * @return The paint (never <code>null</code>).
0503: */
0504: public Paint getItemPaint(int row, int column);
0505:
0506: /**
0507: * Sets the paint to be used for ALL series, and sends a
0508: * {@link RendererChangeEvent} to all registered listeners. If this is
0509: * <code>null</code>, the renderer will use the paint for the series.
0510: *
0511: * @param paint the paint (<code>null</code> permitted).
0512: *
0513: * @deprecated This method should no longer be used (as of version 1.0.6).
0514: * It is sufficient to rely on {@link #setSeriesPaint(int, Paint)} and
0515: * {@link #setBasePaint(Paint)}.
0516: */
0517: public void setPaint(Paint paint);
0518:
0519: /**
0520: * Returns the paint used to fill an item drawn by the renderer.
0521: *
0522: * @param series the series index (zero-based).
0523: *
0524: * @return The paint (possibly <code>null</code>).
0525: *
0526: * @see #setSeriesPaint(int, Paint)
0527: */
0528: public Paint getSeriesPaint(int series);
0529:
0530: /**
0531: * Sets the paint used for a series and sends a {@link RendererChangeEvent}
0532: * to all registered listeners.
0533: *
0534: * @param series the series index (zero-based).
0535: * @param paint the paint (<code>null</code> permitted).
0536: *
0537: * @see #getSeriesPaint(int)
0538: */
0539: public void setSeriesPaint(int series, Paint paint);
0540:
0541: // FIXME: add setSeriesPaint(int, Paint, boolean)?
0542:
0543: /**
0544: * Returns the base paint.
0545: *
0546: * @return The base paint (never <code>null</code>).
0547: *
0548: * @see #setBasePaint(Paint)
0549: */
0550: public Paint getBasePaint();
0551:
0552: /**
0553: * Sets the base paint and sends a {@link RendererChangeEvent} to all
0554: * registered listeners.
0555: *
0556: * @param paint the paint (<code>null</code> not permitted).
0557: *
0558: * @see #getBasePaint()
0559: */
0560: public void setBasePaint(Paint paint);
0561:
0562: // FIXME: add setBasePaint(int, Paint, boolean)?
0563:
0564: //// FILL PAINT /////////////////////////////////////////////////////////
0565:
0566: // /**
0567: // * Returns the paint used to fill data items as they are drawn.
0568: // *
0569: // * @param row the row (or series) index (zero-based).
0570: // * @param column the column (or category) index (zero-based).
0571: // *
0572: // * @return The paint (never <code>null</code>).
0573: // */
0574: // public Paint getItemFillPaint(int row, int column);
0575: //
0576: // /**
0577: // * Returns the paint used to fill an item drawn by the renderer.
0578: // *
0579: // * @param series the series (zero-based index).
0580: // *
0581: // * @return The paint (possibly <code>null</code>).
0582: // *
0583: // * @see #setSeriesFillPaint(int, Paint)
0584: // */
0585: // public Paint getSeriesFillPaint(int series);
0586: //
0587: // /**
0588: // * Sets the paint used for a series outline and sends a
0589: // * {@link RendererChangeEvent} to all registered listeners.
0590: // *
0591: // * @param series the series index (zero-based).
0592: // * @param paint the paint (<code>null</code> permitted).
0593: // *
0594: // * @see #getSeriesFillPaint(int)
0595: // */
0596: // public void setSeriesFillPaint(int series, Paint paint);
0597: //
0598: // /**
0599: // * Returns the base outline paint.
0600: // *
0601: // * @return The paint (never <code>null</code>).
0602: // *
0603: // * @see #setBaseFillPaint(Paint)
0604: // */
0605: // public Paint getBaseFillPaint();
0606: //
0607: // /**
0608: // * Sets the base outline paint and sends a {@link RendererChangeEvent} to
0609: // * all registered listeners.
0610: // *
0611: // * @param paint the paint (<code>null</code> not permitted).
0612: // *
0613: // * @see #getBaseFillPaint()
0614: // */
0615: // public void setBaseFillPaint(Paint paint);
0616:
0617: //// OUTLINE PAINT /////////////////////////////////////////////////////////
0618:
0619: /**
0620: * Returns the paint used to outline data items as they are drawn.
0621: *
0622: * @param row the row (or series) index (zero-based).
0623: * @param column the column (or category) index (zero-based).
0624: *
0625: * @return The paint (never <code>null</code>).
0626: */
0627: public Paint getItemOutlinePaint(int row, int column);
0628:
0629: /**
0630: * Sets the outline paint for ALL series (optional).
0631: *
0632: * @param paint the paint (<code>null</code> permitted).
0633: *
0634: * @deprecated This method should no longer be used (as of version 1.0.6).
0635: * It is sufficient to rely on {@link #setSeriesOutlinePaint(int,
0636: * Paint)} and {@link #setBaseOutlinePaint(Paint)}.
0637: */
0638: public void setOutlinePaint(Paint paint);
0639:
0640: /**
0641: * Returns the paint used to outline an item drawn by the renderer.
0642: *
0643: * @param series the series (zero-based index).
0644: *
0645: * @return The paint (possibly <code>null</code>).
0646: *
0647: * @see #setSeriesOutlinePaint(int, Paint)
0648: */
0649: public Paint getSeriesOutlinePaint(int series);
0650:
0651: /**
0652: * Sets the paint used for a series outline and sends a
0653: * {@link RendererChangeEvent} to all registered listeners.
0654: *
0655: * @param series the series index (zero-based).
0656: * @param paint the paint (<code>null</code> permitted).
0657: *
0658: * @see #getSeriesOutlinePaint(int)
0659: */
0660: public void setSeriesOutlinePaint(int series, Paint paint);
0661:
0662: // FIXME: add setSeriesOutlinePaint(int, Paint, boolean)?
0663:
0664: /**
0665: * Returns the base outline paint.
0666: *
0667: * @return The paint (never <code>null</code>).
0668: *
0669: * @see #setBaseOutlinePaint(Paint)
0670: */
0671: public Paint getBaseOutlinePaint();
0672:
0673: /**
0674: * Sets the base outline paint and sends a {@link RendererChangeEvent} to
0675: * all registered listeners.
0676: *
0677: * @param paint the paint (<code>null</code> not permitted).
0678: *
0679: * @see #getBaseOutlinePaint()
0680: */
0681: public void setBaseOutlinePaint(Paint paint);
0682:
0683: // FIXME: add setBaseOutlinePaint(Paint, boolean)?
0684:
0685: //// STROKE ////////////////////////////////////////////////////////////////
0686:
0687: /**
0688: * Returns the stroke used to draw data items.
0689: *
0690: * @param row the row (or series) index (zero-based).
0691: * @param column the column (or category) index (zero-based).
0692: *
0693: * @return The stroke (never <code>null</code>).
0694: */
0695: public Stroke getItemStroke(int row, int column);
0696:
0697: /**
0698: * Sets the stroke for ALL series and sends a {@link RendererChangeEvent}
0699: * to all registered listeners.
0700: *
0701: * @param stroke the stroke (<code>null</code> permitted).
0702: *
0703: * @deprecated This method should no longer be used (as of version 1.0.6).
0704: * It is sufficient to rely on {@link #setSeriesStroke(int, Stroke)}
0705: * and {@link #setBaseStroke(Stroke)}.
0706: */
0707: public void setStroke(Stroke stroke);
0708:
0709: /**
0710: * Returns the stroke used to draw the items in a series.
0711: *
0712: * @param series the series (zero-based index).
0713: *
0714: * @return The stroke (never <code>null</code>).
0715: *
0716: * @see #setSeriesStroke(int, Stroke)
0717: */
0718: public Stroke getSeriesStroke(int series);
0719:
0720: /**
0721: * Sets the stroke used for a series and sends a
0722: * {@link RendererChangeEvent} to all registered listeners.
0723: *
0724: * @param series the series index (zero-based).
0725: * @param stroke the stroke (<code>null</code> permitted).
0726: *
0727: * @see #getSeriesStroke(int)
0728: */
0729: public void setSeriesStroke(int series, Stroke stroke);
0730:
0731: // FIXME: add setSeriesStroke(int, Stroke, boolean) ?
0732:
0733: /**
0734: * Returns the base stroke.
0735: *
0736: * @return The base stroke (never <code>null</code>).
0737: *
0738: * @see #setBaseStroke(Stroke)
0739: */
0740: public Stroke getBaseStroke();
0741:
0742: /**
0743: * Sets the base stroke and sends a {@link RendererChangeEvent} to all
0744: * registered listeners.
0745: *
0746: * @param stroke the stroke (<code>null</code> not permitted).
0747: *
0748: * @see #getBaseStroke()
0749: */
0750: public void setBaseStroke(Stroke stroke);
0751:
0752: // FIXME: add setBaseStroke(Stroke, boolean) ?
0753:
0754: //// OUTLINE STROKE ////////////////////////////////////////////////////////
0755:
0756: /**
0757: * Returns the stroke used to outline data items.
0758: * <p>
0759: * The default implementation passes control to the
0760: * lookupSeriesOutlineStroke method. You can override this method if you
0761: * require different behaviour.
0762: *
0763: * @param row the row (or series) index (zero-based).
0764: * @param column the column (or category) index (zero-based).
0765: *
0766: * @return The stroke (never <code>null</code>).
0767: */
0768: public Stroke getItemOutlineStroke(int row, int column);
0769:
0770: /**
0771: * Sets the outline stroke for ALL series and sends a
0772: * {@link RendererChangeEvent} to all registered listeners.
0773: *
0774: * @param stroke the stroke (<code>null</code> permitted).
0775: *
0776: * @deprecated This method should no longer be used (as of version 1.0.6).
0777: * It is sufficient to rely on {@link #setSeriesOutlineStroke(int,
0778: * Stroke)} and {@link #setBaseOutlineStroke(Stroke)}.
0779: */
0780: public void setOutlineStroke(Stroke stroke);
0781:
0782: /**
0783: * Returns the stroke used to outline the items in a series.
0784: *
0785: * @param series the series (zero-based index).
0786: *
0787: * @return The stroke (possibly <code>null</code>).
0788: *
0789: * @see #setSeriesOutlineStroke(int, Stroke)
0790: */
0791: public Stroke getSeriesOutlineStroke(int series);
0792:
0793: /**
0794: * Sets the outline stroke used for a series and sends a
0795: * {@link RendererChangeEvent} to all registered listeners.
0796: *
0797: * @param series the series index (zero-based).
0798: * @param stroke the stroke (<code>null</code> permitted).
0799: *
0800: * @see #getSeriesOutlineStroke(int)
0801: */
0802: public void setSeriesOutlineStroke(int series, Stroke stroke);
0803:
0804: // FIXME: add setSeriesOutlineStroke(int, Stroke, boolean) ?
0805:
0806: /**
0807: * Returns the base outline stroke.
0808: *
0809: * @return The stroke (never <code>null</code>).
0810: *
0811: * @see #setBaseOutlineStroke(Stroke)
0812: */
0813: public Stroke getBaseOutlineStroke();
0814:
0815: /**
0816: * Sets the base outline stroke and sends a {@link RendererChangeEvent} to
0817: * all registered listeners.
0818: *
0819: * @param stroke the stroke (<code>null</code> not permitted).
0820: *
0821: * @see #getBaseOutlineStroke()
0822: */
0823: public void setBaseOutlineStroke(Stroke stroke);
0824:
0825: // FIXME: add setBaseOutlineStroke(Stroke, boolean) ?
0826:
0827: //// SHAPE /////////////////////////////////////////////////////////////////
0828:
0829: /**
0830: * Returns a shape used to represent a data item.
0831: *
0832: * @param row the row (or series) index (zero-based).
0833: * @param column the column (or category) index (zero-based).
0834: *
0835: * @return The shape (never <code>null</code>).
0836: */
0837: public Shape getItemShape(int row, int column);
0838:
0839: /**
0840: * Sets the shape for ALL series (optional) and sends a
0841: * {@link RendererChangeEvent} to all registered listeners.
0842: *
0843: * @param shape the shape (<code>null</code> permitted).
0844: *
0845: * @deprecated This method should no longer be used (as of version 1.0.6).
0846: * It is sufficient to rely on {@link #setSeriesShape(int, Shape)} and
0847: * {@link #setBaseShape(Shape)}.
0848: */
0849: public void setShape(Shape shape);
0850:
0851: /**
0852: * Returns a shape used to represent the items in a series.
0853: *
0854: * @param series the series (zero-based index).
0855: *
0856: * @return The shape (possibly <code>null</code>).
0857: *
0858: * @see #setSeriesShape(int, Shape)
0859: */
0860: public Shape getSeriesShape(int series);
0861:
0862: /**
0863: * Sets the shape used for a series and sends a {@link RendererChangeEvent}
0864: * to all registered listeners.
0865: *
0866: * @param series the series index (zero-based).
0867: * @param shape the shape (<code>null</code> permitted).
0868: *
0869: * @see #getSeriesShape(int)
0870: */
0871: public void setSeriesShape(int series, Shape shape);
0872:
0873: // FIXME: add setSeriesShape(int, Shape, boolean) ?
0874:
0875: /**
0876: * Returns the base shape.
0877: *
0878: * @return The shape (never <code>null</code>).
0879: *
0880: * @see #setBaseShape(Shape)
0881: */
0882: public Shape getBaseShape();
0883:
0884: /**
0885: * Sets the base shape and sends a {@link RendererChangeEvent} to all
0886: * registered listeners.
0887: *
0888: * @param shape the shape (<code>null</code> not permitted).
0889: *
0890: * @see #getBaseShape()
0891: */
0892: public void setBaseShape(Shape shape);
0893:
0894: // FIXME: add setBaseShape(Shape, boolean) ?
0895:
0896: // ITEM LABELS VISIBLE
0897:
0898: /**
0899: * Returns <code>true</code> if an item label is visible, and
0900: * <code>false</code> otherwise.
0901: *
0902: * @param row the row index (zero-based).
0903: * @param column the column index (zero-based).
0904: *
0905: * @return A boolean.
0906: */
0907: public boolean isItemLabelVisible(int row, int column);
0908:
0909: /**
0910: * Sets a flag that controls whether or not the item labels for ALL series
0911: * are visible.
0912: *
0913: * @param visible the flag.
0914: *
0915: * @see #setItemLabelsVisible(Boolean)
0916: *
0917: * @deprecated This method should no longer be used (as of version 1.0.6).
0918: * It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int,
0919: * Boolean)} and {@link #setBaseItemLabelsVisible(boolean)}.
0920: */
0921: public void setItemLabelsVisible(boolean visible);
0922:
0923: /**
0924: * Sets a flag that controls whether or not the item labels for ALL series
0925: * are visible.
0926: *
0927: * @param visible the flag (<code>null</code> permitted).
0928: *
0929: * @see #setItemLabelsVisible(boolean)
0930: *
0931: * @deprecated This method should no longer be used (as of version 1.0.6).
0932: * It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int,
0933: * Boolean)} and {@link #setBaseItemLabelsVisible(boolean)}.
0934: */
0935: public void setItemLabelsVisible(Boolean visible);
0936:
0937: /**
0938: * Sets the visibility of item labels for ALL series and, if requested,
0939: * sends a {@link RendererChangeEvent} to all registered listeners.
0940: *
0941: * @param visible a flag that controls whether or not the item labels are
0942: * visible (<code>null</code> permitted).
0943: * @param notify a flag that controls whether or not listeners are
0944: * notified.
0945: *
0946: * @deprecated This method should no longer be used (as of version 1.0.6).
0947: * It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int,
0948: * Boolean, boolean)} and {@link #setBaseItemLabelsVisible(Boolean,
0949: * boolean)}.
0950: */
0951: public void setItemLabelsVisible(Boolean visible, boolean notify);
0952:
0953: /**
0954: * Returns <code>true</code> if the item labels for a series are visible,
0955: * and <code>false</code> otherwise.
0956: *
0957: * @param series the series index (zero-based).
0958: *
0959: * @return A boolean.
0960: *
0961: * @see #setSeriesItemLabelsVisible(int, Boolean)
0962: */
0963: public boolean isSeriesItemLabelsVisible(int series);
0964:
0965: /**
0966: * Sets a flag that controls the visibility of the item labels for a series.
0967: *
0968: * @param series the series index (zero-based).
0969: * @param visible the flag.
0970: *
0971: * @see #isSeriesItemLabelsVisible(int)
0972: */
0973: public void setSeriesItemLabelsVisible(int series, boolean visible);
0974:
0975: /**
0976: * Sets a flag that controls the visibility of the item labels for a series.
0977: *
0978: * @param series the series index (zero-based).
0979: * @param visible the flag (<code>null</code> permitted).
0980: *
0981: * @see #isSeriesItemLabelsVisible(int)
0982: */
0983: public void setSeriesItemLabelsVisible(int series, Boolean visible);
0984:
0985: /**
0986: * Sets the visibility of item labels for a series and, if requested, sends
0987: * a {@link RendererChangeEvent} to all registered listeners.
0988: *
0989: * @param series the series index (zero-based).
0990: * @param visible the visible flag.
0991: * @param notify a flag that controls whether or not listeners are
0992: * notified.
0993: *
0994: * @see #isSeriesItemLabelsVisible(int)
0995: */
0996: public void setSeriesItemLabelsVisible(int series, Boolean visible,
0997: boolean notify);
0998:
0999: /**
1000: * Returns the base setting for item label visibility.
1001: *
1002: * @return A flag (possibly <code>null</code>).
1003: *
1004: * @see #setBaseItemLabelsVisible(Boolean)
1005: */
1006: public Boolean getBaseItemLabelsVisible();
1007:
1008: /**
1009: * Sets the base flag that controls whether or not item labels are visible.
1010: *
1011: * @param visible the flag.
1012: *
1013: * @see #getBaseItemLabelsVisible()
1014: */
1015: public void setBaseItemLabelsVisible(boolean visible);
1016:
1017: /**
1018: * Sets the base setting for item label visibility.
1019: *
1020: * @param visible the flag (<code>null</code> permitted).
1021: *
1022: * @see #getBaseItemLabelsVisible()
1023: */
1024: public void setBaseItemLabelsVisible(Boolean visible);
1025:
1026: /**
1027: * Sets the base visibility for item labels and, if requested, sends a
1028: * {@link RendererChangeEvent} to all registered listeners.
1029: *
1030: * @param visible the visibility flag.
1031: * @param notify a flag that controls whether or not listeners are
1032: * notified.
1033: *
1034: * @see #getBaseItemLabelsVisible()
1035: */
1036: public void setBaseItemLabelsVisible(Boolean visible, boolean notify);
1037:
1038: // ITEM LABEL GENERATOR
1039:
1040: /**
1041: * Returns the item label generator for the specified data item.
1042: *
1043: * @param series the series index (zero-based).
1044: * @param item the item index (zero-based).
1045: *
1046: * @return The generator (possibly <code>null</code>).
1047: */
1048: public CategoryItemLabelGenerator getItemLabelGenerator(int series,
1049: int item);
1050:
1051: /**
1052: * Sets the item label generator for ALL series and sends a
1053: * {@link RendererChangeEvent} to all registered listeners. This overrides
1054: * the per-series settings.
1055: *
1056: * @param generator the generator (<code>null</code> permitted).
1057: *
1058: * @deprecated This method should no longer be used (as of version 1.0.6).
1059: * It is sufficient to rely on {@link #setSeriesItemLabelGenerator(int,
1060: * CategoryItemLabelGenerator)} and
1061: * {@link #setBaseItemLabelGenerator(CategoryItemLabelGenerator)}.
1062: */
1063: public void setItemLabelGenerator(
1064: CategoryItemLabelGenerator generator);
1065:
1066: /**
1067: * Returns the item label generator for a series.
1068: *
1069: * @param series the series index (zero-based).
1070: *
1071: * @return The label generator (possibly <code>null</code>).
1072: *
1073: * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
1074: */
1075: public CategoryItemLabelGenerator getSeriesItemLabelGenerator(
1076: int series);
1077:
1078: /**
1079: * Sets the item label generator for a series and sends a
1080: * {@link RendererChangeEvent} to all registered listeners.
1081: *
1082: * @param series the series index (zero-based).
1083: * @param generator the generator.
1084: *
1085: * @see #getSeriesItemLabelGenerator(int)
1086: */
1087: public void setSeriesItemLabelGenerator(int series,
1088: CategoryItemLabelGenerator generator);
1089:
1090: // FIXME: add setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator,
1091: // boolean)
1092:
1093: /**
1094: * Returns the base item label generator.
1095: *
1096: * @return The generator (possibly <code>null</code>).
1097: *
1098: * @see #setBaseItemLabelGenerator(CategoryItemLabelGenerator)
1099: */
1100: public CategoryItemLabelGenerator getBaseItemLabelGenerator();
1101:
1102: /**
1103: * Sets the base item label generator and sends a
1104: * {@link RendererChangeEvent} to all registered listeners.
1105: *
1106: * @param generator the generator (<code>null</code> permitted).
1107: *
1108: * @see #getBaseItemLabelGenerator()
1109: */
1110: public void setBaseItemLabelGenerator(
1111: CategoryItemLabelGenerator generator);
1112:
1113: // FIXME: add setBaseItemLabelGenerator(CategoryItemLabelGenerator,
1114: // boolean) ?
1115:
1116: // TOOL TIP GENERATOR
1117:
1118: /**
1119: * Returns the tool tip generator that should be used for the specified
1120: * item. This method looks up the generator using the "three-layer"
1121: * approach outlined in the general description of this interface.
1122: *
1123: * @param row the row index (zero-based).
1124: * @param column the column index (zero-based).
1125: *
1126: * @return The generator (possibly <code>null</code>).
1127: */
1128: public CategoryToolTipGenerator getToolTipGenerator(int row,
1129: int column);
1130:
1131: /**
1132: * Returns the tool tip generator that will be used for ALL items in the
1133: * dataset (the "layer 0" generator).
1134: *
1135: * @return A tool tip generator (possibly <code>null</code>).
1136: *
1137: * @see #setToolTipGenerator(CategoryToolTipGenerator)
1138: *
1139: * @deprecated This method should no longer be used (as of version 1.0.6).
1140: * It is sufficient to rely on {@link #getSeriesToolTipGenerator(int)}
1141: * and {@link #getBaseToolTipGenerator()}.
1142: */
1143: public CategoryToolTipGenerator getToolTipGenerator();
1144:
1145: /**
1146: * Sets the tool tip generator for ALL series and sends a
1147: * {@link org.jfree.chart.event.RendererChangeEvent} to all registered
1148: * listeners.
1149: *
1150: * @param generator the generator (<code>null</code> permitted).
1151: *
1152: * @see #getToolTipGenerator()
1153: *
1154: * @deprecated This method should no longer be used (as of version 1.0.6).
1155: * It is sufficient to rely on {@link #setSeriesToolTipGenerator(int,
1156: * CategoryToolTipGenerator)} and
1157: * {@link #setBaseToolTipGenerator(CategoryToolTipGenerator)}.
1158: */
1159: public void setToolTipGenerator(CategoryToolTipGenerator generator);
1160:
1161: /**
1162: * Returns the tool tip generator for the specified series (a "layer 1"
1163: * generator).
1164: *
1165: * @param series the series index (zero-based).
1166: *
1167: * @return The tool tip generator (possibly <code>null</code>).
1168: *
1169: * @see #setSeriesToolTipGenerator(int, CategoryToolTipGenerator)
1170: */
1171: public CategoryToolTipGenerator getSeriesToolTipGenerator(int series);
1172:
1173: /**
1174: * Sets the tool tip generator for a series and sends a
1175: * {@link org.jfree.chart.event.RendererChangeEvent} to all registered
1176: * listeners.
1177: *
1178: * @param series the series index (zero-based).
1179: * @param generator the generator (<code>null</code> permitted).
1180: *
1181: * @see #getSeriesToolTipGenerator(int)
1182: */
1183: public void setSeriesToolTipGenerator(int series,
1184: CategoryToolTipGenerator generator);
1185:
1186: // FIXME: add setSeriesToolTipGenerator(int, CategoryToolTipGenerator,
1187: // boolean) ?
1188:
1189: /**
1190: * Returns the base tool tip generator (the "layer 2" generator).
1191: *
1192: * @return The tool tip generator (possibly <code>null</code>).
1193: *
1194: * @see #setBaseToolTipGenerator(CategoryToolTipGenerator)
1195: */
1196: public CategoryToolTipGenerator getBaseToolTipGenerator();
1197:
1198: /**
1199: * Sets the base tool tip generator and sends a
1200: * {@link org.jfree.chart.event.RendererChangeEvent} to all registered
1201: * listeners.
1202: *
1203: * @param generator the generator (<code>null</code> permitted).
1204: *
1205: * @see #getBaseToolTipGenerator()
1206: */
1207: public void setBaseToolTipGenerator(
1208: CategoryToolTipGenerator generator);
1209:
1210: // FIXME: add setBaseToolTipGenerator(CategoryToolTipGenerator, boolean) ?
1211:
1212: //// ITEM LABEL FONT //////////////////////////////////////////////////////
1213:
1214: /**
1215: * Returns the font for an item label.
1216: *
1217: * @param row the row index (zero-based).
1218: * @param column the column index (zero-based).
1219: *
1220: * @return The font (never <code>null</code>).
1221: */
1222: public Font getItemLabelFont(int row, int column);
1223:
1224: /**
1225: * Returns the font used for all item labels. This may be
1226: * <code>null</code>, in which case the per series font settings will apply.
1227: *
1228: * @return The font (possibly <code>null</code>).
1229: *
1230: * @see #setItemLabelFont(Font)
1231: *
1232: * @deprecated This method should no longer be used (as of version 1.0.6).
1233: * It is sufficient to rely on {@link #getSeriesItemLabelFont(int)} and
1234: * {@link #getBaseItemLabelFont()}.
1235: */
1236: public Font getItemLabelFont();
1237:
1238: /**
1239: * Sets the item label font for ALL series and sends a
1240: * {@link RendererChangeEvent} to all registered listeners. You can set
1241: * this to <code>null</code> if you prefer to set the font on a per series
1242: * basis.
1243: *
1244: * @param font the font (<code>null</code> permitted).
1245: *
1246: * @see #getItemLabelFont()
1247: *
1248: * @deprecated This method should no longer be used (as of version 1.0.6).
1249: * It is sufficient to rely on {@link #setSeriesItemLabelFont(int,
1250: * Font)} and {@link #setBaseItemLabelFont(Font)}.
1251: */
1252: public void setItemLabelFont(Font font);
1253:
1254: /**
1255: * Returns the font for all the item labels in a series.
1256: *
1257: * @param series the series index (zero-based).
1258: *
1259: * @return The font (possibly <code>null</code>).
1260: *
1261: * @see #setSeriesItemLabelFont(int, Font)
1262: */
1263: public Font getSeriesItemLabelFont(int series);
1264:
1265: /**
1266: * Sets the item label font for a series and sends a
1267: * {@link RendererChangeEvent} to all registered listeners.
1268: *
1269: * @param series the series index (zero-based).
1270: * @param font the font (<code>null</code> permitted).
1271: *
1272: * @see #getSeriesItemLabelFont(int)
1273: */
1274: public void setSeriesItemLabelFont(int series, Font font);
1275:
1276: // FIXME: add setSeriesItemLabelFont(int, Font, boolean) ?
1277:
1278: /**
1279: * Returns the base item label font (this is used when no other font
1280: * setting is available).
1281: *
1282: * @return The font (<code>never</code> null).
1283: *
1284: * @see #setBaseItemLabelFont(Font)
1285: */
1286: public Font getBaseItemLabelFont();
1287:
1288: /**
1289: * Sets the base item label font and sends a {@link RendererChangeEvent}
1290: * to all registered listeners.
1291: *
1292: * @param font the font (<code>null</code> not permitted).
1293: *
1294: * @see #getBaseItemLabelFont()
1295: */
1296: public void setBaseItemLabelFont(Font font);
1297:
1298: // FIXME: add setBaseItemLabelFont(Font, boolean) ?
1299:
1300: //// ITEM LABEL PAINT /////////////////////////////////////////////////////
1301:
1302: /**
1303: * Returns the paint used to draw an item label.
1304: *
1305: * @param row the row index (zero based).
1306: * @param column the column index (zero based).
1307: *
1308: * @return The paint (never <code>null</code>).
1309: */
1310: public Paint getItemLabelPaint(int row, int column);
1311:
1312: /**
1313: * Returns the paint used for all item labels. This may be
1314: * <code>null</code>, in which case the per series paint settings will
1315: * apply.
1316: *
1317: * @return The paint (possibly <code>null</code>).
1318: *
1319: * @see #setItemLabelPaint(Paint)
1320: *
1321: * @deprecated This method should no longer be used (as of version 1.0.6).
1322: * It is sufficient to rely on {@link #getSeriesItemLabelPaint(int)}
1323: * and {@link #getBaseItemLabelPaint()}.
1324: */
1325: public Paint getItemLabelPaint();
1326:
1327: /**
1328: * Sets the item label paint for ALL series and sends a
1329: * {@link RendererChangeEvent} to all registered listeners.
1330: *
1331: * @param paint the paint (<code>null</code> permitted).
1332: *
1333: * @see #getItemLabelPaint()
1334: *
1335: * @deprecated This method should no longer be used (as of version 1.0.6).
1336: * It is sufficient to rely on {@link #setSeriesItemLabelPaint(int,
1337: * Paint)} and {@link #setBaseItemLabelPaint(Paint)}.
1338: */
1339: public void setItemLabelPaint(Paint paint);
1340:
1341: /**
1342: * Returns the paint used to draw the item labels for a series.
1343: *
1344: * @param series the series index (zero based).
1345: *
1346: * @return The paint (possibly <code>null<code>).
1347: *
1348: * @see #setSeriesItemLabelPaint(int, Paint)
1349: */
1350: public Paint getSeriesItemLabelPaint(int series);
1351:
1352: /**
1353: * Sets the item label paint for a series and sends a
1354: * {@link RendererChangeEvent} to all registered listeners.
1355: *
1356: * @param series the series (zero based index).
1357: * @param paint the paint (<code>null</code> permitted).
1358: *
1359: * @see #getSeriesItemLabelPaint(int)
1360: */
1361: public void setSeriesItemLabelPaint(int series, Paint paint);
1362:
1363: // FIXME: add setSeriesItemLabelPaint(int, Paint, boolean) ?
1364:
1365: /**
1366: * Returns the base item label paint.
1367: *
1368: * @return The paint (never <code>null<code>).
1369: *
1370: * @see #setBaseItemLabelPaint(Paint)
1371: */
1372: public Paint getBaseItemLabelPaint();
1373:
1374: /**
1375: * Sets the base item label paint and sends a {@link RendererChangeEvent}
1376: * to all registered listeners.
1377: *
1378: * @param paint the paint (<code>null</code> not permitted).
1379: *
1380: * @see #getBaseItemLabelPaint()
1381: */
1382: public void setBaseItemLabelPaint(Paint paint);
1383:
1384: // FIXME: add setBaseItemLabelPaint(Paint, boolean) ?
1385:
1386: // POSITIVE ITEM LABEL POSITION...
1387:
1388: /**
1389: * Returns the item label position for positive values.
1390: *
1391: * @param row the row index (zero-based).
1392: * @param column the column index (zero-based).
1393: *
1394: * @return The item label position (never <code>null</code>).
1395: */
1396: public ItemLabelPosition getPositiveItemLabelPosition(int row,
1397: int column);
1398:
1399: /**
1400: * Returns the item label position for positive values in ALL series.
1401: *
1402: * @return The item label position (possibly <code>null</code>).
1403: *
1404: * @see #setPositiveItemLabelPosition(ItemLabelPosition)
1405: *
1406: * @deprecated This method should no longer be used (as of version 1.0.6).
1407: * It is sufficient to rely on
1408: * {@link #getSeriesPositiveItemLabelPosition(int)}
1409: * and {@link #getBasePositiveItemLabelPosition()}.
1410: */
1411: public ItemLabelPosition getPositiveItemLabelPosition();
1412:
1413: /**
1414: * Sets the item label position for positive values in ALL series, and
1415: * sends a {@link RendererChangeEvent} to all registered listeners. You
1416: * need to set this to <code>null</code> to expose the settings for
1417: * individual series.
1418: *
1419: * @param position the position (<code>null</code> permitted).
1420: *
1421: * @see #getPositiveItemLabelPosition()
1422: *
1423: * @deprecated This method should no longer be used (as of version 1.0.6).
1424: * It is sufficient to rely on
1425: * {@link #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition)}
1426: * and {@link #setBasePositiveItemLabelPosition(ItemLabelPosition)}.
1427: */
1428: public void setPositiveItemLabelPosition(ItemLabelPosition position);
1429:
1430: /**
1431: * Sets the positive item label position for ALL series and (if requested)
1432: * sends a {@link RendererChangeEvent} to all registered listeners.
1433: *
1434: * @param position the position (<code>null</code> permitted).
1435: * @param notify notify registered listeners?
1436: *
1437: * @see #getPositiveItemLabelPosition()
1438: *
1439: * @deprecated This method should no longer be used (as of version 1.0.6).
1440: * It is sufficient to rely on
1441: * {@link #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition,
1442: * boolean)} and {@link #setBasePositiveItemLabelPosition(
1443: * ItemLabelPosition, boolean)}.
1444: */
1445: public void setPositiveItemLabelPosition(
1446: ItemLabelPosition position, boolean notify);
1447:
1448: /**
1449: * Returns the item label position for all positive values in a series.
1450: *
1451: * @param series the series index (zero-based).
1452: *
1453: * @return The item label position.
1454: *
1455: * @see #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition)
1456: */
1457: public ItemLabelPosition getSeriesPositiveItemLabelPosition(
1458: int series);
1459:
1460: /**
1461: * Sets the item label position for all positive values in a series and
1462: * sends a {@link RendererChangeEvent} to all registered listeners.
1463: *
1464: * @param series the series index (zero-based).
1465: * @param position the position (<code>null</code> permitted).
1466: *
1467: * @see #getSeriesPositiveItemLabelPosition(int)
1468: */
1469: public void setSeriesPositiveItemLabelPosition(int series,
1470: ItemLabelPosition position);
1471:
1472: /**
1473: * Sets the item label position for all positive values in a series and (if
1474: * requested) sends a {@link RendererChangeEvent} to all registered
1475: * listeners.
1476: *
1477: * @param series the series index (zero-based).
1478: * @param position the position (<code>null</code> permitted).
1479: * @param notify notify registered listeners?
1480: *
1481: * @see #getSeriesPositiveItemLabelPosition(int)
1482: */
1483: public void setSeriesPositiveItemLabelPosition(int series,
1484: ItemLabelPosition position, boolean notify);
1485:
1486: /**
1487: * Returns the base positive item label position.
1488: *
1489: * @return The position.
1490: *
1491: * @see #setBasePositiveItemLabelPosition(ItemLabelPosition)
1492: */
1493: public ItemLabelPosition getBasePositiveItemLabelPosition();
1494:
1495: /**
1496: * Sets the base positive item label position.
1497: *
1498: * @param position the position.
1499: *
1500: * @see #getBasePositiveItemLabelPosition()
1501: */
1502: public void setBasePositiveItemLabelPosition(
1503: ItemLabelPosition position);
1504:
1505: /**
1506: * Sets the base positive item label position and, if requested, sends a
1507: * {@link RendererChangeEvent} to all registered listeners.
1508: *
1509: * @param position the position.
1510: * @param notify notify registered listeners?
1511: *
1512: * @see #getBasePositiveItemLabelPosition()
1513: */
1514: public void setBasePositiveItemLabelPosition(
1515: ItemLabelPosition position, boolean notify);
1516:
1517: // NEGATIVE ITEM LABEL POSITION...
1518:
1519: /**
1520: * Returns the item label position for negative values. This method can be
1521: * overridden to provide customisation of the item label position for
1522: * individual data items.
1523: *
1524: * @param row the row index (zero-based).
1525: * @param column the column (zero-based).
1526: *
1527: * @return The item label position.
1528: */
1529: public ItemLabelPosition getNegativeItemLabelPosition(int row,
1530: int column);
1531:
1532: /**
1533: * Returns the item label position for negative values in ALL series.
1534: *
1535: * @return The item label position (possibly <code>null</code>).
1536: *
1537: * @see #setNegativeItemLabelPosition(ItemLabelPosition)
1538: *
1539: * @deprecated This method should no longer be used (as of version 1.0.6).
1540: * It is sufficient to rely on
1541: * {@link #getSeriesNegativeItemLabelPosition(int)}
1542: * and {@link #getBaseNegativeItemLabelPosition()}.
1543: */
1544: public ItemLabelPosition getNegativeItemLabelPosition();
1545:
1546: /**
1547: * Sets the item label position for negative values in ALL series, and
1548: * sends a {@link RendererChangeEvent} to all registered listeners. You
1549: * need to set this to <code>null</code> to expose the settings for
1550: * individual series.
1551: *
1552: * @param position the position (<code>null</code> permitted).
1553: *
1554: * @see #getNegativeItemLabelPosition()
1555: *
1556: * @deprecated This method should no longer be used (as of version 1.0.6).
1557: * It is sufficient to rely on
1558: * {@link #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition)}
1559: * and {@link #setBaseNegativeItemLabelPosition(ItemLabelPosition)}.
1560: */
1561: public void setNegativeItemLabelPosition(ItemLabelPosition position);
1562:
1563: /**
1564: * Sets the item label position for negative values in ALL series and (if
1565: * requested) sends a {@link RendererChangeEvent} to all registered
1566: * listeners.
1567: *
1568: * @param position the position (<code>null</code> permitted).
1569: * @param notify notify registered listeners?
1570: *
1571: * @see #getNegativeItemLabelPosition()
1572: *
1573: * @deprecated This method should no longer be used (as of version 1.0.6).
1574: * It is sufficient to rely on
1575: * {@link #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition,
1576: * boolean)} and {@link #setBaseNegativeItemLabelPosition(
1577: * ItemLabelPosition, boolean)}.
1578: */
1579: public void setNegativeItemLabelPosition(
1580: ItemLabelPosition position, boolean notify);
1581:
1582: /**
1583: * Returns the item label position for all negative values in a series.
1584: *
1585: * @param series the series index (zero-based).
1586: *
1587: * @return The item label position.
1588: *
1589: * @see #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition)
1590: */
1591: public ItemLabelPosition getSeriesNegativeItemLabelPosition(
1592: int series);
1593:
1594: /**
1595: * Sets the item label position for negative values in a series and sends a
1596: * {@link RendererChangeEvent} to all registered listeners.
1597: *
1598: * @param series the series index (zero-based).
1599: * @param position the position (<code>null</code> permitted).
1600: *
1601: * @see #getSeriesNegativeItemLabelPosition(int)
1602: */
1603: public void setSeriesNegativeItemLabelPosition(int series,
1604: ItemLabelPosition position);
1605:
1606: /**
1607: * Sets the item label position for negative values in a series and (if
1608: * requested) sends a {@link RendererChangeEvent} to all registered
1609: * listeners.
1610: *
1611: * @param series the series index (zero-based).
1612: * @param position the position (<code>null</code> permitted).
1613: * @param notify notify registered listeners?
1614: *
1615: * @see #getSeriesNegativeItemLabelPosition(int)
1616: */
1617: public void setSeriesNegativeItemLabelPosition(int series,
1618: ItemLabelPosition position, boolean notify);
1619:
1620: /**
1621: * Returns the base item label position for negative values.
1622: *
1623: * @return The position.
1624: *
1625: * @see #setBaseNegativeItemLabelPosition(ItemLabelPosition)
1626: */
1627: public ItemLabelPosition getBaseNegativeItemLabelPosition();
1628:
1629: /**
1630: * Sets the base item label position for negative values and sends a
1631: * {@link RendererChangeEvent} to all registered listeners.
1632: *
1633: * @param position the position.
1634: *
1635: * @see #getBaseNegativeItemLabelPosition()
1636: */
1637: public void setBaseNegativeItemLabelPosition(
1638: ItemLabelPosition position);
1639:
1640: /**
1641: * Sets the base negative item label position and, if requested, sends a
1642: * {@link RendererChangeEvent} to all registered listeners.
1643: *
1644: * @param position the position.
1645: * @param notify notify registered listeners?
1646: *
1647: * @see #getBaseNegativeItemLabelPosition()
1648: */
1649: public void setBaseNegativeItemLabelPosition(
1650: ItemLabelPosition position, boolean notify);
1651:
1652: // CREATE ENTITIES
1653: // FIXME: these methods should be defined
1654:
1655: // public boolean getItemCreateEntity(int series, int item);
1656: //
1657: // public Boolean getSeriesCreateEntities(int series);
1658: //
1659: // public void setSeriesCreateEntities(int series, Boolean create);
1660: //
1661: // public void setSeriesCreateEntities(int series, Boolean create,
1662: // boolean notify);
1663: //
1664: // public boolean getBaseCreateEntities();
1665: //
1666: // public void setBaseCreateEntities(boolean create);
1667: //
1668: // public void setBaseCreateEntities(boolean create, boolean notify);
1669:
1670: // ITEM URL GENERATOR
1671:
1672: /**
1673: * Returns the URL generator for an item.
1674: *
1675: * @param series the series index (zero-based).
1676: * @param item the item index (zero-based).
1677: *
1678: * @return The item URL generator.
1679: */
1680: public CategoryURLGenerator getItemURLGenerator(int series, int item);
1681:
1682: /**
1683: * Sets the item URL generator for ALL series.
1684: *
1685: * @param generator the generator.
1686: *
1687: * @see #getSeriesItemURLGenerator(int)
1688: *
1689: * @deprecated This method should no longer be used (as of version 1.0.6).
1690: * It is sufficient to rely on {@link #setSeriesItemURLGenerator(int,
1691: * CategoryURLGenerator)} and
1692: * {@link #setBaseItemURLGenerator(CategoryURLGenerator)}.
1693: */
1694: public void setItemURLGenerator(CategoryURLGenerator generator);
1695:
1696: /**
1697: * Returns the item URL generator for a series.
1698: *
1699: * @param series the series index (zero-based).
1700: *
1701: * @return The URL generator.
1702: *
1703: * @see #setSeriesItemURLGenerator(int, CategoryURLGenerator)
1704: */
1705: public CategoryURLGenerator getSeriesItemURLGenerator(int series);
1706:
1707: /**
1708: * Sets the item URL generator for a series.
1709: *
1710: * @param series the series index (zero-based).
1711: * @param generator the generator.
1712: *
1713: * @see #getSeriesItemURLGenerator(int)
1714: */
1715: public void setSeriesItemURLGenerator(int series,
1716: CategoryURLGenerator generator);
1717:
1718: // FIXME: add setSeriesItemURLGenerator(int, CategoryURLGenerator, boolean) ?
1719:
1720: /**
1721: * Returns the base item URL generator.
1722: *
1723: * @return The item URL generator (possibly <code>null</code>).
1724: *
1725: * @see #setBaseItemURLGenerator(CategoryURLGenerator)
1726: */
1727: public CategoryURLGenerator getBaseItemURLGenerator();
1728:
1729: /**
1730: * Sets the base item URL generator and sends a {@link RendererChangeEvent}
1731: * to all registered listeners.
1732: *
1733: * @param generator the item URL generator (<code>null</code> permitted).
1734: *
1735: * @see #getBaseItemURLGenerator()
1736: */
1737: public void setBaseItemURLGenerator(CategoryURLGenerator generator);
1738:
1739: // FIXME: add setBaseItemURLGenerator(CategoryURLGenerator, boolean) ?
1740:
1741: /**
1742: * Returns a legend item for a series. This method can return
1743: * <code>null</code>, in which case the series will have no entry in the
1744: * legend.
1745: *
1746: * @param datasetIndex the dataset index (zero-based).
1747: * @param series the series (zero-based index).
1748: *
1749: * @return The legend item (possibly <code>null</code>).
1750: */
1751: public LegendItem getLegendItem(int datasetIndex, int series);
1752:
1753: /**
1754: * Draws a background for the data area.
1755: *
1756: * @param g2 the graphics device.
1757: * @param plot the plot.
1758: * @param dataArea the data area.
1759: */
1760: public void drawBackground(Graphics2D g2, CategoryPlot plot,
1761: Rectangle2D dataArea);
1762:
1763: /**
1764: * Draws an outline for the data area.
1765: *
1766: * @param g2 the graphics device.
1767: * @param plot the plot.
1768: * @param dataArea the data area.
1769: */
1770: public void drawOutline(Graphics2D g2, CategoryPlot plot,
1771: Rectangle2D dataArea);
1772:
1773: /**
1774: * Draws a single data item.
1775: *
1776: * @param g2 the graphics device.
1777: * @param state state information for one chart.
1778: * @param dataArea the data plot area.
1779: * @param plot the plot.
1780: * @param domainAxis the domain axis.
1781: * @param rangeAxis the range axis.
1782: * @param dataset the data.
1783: * @param row the row index (zero-based).
1784: * @param column the column index (zero-based).
1785: * @param pass the pass index.
1786: */
1787: public void drawItem(Graphics2D g2,
1788: CategoryItemRendererState state, Rectangle2D dataArea,
1789: CategoryPlot plot, CategoryAxis domainAxis,
1790: ValueAxis rangeAxis, CategoryDataset dataset, int row,
1791: int column, int pass);
1792:
1793: /**
1794: * Draws a grid line against the domain axis.
1795: *
1796: * @param g2 the graphics device.
1797: * @param plot the plot.
1798: * @param dataArea the area for plotting data (not yet adjusted for any
1799: * 3D effect).
1800: * @param value the value.
1801: *
1802: * @see #drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis,
1803: * Rectangle2D, double)
1804: */
1805: public void drawDomainGridline(Graphics2D g2, CategoryPlot plot,
1806: Rectangle2D dataArea, double value);
1807:
1808: /**
1809: * Draws a grid line against the range axis.
1810: *
1811: * @param g2 the graphics device.
1812: * @param plot the plot.
1813: * @param axis the value axis.
1814: * @param dataArea the area for plotting data (not yet adjusted for any
1815: * 3D effect).
1816: * @param value the value.
1817: *
1818: * @see #drawDomainGridline(Graphics2D, CategoryPlot, Rectangle2D, double)
1819: */
1820: public void drawRangeGridline(Graphics2D g2, CategoryPlot plot,
1821: ValueAxis axis, Rectangle2D dataArea, double value);
1822:
1823: /**
1824: * Draws a line (or some other marker) to indicate a particular category on
1825: * the domain axis.
1826: *
1827: * @param g2 the graphics device.
1828: * @param plot the plot.
1829: * @param axis the category axis.
1830: * @param marker the marker.
1831: * @param dataArea the area for plotting data (not including 3D effect).
1832: *
1833: * @see #drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker,
1834: * Rectangle2D)
1835: */
1836: public void drawDomainMarker(Graphics2D g2, CategoryPlot plot,
1837: CategoryAxis axis, CategoryMarker marker,
1838: Rectangle2D dataArea);
1839:
1840: /**
1841: * Draws a line (or some other marker) to indicate a particular value on
1842: * the range axis.
1843: *
1844: * @param g2 the graphics device.
1845: * @param plot the plot.
1846: * @param axis the value axis.
1847: * @param marker the marker.
1848: * @param dataArea the area for plotting data (not including 3D effect).
1849: *
1850: * @see #drawDomainMarker(Graphics2D, CategoryPlot, CategoryAxis,
1851: * CategoryMarker, Rectangle2D)
1852: */
1853: public void drawRangeMarker(Graphics2D g2, CategoryPlot plot,
1854: ValueAxis axis, Marker marker, Rectangle2D dataArea);
1855:
1856: }
|