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