1 69 70 package org.jfree.chart.renderer; 71 72 import java.awt.BasicStroke ; 73 import java.awt.Color ; 74 import java.awt.Font ; 75 import java.awt.Paint ; 76 import java.awt.Shape ; 77 import java.awt.Stroke ; 78 import java.awt.geom.Point2D ; 79 import java.awt.geom.Rectangle2D ; 80 import java.io.IOException ; 81 import java.io.ObjectInputStream ; 82 import java.io.ObjectOutputStream ; 83 import java.io.Serializable ; 84 import java.util.Arrays ; 85 import java.util.EventListener ; 86 import java.util.List ; 87 88 import javax.swing.event.EventListenerList ; 89 90 import org.jfree.chart.event.RendererChangeEvent; 91 import org.jfree.chart.event.RendererChangeListener; 92 import org.jfree.chart.labels.ItemLabelAnchor; 93 import org.jfree.chart.labels.ItemLabelPosition; 94 import org.jfree.chart.plot.DrawingSupplier; 95 import org.jfree.chart.plot.PlotOrientation; 96 import org.jfree.io.SerialUtilities; 97 import org.jfree.ui.TextAnchor; 98 import org.jfree.util.BooleanList; 99 import org.jfree.util.BooleanUtilities; 100 import org.jfree.util.ObjectList; 101 import org.jfree.util.ObjectUtilities; 102 import org.jfree.util.PaintList; 103 import org.jfree.util.ShapeList; 104 import org.jfree.util.ShapeUtilities; 105 import org.jfree.util.StrokeList; 106 107 113 public abstract class AbstractRenderer implements Cloneable , Serializable { 114 115 116 private static final long serialVersionUID = -828267569428206075L; 117 118 119 public static final Double ZERO = new Double (0.0); 120 121 122 public static final Paint DEFAULT_PAINT = Color.blue; 123 124 125 public static final Paint DEFAULT_OUTLINE_PAINT = Color.gray; 126 127 128 public static final Stroke DEFAULT_STROKE = new BasicStroke (1.0f); 129 130 131 public static final Stroke DEFAULT_OUTLINE_STROKE = new BasicStroke (1.0f); 132 133 134 public static final Shape DEFAULT_SHAPE 135 = new Rectangle2D.Double (-3.0, -3.0, 6.0, 6.0); 136 137 138 public static final Font DEFAULT_VALUE_LABEL_FONT 139 = new Font ("SansSerif", Font.PLAIN, 10); 140 141 142 public static final Paint DEFAULT_VALUE_LABEL_PAINT = Color.black; 143 144 145 private Boolean seriesVisible; 146 147 148 private BooleanList seriesVisibleList; 149 150 151 private boolean baseSeriesVisible; 152 153 154 private Boolean seriesVisibleInLegend; 155 156 160 private BooleanList seriesVisibleInLegendList; 161 162 163 private boolean baseSeriesVisibleInLegend; 164 165 166 private transient Paint paint; 167 168 169 private PaintList paintList; 170 171 172 private transient Paint basePaint; 173 174 175 private transient Paint fillPaint; 176 177 178 private PaintList fillPaintList; 179 180 181 private transient Paint baseFillPaint; 182 183 184 private transient Paint outlinePaint; 185 186 187 private PaintList outlinePaintList; 188 189 190 private transient Paint baseOutlinePaint; 191 192 193 private transient Stroke stroke; 194 195 196 private StrokeList strokeList; 197 198 199 private transient Stroke baseStroke; 200 201 202 private transient Stroke outlineStroke; 203 204 205 private StrokeList outlineStrokeList; 206 207 208 private transient Stroke baseOutlineStroke; 209 210 211 private transient Shape shape; 212 213 214 private ShapeList shapeList; 215 216 217 private transient Shape baseShape; 218 219 220 private Boolean itemLabelsVisible; 221 222 223 private BooleanList itemLabelsVisibleList; 224 225 226 private Boolean baseItemLabelsVisible; 227 228 229 private Font itemLabelFont; 230 231 232 private ObjectList itemLabelFontList; 233 234 235 private Font baseItemLabelFont; 236 237 238 private transient Paint itemLabelPaint; 239 240 241 private PaintList itemLabelPaintList; 242 243 244 private transient Paint baseItemLabelPaint; 245 246 247 private ItemLabelPosition positiveItemLabelPosition; 248 249 250 private ObjectList positiveItemLabelPositionList; 251 252 253 private ItemLabelPosition basePositiveItemLabelPosition; 254 255 256 private ItemLabelPosition negativeItemLabelPosition; 257 258 259 private ObjectList negativeItemLabelPositionList; 260 261 262 private ItemLabelPosition baseNegativeItemLabelPosition; 263 264 265 private double itemLabelAnchorOffset = 2.0; 266 267 271 private Boolean createEntities; 272 273 277 private BooleanList createEntitiesList; 278 279 283 private boolean baseCreateEntities; 284 285 286 private transient EventListenerList listenerList; 287 288 291 public AbstractRenderer() { 292 293 this.seriesVisible = null; 294 this.seriesVisibleList = new BooleanList(); 295 this.baseSeriesVisible = true; 296 297 this.seriesVisibleInLegend = null; 298 this.seriesVisibleInLegendList = new BooleanList(); 299 this.baseSeriesVisibleInLegend = true; 300 301 this.paint = null; 302 this.paintList = new PaintList(); 303 this.basePaint = DEFAULT_PAINT; 304 305 this.fillPaint = null; 306 this.fillPaintList = new PaintList(); 307 this.baseFillPaint = Color.white; 308 309 this.outlinePaint = null; 310 this.outlinePaintList = new PaintList(); 311 this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT; 312 313 this.stroke = null; 314 this.strokeList = new StrokeList(); 315 this.baseStroke = DEFAULT_STROKE; 316 317 this.outlineStroke = null; 318 this.outlineStrokeList = new StrokeList(); 319 this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE; 320 321 this.shape = null; 322 this.shapeList = new ShapeList(); 323 this.baseShape = DEFAULT_SHAPE; 324 325 this.itemLabelsVisible = null; 326 this.itemLabelsVisibleList = new BooleanList(); 327 this.baseItemLabelsVisible = Boolean.FALSE; 328 329 this.itemLabelFont = null; 330 this.itemLabelFontList = new ObjectList(); 331 this.baseItemLabelFont = new Font ("SansSerif", Font.PLAIN, 10); 332 333 this.itemLabelPaint = null; 334 this.itemLabelPaintList = new PaintList(); 335 this.baseItemLabelPaint = Color.black; 336 337 this.positiveItemLabelPosition = null; 338 this.positiveItemLabelPositionList = new ObjectList(); 339 this.basePositiveItemLabelPosition = new ItemLabelPosition( 340 ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER 341 ); 342 343 this.negativeItemLabelPosition = null; 344 this.negativeItemLabelPositionList = new ObjectList(); 345 this.baseNegativeItemLabelPosition = new ItemLabelPosition( 346 ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER 347 ); 348 349 this.createEntities = null; 350 this.createEntitiesList = new BooleanList(); 351 this.baseCreateEntities = true; 352 353 this.listenerList = new EventListenerList (); 354 355 } 356 357 362 public abstract DrawingSupplier getDrawingSupplier(); 363 364 366 375 public boolean getItemVisible(int series, int item) { 376 return isSeriesVisible(series); 377 } 378 379 387 public boolean isSeriesVisible(int series) { 388 389 boolean result = this.baseSeriesVisible; 390 if (this.seriesVisible != null) { 391 result = this.seriesVisible.booleanValue(); 392 } 393 else { 394 Boolean b = this.seriesVisibleList.getBoolean(series); 395 if (b != null) { 396 result = b.booleanValue(); 397 } 398 } 399 return result; 400 } 401 402 409 public Boolean getSeriesVisible() { 410 return this.seriesVisible; 411 } 412 413 421 public void setSeriesVisible(Boolean visible) { 422 setSeriesVisible(visible, true); 423 } 424 425 434 public void setSeriesVisible(Boolean visible, boolean notify) { 435 this.seriesVisible = visible; 436 if (notify) { 437 notifyListeners(new RendererChangeEvent(this)); 438 } 439 } 440 441 448 public Boolean getSeriesVisible(int series) { 449 return this.seriesVisibleList.getBoolean(series); 450 } 451 452 459 public void setSeriesVisible(int series, Boolean visible) { 460 setSeriesVisible(series, visible, true); 461 } 462 463 472 public void setSeriesVisible(int series, Boolean visible, boolean notify) { 473 this.seriesVisibleList.setBoolean(series, visible); 474 if (notify) { 475 notifyListeners(new RendererChangeEvent(this)); 476 } 477 } 478 479 484 public boolean getBaseSeriesVisible() { 485 return this.baseSeriesVisible; 486 } 487 488 494 public void setBaseSeriesVisible(boolean visible) { 495 setBaseSeriesVisible(visible, true); 497 } 498 499 506 public void setBaseSeriesVisible(boolean visible, boolean notify) { 507 this.baseSeriesVisible = visible; 508 if (notify) { 509 notifyListeners(new RendererChangeEvent(this)); 510 } 511 } 512 513 515 523 public boolean isSeriesVisibleInLegend(int series) { 524 boolean result = this.baseSeriesVisibleInLegend; 525 if (this.seriesVisibleInLegend != null) { 526 result = this.seriesVisibleInLegend.booleanValue(); 527 } 528 else { 529 Boolean b = this.seriesVisibleInLegendList.getBoolean(series); 530 if (b != null) { 531 result = b.booleanValue(); 532 } 533 } 534 return result; 535 } 536 537 545 public Boolean getSeriesVisibleInLegend() { 546 return this.seriesVisibleInLegend; 547 } 548 549 557 public void setSeriesVisibleInLegend(Boolean visible) { 558 setSeriesVisibleInLegend(visible, true); 559 } 560 561 570 public void setSeriesVisibleInLegend(Boolean visible, boolean notify) { 571 this.seriesVisibleInLegend = visible; 572 if (notify) { 573 notifyListeners(new RendererChangeEvent(this)); 574 } 575 } 576 577 587 public Boolean getSeriesVisibleInLegend(int series) { 588 return this.seriesVisibleInLegendList.getBoolean(series); 589 } 590 591 598 public void setSeriesVisibleInLegend(int series, Boolean visible) { 599 setSeriesVisibleInLegend(series, visible, true); 600 } 601 602 611 public void setSeriesVisibleInLegend(int series, Boolean visible, 612 boolean notify) { 613 this.seriesVisibleInLegendList.setBoolean(series, visible); 614 if (notify) { 615 notifyListeners(new RendererChangeEvent(this)); 616 } 617 } 618 619 624 public boolean getBaseSeriesVisibleInLegend() { 625 return this.baseSeriesVisibleInLegend; 626 } 627 628 634 public void setBaseSeriesVisibleInLegend(boolean visible) { 635 setBaseSeriesVisibleInLegend(visible, true); 637 } 638 639 646 public void setBaseSeriesVisibleInLegend(boolean visible, boolean notify) { 647 this.baseSeriesVisibleInLegend = visible; 648 if (notify) { 649 notifyListeners(new RendererChangeEvent(this)); 650 } 651 } 652 653 655 667 public Paint getItemPaint(int row, int column) { 668 return getSeriesPaint(row); 669 } 670 671 678 public Paint getSeriesPaint(int series) { 679 680 if (this.paint != null) { 682 return this.paint; 683 } 684 685 Paint seriesPaint = this.paintList.getPaint(series); 687 if (seriesPaint == null) { 688 DrawingSupplier supplier = getDrawingSupplier(); 689 if (supplier != null) { 690 seriesPaint = supplier.getNextPaint(); 691 this.paintList.setPaint(series, seriesPaint); 692 } 693 else { 694 seriesPaint = this.basePaint; 695 } 696 } 697 return seriesPaint; 698 699 } 700 701 708 public void setPaint(Paint paint) { 709 setPaint(paint, true); 710 } 711 712 719 public void setPaint(Paint paint, boolean notify) { 720 this.paint = paint; 721 if (notify) { 722 notifyListeners(new RendererChangeEvent(this)); 723 } 724 } 725 726 733 public void setSeriesPaint(int series, Paint paint) { 734 setSeriesPaint(series, paint, true); 735 } 736 737 745 public void setSeriesPaint(int series, Paint paint, boolean notify) { 746 this.paintList.setPaint(series, paint); 747 if (notify) { 748 notifyListeners(new RendererChangeEvent(this)); 749 } 750 } 751 752 757 public Paint getBasePaint() { 758 return this.basePaint; 759 } 760 761 767 public void setBasePaint(Paint paint) { 768 setBasePaint(paint, true); 770 } 771 772 779 public void setBasePaint(Paint paint, boolean notify) { 780 this.basePaint = paint; 781 if (notify) { 782 notifyListeners(new RendererChangeEvent(this)); 783 } 784 } 785 786 788 799 public Paint getItemFillPaint(int row, int column) { 800 return getSeriesFillPaint(row); 801 } 802 803 810 public Paint getSeriesFillPaint(int series) { 811 812 if (this.fillPaint != null) { 814 return this.fillPaint; 815 } 816 817 Paint seriesFillPaint = this.fillPaintList.getPaint(series); 819 if (seriesFillPaint == null) { 820 seriesFillPaint = this.baseFillPaint; 821 } 822 return seriesFillPaint; 823 824 } 825 826 833 public void setSeriesFillPaint(int series, Paint paint) { 834 setSeriesFillPaint(series, paint, true); 835 } 836 837 845 public void setSeriesFillPaint(int series, Paint paint, boolean notify) { 846 this.fillPaintList.setPaint(series, paint); 847 if (notify) { 848 notifyListeners(new RendererChangeEvent(this)); 849 } 850 } 851 852 857 public void setFillPaint(Paint paint) { 858 setFillPaint(paint, true); 859 } 860 861 868 public void setFillPaint(Paint paint, boolean notify) { 869 this.fillPaint = paint; 870 if (notify) { 871 notifyListeners(new RendererChangeEvent(this)); 872 } 873 } 874 875 880 public Paint getBaseFillPaint() { 881 return this.baseFillPaint; 882 } 883 884 890 public void setBaseFillPaint(Paint paint) { 891 setBaseFillPaint(paint, true); 893 } 894 895 902 public void setBaseFillPaint(Paint paint, boolean notify) { 903 if (paint == null) { 904 throw new IllegalArgumentException ("Null 'paint' argument."); 905 } 906 this.baseFillPaint = paint; 907 if (notify) { 908 notifyListeners(new RendererChangeEvent(this)); 909 } 910 } 911 912 914 925 public Paint getItemOutlinePaint(int row, int column) { 926 return getSeriesOutlinePaint(row); 927 } 928 929 936 public Paint getSeriesOutlinePaint(int series) { 937 938 if (this.outlinePaint != null) { 940 return this.outlinePaint; 941 } 942 943 Paint seriesOutlinePaint = this.outlinePaintList.getPaint(series); 945 if (seriesOutlinePaint == null) { 946 DrawingSupplier supplier = getDrawingSupplier(); 947 if (supplier != null) { 948 seriesOutlinePaint = supplier.getNextOutlinePaint(); 949 this.outlinePaintList.setPaint(series, seriesOutlinePaint); 950 } 951 else { 952 seriesOutlinePaint = this.baseOutlinePaint; 953 } 954 } 955 return seriesOutlinePaint; 956 957 } 958 959 966 public void setSeriesOutlinePaint(int series, Paint paint) { 967 setSeriesOutlinePaint(series, paint, true); 968 } 969 970 978 public void setSeriesOutlinePaint(int series, Paint paint, boolean notify) { 979 this.outlinePaintList.setPaint(series, paint); 980 if (notify) { 981 notifyListeners(new RendererChangeEvent(this)); 982 } 983 } 984 985 990 public void setOutlinePaint(Paint paint) { 991 setOutlinePaint(paint, true); 992 } 993 994 1001 public void setOutlinePaint(Paint paint, boolean notify) { 1002 this.outlinePaint = paint; 1003 if (notify) { 1004 notifyListeners(new RendererChangeEvent(this)); 1005 } 1006 } 1007 1008 1013 public Paint getBaseOutlinePaint() { 1014 return this.baseOutlinePaint; 1015 } 1016 1017 1023 public void setBaseOutlinePaint(Paint paint) { 1024 setBaseOutlinePaint(paint, true); 1026 } 1027 1028 1035 public void setBaseOutlinePaint(Paint paint, boolean notify) { 1036 if (paint == null) { 1037 throw new IllegalArgumentException ("Null 'paint' argument."); 1038 } 1039 this.baseOutlinePaint = paint; 1040 if (notify) { 1041 notifyListeners(new RendererChangeEvent(this)); 1042 } 1043 } 1044 1045 1047 1058 public Stroke getItemStroke(int row, int column) { 1059 return getSeriesStroke(row); 1060 } 1061 1062 1069 public Stroke getSeriesStroke(int series) { 1070 1071 if (this.stroke != null) { 1073 return this.stroke; 1074 } 1075 1076 Stroke result = this.strokeList.getStroke(series); 1078 if (result == null) { 1079 DrawingSupplier supplier = getDrawingSupplier(); 1080 if (supplier != null) { 1081 result = supplier.getNextStroke(); 1082 this.strokeList.setStroke(series, result); 1083 } 1084 else { 1085 result = this.baseStroke; 1086 } 1087 } 1088 return result; 1089 1090 } 1091 1092 1098 public void setStroke(Stroke stroke) { 1099 setStroke(stroke, true); 1100 } 1101 1102 1109 public void setStroke(Stroke stroke, boolean notify) { 1110 this.stroke = stroke; 1111 if (notify) { 1112 notifyListeners(new RendererChangeEvent(this)); 1113 } 1114 } 1115 1116 1123 public void setSeriesStroke(int series, Stroke stroke) { 1124 setSeriesStroke(series, stroke, true); 1125 } 1126 1127 1135 public void setSeriesStroke(int series, Stroke stroke, boolean notify) { 1136 this.strokeList.setStroke(series, stroke); 1137 if (notify) { 1138 notifyListeners(new RendererChangeEvent(this)); 1139 } 1140 } 1141 1142 1147 public Stroke getBaseStroke() { 1148 return this.baseStroke; 1149 } 1150 1151 1156 public void setBaseStroke(Stroke stroke) { 1157 setBaseStroke(stroke, true); 1159 } 1160 1161 1168 public void setBaseStroke(Stroke stroke, boolean notify) { 1169 if (stroke == null) { 1170 throw new IllegalArgumentException ("Null 'stroke' argument."); 1171 } 1172 this.baseStroke = stroke; 1173 if (notify) { 1174 notifyListeners(new RendererChangeEvent(this)); 1175 } 1176 } 1177 1178 1180 1190 public Stroke getItemOutlineStroke(int row, int column) { 1191 return getSeriesOutlineStroke(row); 1192 } 1193 1194 1201 public Stroke getSeriesOutlineStroke(int series) { 1202 1203 if (this.outlineStroke != null) { 1205 return this.outlineStroke; 1206 } 1207 1208 Stroke result = this.outlineStrokeList.getStroke(series); 1210 if (result == null) { 1211 DrawingSupplier supplier = getDrawingSupplier(); 1212 if (supplier != null) { 1213 result = supplier.getNextOutlineStroke(); 1214 this.outlineStrokeList.setStroke(series, result); 1215 } 1216 else { 1217 result = this.baseOutlineStroke; 1218 } 1219 } 1220 return result; 1221 1222 } 1223 1224 1230 public void setOutlineStroke(Stroke stroke) { 1231 setOutlineStroke(stroke, true); 1232 } 1233 1234 1241 public void setOutlineStroke(Stroke stroke, boolean notify) { 1242 this.outlineStroke = stroke; 1243 if (notify) { 1244 notifyListeners(new RendererChangeEvent(this)); 1245 } 1246 } 1247 1248 1255 public void setSeriesOutlineStroke(int series, Stroke stroke) { 1256 setSeriesOutlineStroke(series, stroke, true); 1257 } 1258 1259 1267 public void setSeriesOutlineStroke(int series, Stroke stroke, 1268 boolean notify) { 1269 this.outlineStrokeList.setStroke(series, stroke); 1270 if (notify) { 1271 notifyListeners(new RendererChangeEvent(this)); 1272 } 1273 } 1274 1275 1280 public Stroke getBaseOutlineStroke() { 1281 return this.baseOutlineStroke; 1282 } 1283 1284 1290 public void setBaseOutlineStroke(Stroke stroke) { 1291 setBaseOutlineStroke(stroke, true); 1292 } 1293 1294 1302 public void setBaseOutlineStroke(Stroke stroke, boolean notify) { 1303 if (stroke == null) { 1304 throw new IllegalArgumentException ("Null 'stroke' argument."); 1305 } 1306 this.baseOutlineStroke = stroke; 1307 if (notify) { 1308 notifyListeners(new RendererChangeEvent(this)); 1309 } 1310 } 1311 1312 1314 1325 public Shape getItemShape(int row, int column) { 1326 return getSeriesShape(row); 1327 } 1328 1329 1336 public Shape getSeriesShape(int series) { 1337 1338 if (this.shape != null) { 1340 return this.shape; 1341 } 1342 1343 Shape result = this.shapeList.getShape(series); 1345 if (result == null) { 1346 DrawingSupplier supplier = getDrawingSupplier(); 1347 if (supplier != null) { 1348 result = supplier.getNextShape(); 1349 this.shapeList.setShape(series, result); 1350 } 1351 else { 1352 result = this.baseShape; 1353 } 1354 } 1355 return result; 1356 1357 } 1358 1359 1365 public void setShape(Shape shape) { 1366 setShape(shape, true); 1367 } 1368 1369 1376 public void setShape(Shape shape, boolean notify) { 1377 this.shape = shape; 1378 if (notify) { 1379 notifyListeners(new RendererChangeEvent(this)); 1380 } 1381 } 1382 1383 1390 public void setSeriesShape(int series, Shape shape) { 1391 setSeriesShape(series, shape, true); 1392 } 1393 1394 1402 public void setSeriesShape(int series, Shape shape, boolean notify) { 1403 this.shapeList.setShape(series, shape); 1404 if (notify) { 1405 notifyListeners(new RendererChangeEvent(this)); 1406 } 1407 } 1408 1409 1414 public Shape getBaseShape() { 1415 return this.baseShape; 1416 } 1417 1418 1424 public void setBaseShape(Shape shape) { 1425 setBaseShape(shape, true); 1427 } 1428 1429 1436 public void setBaseShape(Shape shape, boolean notify) { 1437 if (shape == null) { 1438 throw new IllegalArgumentException ("Null 'shape' argument."); 1439 } 1440 this.baseShape = shape; 1441 if (notify) { 1442 notifyListeners(new RendererChangeEvent(this)); 1443 } 1444 } 1445 1446 1448 1457 public boolean isItemLabelVisible(int row, int column) { 1458 return isSeriesItemLabelsVisible(row); 1459 } 1460 1461 1469 public boolean isSeriesItemLabelsVisible(int series) { 1470 1471 if (this.itemLabelsVisible != null) { 1473 return this.itemLabelsVisible.booleanValue(); 1474 } 1475 1476 Boolean b = this.itemLabelsVisibleList.getBoolean(series); 1478 if (b == null) { 1479 b = this.baseItemLabelsVisible; 1480 } 1481 if (b == null) { 1482 b = Boolean.FALSE; 1483 } 1484 return b.booleanValue(); 1485 1486 } 1487 1488 1493 public void setItemLabelsVisible(boolean visible) { 1494 setItemLabelsVisible(BooleanUtilities.valueOf(visible)); 1495 } 1499 1500 1505 public void setItemLabelsVisible(Boolean visible) { 1506 setItemLabelsVisible(visible, true); 1507 } 1508 1509 1518 public void setItemLabelsVisible(Boolean visible, boolean notify) { 1519 this.itemLabelsVisible = visible; 1520 if (notify) { 1521 notifyListeners(new RendererChangeEvent(this)); 1522 } 1523 } 1524 1525 1531 public void setSeriesItemLabelsVisible(int series, boolean visible) { 1532 setSeriesItemLabelsVisible(series, BooleanUtilities.valueOf(visible)); 1533 } 1534 1535 1541 public void setSeriesItemLabelsVisible(int series, Boolean visible) { 1542 setSeriesItemLabelsVisible(series, visible, true); 1543 } 1544 1545 1554 public void setSeriesItemLabelsVisible(int series, Boolean visible, 1555 boolean notify) { 1556 this.itemLabelsVisibleList.setBoolean(series, visible); 1557 if (notify) { 1558 notifyListeners(new RendererChangeEvent(this)); 1559 } 1560 } 1561 1562 1567 public Boolean getBaseItemLabelsVisible() { 1568 return this.baseItemLabelsVisible; 1569 } 1570 1571 1576 public void setBaseItemLabelsVisible(boolean visible) { 1577 setBaseItemLabelsVisible(BooleanUtilities.valueOf(visible)); 1578 } 1579 1580 1585 public void setBaseItemLabelsVisible(Boolean visible) { 1586 setBaseItemLabelsVisible(visible, true); 1587 } 1588 1589 1597 public void setBaseItemLabelsVisible(Boolean visible, boolean notify) { 1598 this.baseItemLabelsVisible = visible; 1599 if (notify) { 1600 notifyListeners(new RendererChangeEvent(this)); 1601 } 1602 } 1603 1604 1606 1614 public Font getItemLabelFont(int row, int column) { 1615 Font result = this.itemLabelFont; 1616 if (result == null) { 1617 result = getSeriesItemLabelFont(row); 1618 if (result == null) { 1619 result = this.baseItemLabelFont; 1620 } 1621 } 1622 return result; 1623 } 1624 1625 1631 public Font getItemLabelFont() { 1632 return this.itemLabelFont; 1633 } 1634 1635 1643 public void setItemLabelFont(Font font) { 1644 setItemLabelFont(font, true); 1645 } 1646 1647 1655 public void setItemLabelFont(Font font, boolean notify) { 1656 this.itemLabelFont = font; 1657 if (notify) { 1658 notifyListeners(new RendererChangeEvent(this)); 1659 } 1660 } 1661 1662 1669 public Font getSeriesItemLabelFont(int series) { 1670 return (Font ) this.itemLabelFontList.get(series); 1671 } 1672 1673 1680 public void setSeriesItemLabelFont(int series, Font font) { 1681 setSeriesItemLabelFont(series, font, true); 1682 } 1683 1684 1693 public void setSeriesItemLabelFont(int series, Font font, boolean notify) { 1694 this.itemLabelFontList.set(series, font); 1695 if (notify) { 1696 notifyListeners(new RendererChangeEvent(this)); 1697 } 1698 } 1699 1700 1706 public Font getBaseItemLabelFont() { 1707 return this.baseItemLabelFont; 1708 } 1709 1710 1716 public void setBaseItemLabelFont(Font font) { 1717 if (font == null) { 1718 throw new IllegalArgumentException ("Null 'font' argument."); 1719 } 1720 setBaseItemLabelFont(font, true); 1721 } 1722 1723 1731 public void setBaseItemLabelFont(Font font, boolean notify) { 1732 this.baseItemLabelFont = font; 1733 if (notify) { 1734 notifyListeners(new RendererChangeEvent(this)); 1735 } 1736 } 1737 1738 1740 1748 public Paint getItemLabelPaint(int row, int column) { 1749 Paint result = this.itemLabelPaint; 1750 if (result == null) { 1751 result = getSeriesItemLabelPaint(row); 1752 if (result == null) { 1753 result = this.baseItemLabelPaint; 1754 } 1755 } 1756 return result; 1757 } 1758 1759 1766 public Paint getItemLabelPaint() { 1767 return this.itemLabelPaint; 1768 } 1769 1770 1776 public void setItemLabelPaint(Paint paint) { 1777 setItemLabelPaint(paint, true); 1778 } 1779 1780 1788 public void setItemLabelPaint(Paint paint, boolean notify) { 1789 this.itemLabelPaint = paint; 1790 if (notify) { 1791 notifyListeners(new RendererChangeEvent(this)); 1792 } 1793 } 1794 1795 1802 public Paint getSeriesItemLabelPaint(int series) { 1803 return this.itemLabelPaintList.getPaint(series); 1804 } 1805 1806 1813 public void setSeriesItemLabelPaint(int series, Paint paint) { 1814 setSeriesItemLabelPaint(series, paint, true); 1815 } 1816 1817 1826 public void setSeriesItemLabelPaint(int series, Paint paint, 1827 boolean notify) { 1828 this.itemLabelPaintList.setPaint(series, paint); 1829 if (notify) { 1830 notifyListeners(new RendererChangeEvent(this)); 1831 } 1832 } 1833 1834 1839 public Paint getBaseItemLabelPaint() { 1840 return this.baseItemLabelPaint; 1841 } 1842 1843 1849 public void setBaseItemLabelPaint(Paint paint) { 1850 setBaseItemLabelPaint(paint, true); 1852 } 1853 1854 1862 public void setBaseItemLabelPaint(Paint paint, boolean notify) { 1863 if (paint == null) { 1864 throw new IllegalArgumentException ("Null 'paint' argument."); 1865 } 1866 this.baseItemLabelPaint = paint; 1867 if (notify) { 1868 notifyListeners(new RendererChangeEvent(this)); 1869 } 1870 } 1871 1872 1874 1882 public ItemLabelPosition getPositiveItemLabelPosition(int row, int column) { 1883 return getSeriesPositiveItemLabelPosition(row); 1884 } 1885 1886 1891 public ItemLabelPosition getPositiveItemLabelPosition() { 1892 return this.positiveItemLabelPosition; 1893 } 1894 1895 1903 public void setPositiveItemLabelPosition(ItemLabelPosition position) { 1904 setPositiveItemLabelPosition(position, true); 1905 } 1906 1907 1914 public void setPositiveItemLabelPosition(ItemLabelPosition position, 1915 boolean notify) { 1916 this.positiveItemLabelPosition = position; 1917 if (notify) { 1918 notifyListeners(new RendererChangeEvent(this)); 1919 } 1920 } 1921 1922 1929 public ItemLabelPosition getSeriesPositiveItemLabelPosition(int series) { 1930 1931 if (this.positiveItemLabelPosition != null) { 1933 return this.positiveItemLabelPosition; 1934 } 1935 1936 ItemLabelPosition position = (ItemLabelPosition) 1938 this.positiveItemLabelPositionList.get(series); 1939 if (position == null) { 1940 position = this.basePositiveItemLabelPosition; 1941 } 1942 return position; 1943 1944 } 1945 1946 1953 public void setSeriesPositiveItemLabelPosition(int series, 1954 ItemLabelPosition position) { 1955 setSeriesPositiveItemLabelPosition(series, position, true); 1956 } 1957 1958 1967 public void setSeriesPositiveItemLabelPosition(int series, 1968 ItemLabelPosition position, 1969 boolean notify) { 1970 this.positiveItemLabelPositionList.set(series, position); 1971 if (notify) { 1972 notifyListeners(new RendererChangeEvent(this)); 1973 } 1974 } 1975 1976 1981 public ItemLabelPosition getBasePositiveItemLabelPosition() { 1982 return this.basePositiveItemLabelPosition; 1983 } 1984 1985 1990 public void setBasePositiveItemLabelPosition(ItemLabelPosition position) { 1991 setBasePositiveItemLabelPosition(position, true); 1993 } 1994 1995 2002 public void setBasePositiveItemLabelPosition(ItemLabelPosition position, 2003 boolean notify) { 2004 if (position == null) { 2005 throw new IllegalArgumentException ("Null 'position' argument."); 2006 } 2007 this.basePositiveItemLabelPosition = position; 2008 if (notify) { 2009 notifyListeners(new RendererChangeEvent(this)); 2010 } 2011 } 2012 2013 2015 2025 public ItemLabelPosition getNegativeItemLabelPosition(int row, int column) { 2026 return getSeriesNegativeItemLabelPosition(row); 2027 } 2028 2029 2034 public ItemLabelPosition getNegativeItemLabelPosition() { 2035 return this.negativeItemLabelPosition; 2036 } 2037 2038 2046 public void setNegativeItemLabelPosition(ItemLabelPosition position) { 2047 setNegativeItemLabelPosition(position, true); 2048 } 2049 2050 2058 public void setNegativeItemLabelPosition(ItemLabelPosition position, 2059 boolean notify) { 2060 this.negativeItemLabelPosition = position; 2061 if (notify) { 2062 notifyListeners(new RendererChangeEvent(this)); 2063 } 2064 } 2065 2066 2073 public ItemLabelPosition getSeriesNegativeItemLabelPosition(int series) { 2074 2075 if (this.negativeItemLabelPosition != null) { 2077 return this.negativeItemLabelPosition; 2078 } 2079 2080 ItemLabelPosition position = (ItemLabelPosition) 2082 this.negativeItemLabelPositionList.get(series); 2083 if (position == null) { 2084 position = this.baseNegativeItemLabelPosition; 2085 } 2086 return position; 2087 2088 } 2089 2090 2097 public void setSeriesNegativeItemLabelPosition(int series, 2098 ItemLabelPosition position) { 2099 setSeriesNegativeItemLabelPosition(series, position, true); 2100 } 2101 2102 2111 public void setSeriesNegativeItemLabelPosition(int series, 2112 ItemLabelPosition position, 2113 boolean notify) { 2114 this.negativeItemLabelPositionList.set(series, position); 2115 if (notify) { 2116 notifyListeners(new RendererChangeEvent(this)); 2117 } 2118 } 2119 2120 2125 public ItemLabelPosition getBaseNegativeItemLabelPosition() { 2126 return this.baseNegativeItemLabelPosition; 2127 } 2128 2129 2135 public void setBaseNegativeItemLabelPosition(ItemLabelPosition position) { 2136 setBaseNegativeItemLabelPosition(position, true); 2137 } 2138 2139 2146 public void setBaseNegativeItemLabelPosition(ItemLabelPosition position, 2147 boolean notify) { 2148 if (position == null) { 2149 throw new IllegalArgumentException ("Null 'position' argument."); 2150 } 2151 this.baseNegativeItemLabelPosition = position; 2152 if (notify) { 2153 notifyListeners(new RendererChangeEvent(this)); 2154 } 2155 } 2156 2157 2162 public double getItemLabelAnchorOffset() { 2163 return this.itemLabelAnchorOffset; 2164 } 2165 2166 2171 public void setItemLabelAnchorOffset(double offset) { 2172 this.itemLabelAnchorOffset = offset; 2173 notifyListeners(new RendererChangeEvent(this)); 2174 } 2175 2176 2185 public boolean getItemCreateEntity(int series, int item) { 2186 if (this.createEntities != null) { 2187 return this.createEntities.booleanValue(); 2188 } 2189 else { 2190 Boolean b = getSeriesCreateEntities(series); 2191 if (b != null) { 2192 return b.booleanValue(); 2193 } 2194 else { 2195 return this.baseCreateEntities; 2196 } 2197 } 2198 } 2199 2200 2208 public Boolean getCreateEntities() { 2209 return this.createEntities; 2210 } 2211 2212 2221 public void setCreateEntities(Boolean create) { 2222 setCreateEntities(create, true); 2223 } 2224 2225 2235 public void setCreateEntities(Boolean create, boolean notify) { 2236 this.createEntities = create; 2237 if (notify) { 2238 notifyListeners(new RendererChangeEvent(this)); 2239 } 2240 } 2241 2242 2250 public Boolean getSeriesCreateEntities(int series) { 2251 return this.createEntitiesList.getBoolean(series); 2252 } 2253 2254 2261 public void setSeriesCreateEntities(int series, Boolean create) { 2262 setSeriesCreateEntities(series, create, true); 2263 } 2264 2265 2274 public void setSeriesCreateEntities(int series, Boolean create, 2275 boolean notify) { 2276 this.createEntitiesList.setBoolean(series, create); 2277 if (notify) { 2278 notifyListeners(new RendererChangeEvent(this)); 2279 } 2280 } 2281 2282 2287 public boolean getBaseCreateEntities() { 2288 return this.baseCreateEntities; 2289 } 2290 2291 2298 public void setBaseCreateEntities(boolean create) { 2299 setBaseCreateEntities(create, true); 2301 } 2302 2303 2311 public void setBaseCreateEntities(boolean create, boolean notify) { 2312 this.baseCreateEntities = create; 2313 if (notify) { 2314 notifyListeners(new RendererChangeEvent(this)); 2315 } 2316 } 2317 2318 2319 private static final double ADJ = Math.cos(Math.PI / 6.0); 2320 2321 2322 private static final double OPP = Math.sin(Math.PI / 6.0); 2323 2324 2334 protected Point2D calculateLabelAnchorPoint(ItemLabelAnchor anchor, 2335 double x, 2336 double y, 2337 PlotOrientation orientation) { 2338 2339 Point2D result = null; 2340 2341 if (anchor == ItemLabelAnchor.CENTER) { 2342 result = new Point2D.Double (x, y); 2343 } 2344 else if (anchor == ItemLabelAnchor.INSIDE1) { 2345 result = new Point2D.Double ( 2346 x + OPP * this.itemLabelAnchorOffset, 2347 y - ADJ * this.itemLabelAnchorOffset 2348 ); 2349 } 2350 else if (anchor == ItemLabelAnchor.INSIDE2) { 2351 result = new Point2D.Double ( 2352 x + ADJ * this.itemLabelAnchorOffset, 2353 y - OPP * this.itemLabelAnchorOffset 2354 ); 2355 } 2356 else if (anchor == ItemLabelAnchor.INSIDE3) { 2357 result = new Point2D.Double (x + this.itemLabelAnchorOffset, y); 2358 } 2359 else if (anchor == ItemLabelAnchor.INSIDE4) { 2360 result = new Point2D.Double ( 2361 x + ADJ * this.itemLabelAnchorOffset, 2362 y + OPP * this.itemLabelAnchorOffset 2363 ); 2364 } 2365 else if (anchor == ItemLabelAnchor.INSIDE5) { 2366 result = new Point2D.Double ( 2367 x + OPP * this.itemLabelAnchorOffset, 2368 y + ADJ * this.itemLabelAnchorOffset 2369 ); 2370 } 2371 else if (anchor == ItemLabelAnchor.INSIDE6) { 2372 result = new Point2D.Double (x, y + this.itemLabelAnchorOffset); 2373 } 2374 else if (anchor == ItemLabelAnchor.INSIDE7) { 2375 result = new Point2D.Double ( 2376 x - OPP * this.itemLabelAnchorOffset, 2377 y + ADJ * this.itemLabelAnchorOffset 2378 ); 2379 } 2380 else if (anchor == ItemLabelAnchor.INSIDE8) { 2381 result = new Point2D.Double ( 2382 x - ADJ * this.itemLabelAnchorOffset, 2383 y + OPP * this.itemLabelAnchorOffset 2384 ); 2385 } 2386 else if (anchor == ItemLabelAnchor.INSIDE9) { 2387 result = new Point2D.Double (x - this.itemLabelAnchorOffset, y); 2388 } 2389 else if (anchor == ItemLabelAnchor.INSIDE10) { 2390 result = new Point2D.Double ( 2391 x - ADJ * this.itemLabelAnchorOffset, 2392 y - OPP * this.itemLabelAnchorOffset 2393 ); 2394 } 2395 else if (anchor == ItemLabelAnchor.INSIDE11) { 2396 result = new Point2D.Double ( 2397 x - OPP * this.itemLabelAnchorOffset, 2398 y - ADJ * this.itemLabelAnchorOffset 2399 ); 2400 } 2401 else if (anchor == ItemLabelAnchor.INSIDE12) { 2402 result = new Point2D.Double (x, y - this.itemLabelAnchorOffset); 2403 } 2404 else if (anchor == ItemLabelAnchor.OUTSIDE1) { 2405 result = new Point2D.Double ( 2406 x + 2.0 * OPP * this.itemLabelAnchorOffset, 2407 y - 2.0 * ADJ * this.itemLabelAnchorOffset 2408 ); 2409 } 2410 else if (anchor == ItemLabelAnchor.OUTSIDE2) { 2411 result = new Point2D.Double ( 2412 x + 2.0 * ADJ * this.itemLabelAnchorOffset, 2413 y - 2.0 * OPP * this.itemLabelAnchorOffset 2414 ); 2415 } 2416 else if (anchor == ItemLabelAnchor.OUTSIDE3) { 2417 result = new Point2D.Double ( 2418 x + 2.0 * this.itemLabelAnchorOffset, y 2419 ); 2420 } 2421 else if (anchor == ItemLabelAnchor.OUTSIDE4) { 2422 result = new Point2D.Double ( 2423 x + 2.0 * ADJ * this.itemLabelAnchorOffset, 2424 y + 2.0 * OPP * this.itemLabelAnchorOffset 2425 ); 2426 } 2427 else if (anchor == ItemLabelAnchor.OUTSIDE5) { 2428 result = new Point2D.Double ( 2429 x + 2.0 * OPP * this.itemLabelAnchorOffset, 2430 y + 2.0 * ADJ * this.itemLabelAnchorOffset 2431 ); 2432 } 2433 else if (anchor == ItemLabelAnchor.OUTSIDE6) { 2434 result = new Point2D.Double ( 2435 x, y + 2.0 * this.itemLabelAnchorOffset 2436 ); 2437 } 2438 else if (anchor == ItemLabelAnchor.OUTSIDE7) { 2439 result = new Point2D.Double ( 2440 x - 2.0 * OPP * this.itemLabelAnchorOffset, 2441 y + 2.0 * ADJ * this.itemLabelAnchorOffset 2442 ); 2443 } 2444 else if (anchor == ItemLabelAnchor.OUTSIDE8) { 2445 result = new Point2D.Double ( 2446 x - 2.0 * ADJ * this.itemLabelAnchorOffset, 2447 y + 2.0 * OPP * this.itemLabelAnchorOffset 2448 ); 2449 } 2450 else if (anchor == ItemLabelAnchor.OUTSIDE9) { 2451 result = new Point2D.Double ( 2452 x - 2.0 * this.itemLabelAnchorOffset, y 2453 ); 2454 } 2455 else if (anchor == ItemLabelAnchor.OUTSIDE10) { 2456 result = new Point2D.Double ( 2457 x - 2.0 * ADJ * this.itemLabelAnchorOffset, 2458 y - 2.0 * OPP * this.itemLabelAnchorOffset 2459 ); 2460 } 2461 else if (anchor == ItemLabelAnchor.OUTSIDE11) { 2462 result = new Point2D.Double ( 2463 x - 2.0 * OPP * this.itemLabelAnchorOffset, 2464 y - 2.0 * ADJ * this.itemLabelAnchorOffset 2465 ); 2466 } 2467 else if (anchor == ItemLabelAnchor.OUTSIDE12) { 2468 result = new Point2D.Double ( 2469 x, y - 2.0 * this.itemLabelAnchorOffset 2470 ); 2471 } 2472 2473 return result; 2474 2475 } 2476 2477 2482 public void addChangeListener(RendererChangeListener listener) { 2483 if (listener == null) { 2484 throw new IllegalArgumentException ("Null 'listener' argument."); 2485 } 2486 this.listenerList.add(RendererChangeListener.class, listener); 2487 } 2488 2489 2495 public void removeChangeListener(RendererChangeListener listener) { 2496 if (listener == null) { 2497 throw new IllegalArgumentException ("Null 'listener' argument."); 2498 } 2499 this.listenerList.remove(RendererChangeListener.class, listener); 2500 } 2501 2502 2511 public boolean hasListener(EventListener listener) { 2512 List list = Arrays.asList(this.listenerList.getListenerList()); 2513 return list.contains(listener); 2514 } 2515 2516 2521 public void notifyListeners(RendererChangeEvent event) { 2522 2523 Object [] ls = this.listenerList.getListenerList(); 2524 for (int i = ls.length - 2; i >= 0; i -= 2) { 2525 if (ls[i] == RendererChangeListener.class) { 2526 ((RendererChangeListener) ls[i + 1]).rendererChanged(event); 2527 } 2528 } 2529 2530 } 2531 2532 2539 public boolean equals(Object obj) { 2540 2541 if (obj == this) { 2542 return true; 2543 } 2544 if (!(obj instanceof AbstractRenderer)) { 2545 return false; 2546 } 2547 2548 AbstractRenderer that = (AbstractRenderer) obj; 2549 if (!ObjectUtilities.equal(this.paint, that.paint)) { 2550 return false; 2551 } 2552 2553 if (!ObjectUtilities.equal(this.paintList, that.paintList)) { 2554 return false; 2555 } 2556 if (!ObjectUtilities.equal(this.basePaint, that.basePaint)) { 2557 return false; 2558 } 2559 if (!ObjectUtilities.equal(this.fillPaint, that.fillPaint)) { 2560 return false; 2561 } 2562 if (!ObjectUtilities.equal(this.fillPaintList, that.fillPaintList)) { 2563 return false; 2564 } 2565 if (!ObjectUtilities.equal(this.baseFillPaint, that.baseFillPaint)) { 2566 return false; 2567 } 2568 if (!ObjectUtilities.equal(this.outlinePaint, that.outlinePaint)) { 2569 return false; 2570 } 2571 if (!ObjectUtilities.equal(this.outlinePaintList, 2572 that.outlinePaintList)) { 2573 return false; 2574 } 2575 if (!ObjectUtilities.equal(this.baseOutlinePaint, 2576 that.baseOutlinePaint)) { 2577 return false; 2578 } 2579 if (!ObjectUtilities.equal(this.stroke, that.stroke)) { 2580 return false; 2581 } 2582 if (!ObjectUtilities.equal(this.strokeList, that.strokeList)) { 2583 return false; 2584 } 2585 if (!ObjectUtilities.equal(this.baseStroke, that.baseStroke)) { 2586 return false; 2587 } 2588 if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { 2589 return false; 2590 } 2591 if (!ObjectUtilities.equal( 2592 this.outlineStrokeList, that.outlineStrokeList 2593 )) { 2594 return false; 2595 } 2596 if (!ObjectUtilities.equal( 2597 this.baseOutlineStroke, that.baseOutlineStroke) 2598 ) { 2599 return false; 2600 } 2601 if (!ObjectUtilities.equal(this.shape, that.shape)) { 2602 return false; 2603 } 2604 if (!ObjectUtilities.equal(this.shapeList, that.shapeList)) { 2605 return false; 2606 } 2607 if (!ObjectUtilities.equal(this.baseShape, that.baseShape)) { 2608 return false; 2609 } 2610 if (!ObjectUtilities.equal( 2611 this.itemLabelsVisible, that.itemLabelsVisible 2612 )) { 2613 return false; 2614 } 2615 if (!ObjectUtilities.equal( 2616 this.itemLabelsVisibleList, that.itemLabelsVisibleList) 2617 ) { 2618 return false; 2619 } 2620 if (!ObjectUtilities.equal( 2621 this.baseItemLabelsVisible, that.baseItemLabelsVisible 2622 )) { 2623 return false; 2624 } 2625 if (!ObjectUtilities.equal(this.itemLabelFont, that.itemLabelFont)) { 2626 return false; 2627 } 2628 if (!ObjectUtilities.equal( 2629 this.itemLabelFontList, that.itemLabelFontList 2630 )) { 2631 return false; 2632 } 2633 if (!ObjectUtilities.equal( 2634 this.baseItemLabelFont, that.baseItemLabelFont 2635 )) { 2636 return false; 2637 } 2638 2639 if (!ObjectUtilities.equal(this.itemLabelPaint, that.itemLabelPaint)) { 2640 return false; 2641 } 2642 if (!ObjectUtilities.equal( 2643 this.itemLabelPaintList, that.itemLabelPaintList 2644 )) { 2645 return false; 2646 } 2647 if (!ObjectUtilities.equal( 2648 this.baseItemLabelPaint, that.baseItemLabelPaint 2649 )) { 2650 return false; 2651 } 2652 2653 if (!ObjectUtilities.equal( 2654 this.positiveItemLabelPosition, that.positiveItemLabelPosition 2655 )) { 2656 return false; 2657 } 2658 if (!ObjectUtilities.equal( 2659 this.positiveItemLabelPositionList, 2660 that.positiveItemLabelPositionList 2661 )) { 2662 return false; 2663 } 2664 if (!ObjectUtilities.equal( 2665 this.basePositiveItemLabelPosition, 2666 that.basePositiveItemLabelPosition 2667 )) { 2668 return false; 2669 } 2670 2671 if (!ObjectUtilities.equal( 2672 this.negativeItemLabelPosition, that.negativeItemLabelPosition 2673 )) { 2674 return false; 2675 } 2676 if (!ObjectUtilities.equal( 2677 this.negativeItemLabelPositionList, 2678 that.negativeItemLabelPositionList 2679 )) { 2680 return false; 2681 } 2682 if (!ObjectUtilities.equal( 2683 this.baseNegativeItemLabelPosition, 2684 that.baseNegativeItemLabelPosition 2685 )) { 2686 return false; 2687 } 2688 if (this.itemLabelAnchorOffset != that.itemLabelAnchorOffset) { 2689 return false; 2690 } 2691 2692 return true; 2693 2694 } 2695 2696 2701 public int hashCode() { 2702 int result = 193; 2703 result = 37 * result + ObjectUtilities.hashCode(this.stroke); 2704 result = 37 * result + ObjectUtilities.hashCode(this.baseStroke); 2705 result = 37 * result + ObjectUtilities.hashCode(this.outlineStroke); 2706 result = 37 * result + ObjectUtilities.hashCode(this.baseOutlineStroke); 2707 return result; 2708 } 2709 2710 2718 protected Object clone() throws CloneNotSupportedException { 2719 AbstractRenderer clone = (AbstractRenderer) super.clone(); 2720 2721 if (this.paintList != null) { 2723 clone.paintList = (PaintList) this.paintList.clone(); 2724 } 2725 2727 if (this.fillPaintList != null) { 2728 clone.fillPaintList = (PaintList) this.fillPaintList.clone(); 2729 } 2730 if (this.outlinePaintList != null) { 2732 clone.outlinePaintList = (PaintList) this.outlinePaintList.clone(); 2733 } 2734 2736 if (this.strokeList != null) { 2738 clone.strokeList = (StrokeList) this.strokeList.clone(); 2739 } 2740 2742 if (this.outlineStrokeList != null) { 2744 clone.outlineStrokeList 2745 = (StrokeList) this.outlineStrokeList.clone(); 2746 } 2747 2749 if (this.shape != null) { 2750 clone.shape = ShapeUtilities.clone(this.shape); 2751 } 2752 if (this.baseShape != null) { 2753 clone.baseShape = ShapeUtilities.clone(this.baseShape); 2754 } 2755 2756 if (this.itemLabelsVisibleList != null) { 2758 clone.itemLabelsVisibleList 2759 = (BooleanList) this.itemLabelsVisibleList.clone(); 2760 } 2761 2763 if (this.itemLabelFontList != null) { 2765 clone.itemLabelFontList 2766 = (ObjectList) this.itemLabelFontList.clone(); 2767 } 2768 2770 if (this.itemLabelPaintList != null) { 2772 clone.itemLabelPaintList 2773 = (PaintList) this.itemLabelPaintList.clone(); 2774 } 2775 2777 if (this.positiveItemLabelPositionList != null) { 2779 clone.positiveItemLabelPositionList 2780 = (ObjectList) this.positiveItemLabelPositionList.clone(); 2781 } 2782 2784 if (this.negativeItemLabelPositionList != null) { 2786 clone.negativeItemLabelPositionList 2787 = (ObjectList) this.negativeItemLabelPositionList.clone(); 2788 } 2789 2791 return clone; 2792 } 2793 2794 2801 private void writeObject(ObjectOutputStream stream) throws IOException { 2802 2803 stream.defaultWriteObject(); 2804 SerialUtilities.writePaint(this.paint, stream); 2805 SerialUtilities.writePaint(this.basePaint, stream); 2806 SerialUtilities.writePaint(this.fillPaint, stream); 2807 SerialUtilities.writePaint(this.baseFillPaint, stream); 2808 SerialUtilities.writePaint(this.outlinePaint, stream); 2809 SerialUtilities.writePaint(this.baseOutlinePaint, stream); 2810 SerialUtilities.writeStroke(this.stroke, stream); 2811 SerialUtilities.writeStroke(this.baseStroke, stream); 2812 SerialUtilities.writeStroke(this.outlineStroke, stream); 2813 SerialUtilities.writeStroke(this.baseOutlineStroke, stream); 2814 SerialUtilities.writeShape(this.shape, stream); 2815 SerialUtilities.writeShape(this.baseShape, stream); 2816 SerialUtilities.writePaint(this.itemLabelPaint, stream); 2817 SerialUtilities.writePaint(this.baseItemLabelPaint, stream); 2818 2819 } 2820 2821 2829 private void readObject(ObjectInputStream stream) 2830 throws IOException , ClassNotFoundException { 2831 2832 stream.defaultReadObject(); 2833 this.paint = SerialUtilities.readPaint(stream); 2834 this.basePaint = SerialUtilities.readPaint(stream); 2835 this.fillPaint = SerialUtilities.readPaint(stream); 2836 this.baseFillPaint = SerialUtilities.readPaint(stream); 2837 this.outlinePaint = SerialUtilities.readPaint(stream); 2838 this.baseOutlinePaint = SerialUtilities.readPaint(stream); 2839 this.stroke = SerialUtilities.readStroke(stream); 2840 this.baseStroke = SerialUtilities.readStroke(stream); 2841 this.outlineStroke = SerialUtilities.readStroke(stream); 2842 this.baseOutlineStroke = SerialUtilities.readStroke(stream); 2843 this.shape = SerialUtilities.readShape(stream); 2844 this.baseShape = SerialUtilities.readShape(stream); 2845 this.itemLabelPaint = SerialUtilities.readPaint(stream); 2846 this.baseItemLabelPaint = SerialUtilities.readPaint(stream); 2847 2848 this.listenerList = new EventListenerList (); 2851 2852 } 2853 2854} 2855 | Popular Tags |