Frames | No Frames |
1: /* =========================================================== 2: * JFreeChart : a free chart library for the Java(tm) platform 3: * =========================================================== 4: * 5: * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. 6: * 7: * Project Info: http://www.jfree.org/jfreechart/index.html 8: * 9: * This library is free software; you can redistribute it and/or modify it 10: * under the terms of the GNU Lesser General Public License as published by 11: * the Free Software Foundation; either version 2.1 of the License, or 12: * (at your option) any later version. 13: * 14: * This library is distributed in the hope that it will be useful, but 15: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17: * License for more details. 18: * 19: * You should have received a copy of the GNU Lesser General Public 20: * License along with this library; if not, write to the Free Software 21: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 22: * USA. 23: * 24: * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 25: * in the United States and other countries.] 26: * 27: * ------------------------- 28: * CategoryItemRenderer.java 29: * ------------------------- 30: * 31: * (C) Copyright 2001-2007, by Object Refinery Limited and Contributors. 32: * 33: * Original Author: David Gilbert (for Object Refinery Limited); 34: * Contributor(s): Mark Watson (www.markwatson.com); 35: * 36: * Changes 37: * ------- 38: * 23-Oct-2001 : Version 1 (DG); 39: * 16-Jan-2002 : Renamed HorizontalCategoryItemRenderer.java 40: * --> CategoryItemRenderer.java (DG); 41: * 05-Feb-2002 : Changed return type of the drawCategoryItem method from void 42: * to Shape, as part of the tooltips implementation (DG) 43: * 44: * NOTE (30-May-2002) : this has subsequently been changed back 45: * to void, tooltips are now collected along with entities in 46: * ChartRenderingInfo (DG); 47: * 48: * 14-Mar-2002 : Added the initialise method, and changed all bar plots to use 49: * this renderer (DG); 50: * 23-May-2002 : Added ChartRenderingInfo to the initialise method (DG); 51: * 29-May-2002 : Added the getAxisArea(Rectangle2D) method (DG); 52: * 06-Jun-2002 : Updated Javadoc comments (DG); 53: * 26-Jun-2002 : Added range axis to the initialise method (DG); 54: * 24-Sep-2002 : Added getLegendItem() method (DG); 55: * 23-Oct-2002 : Added methods to get/setToolTipGenerator (DG); 56: * 05-Nov-2002 : Replaced references to CategoryDataset with TableDataset (DG); 57: * 06-Nov-2002 : Added the domain axis to the drawCategoryItem method. Renamed 58: * drawCategoryItem() --> drawItem() (DG); 59: * 20-Nov-2002 : Changed signature of drawItem() method to reflect use of 60: * TableDataset (DG); 61: * 26-Nov-2002 : Replaced the isStacked() method with the getRangeType() 62: * method (DG); 63: * 08-Jan-2003 : Changed getSeriesCount() --> getRowCount() and 64: * getCategoryCount() --> getColumnCount() (DG); 65: * 09-Jan-2003 : Changed name of grid-line methods (DG); 66: * 21-Jan-2003 : Merged TableDataset with CategoryDataset (DG); 67: * 10-Apr-2003 : Changed CategoryDataset to KeyedValues2DDataset in 68: * drawItem() method (DG); 69: * 29-Apr-2003 : Eliminated Renderer interface (DG); 70: * 02-Sep-2003 : Fix for bug 790407 (DG); 71: * 16-Sep-2003 : Changed ChartRenderingInfo --> PlotRenderingInfo (DG); 72: * 20-Oct-2003 : Added setOutlinePaint() method (DG); 73: * 06-Feb-2004 : Added missing methods, and moved deprecated methods (DG); 74: * 19-Feb-2004 : Added extra setXXXLabelsVisible() methods (DG); 75: * 29-Apr-2004 : Changed Integer --> int in initialise() method (DG); 76: * 18-May-2004 : Added methods for item label paint (DG); 77: * 05-Nov-2004 : Added getPassCount() method and 'pass' parameter to drawItem() 78: * method (DG); 79: * 07-Jan-2005 : Renamed getRangeExtent() --> findRangeBounds (DG); 80: * 11-Jan-2005 : Removed deprecated code in preparation for 1.0.0 release (DG); 81: * 23-Feb-2005 : Now extends LegendItemSource (DG); 82: * 20-Apr-2005 : Renamed CategoryLabelGenerator 83: * --> CategoryItemLabelGenerator (DG); 84: * 20-May-2005 : Added drawDomainMarker() method (DG); 85: * ------------- JFREECHART 1.0.x --------------------------------------------- 86: * 20-Feb-2007 : Updated API docs (DG); 87: * 19-Apr-2007 : Deprecated seriesVisible and seriesVisibleInLegend flags (DG); 88: * 20-Apr-2007 : Deprecated paint, fillPaint, outlinePaint, stroke, 89: * outlineStroke, shape, itemLabelsVisible, itemLabelFont, 90: * itemLabelPaint, positiveItemLabelPosition, 91: * negativeItemLabelPosition and createEntities override 92: * fields (DG); 93: * 94: */ 95: 96: package org.jfree.chart.renderer.category; 97: 98: import java.awt.Font; 99: import java.awt.Graphics2D; 100: import java.awt.Paint; 101: import java.awt.Shape; 102: import java.awt.Stroke; 103: import java.awt.geom.Rectangle2D; 104: 105: import org.jfree.chart.LegendItem; 106: import org.jfree.chart.LegendItemSource; 107: import org.jfree.chart.axis.CategoryAxis; 108: import org.jfree.chart.axis.ValueAxis; 109: import org.jfree.chart.event.RendererChangeEvent; 110: import org.jfree.chart.event.RendererChangeListener; 111: import org.jfree.chart.labels.CategoryItemLabelGenerator; 112: import org.jfree.chart.labels.CategoryToolTipGenerator; 113: import org.jfree.chart.labels.ItemLabelPosition; 114: import org.jfree.chart.plot.CategoryMarker; 115: import org.jfree.chart.plot.CategoryPlot; 116: import org.jfree.chart.plot.Marker; 117: import org.jfree.chart.plot.PlotRenderingInfo; 118: import org.jfree.chart.urls.CategoryURLGenerator; 119: import org.jfree.data.Range; 120: import org.jfree.data.category.CategoryDataset; 121: 122: /** 123: * A plug-in object that is used by the {@link CategoryPlot} class to display 124: * individual data items from a {@link CategoryDataset}. 125: * <p> 126: * This interface defines the methods that must be provided by all renderers. 127: * If you are implementing a custom renderer, you should consider extending the 128: * {@link AbstractCategoryItemRenderer} class. 129: * <p> 130: * Most renderer attributes are defined using a "three layer" approach. When 131: * looking up an attribute (for example, the outline paint) the renderer first 132: * checks to see if there is a setting (in layer 0) that applies to ALL items 133: * that the renderer draws. If there is, that setting is used, but if it is 134: * <code>null</code> the renderer looks up the next layer, which contains 135: * "per series" settings for the attribute (many attributes are defined on a 136: * per series basis, so this is the layer that is most commonly used). If the 137: * layer 1 setting is <code>null</code>, the renderer will look up the final 138: * layer, which provides a default or "base" setting. Some attributes allow 139: * the base setting to be <code>null</code>, while other attributes enforce 140: * non-<code>null</code> values. 141: */ 142: 143: public interface CategoryItemRenderer extends LegendItemSource { 144: 145: /** 146: * Returns the number of passes through the dataset required by the 147: * renderer. Usually this will be one, but some renderers may use 148: * a second or third pass to overlay items on top of things that were 149: * drawn in an earlier pass. 150: * 151: * @return The pass count. 152: */ 153: public int getPassCount(); 154: 155: /** 156: * Returns the plot that the renderer has been assigned to (where 157: * <code>null</code> indicates that the renderer is not currently assigned 158: * to a plot). 159: * 160: * @return The plot (possibly <code>null</code>). 161: * 162: * @see #setPlot(CategoryPlot) 163: */ 164: public CategoryPlot getPlot(); 165: 166: /** 167: * Sets the plot that the renderer has been assigned to. This method is 168: * usually called by the {@link CategoryPlot}, in normal usage you 169: * shouldn't need to call this method directly. 170: * 171: * @param plot the plot (<code>null</code> not permitted). 172: * 173: * @see #getPlot() 174: */ 175: public void setPlot(CategoryPlot plot); 176: 177: /** 178: * Adds a change listener. 179: * 180: * @param listener the listener. 181: * 182: * @see #removeChangeListener(RendererChangeListener) 183: */ 184: public void addChangeListener(RendererChangeListener listener); 185: 186: /** 187: * Removes a change listener. 188: * 189: * @param listener the listener. 190: * 191: * @see #addChangeListener(RendererChangeListener) 192: */ 193: public void removeChangeListener(RendererChangeListener listener); 194: 195: /** 196: * Returns the range of values the renderer requires to display all the 197: * items from the specified dataset. 198: * 199: * @param dataset the dataset (<code>null</code> permitted). 200: * 201: * @return The range (or <code>null</code> if the dataset is 202: * <code>null</code> or empty). 203: */ 204: public Range findRangeBounds(CategoryDataset dataset); 205: 206: /** 207: * Initialises the renderer. This method will be called before the first 208: * item is rendered, giving the renderer an opportunity to initialise any 209: * state information it wants to maintain. The renderer can do nothing if 210: * it chooses. 211: * 212: * @param g2 the graphics device. 213: * @param dataArea the area inside the axes. 214: * @param plot the plot. 215: * @param rendererIndex the renderer index. 216: * @param info collects chart rendering information for return to caller. 217: * 218: * @return A state object (maintains state information relevant to one 219: * chart drawing). 220: */ 221: public CategoryItemRendererState initialise(Graphics2D g2, 222: Rectangle2D dataArea, 223: CategoryPlot plot, 224: int rendererIndex, 225: PlotRenderingInfo info); 226: 227: /** 228: * Returns a boolean that indicates whether or not the specified item 229: * should be drawn (this is typically used to hide an entire series). 230: * 231: * @param series the series index. 232: * @param item the item index. 233: * 234: * @return A boolean. 235: */ 236: public boolean getItemVisible(int series, int item); 237: 238: /** 239: * Returns a boolean that indicates whether or not the specified series 240: * should be drawn (this is typically used to hide an entire series). 241: * 242: * @param series the series index. 243: * 244: * @return A boolean. 245: */ 246: public boolean isSeriesVisible(int series); 247: 248: /** 249: * Returns the flag that controls the visibility of ALL series. This flag 250: * overrides the per series and default settings - you must set it to 251: * <code>null</code> if you want the other settings to apply. 252: * 253: * @return The flag (possibly <code>null</code>). 254: * 255: * @see #setSeriesVisible(Boolean) 256: * 257: * @deprecated This method should no longer be used (as of version 1.0.6). 258: * It is sufficient to rely on {@link #getSeriesVisible(int)} and 259: * {@link #getBaseSeriesVisible()}. 260: */ 261: public Boolean getSeriesVisible(); 262: 263: /** 264: * Sets the flag that controls the visibility of ALL series and sends a 265: * {@link RendererChangeEvent} to all registered listeners. This flag 266: * overrides the per series and default settings - you must set it to 267: * <code>null</code> if you want the other settings to apply. 268: * 269: * @param visible the flag (<code>null</code> permitted). 270: * 271: * @see #getSeriesVisible() 272: * 273: * @deprecated This method should no longer be used (as of version 1.0.6). 274: * It is sufficient to rely on {@link #setSeriesVisible(int, Boolean)} 275: * and {@link #setBaseSeriesVisible(boolean)}. 276: */ 277: public void setSeriesVisible(Boolean visible); 278: 279: /** 280: * Sets the flag that controls the visibility of ALL series and sends a 281: * {@link RendererChangeEvent} to all registered listeners. This flag 282: * overrides the per series and default settings - you must set it to 283: * <code>null</code> if you want the other settings to apply. 284: * 285: * @param visible the flag (<code>null</code> permitted). 286: * @param notify notify listeners? 287: * 288: * @see #getSeriesVisible() 289: * 290: * @deprecated This method should no longer be used (as of version 1.0.6). 291: * It is sufficient to rely on {@link #setSeriesVisible(int, Boolean, 292: * boolean)} and {@link #setBaseSeriesVisible(boolean, boolean)}. 293: */ 294: public void setSeriesVisible(Boolean visible, boolean notify); 295: 296: /** 297: * Returns the flag that controls whether a series is visible. 298: * 299: * @param series the series index (zero-based). 300: * 301: * @return The flag (possibly <code>null</code>). 302: * 303: * @see #setSeriesVisible(int, Boolean) 304: */ 305: public Boolean getSeriesVisible(int series); 306: 307: /** 308: * Sets the flag that controls whether a series is visible and sends a 309: * {@link RendererChangeEvent} to all registered listeners. 310: * 311: * @param series the series index (zero-based). 312: * @param visible the flag (<code>null</code> permitted). 313: * 314: * @see #getSeriesVisible(int) 315: */ 316: public void setSeriesVisible(int series, Boolean visible); 317: 318: /** 319: * Sets the flag that controls whether a series is visible and, if 320: * requested, sends a {@link RendererChangeEvent} to all registered 321: * listeners. 322: * 323: * @param series the series index. 324: * @param visible the flag (<code>null</code> permitted). 325: * @param notify notify listeners? 326: * 327: * @see #getSeriesVisible(int) 328: */ 329: public void setSeriesVisible(int series, Boolean visible, boolean notify); 330: 331: /** 332: * Returns the base visibility for all series. 333: * 334: * @return The base visibility. 335: * 336: * @see #setBaseSeriesVisible(boolean) 337: */ 338: public boolean getBaseSeriesVisible(); 339: 340: /** 341: * Sets the base visibility and sends a {@link RendererChangeEvent} to all 342: * registered listeners. 343: * 344: * @param visible the flag. 345: * 346: * @see #getBaseSeriesVisible() 347: */ 348: public void setBaseSeriesVisible(boolean visible); 349: 350: /** 351: * Sets the base visibility and, if requested, sends 352: * a {@link RendererChangeEvent} to all registered listeners. 353: * 354: * @param visible the visibility. 355: * @param notify notify listeners? 356: * 357: * @see #getBaseSeriesVisible() 358: */ 359: public void setBaseSeriesVisible(boolean visible, boolean notify); 360: 361: // SERIES VISIBLE IN LEGEND (not yet respected by all renderers) 362: 363: /** 364: * Returns <code>true</code> if the series should be shown in the legend, 365: * and <code>false</code> otherwise. 366: * 367: * @param series the series index. 368: * 369: * @return A boolean. 370: */ 371: public boolean isSeriesVisibleInLegend(int series); 372: 373: /** 374: * Returns the flag that controls the visibility of ALL series in the 375: * legend. This flag overrides the per series and default settings - you 376: * must set it to <code>null</code> if you want the other settings to 377: * apply. 378: * 379: * @return The flag (possibly <code>null</code>). 380: * 381: * @see #setSeriesVisibleInLegend(Boolean) 382: * 383: * @deprecated This method should no longer be used (as of version 1.0.6). 384: * It is sufficient to rely on {@link #getSeriesVisibleInLegend(int)} 385: * and {@link #getBaseSeriesVisibleInLegend()}. 386: */ 387: public Boolean getSeriesVisibleInLegend(); 388: 389: /** 390: * Sets the flag that controls the visibility of ALL series in the legend 391: * and sends a {@link RendererChangeEvent} to all registered listeners. 392: * This flag overrides the per series and default settings - you must set 393: * it to <code>null</code> if you want the other settings to apply. 394: * 395: * @param visible the flag (<code>null</code> permitted). 396: * 397: * @see #getSeriesVisibleInLegend() 398: * 399: * @deprecated This method should no longer be used (as of version 1.0.6). 400: * It is sufficient to rely on {@link #setSeriesVisibleInLegend(int, 401: * Boolean)} and {@link #setBaseSeriesVisibleInLegend(boolean)}. 402: */ 403: public void setSeriesVisibleInLegend(Boolean visible); 404: 405: /** 406: * Sets the flag that controls the visibility of ALL series in the legend 407: * and sends a {@link RendererChangeEvent} to all registered listeners. 408: * This flag overrides the per series and default settings - you must set 409: * it to <code>null</code> if you want the other settings to apply. 410: * 411: * @param visible the flag (<code>null</code> permitted). 412: * @param notify notify listeners? 413: * 414: * @see #getSeriesVisibleInLegend() 415: * 416: * @deprecated This method should no longer be used (as of version 1.0.6). 417: * It is sufficient to rely on {@link #setSeriesVisibleInLegend(int, 418: * Boolean, boolean)} and {@link #setBaseSeriesVisibleInLegend(boolean, 419: * boolean)}. 420: */ 421: public void setSeriesVisibleInLegend(Boolean visible, boolean notify); 422: 423: /** 424: * Returns the flag that controls whether a series is visible in the 425: * legend. This method returns only the "per series" settings - to 426: * incorporate the override and base settings as well, you need to use the 427: * {@link #isSeriesVisibleInLegend(int)} method. 428: * 429: * @param series the series index (zero-based). 430: * 431: * @return The flag (possibly <code>null</code>). 432: * 433: * @see #setSeriesVisibleInLegend(int, Boolean) 434: */ 435: public Boolean getSeriesVisibleInLegend(int series); 436: 437: /** 438: * Sets the flag that controls whether a series is visible in the legend 439: * and sends a {@link RendererChangeEvent} to all registered listeners. 440: * 441: * @param series the series index (zero-based). 442: * @param visible the flag (<code>null</code> permitted). 443: * 444: * @see #getSeriesVisibleInLegend(int) 445: */ 446: public void setSeriesVisibleInLegend(int series, Boolean visible); 447: 448: /** 449: * Sets the flag that controls whether a series is visible in the legend 450: * and, if requested, sends a {@link RendererChangeEvent} to all registered 451: * listeners. 452: * 453: * @param series the series index. 454: * @param visible the flag (<code>null</code> permitted). 455: * @param notify notify listeners? 456: * 457: * @see #getSeriesVisibleInLegend(int) 458: */ 459: public void setSeriesVisibleInLegend(int series, Boolean visible, 460: boolean notify); 461: 462: /** 463: * Returns the base visibility in the legend for all series. 464: * 465: * @return The base visibility. 466: * 467: * @see #setBaseSeriesVisibleInLegend(boolean) 468: */ 469: public boolean getBaseSeriesVisibleInLegend(); 470: 471: /** 472: * Sets the base visibility in the legend and sends a 473: * {@link RendererChangeEvent} to all registered listeners. 474: * 475: * @param visible the flag. 476: * 477: * @see #getBaseSeriesVisibleInLegend() 478: */ 479: public void setBaseSeriesVisibleInLegend(boolean visible); 480: 481: /** 482: * Sets the base visibility in the legend and, if requested, sends 483: * a {@link RendererChangeEvent} to all registered listeners. 484: * 485: * @param visible the visibility. 486: * @param notify notify listeners? 487: * 488: * @see #getBaseSeriesVisibleInLegend() 489: */ 490: public void setBaseSeriesVisibleInLegend(boolean visible, boolean notify); 491: 492: 493: //// PAINT ///////////////////////////////////////////////////////////////// 494: 495: /** 496: * Returns the paint used to fill data items as they are drawn. 497: * 498: * @param row the row (or series) index (zero-based). 499: * @param column the column (or category) index (zero-based). 500: * 501: * @return The paint (never <code>null</code>). 502: */ 503: public Paint getItemPaint(int row, int column); 504: 505: /** 506: * Sets the paint to be used for ALL series, and sends a 507: * {@link RendererChangeEvent} to all registered listeners. If this is 508: * <code>null</code>, the renderer will use the paint for the series. 509: * 510: * @param paint the paint (<code>null</code> permitted). 511: * 512: * @deprecated This method should no longer be used (as of version 1.0.6). 513: * It is sufficient to rely on {@link #setSeriesPaint(int, Paint)} and 514: * {@link #setBasePaint(Paint)}. 515: */ 516: public void setPaint(Paint paint); 517: 518: /** 519: * Returns the paint used to fill an item drawn by the renderer. 520: * 521: * @param series the series index (zero-based). 522: * 523: * @return The paint (possibly <code>null</code>). 524: * 525: * @see #setSeriesPaint(int, Paint) 526: */ 527: public Paint getSeriesPaint(int series); 528: 529: /** 530: * Sets the paint used for a series and sends a {@link RendererChangeEvent} 531: * to all registered listeners. 532: * 533: * @param series the series index (zero-based). 534: * @param paint the paint (<code>null</code> permitted). 535: * 536: * @see #getSeriesPaint(int) 537: */ 538: public void setSeriesPaint(int series, Paint paint); 539: 540: // FIXME: add setSeriesPaint(int, Paint, boolean)? 541: 542: /** 543: * Returns the base paint. 544: * 545: * @return The base paint (never <code>null</code>). 546: * 547: * @see #setBasePaint(Paint) 548: */ 549: public Paint getBasePaint(); 550: 551: /** 552: * Sets the base paint and sends a {@link RendererChangeEvent} to all 553: * registered listeners. 554: * 555: * @param paint the paint (<code>null</code> not permitted). 556: * 557: * @see #getBasePaint() 558: */ 559: public void setBasePaint(Paint paint); 560: 561: // FIXME: add setBasePaint(int, Paint, boolean)? 562: 563: //// FILL PAINT ///////////////////////////////////////////////////////// 564: 565: // /** 566: // * Returns the paint used to fill data items as they are drawn. 567: // * 568: // * @param row the row (or series) index (zero-based). 569: // * @param column the column (or category) index (zero-based). 570: // * 571: // * @return The paint (never <code>null</code>). 572: // */ 573: // public Paint getItemFillPaint(int row, int column); 574: // 575: // /** 576: // * Returns the paint used to fill an item drawn by the renderer. 577: // * 578: // * @param series the series (zero-based index). 579: // * 580: // * @return The paint (possibly <code>null</code>). 581: // * 582: // * @see #setSeriesFillPaint(int, Paint) 583: // */ 584: // public Paint getSeriesFillPaint(int series); 585: // 586: // /** 587: // * Sets the paint used for a series outline and sends a 588: // * {@link RendererChangeEvent} to all registered listeners. 589: // * 590: // * @param series the series index (zero-based). 591: // * @param paint the paint (<code>null</code> permitted). 592: // * 593: // * @see #getSeriesFillPaint(int) 594: // */ 595: // public void setSeriesFillPaint(int series, Paint paint); 596: // 597: // /** 598: // * Returns the base outline paint. 599: // * 600: // * @return The paint (never <code>null</code>). 601: // * 602: // * @see #setBaseFillPaint(Paint) 603: // */ 604: // public Paint getBaseFillPaint(); 605: // 606: // /** 607: // * Sets the base outline paint and sends a {@link RendererChangeEvent} to 608: // * all registered listeners. 609: // * 610: // * @param paint the paint (<code>null</code> not permitted). 611: // * 612: // * @see #getBaseFillPaint() 613: // */ 614: // public void setBaseFillPaint(Paint paint); 615: 616: //// OUTLINE PAINT ///////////////////////////////////////////////////////// 617: 618: /** 619: * Returns the paint used to outline data items as they are drawn. 620: * 621: * @param row the row (or series) index (zero-based). 622: * @param column the column (or category) index (zero-based). 623: * 624: * @return The paint (never <code>null</code>). 625: */ 626: public Paint getItemOutlinePaint(int row, int column); 627: 628: /** 629: * Sets the outline paint for ALL series (optional). 630: * 631: * @param paint the paint (<code>null</code> permitted). 632: * 633: * @deprecated This method should no longer be used (as of version 1.0.6). 634: * It is sufficient to rely on {@link #setSeriesOutlinePaint(int, 635: * Paint)} and {@link #setBaseOutlinePaint(Paint)}. 636: */ 637: public void setOutlinePaint(Paint paint); 638: 639: /** 640: * Returns the paint used to outline an item drawn by the renderer. 641: * 642: * @param series the series (zero-based index). 643: * 644: * @return The paint (possibly <code>null</code>). 645: * 646: * @see #setSeriesOutlinePaint(int, Paint) 647: */ 648: public Paint getSeriesOutlinePaint(int series); 649: 650: /** 651: * Sets the paint used for a series outline and sends a 652: * {@link RendererChangeEvent} to all registered listeners. 653: * 654: * @param series the series index (zero-based). 655: * @param paint the paint (<code>null</code> permitted). 656: * 657: * @see #getSeriesOutlinePaint(int) 658: */ 659: public void setSeriesOutlinePaint(int series, Paint paint); 660: 661: // FIXME: add setSeriesOutlinePaint(int, Paint, boolean)? 662: 663: /** 664: * Returns the base outline paint. 665: * 666: * @return The paint (never <code>null</code>). 667: * 668: * @see #setBaseOutlinePaint(Paint) 669: */ 670: public Paint getBaseOutlinePaint(); 671: 672: /** 673: * Sets the base outline paint and sends a {@link RendererChangeEvent} to 674: * all registered listeners. 675: * 676: * @param paint the paint (<code>null</code> not permitted). 677: * 678: * @see #getBaseOutlinePaint() 679: */ 680: public void setBaseOutlinePaint(Paint paint); 681: 682: // FIXME: add setBaseOutlinePaint(Paint, boolean)? 683: 684: //// STROKE //////////////////////////////////////////////////////////////// 685: 686: /** 687: * Returns the stroke used to draw data items. 688: * 689: * @param row the row (or series) index (zero-based). 690: * @param column the column (or category) index (zero-based). 691: * 692: * @return The stroke (never <code>null</code>). 693: */ 694: public Stroke getItemStroke(int row, int column); 695: 696: /** 697: * Sets the stroke for ALL series and sends a {@link RendererChangeEvent} 698: * to all registered listeners. 699: * 700: * @param stroke the stroke (<code>null</code> permitted). 701: * 702: * @deprecated This method should no longer be used (as of version 1.0.6). 703: * It is sufficient to rely on {@link #setSeriesStroke(int, Stroke)} 704: * and {@link #setBaseStroke(Stroke)}. 705: */ 706: public void setStroke(Stroke stroke); 707: 708: /** 709: * Returns the stroke used to draw the items in a series. 710: * 711: * @param series the series (zero-based index). 712: * 713: * @return The stroke (never <code>null</code>). 714: * 715: * @see #setSeriesStroke(int, Stroke) 716: */ 717: public Stroke getSeriesStroke(int series); 718: 719: /** 720: * Sets the stroke used for a series and sends a 721: * {@link RendererChangeEvent} to all registered listeners. 722: * 723: * @param series the series index (zero-based). 724: * @param stroke the stroke (<code>null</code> permitted). 725: * 726: * @see #getSeriesStroke(int) 727: */ 728: public void setSeriesStroke(int series, Stroke stroke); 729: 730: // FIXME: add setSeriesStroke(int, Stroke, boolean) ? 731: 732: /** 733: * Returns the base stroke. 734: * 735: * @return The base stroke (never <code>null</code>). 736: * 737: * @see #setBaseStroke(Stroke) 738: */ 739: public Stroke getBaseStroke(); 740: 741: /** 742: * Sets the base stroke and sends a {@link RendererChangeEvent} to all 743: * registered listeners. 744: * 745: * @param stroke the stroke (<code>null</code> not permitted). 746: * 747: * @see #getBaseStroke() 748: */ 749: public void setBaseStroke(Stroke stroke); 750: 751: // FIXME: add setBaseStroke(Stroke, boolean) ? 752: 753: //// OUTLINE STROKE //////////////////////////////////////////////////////// 754: 755: /** 756: * Returns the stroke used to outline data items. 757: * <p> 758: * The default implementation passes control to the 759: * lookupSeriesOutlineStroke method. You can override this method if you 760: * require different behaviour. 761: * 762: * @param row the row (or series) index (zero-based). 763: * @param column the column (or category) index (zero-based). 764: * 765: * @return The stroke (never <code>null</code>). 766: */ 767: public Stroke getItemOutlineStroke(int row, int column); 768: 769: /** 770: * Sets the outline stroke for ALL series and sends a 771: * {@link RendererChangeEvent} to all registered listeners. 772: * 773: * @param stroke the stroke (<code>null</code> permitted). 774: * 775: * @deprecated This method should no longer be used (as of version 1.0.6). 776: * It is sufficient to rely on {@link #setSeriesOutlineStroke(int, 777: * Stroke)} and {@link #setBaseOutlineStroke(Stroke)}. 778: */ 779: public void setOutlineStroke(Stroke stroke); 780: 781: /** 782: * Returns the stroke used to outline the items in a series. 783: * 784: * @param series the series (zero-based index). 785: * 786: * @return The stroke (possibly <code>null</code>). 787: * 788: * @see #setSeriesOutlineStroke(int, Stroke) 789: */ 790: public Stroke getSeriesOutlineStroke(int series); 791: 792: /** 793: * Sets the outline stroke used for a series and sends a 794: * {@link RendererChangeEvent} to all registered listeners. 795: * 796: * @param series the series index (zero-based). 797: * @param stroke the stroke (<code>null</code> permitted). 798: * 799: * @see #getSeriesOutlineStroke(int) 800: */ 801: public void setSeriesOutlineStroke(int series, Stroke stroke); 802: 803: // FIXME: add setSeriesOutlineStroke(int, Stroke, boolean) ? 804: 805: /** 806: * Returns the base outline stroke. 807: * 808: * @return The stroke (never <code>null</code>). 809: * 810: * @see #setBaseOutlineStroke(Stroke) 811: */ 812: public Stroke getBaseOutlineStroke(); 813: 814: /** 815: * Sets the base outline stroke and sends a {@link RendererChangeEvent} to 816: * all registered listeners. 817: * 818: * @param stroke the stroke (<code>null</code> not permitted). 819: * 820: * @see #getBaseOutlineStroke() 821: */ 822: public void setBaseOutlineStroke(Stroke stroke); 823: 824: // FIXME: add setBaseOutlineStroke(Stroke, boolean) ? 825: 826: //// SHAPE ///////////////////////////////////////////////////////////////// 827: 828: /** 829: * Returns a shape used to represent a data item. 830: * 831: * @param row the row (or series) index (zero-based). 832: * @param column the column (or category) index (zero-based). 833: * 834: * @return The shape (never <code>null</code>). 835: */ 836: public Shape getItemShape(int row, int column); 837: 838: /** 839: * Sets the shape for ALL series (optional) and sends a 840: * {@link RendererChangeEvent} to all registered listeners. 841: * 842: * @param shape the shape (<code>null</code> permitted). 843: * 844: * @deprecated This method should no longer be used (as of version 1.0.6). 845: * It is sufficient to rely on {@link #setSeriesShape(int, Shape)} and 846: * {@link #setBaseShape(Shape)}. 847: */ 848: public void setShape(Shape shape); 849: 850: /** 851: * Returns a shape used to represent the items in a series. 852: * 853: * @param series the series (zero-based index). 854: * 855: * @return The shape (possibly <code>null</code>). 856: * 857: * @see #setSeriesShape(int, Shape) 858: */ 859: public Shape getSeriesShape(int series); 860: 861: /** 862: * Sets the shape used for a series and sends a {@link RendererChangeEvent} 863: * to all registered listeners. 864: * 865: * @param series the series index (zero-based). 866: * @param shape the shape (<code>null</code> permitted). 867: * 868: * @see #getSeriesShape(int) 869: */ 870: public void setSeriesShape(int series, Shape shape); 871: 872: // FIXME: add setSeriesShape(int, Shape, boolean) ? 873: 874: /** 875: * Returns the base shape. 876: * 877: * @return The shape (never <code>null</code>). 878: * 879: * @see #setBaseShape(Shape) 880: */ 881: public Shape getBaseShape(); 882: 883: /** 884: * Sets the base shape and sends a {@link RendererChangeEvent} to all 885: * registered listeners. 886: * 887: * @param shape the shape (<code>null</code> not permitted). 888: * 889: * @see #getBaseShape() 890: */ 891: public void setBaseShape(Shape shape); 892: 893: // FIXME: add setBaseShape(Shape, boolean) ? 894: 895: // ITEM LABELS VISIBLE 896: 897: /** 898: * Returns <code>true</code> if an item label is visible, and 899: * <code>false</code> otherwise. 900: * 901: * @param row the row index (zero-based). 902: * @param column the column index (zero-based). 903: * 904: * @return A boolean. 905: */ 906: public boolean isItemLabelVisible(int row, int column); 907: 908: /** 909: * Sets a flag that controls whether or not the item labels for ALL series 910: * are visible. 911: * 912: * @param visible the flag. 913: * 914: * @see #setItemLabelsVisible(Boolean) 915: * 916: * @deprecated This method should no longer be used (as of version 1.0.6). 917: * It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int, 918: * Boolean)} and {@link #setBaseItemLabelsVisible(boolean)}. 919: */ 920: public void setItemLabelsVisible(boolean visible); 921: 922: /** 923: * Sets a flag that controls whether or not the item labels for ALL series 924: * are visible. 925: * 926: * @param visible the flag (<code>null</code> permitted). 927: * 928: * @see #setItemLabelsVisible(boolean) 929: * 930: * @deprecated This method should no longer be used (as of version 1.0.6). 931: * It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int, 932: * Boolean)} and {@link #setBaseItemLabelsVisible(boolean)}. 933: */ 934: public void setItemLabelsVisible(Boolean visible); 935: 936: /** 937: * Sets the visibility of item labels for ALL series and, if requested, 938: * sends a {@link RendererChangeEvent} to all registered listeners. 939: * 940: * @param visible a flag that controls whether or not the item labels are 941: * visible (<code>null</code> permitted). 942: * @param notify a flag that controls whether or not listeners are 943: * notified. 944: * 945: * @deprecated This method should no longer be used (as of version 1.0.6). 946: * It is sufficient to rely on {@link #setSeriesItemLabelsVisible(int, 947: * Boolean, boolean)} and {@link #setBaseItemLabelsVisible(Boolean, 948: * boolean)}. 949: */ 950: public void setItemLabelsVisible(Boolean visible, boolean notify); 951: 952: /** 953: * Returns <code>true</code> if the item labels for a series are visible, 954: * and <code>false</code> otherwise. 955: * 956: * @param series the series index (zero-based). 957: * 958: * @return A boolean. 959: * 960: * @see #setSeriesItemLabelsVisible(int, Boolean) 961: */ 962: public boolean isSeriesItemLabelsVisible(int series); 963: 964: /** 965: * Sets a flag that controls the visibility of the item labels for a series. 966: * 967: * @param series the series index (zero-based). 968: * @param visible the flag. 969: * 970: * @see #isSeriesItemLabelsVisible(int) 971: */ 972: public void setSeriesItemLabelsVisible(int series, boolean visible); 973: 974: /** 975: * Sets a flag that controls the visibility of the item labels for a series. 976: * 977: * @param series the series index (zero-based). 978: * @param visible the flag (<code>null</code> permitted). 979: * 980: * @see #isSeriesItemLabelsVisible(int) 981: */ 982: public void setSeriesItemLabelsVisible(int series, Boolean visible); 983: 984: /** 985: * Sets the visibility of item labels for a series and, if requested, sends 986: * a {@link RendererChangeEvent} to all registered listeners. 987: * 988: * @param series the series index (zero-based). 989: * @param visible the visible flag. 990: * @param notify a flag that controls whether or not listeners are 991: * notified. 992: * 993: * @see #isSeriesItemLabelsVisible(int) 994: */ 995: public void setSeriesItemLabelsVisible(int series, Boolean visible, 996: boolean notify); 997: 998: /** 999: * Returns the base setting for item label visibility. 1000: * 1001: * @return A flag (possibly <code>null</code>). 1002: * 1003: * @see #setBaseItemLabelsVisible(Boolean) 1004: */ 1005: public Boolean getBaseItemLabelsVisible(); 1006: 1007: /** 1008: * Sets the base flag that controls whether or not item labels are visible. 1009: * 1010: * @param visible the flag. 1011: * 1012: * @see #getBaseItemLabelsVisible() 1013: */ 1014: public void setBaseItemLabelsVisible(boolean visible); 1015: 1016: /** 1017: * Sets the base setting for item label visibility. 1018: * 1019: * @param visible the flag (<code>null</code> permitted). 1020: * 1021: * @see #getBaseItemLabelsVisible() 1022: */ 1023: public void setBaseItemLabelsVisible(Boolean visible); 1024: 1025: /** 1026: * Sets the base visibility for item labels and, if requested, sends a 1027: * {@link RendererChangeEvent} to all registered listeners. 1028: * 1029: * @param visible the visibility flag. 1030: * @param notify a flag that controls whether or not listeners are 1031: * notified. 1032: * 1033: * @see #getBaseItemLabelsVisible() 1034: */ 1035: public void setBaseItemLabelsVisible(Boolean visible, boolean notify); 1036: 1037: // ITEM LABEL GENERATOR 1038: 1039: /** 1040: * Returns the item label generator for the specified data item. 1041: * 1042: * @param series the series index (zero-based). 1043: * @param item the item index (zero-based). 1044: * 1045: * @return The generator (possibly <code>null</code>). 1046: */ 1047: public CategoryItemLabelGenerator getItemLabelGenerator(int series, 1048: int item); 1049: 1050: /** 1051: * Sets the item label generator for ALL series and sends a 1052: * {@link RendererChangeEvent} to all registered listeners. This overrides 1053: * the per-series settings. 1054: * 1055: * @param generator the generator (<code>null</code> permitted). 1056: * 1057: * @deprecated This method should no longer be used (as of version 1.0.6). 1058: * It is sufficient to rely on {@link #setSeriesItemLabelGenerator(int, 1059: * CategoryItemLabelGenerator)} and 1060: * {@link #setBaseItemLabelGenerator(CategoryItemLabelGenerator)}. 1061: */ 1062: public void setItemLabelGenerator(CategoryItemLabelGenerator generator); 1063: 1064: /** 1065: * Returns the item label generator for a series. 1066: * 1067: * @param series the series index (zero-based). 1068: * 1069: * @return The label generator (possibly <code>null</code>). 1070: * 1071: * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator) 1072: */ 1073: public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series); 1074: 1075: /** 1076: * Sets the item label generator for a series and sends a 1077: * {@link RendererChangeEvent} to all registered listeners. 1078: * 1079: * @param series the series index (zero-based). 1080: * @param generator the generator. 1081: * 1082: * @see #getSeriesItemLabelGenerator(int) 1083: */ 1084: public void setSeriesItemLabelGenerator(int series, 1085: CategoryItemLabelGenerator generator); 1086: 1087: // FIXME: add setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator, 1088: // boolean) 1089: 1090: /** 1091: * Returns the base item label generator. 1092: * 1093: * @return The generator (possibly <code>null</code>). 1094: * 1095: * @see #setBaseItemLabelGenerator(CategoryItemLabelGenerator) 1096: */ 1097: public CategoryItemLabelGenerator getBaseItemLabelGenerator(); 1098: 1099: /** 1100: * Sets the base item label generator and sends a 1101: * {@link RendererChangeEvent} to all registered listeners. 1102: * 1103: * @param generator the generator (<code>null</code> permitted). 1104: * 1105: * @see #getBaseItemLabelGenerator() 1106: */ 1107: public void setBaseItemLabelGenerator(CategoryItemLabelGenerator generator); 1108: 1109: // FIXME: add setBaseItemLabelGenerator(CategoryItemLabelGenerator, 1110: // boolean) ? 1111: 1112: // TOOL TIP GENERATOR 1113: 1114: /** 1115: * Returns the tool tip generator that should be used for the specified 1116: * item. This method looks up the generator using the "three-layer" 1117: * approach outlined in the general description of this interface. 1118: * 1119: * @param row the row index (zero-based). 1120: * @param column the column index (zero-based). 1121: * 1122: * @return The generator (possibly <code>null</code>). 1123: */ 1124: public CategoryToolTipGenerator getToolTipGenerator(int row, int column); 1125: 1126: /** 1127: * Returns the tool tip generator that will be used for ALL items in the 1128: * dataset (the "layer 0" generator). 1129: * 1130: * @return A tool tip generator (possibly <code>null</code>). 1131: * 1132: * @see #setToolTipGenerator(CategoryToolTipGenerator) 1133: * 1134: * @deprecated This method should no longer be used (as of version 1.0.6). 1135: * It is sufficient to rely on {@link #getSeriesToolTipGenerator(int)} 1136: * and {@link #getBaseToolTipGenerator()}. 1137: */ 1138: public CategoryToolTipGenerator getToolTipGenerator(); 1139: 1140: /** 1141: * Sets the tool tip generator for ALL series and sends a 1142: * {@link org.jfree.chart.event.RendererChangeEvent} to all registered 1143: * listeners. 1144: * 1145: * @param generator the generator (<code>null</code> permitted). 1146: * 1147: * @see #getToolTipGenerator() 1148: * 1149: * @deprecated This method should no longer be used (as of version 1.0.6). 1150: * It is sufficient to rely on {@link #setSeriesToolTipGenerator(int, 1151: * CategoryToolTipGenerator)} and 1152: * {@link #setBaseToolTipGenerator(CategoryToolTipGenerator)}. 1153: */ 1154: public void setToolTipGenerator(CategoryToolTipGenerator generator); 1155: 1156: /** 1157: * Returns the tool tip generator for the specified series (a "layer 1" 1158: * generator). 1159: * 1160: * @param series the series index (zero-based). 1161: * 1162: * @return The tool tip generator (possibly <code>null</code>). 1163: * 1164: * @see #setSeriesToolTipGenerator(int, CategoryToolTipGenerator) 1165: */ 1166: public CategoryToolTipGenerator getSeriesToolTipGenerator(int series); 1167: 1168: /** 1169: * Sets the tool tip generator for a series and sends a 1170: * {@link org.jfree.chart.event.RendererChangeEvent} to all registered 1171: * listeners. 1172: * 1173: * @param series the series index (zero-based). 1174: * @param generator the generator (<code>null</code> permitted). 1175: * 1176: * @see #getSeriesToolTipGenerator(int) 1177: */ 1178: public void setSeriesToolTipGenerator(int series, 1179: CategoryToolTipGenerator generator); 1180: 1181: // FIXME: add setSeriesToolTipGenerator(int, CategoryToolTipGenerator, 1182: // boolean) ? 1183: 1184: /** 1185: * Returns the base tool tip generator (the "layer 2" generator). 1186: * 1187: * @return The tool tip generator (possibly <code>null</code>). 1188: * 1189: * @see #setBaseToolTipGenerator(CategoryToolTipGenerator) 1190: */ 1191: public CategoryToolTipGenerator getBaseToolTipGenerator(); 1192: 1193: /** 1194: * Sets the base tool tip generator and sends a 1195: * {@link org.jfree.chart.event.RendererChangeEvent} to all registered 1196: * listeners. 1197: * 1198: * @param generator the generator (<code>null</code> permitted). 1199: * 1200: * @see #getBaseToolTipGenerator() 1201: */ 1202: public void setBaseToolTipGenerator(CategoryToolTipGenerator generator); 1203: 1204: // FIXME: add setBaseToolTipGenerator(CategoryToolTipGenerator, boolean) ? 1205: 1206: //// ITEM LABEL FONT ////////////////////////////////////////////////////// 1207: 1208: /** 1209: * Returns the font for an item label. 1210: * 1211: * @param row the row index (zero-based). 1212: * @param column the column index (zero-based). 1213: * 1214: * @return The font (never <code>null</code>). 1215: */ 1216: public Font getItemLabelFont(int row, int column); 1217: 1218: /** 1219: * Returns the font used for all item labels. This may be 1220: * <code>null</code>, in which case the per series font settings will apply. 1221: * 1222: * @return The font (possibly <code>null</code>). 1223: * 1224: * @see #setItemLabelFont(Font) 1225: * 1226: * @deprecated This method should no longer be used (as of version 1.0.6). 1227: * It is sufficient to rely on {@link #getSeriesItemLabelFont(int)} and 1228: * {@link #getBaseItemLabelFont()}. 1229: */ 1230: public Font getItemLabelFont(); 1231: 1232: /** 1233: * Sets the item label font for ALL series and sends a 1234: * {@link RendererChangeEvent} to all registered listeners. You can set 1235: * this to <code>null</code> if you prefer to set the font on a per series 1236: * basis. 1237: * 1238: * @param font the font (<code>null</code> permitted). 1239: * 1240: * @see #getItemLabelFont() 1241: * 1242: * @deprecated This method should no longer be used (as of version 1.0.6). 1243: * It is sufficient to rely on {@link #setSeriesItemLabelFont(int, 1244: * Font)} and {@link #setBaseItemLabelFont(Font)}. 1245: */ 1246: public void setItemLabelFont(Font font); 1247: 1248: /** 1249: * Returns the font for all the item labels in a series. 1250: * 1251: * @param series the series index (zero-based). 1252: * 1253: * @return The font (possibly <code>null</code>). 1254: * 1255: * @see #setSeriesItemLabelFont(int, Font) 1256: */ 1257: public Font getSeriesItemLabelFont(int series); 1258: 1259: /** 1260: * Sets the item label font for a series and sends a 1261: * {@link RendererChangeEvent} to all registered listeners. 1262: * 1263: * @param series the series index (zero-based). 1264: * @param font the font (<code>null</code> permitted). 1265: * 1266: * @see #getSeriesItemLabelFont(int) 1267: */ 1268: public void setSeriesItemLabelFont(int series, Font font); 1269: 1270: // FIXME: add setSeriesItemLabelFont(int, Font, boolean) ? 1271: 1272: /** 1273: * Returns the base item label font (this is used when no other font 1274: * setting is available). 1275: * 1276: * @return The font (<code>never</code> null). 1277: * 1278: * @see #setBaseItemLabelFont(Font) 1279: */ 1280: public Font getBaseItemLabelFont(); 1281: 1282: /** 1283: * Sets the base item label font and sends a {@link RendererChangeEvent} 1284: * to all registered listeners. 1285: * 1286: * @param font the font (<code>null</code> not permitted). 1287: * 1288: * @see #getBaseItemLabelFont() 1289: */ 1290: public void setBaseItemLabelFont(Font font); 1291: 1292: // FIXME: add setBaseItemLabelFont(Font, boolean) ? 1293: 1294: //// ITEM LABEL PAINT ///////////////////////////////////////////////////// 1295: 1296: /** 1297: * Returns the paint used to draw an item label. 1298: * 1299: * @param row the row index (zero based). 1300: * @param column the column index (zero based). 1301: * 1302: * @return The paint (never <code>null</code>). 1303: */ 1304: public Paint getItemLabelPaint(int row, int column); 1305: 1306: /** 1307: * Returns the paint used for all item labels. This may be 1308: * <code>null</code>, in which case the per series paint settings will 1309: * apply. 1310: * 1311: * @return The paint (possibly <code>null</code>). 1312: * 1313: * @see #setItemLabelPaint(Paint) 1314: * 1315: * @deprecated This method should no longer be used (as of version 1.0.6). 1316: * It is sufficient to rely on {@link #getSeriesItemLabelPaint(int)} 1317: * and {@link #getBaseItemLabelPaint()}. 1318: */ 1319: public Paint getItemLabelPaint(); 1320: 1321: /** 1322: * Sets the item label paint for ALL series and sends a 1323: * {@link RendererChangeEvent} to all registered listeners. 1324: * 1325: * @param paint the paint (<code>null</code> permitted). 1326: * 1327: * @see #getItemLabelPaint() 1328: * 1329: * @deprecated This method should no longer be used (as of version 1.0.6). 1330: * It is sufficient to rely on {@link #setSeriesItemLabelPaint(int, 1331: * Paint)} and {@link #setBaseItemLabelPaint(Paint)}. 1332: */ 1333: public void setItemLabelPaint(Paint paint); 1334: 1335: /** 1336: * Returns the paint used to draw the item labels for a series. 1337: * 1338: * @param series the series index (zero based). 1339: * 1340: * @return The paint (possibly <code>null<code>). 1341: * 1342: * @see #setSeriesItemLabelPaint(int, Paint) 1343: */ 1344: public Paint getSeriesItemLabelPaint(int series); 1345: 1346: /** 1347: * Sets the item label paint for a series and sends a 1348: * {@link RendererChangeEvent} to all registered listeners. 1349: * 1350: * @param series the series (zero based index). 1351: * @param paint the paint (<code>null</code> permitted). 1352: * 1353: * @see #getSeriesItemLabelPaint(int) 1354: */ 1355: public void setSeriesItemLabelPaint(int series, Paint paint); 1356: 1357: // FIXME: add setSeriesItemLabelPaint(int, Paint, boolean) ? 1358: 1359: /** 1360: * Returns the base item label paint. 1361: * 1362: * @return The paint (never <code>null<code>). 1363: * 1364: * @see #setBaseItemLabelPaint(Paint) 1365: */ 1366: public Paint getBaseItemLabelPaint(); 1367: 1368: /** 1369: * Sets the base item label paint and sends a {@link RendererChangeEvent} 1370: * to all registered listeners. 1371: * 1372: * @param paint the paint (<code>null</code> not permitted). 1373: * 1374: * @see #getBaseItemLabelPaint() 1375: */ 1376: public void setBaseItemLabelPaint(Paint paint); 1377: 1378: // FIXME: add setBaseItemLabelPaint(Paint, boolean) ? 1379: 1380: // POSITIVE ITEM LABEL POSITION... 1381: 1382: /** 1383: * Returns the item label position for positive values. 1384: * 1385: * @param row the row index (zero-based). 1386: * @param column the column index (zero-based). 1387: * 1388: * @return The item label position (never <code>null</code>). 1389: */ 1390: public ItemLabelPosition getPositiveItemLabelPosition(int row, int column); 1391: 1392: /** 1393: * Returns the item label position for positive values in ALL series. 1394: * 1395: * @return The item label position (possibly <code>null</code>). 1396: * 1397: * @see #setPositiveItemLabelPosition(ItemLabelPosition) 1398: * 1399: * @deprecated This method should no longer be used (as of version 1.0.6). 1400: * It is sufficient to rely on 1401: * {@link #getSeriesPositiveItemLabelPosition(int)} 1402: * and {@link #getBasePositiveItemLabelPosition()}. 1403: */ 1404: public ItemLabelPosition getPositiveItemLabelPosition(); 1405: 1406: /** 1407: * Sets the item label position for positive values in ALL series, and 1408: * sends a {@link RendererChangeEvent} to all registered listeners. You 1409: * need to set this to <code>null</code> to expose the settings for 1410: * individual series. 1411: * 1412: * @param position the position (<code>null</code> permitted). 1413: * 1414: * @see #getPositiveItemLabelPosition() 1415: * 1416: * @deprecated This method should no longer be used (as of version 1.0.6). 1417: * It is sufficient to rely on 1418: * {@link #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition)} 1419: * and {@link #setBasePositiveItemLabelPosition(ItemLabelPosition)}. 1420: */ 1421: public void setPositiveItemLabelPosition(ItemLabelPosition position); 1422: 1423: /** 1424: * Sets the positive item label position for ALL series and (if requested) 1425: * sends a {@link RendererChangeEvent} to all registered listeners. 1426: * 1427: * @param position the position (<code>null</code> permitted). 1428: * @param notify notify registered listeners? 1429: * 1430: * @see #getPositiveItemLabelPosition() 1431: * 1432: * @deprecated This method should no longer be used (as of version 1.0.6). 1433: * It is sufficient to rely on 1434: * {@link #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition, 1435: * boolean)} and {@link #setBasePositiveItemLabelPosition( 1436: * ItemLabelPosition, boolean)}. 1437: */ 1438: public void setPositiveItemLabelPosition(ItemLabelPosition position, 1439: boolean notify); 1440: 1441: /** 1442: * Returns the item label position for all positive values in a series. 1443: * 1444: * @param series the series index (zero-based). 1445: * 1446: * @return The item label position. 1447: * 1448: * @see #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition) 1449: */ 1450: public ItemLabelPosition getSeriesPositiveItemLabelPosition(int series); 1451: 1452: /** 1453: * Sets the item label position for all positive values in a series and 1454: * sends a {@link RendererChangeEvent} to all registered listeners. 1455: * 1456: * @param series the series index (zero-based). 1457: * @param position the position (<code>null</code> permitted). 1458: * 1459: * @see #getSeriesPositiveItemLabelPosition(int) 1460: */ 1461: public void setSeriesPositiveItemLabelPosition(int series, 1462: ItemLabelPosition position); 1463: 1464: /** 1465: * Sets the item label position for all positive values in a series and (if 1466: * requested) sends a {@link RendererChangeEvent} to all registered 1467: * listeners. 1468: * 1469: * @param series the series index (zero-based). 1470: * @param position the position (<code>null</code> permitted). 1471: * @param notify notify registered listeners? 1472: * 1473: * @see #getSeriesPositiveItemLabelPosition(int) 1474: */ 1475: public void setSeriesPositiveItemLabelPosition(int series, 1476: ItemLabelPosition position, boolean notify); 1477: 1478: /** 1479: * Returns the base positive item label position. 1480: * 1481: * @return The position. 1482: * 1483: * @see #setBasePositiveItemLabelPosition(ItemLabelPosition) 1484: */ 1485: public ItemLabelPosition getBasePositiveItemLabelPosition(); 1486: 1487: /** 1488: * Sets the base positive item label position. 1489: * 1490: * @param position the position. 1491: * 1492: * @see #getBasePositiveItemLabelPosition() 1493: */ 1494: public void setBasePositiveItemLabelPosition(ItemLabelPosition position); 1495: 1496: /** 1497: * Sets the base positive item label position and, if requested, sends a 1498: * {@link RendererChangeEvent} to all registered listeners. 1499: * 1500: * @param position the position. 1501: * @param notify notify registered listeners? 1502: * 1503: * @see #getBasePositiveItemLabelPosition() 1504: */ 1505: public void setBasePositiveItemLabelPosition(ItemLabelPosition position, 1506: boolean notify); 1507: 1508: 1509: // NEGATIVE ITEM LABEL POSITION... 1510: 1511: /** 1512: * Returns the item label position for negative values. This method can be 1513: * overridden to provide customisation of the item label position for 1514: * individual data items. 1515: * 1516: * @param row the row index (zero-based). 1517: * @param column the column (zero-based). 1518: * 1519: * @return The item label position. 1520: */ 1521: public ItemLabelPosition getNegativeItemLabelPosition(int row, int column); 1522: 1523: /** 1524: * Returns the item label position for negative values in ALL series. 1525: * 1526: * @return The item label position (possibly <code>null</code>). 1527: * 1528: * @see #setNegativeItemLabelPosition(ItemLabelPosition) 1529: * 1530: * @deprecated This method should no longer be used (as of version 1.0.6). 1531: * It is sufficient to rely on 1532: * {@link #getSeriesNegativeItemLabelPosition(int)} 1533: * and {@link #getBaseNegativeItemLabelPosition()}. 1534: */ 1535: public ItemLabelPosition getNegativeItemLabelPosition(); 1536: 1537: /** 1538: * Sets the item label position for negative values in ALL series, and 1539: * sends a {@link RendererChangeEvent} to all registered listeners. You 1540: * need to set this to <code>null</code> to expose the settings for 1541: * individual series. 1542: * 1543: * @param position the position (<code>null</code> permitted). 1544: * 1545: * @see #getNegativeItemLabelPosition() 1546: * 1547: * @deprecated This method should no longer be used (as of version 1.0.6). 1548: * It is sufficient to rely on 1549: * {@link #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition)} 1550: * and {@link #setBaseNegativeItemLabelPosition(ItemLabelPosition)}. 1551: */ 1552: public void setNegativeItemLabelPosition(ItemLabelPosition position); 1553: 1554: /** 1555: * Sets the item label position for negative values in ALL series and (if 1556: * requested) sends a {@link RendererChangeEvent} to all registered 1557: * listeners. 1558: * 1559: * @param position the position (<code>null</code> permitted). 1560: * @param notify notify registered listeners? 1561: * 1562: * @see #getNegativeItemLabelPosition() 1563: * 1564: * @deprecated This method should no longer be used (as of version 1.0.6). 1565: * It is sufficient to rely on 1566: * {@link #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition, 1567: * boolean)} and {@link #setBaseNegativeItemLabelPosition( 1568: * ItemLabelPosition, boolean)}. 1569: */ 1570: public void setNegativeItemLabelPosition(ItemLabelPosition position, 1571: boolean notify); 1572: 1573: /** 1574: * Returns the item label position for all negative values in a series. 1575: * 1576: * @param series the series index (zero-based). 1577: * 1578: * @return The item label position. 1579: * 1580: * @see #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition) 1581: */ 1582: public ItemLabelPosition getSeriesNegativeItemLabelPosition(int series); 1583: 1584: /** 1585: * Sets the item label position for negative values in a series and sends a 1586: * {@link RendererChangeEvent} to all registered listeners. 1587: * 1588: * @param series the series index (zero-based). 1589: * @param position the position (<code>null</code> permitted). 1590: * 1591: * @see #getSeriesNegativeItemLabelPosition(int) 1592: */ 1593: public void setSeriesNegativeItemLabelPosition(int series, 1594: ItemLabelPosition position); 1595: 1596: /** 1597: * Sets the item label position for negative values in a series and (if 1598: * requested) sends a {@link RendererChangeEvent} to all registered 1599: * listeners. 1600: * 1601: * @param series the series index (zero-based). 1602: * @param position the position (<code>null</code> permitted). 1603: * @param notify notify registered listeners? 1604: * 1605: * @see #getSeriesNegativeItemLabelPosition(int) 1606: */ 1607: public void setSeriesNegativeItemLabelPosition(int series, 1608: ItemLabelPosition position, 1609: boolean notify); 1610: 1611: /** 1612: * Returns the base item label position for negative values. 1613: * 1614: * @return The position. 1615: * 1616: * @see #setBaseNegativeItemLabelPosition(ItemLabelPosition) 1617: */ 1618: public ItemLabelPosition getBaseNegativeItemLabelPosition(); 1619: 1620: /** 1621: * Sets the base item label position for negative values and sends a 1622: * {@link RendererChangeEvent} to all registered listeners. 1623: * 1624: * @param position the position. 1625: * 1626: * @see #getBaseNegativeItemLabelPosition() 1627: */ 1628: public void setBaseNegativeItemLabelPosition(ItemLabelPosition position); 1629: 1630: /** 1631: * Sets the base negative item label position and, if requested, sends a 1632: * {@link RendererChangeEvent} to all registered listeners. 1633: * 1634: * @param position the position. 1635: * @param notify notify registered listeners? 1636: * 1637: * @see #getBaseNegativeItemLabelPosition() 1638: */ 1639: public void setBaseNegativeItemLabelPosition(ItemLabelPosition position, 1640: boolean notify); 1641: 1642: // CREATE ENTITIES 1643: // FIXME: these methods should be defined 1644: 1645: // public boolean getItemCreateEntity(int series, int item); 1646: // 1647: // public Boolean getSeriesCreateEntities(int series); 1648: // 1649: // public void setSeriesCreateEntities(int series, Boolean create); 1650: // 1651: // public void setSeriesCreateEntities(int series, Boolean create, 1652: // boolean notify); 1653: // 1654: // public boolean getBaseCreateEntities(); 1655: // 1656: // public void setBaseCreateEntities(boolean create); 1657: // 1658: // public void setBaseCreateEntities(boolean create, boolean notify); 1659: 1660: 1661: // ITEM URL GENERATOR 1662: 1663: /** 1664: * Returns the URL generator for an item. 1665: * 1666: * @param series the series index (zero-based). 1667: * @param item the item index (zero-based). 1668: * 1669: * @return The item URL generator. 1670: */ 1671: public CategoryURLGenerator getItemURLGenerator(int series, int item); 1672: 1673: /** 1674: * Sets the item URL generator for ALL series. 1675: * 1676: * @param generator the generator. 1677: * 1678: * @see #getSeriesItemURLGenerator(int) 1679: * 1680: * @deprecated This method should no longer be used (as of version 1.0.6). 1681: * It is sufficient to rely on {@link #setSeriesItemURLGenerator(int, 1682: * CategoryURLGenerator)} and 1683: * {@link #setBaseItemURLGenerator(CategoryURLGenerator)}. 1684: */ 1685: public void setItemURLGenerator(CategoryURLGenerator generator); 1686: 1687: /** 1688: * Returns the item URL generator for a series. 1689: * 1690: * @param series the series index (zero-based). 1691: * 1692: * @return The URL generator. 1693: * 1694: * @see #setSeriesItemURLGenerator(int, CategoryURLGenerator) 1695: */ 1696: public CategoryURLGenerator getSeriesItemURLGenerator(int series); 1697: 1698: /** 1699: * Sets the item URL generator for a series. 1700: * 1701: * @param series the series index (zero-based). 1702: * @param generator the generator. 1703: * 1704: * @see #getSeriesItemURLGenerator(int) 1705: */ 1706: public void setSeriesItemURLGenerator(int series, 1707: CategoryURLGenerator generator); 1708: 1709: // FIXME: add setSeriesItemURLGenerator(int, CategoryURLGenerator, boolean)? 1710: 1711: /** 1712: * Returns the base item URL generator. 1713: * 1714: * @return The item URL generator (possibly <code>null</code>). 1715: * 1716: * @see #setBaseItemURLGenerator(CategoryURLGenerator) 1717: */ 1718: public CategoryURLGenerator getBaseItemURLGenerator(); 1719: 1720: /** 1721: * Sets the base item URL generator and sends a {@link RendererChangeEvent} 1722: * to all registered listeners. 1723: * 1724: * @param generator the item URL generator (<code>null</code> permitted). 1725: * 1726: * @see #getBaseItemURLGenerator() 1727: */ 1728: public void setBaseItemURLGenerator(CategoryURLGenerator generator); 1729: 1730: // FIXME: add setBaseItemURLGenerator(CategoryURLGenerator, boolean) ? 1731: 1732: /** 1733: * Returns a legend item for a series. This method can return 1734: * <code>null</code>, in which case the series will have no entry in the 1735: * legend. 1736: * 1737: * @param datasetIndex the dataset index (zero-based). 1738: * @param series the series (zero-based index). 1739: * 1740: * @return The legend item (possibly <code>null</code>). 1741: */ 1742: public LegendItem getLegendItem(int datasetIndex, int series); 1743: 1744: /** 1745: * Draws a background for the data area. 1746: * 1747: * @param g2 the graphics device. 1748: * @param plot the plot. 1749: * @param dataArea the data area. 1750: */ 1751: public void drawBackground(Graphics2D g2, 1752: CategoryPlot plot, 1753: Rectangle2D dataArea); 1754: 1755: /** 1756: * Draws an outline for the data area. 1757: * 1758: * @param g2 the graphics device. 1759: * @param plot the plot. 1760: * @param dataArea the data area. 1761: */ 1762: public void drawOutline(Graphics2D g2, 1763: CategoryPlot plot, 1764: Rectangle2D dataArea); 1765: 1766: /** 1767: * Draws a single data item. 1768: * 1769: * @param g2 the graphics device. 1770: * @param state state information for one chart. 1771: * @param dataArea the data plot area. 1772: * @param plot the plot. 1773: * @param domainAxis the domain axis. 1774: * @param rangeAxis the range axis. 1775: * @param dataset the data. 1776: * @param row the row index (zero-based). 1777: * @param column the column index (zero-based). 1778: * @param pass the pass index. 1779: */ 1780: public void drawItem(Graphics2D g2, 1781: CategoryItemRendererState state, 1782: Rectangle2D dataArea, 1783: CategoryPlot plot, 1784: CategoryAxis domainAxis, 1785: ValueAxis rangeAxis, 1786: CategoryDataset dataset, 1787: int row, 1788: int column, 1789: int pass); 1790: 1791: /** 1792: * Draws a grid line against the domain axis. 1793: * 1794: * @param g2 the graphics device. 1795: * @param plot the plot. 1796: * @param dataArea the area for plotting data (not yet adjusted for any 1797: * 3D effect). 1798: * @param value the value. 1799: * 1800: * @see #drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis, 1801: * Rectangle2D, double) 1802: */ 1803: public void drawDomainGridline(Graphics2D g2, 1804: CategoryPlot plot, 1805: Rectangle2D dataArea, 1806: 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, 1821: CategoryPlot plot, 1822: ValueAxis axis, 1823: Rectangle2D dataArea, 1824: double value); 1825: 1826: /** 1827: * Draws a line (or some other marker) to indicate a particular category on 1828: * the domain axis. 1829: * 1830: * @param g2 the graphics device. 1831: * @param plot the plot. 1832: * @param axis the category axis. 1833: * @param marker the marker. 1834: * @param dataArea the area for plotting data (not including 3D effect). 1835: * 1836: * @see #drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, 1837: * Rectangle2D) 1838: */ 1839: public void drawDomainMarker(Graphics2D g2, 1840: CategoryPlot plot, 1841: CategoryAxis axis, 1842: CategoryMarker marker, 1843: Rectangle2D dataArea); 1844: 1845: /** 1846: * Draws a line (or some other marker) to indicate a particular value on 1847: * the range axis. 1848: * 1849: * @param g2 the graphics device. 1850: * @param plot the plot. 1851: * @param axis the value axis. 1852: * @param marker the marker. 1853: * @param dataArea the area for plotting data (not including 3D effect). 1854: * 1855: * @see #drawDomainMarker(Graphics2D, CategoryPlot, CategoryAxis, 1856: * CategoryMarker, Rectangle2D) 1857: */ 1858: public void drawRangeMarker(Graphics2D g2, 1859: CategoryPlot plot, 1860: ValueAxis axis, 1861: Marker marker, 1862: Rectangle2D dataArea); 1863: 1864: }