001/* =========================================================== 002 * JFreeChart : a free chart library for the Java(tm) platform 003 * =========================================================== 004 * 005 * (C) Copyright 2000-present, by David Gilbert and Contributors. 006 * 007 * Project Info: http://www.jfree.org/jfreechart/index.html 008 * 009 * This library is free software; you can redistribute it and/or modify it 010 * under the terms of the GNU Lesser General Public License as published by 011 * the Free Software Foundation; either version 2.1 of the License, or 012 * (at your option) any later version. 013 * 014 * This library is distributed in the hope that it will be useful, but 015 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 016 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 017 * License for more details. 018 * 019 * You should have received a copy of the GNU Lesser General Public 020 * License along with this library; if not, write to the Free Software 021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 022 * USA. 023 * 024 * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 025 * Other names may be trademarks of their respective owners.] 026 * 027 * ------------------------- 028 * CategoryItemRenderer.java 029 * ------------------------- 030 * 031 * (C) Copyright 2001-present, by David Gilbert and Contributors. 032 * 033 * Original Author: David Gilbert; 034 * Contributor(s): Mark Watson (www.markwatson.com); 035 * 036 */ 037 038package org.jfree.chart.renderer.category; 039 040import java.awt.Font; 041import java.awt.Graphics2D; 042import java.awt.Paint; 043import java.awt.Shape; 044import java.awt.Stroke; 045import java.awt.geom.Rectangle2D; 046 047import org.jfree.chart.LegendItem; 048import org.jfree.chart.LegendItemSource; 049import org.jfree.chart.axis.CategoryAxis; 050import org.jfree.chart.axis.ValueAxis; 051import org.jfree.chart.event.RendererChangeEvent; 052import org.jfree.chart.event.RendererChangeListener; 053import org.jfree.chart.labels.CategoryItemLabelGenerator; 054import org.jfree.chart.labels.CategoryToolTipGenerator; 055import org.jfree.chart.labels.ItemLabelPosition; 056import org.jfree.chart.plot.CategoryMarker; 057import org.jfree.chart.plot.CategoryPlot; 058import org.jfree.chart.plot.Marker; 059import org.jfree.chart.plot.PlotRenderingInfo; 060import org.jfree.chart.ui.RectangleEdge; 061import org.jfree.chart.urls.CategoryURLGenerator; 062import org.jfree.data.Range; 063import org.jfree.data.category.CategoryDataset; 064 065/** 066 * A plug-in object that is used by the {@link CategoryPlot} class to display 067 * individual data items from a {@link CategoryDataset}. 068 * <p> 069 * This interface defines the methods that must be provided by all renderers. 070 * If you are implementing a custom renderer, you should consider extending the 071 * {@link AbstractCategoryItemRenderer} class. 072 * <p> 073 * Most renderer attributes are defined using a two layer approach. When 074 * looking up an attribute (for example, the outline paint) the renderer first 075 * checks to see if there is a setting that applies to a specific series 076 * that the renderer draws. If there is, that setting is used, but if it is 077 * {@code null} the renderer looks up the default setting. Some attributes 078 * allow the base setting to be {@code null}, while other attributes enforce 079 * non-{@code null} values. 080 */ 081public interface CategoryItemRenderer extends LegendItemSource { 082 083 /** 084 * Returns the number of passes through the dataset required by the 085 * renderer. Usually this will be one, but some renderers may use 086 * a second or third pass to overlay items on top of things that were 087 * drawn in an earlier pass. 088 * 089 * @return The pass count. 090 */ 091 int getPassCount(); 092 093 /** 094 * Returns the plot that the renderer has been assigned to (where 095 * {@code null} indicates that the renderer is not currently assigned 096 * to a plot). 097 * 098 * @return The plot (possibly {@code null}). 099 * 100 * @see #setPlot(CategoryPlot) 101 */ 102 CategoryPlot getPlot(); 103 104 /** 105 * Sets the plot that the renderer has been assigned to. This method is 106 * usually called by the {@link CategoryPlot}, in normal usage you 107 * shouldn't need to call this method directly. 108 * 109 * @param plot the plot ({@code null} not permitted). 110 * 111 * @see #getPlot() 112 */ 113 void setPlot(CategoryPlot plot); 114 115 /** 116 * Adds a change listener. 117 * 118 * @param listener the listener. 119 * 120 * @see #removeChangeListener(RendererChangeListener) 121 */ 122 void addChangeListener(RendererChangeListener listener); 123 124 /** 125 * Removes a change listener. 126 * 127 * @param listener the listener. 128 * 129 * @see #addChangeListener(RendererChangeListener) 130 */ 131 void removeChangeListener(RendererChangeListener listener); 132 133 /** 134 * Returns the range of values the renderer requires to display all the 135 * items from the specified dataset. 136 * 137 * @param dataset the dataset ({@code null} permitted). 138 * 139 * @return The range (or {@code null} if the dataset is 140 * {@code null} or empty). 141 */ 142 Range findRangeBounds(CategoryDataset dataset); 143 144 /** 145 * Initialises the renderer. This method will be called before the first 146 * item is rendered, giving the renderer an opportunity to initialise any 147 * state information it wants to maintain. The renderer can do nothing if 148 * it chooses. 149 * 150 * @param g2 the graphics device. 151 * @param dataArea the area inside the axes. 152 * @param plot the plot. 153 * @param rendererIndex the renderer index. 154 * @param info collects chart rendering information for return to caller. 155 * 156 * @return A state object (maintains state information relevant to one 157 * chart drawing). 158 */ 159 CategoryItemRendererState initialise(Graphics2D g2, 160 Rectangle2D dataArea, 161 CategoryPlot plot, 162 int rendererIndex, 163 PlotRenderingInfo info); 164 165 /** 166 * Returns a boolean that indicates whether or not the specified item 167 * should be drawn (this is typically used to hide an entire series). 168 * 169 * @param series the series index. 170 * @param item the item index. 171 * 172 * @return A boolean. 173 */ 174 boolean getItemVisible(int series, int item); 175 176 /** 177 * Returns a boolean that indicates whether or not the specified series 178 * should be drawn (this is typically used to hide an entire series). 179 * 180 * @param series the series index. 181 * 182 * @return A boolean. 183 */ 184 boolean isSeriesVisible(int series); 185 186 /** 187 * Returns the flag that controls whether a series is visible. 188 * 189 * @param series the series index (zero-based). 190 * 191 * @return The flag (possibly {@code null}). 192 * 193 * @see #setSeriesVisible(int, Boolean) 194 */ 195 Boolean getSeriesVisible(int series); 196 197 /** 198 * Sets the flag that controls whether a series is visible and sends a 199 * {@link RendererChangeEvent} to all registered listeners. 200 * 201 * @param series the series index (zero-based). 202 * @param visible the flag ({@code null} permitted). 203 * 204 * @see #getSeriesVisible(int) 205 */ 206 void setSeriesVisible(int series, Boolean visible); 207 208 /** 209 * Sets the flag that controls whether a series is visible and, if 210 * requested, sends a {@link RendererChangeEvent} to all registered 211 * listeners. 212 * 213 * @param series the series index. 214 * @param visible the flag ({@code null} permitted). 215 * @param notify notify listeners? 216 * 217 * @see #getSeriesVisible(int) 218 */ 219 void setSeriesVisible(int series, Boolean visible, boolean notify); 220 221 /** 222 * Returns the default visibility for all series. 223 * 224 * @return The default visibility. 225 * 226 * @see #setDefaultSeriesVisible(boolean) 227 */ 228 boolean getDefaultSeriesVisible(); 229 230 /** 231 * Sets the default visibility and sends a {@link RendererChangeEvent} to all 232 * registered listeners. 233 * 234 * @param visible the flag. 235 * 236 * @see #getDefaultSeriesVisible() 237 */ 238 void setDefaultSeriesVisible(boolean visible); 239 240 /** 241 * Sets the default visibility and, if requested, sends 242 * a {@link RendererChangeEvent} to all registered listeners. 243 * 244 * @param visible the visibility. 245 * @param notify notify listeners? 246 * 247 * @see #getDefaultSeriesVisible() 248 */ 249 void setDefaultSeriesVisible(boolean visible, boolean notify); 250 251 // SERIES VISIBLE IN LEGEND (not yet respected by all renderers) 252 253 /** 254 * Returns {@code true} if the series should be shown in the legend, 255 * and {@code false} otherwise. 256 * 257 * @param series the series index. 258 * 259 * @return A boolean. 260 */ 261 boolean isSeriesVisibleInLegend(int series); 262 263 /** 264 * Returns the flag that controls whether a series is visible in the 265 * legend. This method returns only the "per series" settings - to 266 * incorporate the override and base settings as well, you need to use the 267 * {@link #isSeriesVisibleInLegend(int)} method. 268 * 269 * @param series the series index (zero-based). 270 * 271 * @return The flag (possibly {@code null}). 272 * 273 * @see #setSeriesVisibleInLegend(int, Boolean) 274 */ 275 Boolean getSeriesVisibleInLegend(int series); 276 277 /** 278 * Sets the flag that controls whether a series is visible in the legend 279 * and sends a {@link RendererChangeEvent} to all registered listeners. 280 * 281 * @param series the series index (zero-based). 282 * @param visible the flag ({@code null} permitted). 283 * 284 * @see #getSeriesVisibleInLegend(int) 285 */ 286 void setSeriesVisibleInLegend(int series, Boolean visible); 287 288 /** 289 * Sets the flag that controls whether a series is visible in the legend 290 * and, if requested, sends a {@link RendererChangeEvent} to all registered 291 * listeners. 292 * 293 * @param series the series index. 294 * @param visible the flag ({@code null} permitted). 295 * @param notify notify listeners? 296 * 297 * @see #getSeriesVisibleInLegend(int) 298 */ 299 void setSeriesVisibleInLegend(int series, Boolean visible, 300 boolean notify); 301 302 /** 303 * Returns the default visibility in the legend for all series. 304 * 305 * @return The default visibility. 306 * 307 * @see #setDefaultSeriesVisibleInLegend(boolean) 308 */ 309 boolean getDefaultSeriesVisibleInLegend(); 310 311 /** 312 * Sets the default visibility in the legend and sends a 313 * {@link RendererChangeEvent} to all registered listeners. 314 * 315 * @param visible the flag. 316 * 317 * @see #getDefaultSeriesVisibleInLegend() 318 */ 319 void setDefaultSeriesVisibleInLegend(boolean visible); 320 321 /** 322 * Sets the default visibility in the legend and, if requested, sends 323 * a {@link RendererChangeEvent} to all registered listeners. 324 * 325 * @param visible the visibility. 326 * @param notify notify listeners? 327 * 328 * @see #getDefaultSeriesVisibleInLegend() 329 */ 330 void setDefaultSeriesVisibleInLegend(boolean visible, boolean notify); 331 332 333 //// PAINT ///////////////////////////////////////////////////////////////// 334 335 /** 336 * Returns the paint used to fill data items as they are drawn. 337 * 338 * @param row the row (or series) index (zero-based). 339 * @param column the column (or category) index (zero-based). 340 * 341 * @return The paint (never {@code null}). 342 */ 343 Paint getItemPaint(int row, int column); 344 345 /** 346 * Returns the paint used to fill an item drawn by the renderer. 347 * 348 * @param series the series index (zero-based). 349 * 350 * @return The paint (possibly {@code null}). 351 * 352 * @see #setSeriesPaint(int, Paint) 353 */ 354 Paint getSeriesPaint(int series); 355 356 /** 357 * Sets the paint used for a series and sends a {@link RendererChangeEvent} 358 * to all registered listeners. 359 * 360 * @param series the series index (zero-based). 361 * @param paint the paint ({@code null} permitted). 362 * 363 * @see #getSeriesPaint(int) 364 */ 365 void setSeriesPaint(int series, Paint paint); 366 367 /** 368 * Sets the paint used for a series and, if requested, sends a 369 * {@link RendererChangeEvent} to all registered listeners. 370 * 371 * @param series the series index (zero-based). 372 * @param paint the paint ({@code null} permitted). 373 * @param notify notify listeners? 374 */ 375 void setSeriesPaint(int series, Paint paint, boolean notify); 376 377 /** 378 * Returns the default paint. During rendering, a renderer will first look 379 * up the series paint and, if this is {@code null}, it will use the 380 * default paint. 381 * 382 * @return The default paint (never {@code null}). 383 * 384 * @see #setDefaultPaint(Paint) 385 */ 386 Paint getDefaultPaint(); 387 388 /** 389 * Sets the default paint and sends a {@link RendererChangeEvent} to all 390 * registered listeners. 391 * 392 * @param paint the paint ({@code null} not permitted). 393 * 394 * @see #getDefaultPaint() 395 */ 396 void setDefaultPaint(Paint paint); 397 398 /** 399 * Sets the default paint and, if requested, sends a 400 * {@link RendererChangeEvent} to all registered listeners. 401 * 402 * @param paint the paint ({@code null} not permitted). 403 * @param notify notify listeners? 404 * 405 * @see #getDefaultPaint() 406 */ 407 void setDefaultPaint(Paint paint, boolean notify); 408 409 //// FILL PAINT ///////////////////////////////////////////////////////// 410 411 /** 412 * Returns the paint used to fill data items as they are drawn. 413 * 414 * @param row the row (or series) index (zero-based). 415 * @param column the column (or category) index (zero-based). 416 * 417 * @return The paint (never {@code null}). 418 */ 419 Paint getItemFillPaint(int row, int column); 420 421 /** 422 * Returns the paint used to fill an item drawn by the renderer. 423 * 424 * @param series the series (zero-based index). 425 * 426 * @return The paint (possibly {@code null}). 427 * 428 * @see #setSeriesFillPaint(int, Paint) 429 */ 430 Paint getSeriesFillPaint(int series); 431 432 /** 433 * Sets the paint used for a series outline and sends a 434 * {@link RendererChangeEvent} to all registered listeners. 435 * 436 * @param series the series index (zero-based). 437 * @param paint the paint ({@code null} permitted). 438 * 439 * @see #getSeriesFillPaint(int) 440 */ 441 void setSeriesFillPaint(int series, Paint paint); 442 443 /** 444 * Returns the default outline paint. 445 * 446 * @return The paint (never {@code null}). 447 * 448 * @see #setDefaultFillPaint(Paint) 449 */ 450 Paint getDefaultFillPaint(); 451 452 /** 453 * Sets the default outline paint and sends a {@link RendererChangeEvent} to 454 * all registered listeners. 455 * 456 * @param paint the paint ({@code null} not permitted). 457 * 458 * @see #getDefaultFillPaint() 459 */ 460 void setDefaultFillPaint(Paint paint); 461 462 //// OUTLINE PAINT ///////////////////////////////////////////////////////// 463 464 /** 465 * Returns the paint used to outline data items as they are drawn. 466 * 467 * @param row the row (or series) index (zero-based). 468 * @param column the column (or category) index (zero-based). 469 * 470 * @return The paint (never {@code null}). 471 */ 472 Paint getItemOutlinePaint(int row, int column); 473 474 /** 475 * Returns the paint used to outline an item drawn by the renderer. 476 * 477 * @param series the series (zero-based index). 478 * 479 * @return The paint (possibly {@code null}). 480 * 481 * @see #setSeriesOutlinePaint(int, Paint) 482 */ 483 Paint getSeriesOutlinePaint(int series); 484 485 /** 486 * Sets the paint used for a series outline and sends a 487 * {@link RendererChangeEvent} to all registered listeners. 488 * 489 * @param series the series index (zero-based). 490 * @param paint the paint ({@code null} permitted). 491 * 492 * @see #getSeriesOutlinePaint(int) 493 */ 494 void setSeriesOutlinePaint(int series, Paint paint); 495 496 /** 497 * Sets the paint used for a series outline and, if requested, sends a 498 * {@link RendererChangeEvent} to all registered listeners. 499 * 500 * @param series the series index (zero-based). 501 * @param paint the paint ({@code null} permitted). 502 * @param notify notify listeners? 503 * 504 * @see #getSeriesOutlinePaint(int) 505 */ 506 void setSeriesOutlinePaint(int series, Paint paint, boolean notify); 507 508 /** 509 * Returns the default outline paint. During rendering, the renderer 510 * will look up the series outline paint and, if this is {@code null}, it 511 * will use the default outline paint. 512 * 513 * @return The paint (never {@code null}). 514 * 515 * @see #setDefaultOutlinePaint(Paint) 516 */ 517 Paint getDefaultOutlinePaint(); 518 519 /** 520 * Sets the default outline paint and sends a {@link RendererChangeEvent} to 521 * all registered listeners. 522 * 523 * @param paint the paint ({@code null} not permitted). 524 * 525 * @see #getDefaultOutlinePaint() 526 */ 527 void setDefaultOutlinePaint(Paint paint); 528 529 /** 530 * Sets the default outline paint and, if requested, sends a 531 * {@link RendererChangeEvent} to all registered listeners. 532 * 533 * @param paint the paint ({@code null} not permitted). 534 * @param notify notify listeners? 535 * 536 * @see #getDefaultOutlinePaint() 537 */ 538 void setDefaultOutlinePaint(Paint paint, boolean notify); 539 540 //// STROKE //////////////////////////////////////////////////////////////// 541 542 /** 543 * Returns the stroke used to draw data items. 544 * 545 * @param row the row (or series) index (zero-based). 546 * @param column the column (or category) index (zero-based). 547 * 548 * @return The stroke (never {@code null}). 549 */ 550 Stroke getItemStroke(int row, int column); 551 552 /** 553 * Returns the stroke used to draw the items in a series. 554 * 555 * @param series the series (zero-based index). 556 * 557 * @return The stroke (never {@code null}). 558 * 559 * @see #setSeriesStroke(int, Stroke) 560 */ 561 Stroke getSeriesStroke(int series); 562 563 /** 564 * Sets the stroke used for a series and sends a 565 * {@link RendererChangeEvent} to all registered listeners. 566 * 567 * @param series the series index (zero-based). 568 * @param stroke the stroke ({@code null} permitted). 569 * 570 * @see #getSeriesStroke(int) 571 */ 572 void setSeriesStroke(int series, Stroke stroke); 573 574 /** 575 * Sets the stroke used for a series and, if requested, sends a 576 * {@link RendererChangeEvent} to all registered listeners. 577 * 578 * @param series the series index (zero-based). 579 * @param stroke the stroke ({@code null} permitted). 580 * @param notify notify listeners? 581 * 582 * @see #getSeriesStroke(int) 583 */ 584 void setSeriesStroke(int series, Stroke stroke, boolean notify); 585 586 /** 587 * Returns the default stroke. 588 * 589 * @return The default stroke (never {@code null}). 590 * 591 * @see #setDefaultStroke(Stroke) 592 */ 593 Stroke getDefaultStroke(); 594 595 /** 596 * Sets the default stroke and sends a {@link RendererChangeEvent} to all 597 * registered listeners. 598 * 599 * @param stroke the stroke ({@code null} not permitted). 600 * 601 * @see #getDefaultStroke() 602 */ 603 void setDefaultStroke(Stroke stroke); 604 605 /** 606 * Sets the default stroke and, if requested, sends a 607 * {@link RendererChangeEvent} to all registered listeners. 608 * 609 * @param stroke the stroke ({@code null} not permitted). 610 * @param notify notify listeners? 611 * 612 * @see #getDefaultStroke() 613 */ 614 void setDefaultStroke(Stroke stroke, boolean notify); 615 616 //// OUTLINE STROKE //////////////////////////////////////////////////////// 617 618 /** 619 * Returns the stroke used to outline data items. 620 * <p> 621 * The default implementation passes control to the 622 * lookupSeriesOutlineStroke method. You can override this method if you 623 * require different behaviour. 624 * 625 * @param row the row (or series) index (zero-based). 626 * @param column the column (or category) index (zero-based). 627 * 628 * @return The stroke (never {@code null}). 629 */ 630 Stroke getItemOutlineStroke(int row, int column); 631 632 /** 633 * Returns the stroke used to outline the items in a series. 634 * 635 * @param series the series (zero-based index). 636 * 637 * @return The stroke (possibly {@code null}). 638 * 639 * @see #setSeriesOutlineStroke(int, Stroke) 640 */ 641 Stroke getSeriesOutlineStroke(int series); 642 643 /** 644 * Sets the outline stroke used for a series and sends a 645 * {@link RendererChangeEvent} to all registered listeners. 646 * 647 * @param series the series index (zero-based). 648 * @param stroke the stroke ({@code null} permitted). 649 * 650 * @see #getSeriesOutlineStroke(int) 651 */ 652 void setSeriesOutlineStroke(int series, Stroke stroke); 653 654 /** 655 * Sets the outline stroke used for a series and, if requested, sends a 656 * {@link RendererChangeEvent} to all registered listeners. 657 * 658 * @param series the series index (zero-based). 659 * @param stroke the stroke ({@code null} permitted). 660 * @param notify notify listeners? 661 * 662 * @see #getSeriesOutlineStroke(int) 663 */ 664 void setSeriesOutlineStroke(int series, Stroke stroke, boolean notify); 665 666 /** 667 * Returns the default outline stroke. 668 * 669 * @return The stroke (never {@code null}). 670 * 671 * @see #setDefaultOutlineStroke(Stroke) 672 */ 673 Stroke getDefaultOutlineStroke(); 674 675 /** 676 * Sets the default outline stroke and sends a {@link RendererChangeEvent} to 677 * all registered listeners. 678 * 679 * @param stroke the stroke ({@code null} not permitted). 680 * 681 * @see #getDefaultOutlineStroke() 682 */ 683 void setDefaultOutlineStroke(Stroke stroke); 684 685 /** 686 * Sets the default outline stroke and, if requested, sends a 687 * {@link RendererChangeEvent} to all registered listeners. 688 * 689 * @param stroke the stroke ({@code null} not permitted). 690 * @param notify notify listeners? 691 * 692 * @see #getDefaultOutlineStroke() 693 */ 694 void setDefaultOutlineStroke(Stroke stroke, boolean notify); 695 696 //// SHAPE ///////////////////////////////////////////////////////////////// 697 698 /** 699 * Returns a shape used to represent a data item. 700 * 701 * @param row the row (or series) index (zero-based). 702 * @param column the column (or category) index (zero-based). 703 * 704 * @return The shape (never {@code null}). 705 */ 706 Shape getItemShape(int row, int column); 707 708 /** 709 * Returns a shape used to represent the items in a series. 710 * 711 * @param series the series (zero-based index). 712 * 713 * @return The shape (possibly {@code null}). 714 * 715 * @see #setSeriesShape(int, Shape) 716 */ 717 Shape getSeriesShape(int series); 718 719 /** 720 * Sets the shape used for a series and sends a {@link RendererChangeEvent} 721 * to all registered listeners. 722 * 723 * @param series the series index (zero-based). 724 * @param shape the shape ({@code null} permitted). 725 * 726 * @see #getSeriesShape(int) 727 */ 728 void setSeriesShape(int series, Shape shape); 729 730 /** 731 * Sets the shape used for a series and, if requested, sends a 732 * {@link RendererChangeEvent} to all registered listeners. 733 * 734 * @param series the series index (zero-based). 735 * @param shape the shape ({@code null} permitted). 736 * @param notify notify listeners? 737 * 738 * @see #getSeriesShape(int) 739 */ 740 void setSeriesShape(int series, Shape shape, boolean notify); 741 742 /** 743 * Returns the default shape. 744 * 745 * @return The shape (never {@code null}). 746 * 747 * @see #setDefaultShape(Shape) 748 */ 749 Shape getDefaultShape(); 750 751 /** 752 * Sets the default shape and sends a {@link RendererChangeEvent} to all 753 * registered listeners. 754 * 755 * @param shape the shape ({@code null} not permitted). 756 * 757 * @see #getDefaultShape() 758 */ 759 void setDefaultShape(Shape shape); 760 761 /** 762 * Sets the default shape and, if requested, sends a 763 * {@link RendererChangeEvent} to all registered listeners. 764 * 765 * @param shape the shape ({@code null} not permitted). 766 * @param notify notify listeners? 767 * 768 * @see #getDefaultShape() 769 */ 770 void setDefaultShape(Shape shape, boolean notify); 771 772 // ITEM LABELS VISIBLE 773 774 /** 775 * Returns {@code true} if an item label is visible, and 776 * {@code false} otherwise. 777 * 778 * @param row the row index (zero-based). 779 * @param column the column index (zero-based). 780 * 781 * @return A boolean. 782 */ 783 boolean isItemLabelVisible(int row, int column); 784 785 /** 786 * Returns {@code true} if the item labels for a series are visible, 787 * and {@code false} otherwise. 788 * 789 * @param series the series index (zero-based). 790 * 791 * @return A boolean. 792 * 793 * @see #setSeriesItemLabelsVisible(int, Boolean) 794 */ 795 boolean isSeriesItemLabelsVisible(int series); 796 797 /** 798 * Sets a flag that controls the visibility of the item labels for a series. 799 * 800 * @param series the series index (zero-based). 801 * @param visible the flag. 802 * 803 * @see #isSeriesItemLabelsVisible(int) 804 */ 805 void setSeriesItemLabelsVisible(int series, boolean visible); 806 807 /** 808 * Sets a flag that controls the visibility of the item labels for a series. 809 * 810 * @param series the series index (zero-based). 811 * @param visible the flag ({@code null} permitted). 812 * 813 * @see #isSeriesItemLabelsVisible(int) 814 */ 815 void setSeriesItemLabelsVisible(int series, Boolean visible); 816 817 /** 818 * Sets the visibility of item labels for a series and, if requested, sends 819 * a {@link RendererChangeEvent} to all registered listeners. 820 * 821 * @param series the series index (zero-based). 822 * @param visible the visible flag. 823 * @param notify a flag that controls whether or not listeners are 824 * notified. 825 * 826 * @see #isSeriesItemLabelsVisible(int) 827 */ 828 void setSeriesItemLabelsVisible(int series, Boolean visible, 829 boolean notify); 830 831 /** 832 * Returns the default setting for item label visibility. A {@code null} 833 * result should be interpreted as equivalent to {@code Boolean.FALSE} 834 * (this is an error in the API design, the return value should have been 835 * a boolean primitive). 836 * 837 * @return A flag (possibly {@code null}). 838 * 839 * @see #setDefaultItemLabelsVisible(boolean) 840 */ 841 boolean getDefaultItemLabelsVisible(); 842 843 /** 844 * Sets the default flag that controls whether or not item labels are visible 845 * and sends a {@link RendererChangeEvent} to all registered listeners. 846 * 847 * @param visible the flag. 848 * 849 * @see #getDefaultItemLabelsVisible() 850 */ 851 void setDefaultItemLabelsVisible(boolean visible); 852 853 /** 854 * Sets the default visibility for item labels and, if requested, sends a 855 * {@link RendererChangeEvent} to all registered listeners. 856 * 857 * @param visible the visibility flag. 858 * @param notify a flag that controls whether or not listeners are 859 * notified. 860 * 861 * @see #getDefaultItemLabelsVisible() 862 */ 863 void setDefaultItemLabelsVisible(boolean visible, boolean notify); 864 865 // ITEM LABEL GENERATOR 866 867 /** 868 * Returns the item label generator for the specified data item. 869 * 870 * @param series the series index (zero-based). 871 * @param item the item index (zero-based). 872 * 873 * @return The generator (possibly {@code null}). 874 */ 875 CategoryItemLabelGenerator getItemLabelGenerator(int series, 876 int item); 877 878 /** 879 * Returns the item label generator for a series. 880 * 881 * @param series the series index (zero-based). 882 * 883 * @return The label generator (possibly {@code null}). 884 * 885 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator) 886 */ 887 CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series); 888 889 /** 890 * Sets the item label generator for a series and sends a 891 * {@link RendererChangeEvent} to all registered listeners. 892 * 893 * @param series the series index (zero-based). 894 * @param generator the generator. 895 * 896 * @see #getSeriesItemLabelGenerator(int) 897 */ 898 void setSeriesItemLabelGenerator(int series, 899 CategoryItemLabelGenerator generator); 900 901 /** 902 * Sets the item label generator for a series and, if requested, sends a 903 * {@link RendererChangeEvent} to all registered listeners. 904 * 905 * @param series the series index (zero-based). 906 * @param generator the generator. 907 * @param notify notify listeners? 908 * 909 * @see #getSeriesItemLabelGenerator(int) 910 */ 911 void setSeriesItemLabelGenerator(int series, 912 CategoryItemLabelGenerator generator, boolean notify); 913 914 /** 915 * Returns the default item label generator. 916 * 917 * @return The generator (possibly {@code null}). 918 * 919 * @see #setDefaultItemLabelGenerator(CategoryItemLabelGenerator) 920 */ 921 CategoryItemLabelGenerator getDefaultItemLabelGenerator(); 922 923 /** 924 * Sets the default item label generator and sends a 925 * {@link RendererChangeEvent} to all registered listeners. 926 * 927 * @param generator the generator ({@code null} permitted). 928 * 929 * @see #getDefaultItemLabelGenerator() 930 */ 931 void setDefaultItemLabelGenerator(CategoryItemLabelGenerator generator); 932 933 /** 934 * Sets the default item label generator and, if requested, sends a 935 * {@link RendererChangeEvent} to all registered listeners. 936 * 937 * @param generator the generator ({@code null} permitted). 938 * @param notify notify listeners? 939 * 940 * @see #getDefaultItemLabelGenerator() 941 */ 942 void setDefaultItemLabelGenerator(CategoryItemLabelGenerator generator, 943 boolean notify); 944 945 // TOOL TIP GENERATOR 946 947 /** 948 * Returns the tool tip generator that should be used for the specified 949 * item. This method looks up the generator using the "three-layer" 950 * approach outlined in the general description of this interface. 951 * 952 * @param row the row index (zero-based). 953 * @param column the column index (zero-based). 954 * 955 * @return The generator (possibly {@code null}). 956 */ 957 CategoryToolTipGenerator getToolTipGenerator(int row, int column); 958 959 /** 960 * Returns the tool tip generator for the specified series (a "layer 1" 961 * generator). 962 * 963 * @param series the series index (zero-based). 964 * 965 * @return The tool tip generator (possibly {@code null}). 966 * 967 * @see #setSeriesToolTipGenerator(int, CategoryToolTipGenerator) 968 */ 969 CategoryToolTipGenerator getSeriesToolTipGenerator(int series); 970 971 /** 972 * Sets the tool tip generator for a series and sends a 973 * {@link org.jfree.chart.event.RendererChangeEvent} to all registered 974 * listeners. 975 * 976 * @param series the series index (zero-based). 977 * @param generator the generator ({@code null} permitted). 978 * 979 * @see #getSeriesToolTipGenerator(int) 980 */ 981 void setSeriesToolTipGenerator(int series, 982 CategoryToolTipGenerator generator); 983 984 /** 985 * Sets the tool tip generator for a series and, if requested, sends a 986 * {@link RendererChangeEvent} to all registered listeners. 987 * 988 * @param series the series index (zero-based). 989 * @param generator the generator ({@code null} permitted). 990 * @param notify notify listeners? 991 * 992 * @see #getSeriesToolTipGenerator(int) 993 */ 994 void setSeriesToolTipGenerator(int series, 995 CategoryToolTipGenerator generator, boolean notify); 996 997 /** 998 * Returns the default tool tip generator (the "layer 2" generator). 999 * 1000 * @return The tool tip generator (possibly {@code null}). 1001 * 1002 * @see #setDefaultToolTipGenerator(CategoryToolTipGenerator) 1003 */ 1004 CategoryToolTipGenerator getDefaultToolTipGenerator(); 1005 1006 /** 1007 * Sets the default tool tip generator and sends a 1008 * {@link org.jfree.chart.event.RendererChangeEvent} to all registered 1009 * listeners. 1010 * 1011 * @param generator the generator ({@code null} permitted). 1012 * 1013 * @see #getDefaultToolTipGenerator() 1014 */ 1015 void setDefaultToolTipGenerator(CategoryToolTipGenerator generator); 1016 1017 /** 1018 * Sets the default tool tip generator and, if requested, sends a 1019 * {@link RendererChangeEvent} to all registered listeners. 1020 * 1021 * @param generator the generator ({@code null} permitted). 1022 * @param notify notify listeners? 1023 * 1024 * @see #getDefaultToolTipGenerator() 1025 */ 1026 void setDefaultToolTipGenerator(CategoryToolTipGenerator generator, 1027 boolean notify); 1028 1029 //// ITEM LABEL FONT ////////////////////////////////////////////////////// 1030 1031 /** 1032 * Returns the font for an item label. 1033 * 1034 * @param row the row index (zero-based). 1035 * @param column the column index (zero-based). 1036 * 1037 * @return The font (never {@code null}). 1038 */ 1039 Font getItemLabelFont(int row, int column); 1040 1041 /** 1042 * Returns the font for all the item labels in a series. 1043 * 1044 * @param series the series index (zero-based). 1045 * 1046 * @return The font (possibly {@code null}). 1047 * 1048 * @see #setSeriesItemLabelFont(int, Font) 1049 */ 1050 Font getSeriesItemLabelFont(int series); 1051 1052 /** 1053 * Sets the item label font for a series and sends a 1054 * {@link RendererChangeEvent} to all registered listeners. 1055 * 1056 * @param series the series index (zero-based). 1057 * @param font the font ({@code null} permitted). 1058 * 1059 * @see #getSeriesItemLabelFont(int) 1060 */ 1061 void setSeriesItemLabelFont(int series, Font font); 1062 1063 /** 1064 * Sets the item label font for a series and, if requested, sends a 1065 * {@link RendererChangeEvent} to all registered listeners. 1066 * 1067 * @param series the series index (zero-based). 1068 * @param font the font ({@code null} permitted). 1069 * @param notify notify listeners? 1070 * 1071 * @see #getSeriesItemLabelFont(int) 1072 */ 1073 void setSeriesItemLabelFont(int series, Font font, boolean notify); 1074 1075 /** 1076 * Returns the default item label font (this is used when no other font 1077 * setting is available). 1078 * 1079 * @return The font (never {@code null}). 1080 * 1081 * @see #setDefaultItemLabelFont(Font) 1082 */ 1083 Font getDefaultItemLabelFont(); 1084 1085 /** 1086 * Sets the default item label font and sends a {@link RendererChangeEvent} 1087 * to all registered listeners. 1088 * 1089 * @param font the font ({@code null} not permitted). 1090 * 1091 * @see #getDefaultItemLabelFont() 1092 */ 1093 void setDefaultItemLabelFont(Font font); 1094 1095 /** 1096 * Sets the default item label font and sends a {@link RendererChangeEvent} 1097 * to all registered listeners. 1098 * 1099 * @param font the font ({@code null} not permitted). 1100 * @param notify notify listeners? 1101 * 1102 * @see #getDefaultItemLabelFont() 1103 */ 1104 void setDefaultItemLabelFont(Font font, boolean notify); 1105 1106 //// ITEM LABEL PAINT ///////////////////////////////////////////////////// 1107 1108 /** 1109 * Returns the paint used to draw an item label. 1110 * 1111 * @param row the row index (zero based). 1112 * @param column the column index (zero based). 1113 * 1114 * @return The paint (never {@code null}). 1115 */ 1116 Paint getItemLabelPaint(int row, int column); 1117 1118 /** 1119 * Returns the paint used to draw the item labels for a series. 1120 * 1121 * @param series the series index (zero based). 1122 * 1123 * @return The paint (possibly {@code null}). 1124 * 1125 * @see #setSeriesItemLabelPaint(int, Paint) 1126 */ 1127 Paint getSeriesItemLabelPaint(int series); 1128 1129 /** 1130 * Sets the item label paint for a series and sends a 1131 * {@link RendererChangeEvent} to all registered listeners. 1132 * 1133 * @param series the series (zero based index). 1134 * @param paint the paint ({@code null} permitted). 1135 * 1136 * @see #getSeriesItemLabelPaint(int) 1137 */ 1138 void setSeriesItemLabelPaint(int series, Paint paint); 1139 1140 /** 1141 * Sets the item label paint for a series and, if requested, sends a 1142 * {@link RendererChangeEvent} to all registered listeners. 1143 * 1144 * @param series the series (zero based index). 1145 * @param paint the paint ({@code null} permitted). 1146 * @param notify notify listeners? 1147 * 1148 * @see #getSeriesItemLabelPaint(int) 1149 */ 1150 void setSeriesItemLabelPaint(int series, Paint paint, boolean notify); 1151 1152 /** 1153 * Returns the default item label paint. 1154 * 1155 * @return The paint (never {@code null}). 1156 * 1157 * @see #setDefaultItemLabelPaint(Paint) 1158 */ 1159 Paint getDefaultItemLabelPaint(); 1160 1161 /** 1162 * Sets the default item label paint and sends a {@link RendererChangeEvent} 1163 * to all registered listeners. 1164 * 1165 * @param paint the paint ({@code null} not permitted). 1166 * 1167 * @see #getDefaultItemLabelPaint() 1168 */ 1169 void setDefaultItemLabelPaint(Paint paint); 1170 1171 /** 1172 * Sets the default item label paint and, if requested, sends a 1173 * {@link RendererChangeEvent} to all registered listeners. 1174 * 1175 * @param paint the paint ({@code null} not permitted). 1176 * @param notify notify listeners? 1177 * 1178 * @see #getDefaultItemLabelPaint() 1179 */ 1180 void setDefaultItemLabelPaint(Paint paint, boolean notify); 1181 1182 // POSITIVE ITEM LABEL POSITION... 1183 1184 /** 1185 * Returns the item label position for positive values. 1186 * 1187 * @param row the row index (zero-based). 1188 * @param column the column index (zero-based). 1189 * 1190 * @return The item label position (never {@code null}). 1191 */ 1192 ItemLabelPosition getPositiveItemLabelPosition(int row, int column); 1193 1194 /** 1195 * Returns the item label position for all positive values in a series. 1196 * 1197 * @param series the series index (zero-based). 1198 * 1199 * @return The item label position. 1200 * 1201 * @see #setSeriesPositiveItemLabelPosition(int, ItemLabelPosition) 1202 */ 1203 ItemLabelPosition getSeriesPositiveItemLabelPosition(int series); 1204 1205 /** 1206 * Sets the item label position for all positive values in a series and 1207 * sends a {@link RendererChangeEvent} to all registered listeners. 1208 * 1209 * @param series the series index (zero-based). 1210 * @param position the position ({@code null} permitted). 1211 * 1212 * @see #getSeriesPositiveItemLabelPosition(int) 1213 */ 1214 void setSeriesPositiveItemLabelPosition(int series, 1215 ItemLabelPosition position); 1216 1217 /** 1218 * Sets the item label position for all positive values in a series and (if 1219 * requested) sends a {@link RendererChangeEvent} to all registered 1220 * listeners. 1221 * 1222 * @param series the series index (zero-based). 1223 * @param position the position ({@code null} permitted). 1224 * @param notify notify registered listeners? 1225 * 1226 * @see #getSeriesPositiveItemLabelPosition(int) 1227 */ 1228 void setSeriesPositiveItemLabelPosition(int series, 1229 ItemLabelPosition position, boolean notify); 1230 1231 /** 1232 * Returns the default positive item label position. 1233 * 1234 * @return The position. 1235 * 1236 * @see #setDefaultPositiveItemLabelPosition(ItemLabelPosition) 1237 */ 1238 ItemLabelPosition getDefaultPositiveItemLabelPosition(); 1239 1240 /** 1241 * Sets the default positive item label position. 1242 * 1243 * @param position the position. 1244 * 1245 * @see #getDefaultPositiveItemLabelPosition() 1246 */ 1247 void setDefaultPositiveItemLabelPosition(ItemLabelPosition position); 1248 1249 /** 1250 * Sets the default positive item label position and, if requested, sends a 1251 * {@link RendererChangeEvent} to all registered listeners. 1252 * 1253 * @param position the position. 1254 * @param notify notify registered listeners? 1255 * 1256 * @see #getDefaultPositiveItemLabelPosition() 1257 */ 1258 void setDefaultPositiveItemLabelPosition(ItemLabelPosition position, 1259 boolean notify); 1260 1261 1262 // NEGATIVE ITEM LABEL POSITION... 1263 1264 /** 1265 * Returns the item label position for negative values. This method can be 1266 * overridden to provide customisation of the item label position for 1267 * individual data items. 1268 * 1269 * @param row the row index (zero-based). 1270 * @param column the column (zero-based). 1271 * 1272 * @return The item label position. 1273 */ 1274 ItemLabelPosition getNegativeItemLabelPosition(int row, int column); 1275 1276 /** 1277 * Returns the item label position for all negative values in a series. 1278 * 1279 * @param series the series index (zero-based). 1280 * 1281 * @return The item label position. 1282 * 1283 * @see #setSeriesNegativeItemLabelPosition(int, ItemLabelPosition) 1284 */ 1285 ItemLabelPosition getSeriesNegativeItemLabelPosition(int series); 1286 1287 /** 1288 * Sets the item label position for negative values in a series and sends a 1289 * {@link RendererChangeEvent} to all registered listeners. 1290 * 1291 * @param series the series index (zero-based). 1292 * @param position the position ({@code null} permitted). 1293 * 1294 * @see #getSeriesNegativeItemLabelPosition(int) 1295 */ 1296 void setSeriesNegativeItemLabelPosition(int series, 1297 ItemLabelPosition position); 1298 1299 /** 1300 * Sets the item label position for negative values in a series and (if 1301 * requested) sends a {@link RendererChangeEvent} to all registered 1302 * listeners. 1303 * 1304 * @param series the series index (zero-based). 1305 * @param position the position ({@code null} permitted). 1306 * @param notify notify registered listeners? 1307 * 1308 * @see #getSeriesNegativeItemLabelPosition(int) 1309 */ 1310 void setSeriesNegativeItemLabelPosition(int series, 1311 ItemLabelPosition position, boolean notify); 1312 1313 /** 1314 * Returns the default item label position for negative values. 1315 * 1316 * @return The position. 1317 * 1318 * @see #setDefaultNegativeItemLabelPosition(ItemLabelPosition) 1319 */ 1320 ItemLabelPosition getDefaultNegativeItemLabelPosition(); 1321 1322 /** 1323 * Sets the default item label position for negative values and sends a 1324 * {@link RendererChangeEvent} to all registered listeners. 1325 * 1326 * @param position the position. 1327 * 1328 * @see #getDefaultNegativeItemLabelPosition() 1329 */ 1330 void setDefaultNegativeItemLabelPosition(ItemLabelPosition position); 1331 1332 /** 1333 * Sets the default negative item label position and, if requested, sends a 1334 * {@link RendererChangeEvent} to all registered listeners. 1335 * 1336 * @param position the position. 1337 * @param notify notify registered listeners? 1338 * 1339 * @see #getDefaultNegativeItemLabelPosition() 1340 */ 1341 void setDefaultNegativeItemLabelPosition(ItemLabelPosition position, 1342 boolean notify); 1343 1344 // CREATE ENTITIES 1345 1346 /** 1347 * Returns a flag that determines whether or not an entity is generated 1348 * for the specified item. The standard implementation of this method 1349 * will typically return the flag for the series or, if that is 1350 * {@code null}, the value returned by {@link #getDefaultCreateEntities()}. 1351 * 1352 * @param series the series index (zero-based). 1353 * @param item the item index (zero-based). 1354 * 1355 * @return A boolean. 1356 */ 1357 boolean getItemCreateEntity(int series, int item); 1358 1359 /** 1360 * Returns a boolean indicating whether or not entities should be created 1361 * for the items in a series. 1362 * 1363 * @param series the series index (zero-based). 1364 * 1365 * @return The flag for the series (possibly {@code null}). 1366 */ 1367 Boolean getSeriesCreateEntities(int series); 1368 1369 /** 1370 * Sets a flag that indicates whether or not entities should be created during 1371 * rendering for the items in the specified series, and sends a 1372 * {@link RendererChangeEvent} to all registered listeners. 1373 * 1374 * @param series the series index (zero-based). 1375 * @param create the new flag value ({@code null} permitted). 1376 */ 1377 void setSeriesCreateEntities(int series, Boolean create); 1378 1379 /** 1380 * Sets a flag that indicates whether or not entities should be created during 1381 * rendering for the items in the specified series, and sends a 1382 * {@link RendererChangeEvent} to all registered listeners if requested. 1383 * 1384 * @param series the series index (zero-based). 1385 * @param create the new flag value ({@code null} permitted). 1386 * @param notify notify listeners? 1387 */ 1388 void setSeriesCreateEntities(int series, Boolean create, 1389 boolean notify); 1390 1391 /** 1392 * Returns the default value for the flag that controls whether or not 1393 * an entity is created for an item during rendering. 1394 * 1395 * @return A boolean. 1396 */ 1397 boolean getDefaultCreateEntities(); 1398 1399 /** 1400 * Sets the default value for the flag that controls whether or not an 1401 * entity is created for an item during rendering and sends a 1402 * {@link RendererChangeEvent} to all registered listeners. 1403 * 1404 * @param create the new flag value. 1405 */ 1406 void setDefaultCreateEntities(boolean create); 1407 1408 /** 1409 * Sets the default value for the flag that controls whether or not an 1410 * entity is created for an item during rendering and, if requested, sends a 1411 * {@link RendererChangeEvent} to all registered listeners. 1412 * 1413 * @param create the new flag value. 1414 * @param notify notify listeners? 1415 */ 1416 void setDefaultCreateEntities(boolean create, boolean notify); 1417 1418 1419 // ITEM URL GENERATOR 1420 1421 /** 1422 * Returns the URL generator for an item. 1423 * 1424 * @param series the series index (zero-based). 1425 * @param item the item index (zero-based). 1426 * 1427 * @return The item URL generator. 1428 */ 1429 CategoryURLGenerator getItemURLGenerator(int series, int item); 1430 1431 /** 1432 * Returns the item URL generator for a series. 1433 * 1434 * @param series the series index (zero-based). 1435 * 1436 * @return The URL generator. 1437 * 1438 * @see #setSeriesItemURLGenerator(int, CategoryURLGenerator) 1439 */ 1440 CategoryURLGenerator getSeriesItemURLGenerator(int series); 1441 1442 /** 1443 * Sets the item URL generator for a series and sends a 1444 * {@link RendererChangeEvent} to all registered listeners. 1445 * 1446 * @param series the series index (zero-based). 1447 * @param generator the generator ({@code null} permitted). 1448 * 1449 * @see #getSeriesItemURLGenerator(int) 1450 */ 1451 void setSeriesItemURLGenerator(int series, 1452 CategoryURLGenerator generator); 1453 1454 /** 1455 * Sets the item URL generator for a series and, if requested, sends a 1456 * {@link RendererChangeEvent} to all registered listeners. 1457 * 1458 * @param series the series index (zero-based). 1459 * @param generator the generator ({@code null} permitted). 1460 * @param notify notify listeners? 1461 * 1462 * @see #getSeriesItemURLGenerator(int) 1463 */ 1464 void setSeriesItemURLGenerator(int series, 1465 CategoryURLGenerator generator, boolean notify); 1466 1467 /** 1468 * Returns the default item URL generator. 1469 * 1470 * @return The item URL generator (possibly {@code null}). 1471 * 1472 * @see #setDefaultItemURLGenerator(CategoryURLGenerator) 1473 */ 1474 CategoryURLGenerator getDefaultItemURLGenerator(); 1475 1476 /** 1477 * Sets the default item URL generator and sends a 1478 * {@link RendererChangeEvent} to all registered listeners. 1479 * 1480 * @param generator the item URL generator ({@code null} permitted). 1481 * 1482 * @see #getDefaultItemURLGenerator() 1483 */ 1484 void setDefaultItemURLGenerator(CategoryURLGenerator generator); 1485 1486 /** 1487 * Sets the default item URL generator and, if requested, sends a 1488 * {@link RendererChangeEvent} to all registered listeners. 1489 * 1490 * @param generator the item URL generator ({@code null} permitted). 1491 * @param notify notify listeners? 1492 * 1493 * @see #getDefaultItemURLGenerator() 1494 */ 1495 void setDefaultItemURLGenerator(CategoryURLGenerator generator, boolean notify); 1496 1497 /** 1498 * Returns a legend item for a series. This method can return 1499 * {@code null}, in which case the series will have no entry in the 1500 * legend. 1501 * 1502 * @param datasetIndex the dataset index (zero-based). 1503 * @param series the series (zero-based index). 1504 * 1505 * @return The legend item (possibly {@code null}). 1506 */ 1507 LegendItem getLegendItem(int datasetIndex, int series); 1508 1509 /** 1510 * Draws a background for the data area. 1511 * 1512 * @param g2 the graphics device. 1513 * @param plot the plot. 1514 * @param dataArea the data area. 1515 */ 1516 void drawBackground(Graphics2D g2, CategoryPlot plot, 1517 Rectangle2D dataArea); 1518 1519 /** 1520 * Draws an outline for the data area. 1521 * 1522 * @param g2 the graphics device. 1523 * @param plot the plot. 1524 * @param dataArea the data area. 1525 */ 1526 void drawOutline(Graphics2D g2, CategoryPlot plot, 1527 Rectangle2D dataArea); 1528 1529 /** 1530 * Draws a single data item. 1531 * 1532 * @param g2 the graphics device. 1533 * @param state state information for one chart. 1534 * @param dataArea the data plot area. 1535 * @param plot the plot. 1536 * @param domainAxis the domain axis. 1537 * @param rangeAxis the range axis. 1538 * @param dataset the data. 1539 * @param row the row index (zero-based). 1540 * @param column the column index (zero-based). 1541 * @param pass the pass index. 1542 */ 1543 void drawItem(Graphics2D g2, CategoryItemRendererState state, 1544 Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, 1545 ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, 1546 int pass); 1547 1548 /** 1549 * Draws a grid line against the domain axis. 1550 * 1551 * @param g2 the graphics device. 1552 * @param plot the plot. 1553 * @param dataArea the area for plotting data. 1554 * @param value the value. 1555 */ 1556 void drawDomainGridline(Graphics2D g2, CategoryPlot plot, 1557 Rectangle2D dataArea, double value); 1558 1559 /** 1560 * Draws a grid line against the range axis. 1561 * 1562 * @param g2 the graphics device. 1563 * @param plot the plot. 1564 * @param axis the value axis. 1565 * @param dataArea the area for plotting data. 1566 * @param value the value. 1567 * @param paint the paint ({@code null} not permitted). 1568 * @param stroke the line stroke ({@code null} not permitted). 1569 */ 1570 void drawRangeLine(Graphics2D g2, CategoryPlot plot, ValueAxis axis, 1571 Rectangle2D dataArea, double value, Paint paint, Stroke stroke); 1572 1573 /** 1574 * Draws a line (or some other marker) to indicate a particular category on 1575 * the domain axis. 1576 * 1577 * @param g2 the graphics device. 1578 * @param plot the plot. 1579 * @param axis the category axis. 1580 * @param marker the marker. 1581 * @param dataArea the area for plotting data. 1582 * 1583 * @see #drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, 1584 * Rectangle2D) 1585 */ 1586 void drawDomainMarker(Graphics2D g2, CategoryPlot plot, 1587 CategoryAxis axis, CategoryMarker marker, Rectangle2D dataArea); 1588 1589 /** 1590 * Draws a line (or some other marker) to indicate a particular value on 1591 * the range axis. 1592 * 1593 * @param g2 the graphics device. 1594 * @param plot the plot. 1595 * @param axis the value axis. 1596 * @param marker the marker. 1597 * @param dataArea the area for plotting data. 1598 * 1599 * @see #drawDomainMarker(Graphics2D, CategoryPlot, CategoryAxis, 1600 * CategoryMarker, Rectangle2D) 1601 */ 1602 void drawRangeMarker(Graphics2D g2, CategoryPlot plot, 1603 ValueAxis axis, Marker marker, Rectangle2D dataArea); 1604 1605 /** 1606 * Returns the Java2D coordinate for the middle of the specified data item. 1607 * 1608 * @param rowKey the row key. 1609 * @param columnKey the column key. 1610 * @param dataset the dataset. 1611 * @param axis the axis. 1612 * @param area the data area. 1613 * @param edge the edge along which the axis lies. 1614 * 1615 * @return The Java2D coordinate for the middle of the item. 1616 */ 1617 double getItemMiddle(Comparable rowKey, Comparable columnKey, 1618 CategoryDataset dataset, CategoryAxis axis, Rectangle2D area, 1619 RectangleEdge edge); 1620 1621}