File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | |||
Method name: void drawRangeMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D)
|
Method name: void drawDomainMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D)
|
|||
Number of AST nodes: 92 | Number of AST nodes:92 | |||
1 | if (marker instanceof ValueMarker) {↵ | 1 | if (marker instanceof ValueMarker) {↵ | |
2 | ValueMarker vm = (ValueMarker) marker;↵ | 2 | ValueMarker vm = (ValueMarker) marker;↵ | |
3 | double value = vm.getValue();↵ | 3 | double value = vm.getValue();↵ | |
4 | Range range = domainAxis.getRange();↵ | 4 | Range range = rangeAxis.getRange();↵ | |
5 | if (!range.contains(value)) {↵ | 5 | if (!range.contains(value)) {↵ | |
6 | return;↵ | 6 | return;↵ | |
7 | }↵ | 7 | }↵ | |
8 | double v = domainAxis.valueToJava2D(value, dataArea,↵ | 8 | double v = rangeAxis.valueToJava2D(value, dataArea,↵ | |
9 | plot.getDomainAxisEdge());↵ | 9 | plot.getRangeAxisEdge());↵ | |
10 | PlotOrientation orientation = plot.getOrientation();↵ | 10 | PlotOrientation orientation = plot.getOrientation();↵ | |
11 | Line2D line = null;↵ | 11 | Line2D line = null;↵ | |
12 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 12 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
13 | line = new Line2D.Double(dataArea.getMinX(), v,↵ | 13 | line = new Line2D.Double(v, dataArea.getMinY(), v,↵ | |
14 | dataArea.getMaxX(), v);↵ | 14 | dataArea.getMaxY());↵ | |
15 | }↵ | 15 | }↵ | |
16 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 16 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
17 | line = new Line2D.Double(v, dataArea.getMinY(), v,↵ | 17 | line = new Line2D.Double(dataArea.getMinX(), v,↵ | |
18 | dataArea.getMaxY());↵ | 18 | dataArea.getMaxX(), v);↵ | |
19 | }↵ | 19 | }↵ | |
20 | final Composite originalComposite = g2.getComposite();↵ | 20 | final Composite originalComposite = g2.getComposite();↵ | |
21 | g2.setComposite(AlphaComposite.getInstance(↵ | 21 | g2.setComposite(AlphaComposite.getInstance(↵ | |
22 | AlphaComposite.SRC_OVER, marker.getAlpha()));↵ | 22 | AlphaComposite.SRC_OVER, marker.getAlpha()));↵ | |
23 | g2.setPaint(marker.getPaint());↵ | 23 | g2.setPaint(marker.getPaint());↵ | |
24 | g2.setStroke(marker.getStroke());↵ | 24 | g2.setStroke(marker.getStroke());↵ | |
25 | g2.draw(line);↵ | 25 | g2.draw(line);↵ | |
26 | String label = marker.getLabel();↵ | 26 | String label = marker.getLabel();↵ | |
27 | RectangleAnchor anchor = marker.getLabelAnchor();↵ | 27 | RectangleAnchor anchor = marker.getLabelAnchor();↵ | |
28 | if (label != null) {↵ | 28 | if (label != null) {↵ | |
29 | Font labelFont = marker.getLabelFont();↵ | 29 | Font labelFont = marker.getLabelFont();↵ | |
30 | g2.setFont(labelFont);↵ | 30 | g2.setFont(labelFont);↵ | |
31 | g2.setPaint(marker.getLabelPaint());↵ | 31 | g2.setPaint(marker.getLabelPaint());↵ | |
32 | Point2D coordinates = calculateDomainMarkerTextAnchorPoint(↵ | 32 | Point2D coordinates = calculateRangeMarkerTextAnchorPoint(↵ | |
33 | g2, orientation, dataArea, line.getBounds2D(),↵ | 33 | g2, orientation, dataArea, line.getBounds2D(),↵ | |
34 | marker.getLabelOffset(),↵ | 34 | marker.getLabelOffset(),↵ | |
35 | LengthAdjustmentType.EXPAND, anchor);↵ | 35 | LengthAdjustmentType.EXPAND, anchor);↵ | |
36 | TextUtilities.drawAlignedString(label, g2,↵ | 36 | TextUtilities.drawAlignedString(label, g2,↵ | |
37 | (float) coordinates.getX(), (float) coordinates.getY(),↵ | 37 | (float) coordinates.getX(), (float) coordinates.getY(),↵ | |
38 | marker.getLabelTextAnchor());↵ | 38 | marker.getLabelTextAnchor());↵ | |
39 | }↵ | 39 | }↵ | |
40 | g2.setComposite(originalComposite);↵ | 40 | g2.setComposite(originalComposite);↵ | |
41 | }↵ | 41 | }↵ | |
42 | else if (marker instanceof IntervalMarker) {↵ | 42 | else if (marker instanceof IntervalMarker) {↵ | |
43 | IntervalMarker im = (IntervalMarker) marker;↵ | 43 | IntervalMarker im = (IntervalMarker) marker;↵ | |
44 | double start = im.getStartValue();↵ | 44 | double start = im.getStartValue();↵ | |
45 | double end = im.getEndValue();↵ | 45 | double end = im.getEndValue();↵ | |
46 | Range range = domainAxis.getRange();↵ | 46 | Range range = rangeAxis.getRange();↵ | |
47 | if (!(range.intersects(start, end))) {↵ | 47 | if (!(range.intersects(start, end))) {↵ | |
48 | return;↵ | 48 | return;↵ | |
49 | }↵ | 49 | }↵ | |
50 | double start2d = domainAxis.valueToJava2D(start, dataArea,↵ | 50 | double start2d = rangeAxis.valueToJava2D(start, dataArea,↵ | |
51 | plot.getDomainAxisEdge());↵ | 51 | plot.getRangeAxisEdge());↵ | |
52 | double end2d = domainAxis.valueToJava2D(end, dataArea,↵ | 52 | double end2d = rangeAxis.valueToJava2D(end, dataArea,↵ | |
53 | plot.getDomainAxisEdge());↵ | 53 | plot.getRangeAxisEdge());↵ | |
54 | double low = Math.min(start2d, end2d);↵ | 54 | double low = Math.min(start2d, end2d);↵ | |
55 | double high = Math.max(start2d, end2d);↵ | 55 | double high = Math.max(start2d, end2d);↵ | |
56 | PlotOrientation orientation = plot.getOrientation();↵ | 56 | PlotOrientation orientation = plot.getOrientation();↵ | |
57 | Rectangle2D rect = null;↵ | 57 | Rectangle2D rect = null;↵ | |
58 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 58 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
59 | // clip top and bottom bounds to data area↵ | 59 | // clip left and right bounds to data area↵ | |
60 | low = Math.max(low, dataArea.getMinY());↵ | 60 | low = Math.max(low, dataArea.getMinX());↵ | |
61 | high = Math.min(high, dataArea.getMaxY());↵ | 61 | high = Math.min(high, dataArea.getMaxX());↵ | |
62 | rect = new Rectangle2D.Double(dataArea.getMinX(),↵ | 62 | rect = new Rectangle2D.Double(low,↵ | |
63 | low, dataArea.getWidth(),↵ | 63 | dataArea.getMinY(), high - low,↵ | |
64 | high - low);↵ | 64 | dataArea.getHeight());↵ | |
65 | }↵ | 65 | }↵ | |
66 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 66 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
67 | // clip left and right bounds to data area↵ | 67 | // clip top and bottom bounds to data area↵ | |
68 | low = Math.max(low, dataArea.getMinX());↵ | 68 | low = Math.max(low, dataArea.getMinY());↵ | |
69 | high = Math.min(high, dataArea.getMaxX());↵ | 69 | high = Math.min(high, dataArea.getMaxY());↵ | |
70 | rect = new Rectangle2D.Double(low,↵ | 70 | rect = new Rectangle2D.Double(dataArea.getMinX(),↵ | |
71 | dataArea.getMinY(), high - low,↵ | 71 | low, dataArea.getWidth(),↵ | |
72 | dataArea.getHeight());↵ | 72 | high - low);↵ | |
73 | }↵ | 73 | }↵ | |
74 | final Composite originalComposite = g2.getComposite();↵ | 74 | final Composite originalComposite = g2.getComposite();↵ | |
75 | g2.setComposite(AlphaComposite.getInstance(↵ | 75 | g2.setComposite(AlphaComposite.getInstance(↵ | |
76 | AlphaComposite.SRC_OVER, marker.getAlpha()));↵ | 76 | AlphaComposite.SRC_OVER, marker.getAlpha()));↵ | |
77 | Paint p = marker.getPaint();↵ | 77 | Paint p = marker.getPaint();↵ | |
78 | if (p instanceof GradientPaint) {↵ | 78 | if (p instanceof GradientPaint) {↵ | |
79 | GradientPaint gp = (GradientPaint) p;↵ | 79 | GradientPaint gp = (GradientPaint) p;↵ | |
80 | GradientPaintTransformer t = im.getGradientPaintTransformer();↵ | 80 | GradientPaintTransformer t = im.getGradientPaintTransformer();↵ | |
81 | if (t != null) {↵ | 81 | if (t != null) {↵ | |
82 | gp = t.transform(gp, rect);↵ | 82 | gp = t.transform(gp, rect);↵ | |
83 | }↵ | 83 | }↵ | |
84 | g2.setPaint(gp);↵ | 84 | g2.setPaint(gp);↵ | |
85 | }↵ | 85 | }↵ | |
86 | else {↵ | 86 | else {↵ | |
87 | g2.setPaint(p);↵ | 87 | g2.setPaint(p);↵ | |
88 | }↵ | 88 | }↵ | |
89 | g2.fill(rect);↵ | 89 | g2.fill(rect);↵ | |
90 | // now draw the outlines, if visible...↵ | 90 | // now draw the outlines, if visible...↵ | |
91 | if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) {↵ | 91 | if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) {↵ | |
92 | if (orientation == PlotOrientation.VERTICAL) {↵ | 92 | if (orientation == PlotOrientation.VERTICAL) {↵ | |
93 | Line2D line = new Line2D.Double();↵ | 93 | Line2D line = new Line2D.Double();↵ | |
94 | double y0 = dataArea.getMinY();↵ | 94 | double x0 = dataArea.getMinX();↵ | |
95 | double y1 = dataArea.getMaxY();↵ | 95 | double x1 = dataArea.getMaxX();↵ | |
96 | g2.setPaint(im.getOutlinePaint());↵ | 96 | g2.setPaint(im.getOutlinePaint());↵ | |
97 | g2.setStroke(im.getOutlineStroke());↵ | 97 | g2.setStroke(im.getOutlineStroke());↵ | |
98 | if (range.contains(start)) {↵ | 98 | if (range.contains(start)) {↵ | |
99 | line.setLine(start2d, y0, start2d, y1);↵ | 99 | line.setLine(x0, start2d, x1, start2d);↵ | |
100 | g2.draw(line);↵ | 100 | g2.draw(line);↵ | |
101 | }↵ | 101 | }↵ | |
102 | if (range.contains(end)) {↵ | 102 | if (range.contains(end)) {↵ | |
103 | line.setLine(end2d, y0, end2d, y1);↵ | 103 | line.setLine(x0, end2d, x1, end2d);↵ | |
104 | g2.draw(line);↵ | 104 | g2.draw(line);↵ | |
105 | }↵ | 105 | }↵ | |
106 | }↵ | 106 | }↵ | |
107 | else { // PlotOrientation.HORIZONTAL↵ | 107 | else { // PlotOrientation.HORIZONTAL↵ | |
108 | Line2D line = new Line2D.Double();↵ | 108 | Line2D line = new Line2D.Double();↵ | |
109 | double x0 = dataArea.getMinX();↵ | 109 | double y0 = dataArea.getMinY();↵ | |
110 | double x1 = dataArea.getMaxX();↵ | 110 | double y1 = dataArea.getMaxY();↵ | |
111 | g2.setPaint(im.getOutlinePaint());↵ | 111 | g2.setPaint(im.getOutlinePaint());↵ | |
112 | g2.setStroke(im.getOutlineStroke());↵ | 112 | g2.setStroke(im.getOutlineStroke());↵ | |
113 | if (range.contains(start)) {↵ | 113 | if (range.contains(start)) {↵ | |
114 | line.setLine(x0, start2d, x1, start2d);↵ | 114 | line.setLine(start2d, y0, start2d, y1);↵ | |
115 | g2.draw(line);↵ | 115 | g2.draw(line);↵ | |
116 | }↵ | 116 | }↵ | |
117 | if (range.contains(end)) {↵ | 117 | if (range.contains(end)) {↵ | |
118 | line.setLine(x0, end2d, x1, end2d);↵ | 118 | line.setLine(end2d, y0, end2d, y1);↵ | |
119 | g2.draw(line);↵ | 119 | g2.draw(line);↵ | |
120 | }↵ | 120 | }↵ | |
121 | }↵ | 121 | }↵ | |
122 | }↵ | 122 | }↵ | |
123 | String label = marker.getLabel();↵ | 123 | String label = marker.getLabel();↵ | |
124 | RectangleAnchor anchor = marker.getLabelAnchor();↵ | 124 | RectangleAnchor anchor = marker.getLabelAnchor();↵ | |
125 | if (label != null) {↵ | 125 | if (label != null) {↵ | |
126 | Font labelFont = marker.getLabelFont();↵ | 126 | Font labelFont = marker.getLabelFont();↵ | |
127 | g2.setFont(labelFont);↵ | 127 | g2.setFont(labelFont);↵ | |
128 | g2.setPaint(marker.getLabelPaint());↵ | 128 | g2.setPaint(marker.getLabelPaint());↵ | |
129 | Point2D coordinates = calculateDomainMarkerTextAnchorPoint(↵ | 129 | Point2D coordinates = calculateRangeMarkerTextAnchorPoint(↵ | |
130 | g2, orientation, dataArea, rect,↵ | 130 | g2, orientation, dataArea, rect,↵ | |
131 | marker.getLabelOffset(), marker.getLabelOffsetType(),↵ | 131 | marker.getLabelOffset(), marker.getLabelOffsetType(),↵ | |
132 | anchor);↵ | 132 | anchor);↵ | |
133 | TextUtilities.drawAlignedString(label, g2,↵ | 133 | TextUtilities.drawAlignedString(label, g2,↵ | |
134 | (float) coordinates.getX(), (float) coordinates.getY(),↵ | 134 | (float) coordinates.getX(), (float) coordinates.getY(),↵ | |
135 | marker.getLabelTextAnchor());↵ | 135 | marker.getLabelTextAnchor());↵ | |
136 | }↵ | 136 | }↵ | |
137 | g2.setComposite(originalComposite);↵ | 137 | g2.setComposite(originalComposite);↵ | |
138 | } | 138 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 7.820478 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 1200 |
Number of mapped statements | 92 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 86.8931 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (marker instanceof ValueMarker) | 1 | if (marker instanceof ValueMarker) | ||||||||||||||
2 | ValueMarker vm = (ValueMarker)marker; | 2 | ValueMarker vm = (ValueMarker)marker; | ||||||||||||||
3 | double value = vm.getValue(); | 3 | double value = vm.getValue(); | ||||||||||||||
4 | Range range = domainAxis.getRange(); |
| 4 | Range range = rangeAxis.getRange(); | |||||||||||||
5 | if (!range.contains(value)) | 5 | if (!range.contains(value)) | ||||||||||||||
6 | return; | 6 | return; | ||||||||||||||
7 | double v = domainAxis.valueToJava2D(value, dataArea, plot.getDomainAxisEdge()); |
| 7 | double v = rangeAxis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge()); | |||||||||||||
8 | PlotOrientation orientation = plot.getOrientation(); | 8 | PlotOrientation orientation = plot.getOrientation(); | ||||||||||||||
9 | Line2D line = null; | 9 | Line2D line = null; | ||||||||||||||
10 | if (orientation == PlotOrientation.HORIZONTAL) |
| 12 | if (orientation == PlotOrientation.VERTICAL) | |||||||||||||
11 | line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); | 13 | line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); | ||||||||||||||
12 | else if (orientation == PlotOrientation.VERTICAL) |
| 10 | else if (orientation == PlotOrientation.HORIZONTAL) | |||||||||||||
13 | line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); | 11 | line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); | ||||||||||||||
14 | final Composite originalComposite = g2.getComposite(); | 14 | final Composite originalComposite = g2.getComposite(); | ||||||||||||||
15 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha())); | 15 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha())); | ||||||||||||||
16 | g2.setPaint(marker.getPaint()); | 16 | g2.setPaint(marker.getPaint()); | ||||||||||||||
17 | g2.setStroke(marker.getStroke()); | 17 | g2.setStroke(marker.getStroke()); | ||||||||||||||
18 | g2.draw(line); | 18 | g2.draw(line); | ||||||||||||||
19 | String label = marker.getLabel(); | 19 | String label = marker.getLabel(); | ||||||||||||||
20 | RectangleAnchor anchor = marker.getLabelAnchor(); | 20 | RectangleAnchor anchor = marker.getLabelAnchor(); | ||||||||||||||
21 | if (label != null) | 21 | if (label != null) | ||||||||||||||
22 | Font labelFont = marker.getLabelFont(); | 22 | Font labelFont = marker.getLabelFont(); | ||||||||||||||
23 | g2.setFont(labelFont); | 23 | g2.setFont(labelFont); | ||||||||||||||
24 | g2.setPaint(marker.getLabelPaint()); | 24 | g2.setPaint(marker.getLabelPaint()); | ||||||||||||||
25 | Point2D coordinates = calculateDomainMarkerTextAnchorPoint(g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor); |
| 25 | Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), LengthAdjustmentType.EXPAND, anchor); | |||||||||||||
26 | TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor()); | 26 | TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor()); | ||||||||||||||
27 | g2.setComposite(originalComposite); | 27 | g2.setComposite(originalComposite); | ||||||||||||||
28 | else if (marker instanceof IntervalMarker) | 28 | else if (marker instanceof IntervalMarker) | ||||||||||||||
29 | IntervalMarker im = (IntervalMarker)marker; | 29 | IntervalMarker im = (IntervalMarker)marker; | ||||||||||||||
30 | double start = im.getStartValue(); | 30 | double start = im.getStartValue(); | ||||||||||||||
31 | double end = im.getEndValue(); | 31 | double end = im.getEndValue(); | ||||||||||||||
32 | Range range = domainAxis.getRange(); |
| 32 | Range range = rangeAxis.getRange(); | |||||||||||||
33 | if (!(range.intersects(start, end))) | 33 | if (!(range.intersects(start, end))) | ||||||||||||||
34 | return; | 34 | return; | ||||||||||||||
35 | double start2d = domainAxis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); |
| 35 | double start2d = rangeAxis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge()); | |||||||||||||
36 | double end2d = domainAxis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); |
| 36 | double end2d = rangeAxis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge()); | |||||||||||||
37 | double low = Math.min(start2d, end2d); | 37 | double low = Math.min(start2d, end2d); | ||||||||||||||
38 | double high = Math.max(start2d, end2d); | 38 | double high = Math.max(start2d, end2d); | ||||||||||||||
39 | PlotOrientation orientation = plot.getOrientation(); | 39 | PlotOrientation orientation = plot.getOrientation(); | ||||||||||||||
40 | Rectangle2D rect = null; | 40 | Rectangle2D rect = null; | ||||||||||||||
41 | if (orientation == PlotOrientation.HORIZONTAL) |
| 45 | if (orientation == PlotOrientation.VERTICAL) | |||||||||||||
42 | low = Math.max(low, dataArea.getMinY()); | 46 | low = Math.max(low, dataArea.getMinY()); | ||||||||||||||
43 | high = Math.min(high, dataArea.getMaxY()); | 47 | high = Math.min(high, dataArea.getMaxY()); | ||||||||||||||
44 | rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); | 48 | rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); | ||||||||||||||
45 | else if (orientation == PlotOrientation.VERTICAL) |
| 41 | else if (orientation == PlotOrientation.HORIZONTAL) | |||||||||||||
46 | low = Math.max(low, dataArea.getMinX()); | 42 | low = Math.max(low, dataArea.getMinX()); | ||||||||||||||
47 | high = Math.min(high, dataArea.getMaxX()); | 43 | high = Math.min(high, dataArea.getMaxX()); | ||||||||||||||
48 | rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); | 44 | rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); | ||||||||||||||
49 | final Composite originalComposite = g2.getComposite(); | 49 | final Composite originalComposite = g2.getComposite(); | ||||||||||||||
50 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha())); | 50 | g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha())); | ||||||||||||||
51 | Paint p = marker.getPaint(); | 51 | Paint p = marker.getPaint(); | ||||||||||||||
52 | if (p instanceof GradientPaint) | 52 | if (p instanceof GradientPaint) | ||||||||||||||
53 | GradientPaint gp = (GradientPaint)p; | 53 | GradientPaint gp = (GradientPaint)p; | ||||||||||||||
54 | GradientPaintTransformer t = im.getGradientPaintTransformer(); | 54 | GradientPaintTransformer t = im.getGradientPaintTransformer(); | ||||||||||||||
55 | if (t != null) | 55 | if (t != null) | ||||||||||||||
56 | gp = t.transform(gp, rect); | 56 | gp = t.transform(gp, rect); | ||||||||||||||
57 | g2.setPaint(gp); | 57 | g2.setPaint(gp); | ||||||||||||||
else | else | ||||||||||||||||
58 | g2.setPaint(p); | 58 | g2.setPaint(p); | ||||||||||||||
59 | g2.fill(rect); | 59 | g2.fill(rect); | ||||||||||||||
60 | if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) | 60 | if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) | ||||||||||||||
61 | if (orientation == PlotOrientation.VERTICAL) |
| 61 | if (orientation == PlotOrientation.VERTICAL) | |||||||||||||
62 | Line2D line = new Line2D.Double(); | 73 | Line2D line = new Line2D.Double(); | ||||||||||||||
63 | double y0 = dataArea.getMinY(); | 74 | double y0 = dataArea.getMinY(); | ||||||||||||||
64 | double y1 = dataArea.getMaxY(); | 75 | double y1 = dataArea.getMaxY(); | ||||||||||||||
65 | g2.setPaint(im.getOutlinePaint()); | 76 | g2.setPaint(im.getOutlinePaint()); | ||||||||||||||
66 | g2.setStroke(im.getOutlineStroke()); | 77 | g2.setStroke(im.getOutlineStroke()); | ||||||||||||||
67 | if (range.contains(start)) | 78 | if (range.contains(start)) | ||||||||||||||
68 | line.setLine(start2d, y0, start2d, y1); | 79 | line.setLine(start2d, y0, start2d, y1); | ||||||||||||||
69 | g2.draw(line); | 80 | g2.draw(line); | ||||||||||||||
70 | if (range.contains(end)) | 81 | if (range.contains(end)) | ||||||||||||||
71 | line.setLine(end2d, y0, end2d, y1); | 82 | line.setLine(end2d, y0, end2d, y1); | ||||||||||||||
72 | g2.draw(line); | 83 | g2.draw(line); | ||||||||||||||
else | else | ||||||||||||||||
73 | Line2D line = new Line2D.Double(); | 62 | Line2D line = new Line2D.Double(); | ||||||||||||||
74 | double x0 = dataArea.getMinX(); | 63 | double x0 = dataArea.getMinX(); | ||||||||||||||
75 | double x1 = dataArea.getMaxX(); | 64 | double x1 = dataArea.getMaxX(); | ||||||||||||||
76 | g2.setPaint(im.getOutlinePaint()); | 65 | g2.setPaint(im.getOutlinePaint()); | ||||||||||||||
77 | g2.setStroke(im.getOutlineStroke()); | 66 | g2.setStroke(im.getOutlineStroke()); | ||||||||||||||
78 | if (range.contains(start)) | 67 | if (range.contains(start)) | ||||||||||||||
79 | line.setLine(x0, start2d, x1, start2d); | 68 | line.setLine(x0, start2d, x1, start2d); | ||||||||||||||
80 | g2.draw(line); | 69 | g2.draw(line); | ||||||||||||||
81 | if (range.contains(end)) | 70 | if (range.contains(end)) | ||||||||||||||
82 | line.setLine(x0, end2d, x1, end2d); | 71 | line.setLine(x0, end2d, x1, end2d); | ||||||||||||||
83 | g2.draw(line); | 72 | g2.draw(line); | ||||||||||||||
84 | String label = marker.getLabel(); | 84 | String label = marker.getLabel(); | ||||||||||||||
85 | RectangleAnchor anchor = marker.getLabelAnchor(); | 85 | RectangleAnchor anchor = marker.getLabelAnchor(); | ||||||||||||||
86 | if (label != null) | 86 | if (label != null) | ||||||||||||||
87 | Font labelFont = marker.getLabelFont(); | 87 | Font labelFont = marker.getLabelFont(); | ||||||||||||||
88 | g2.setFont(labelFont); | 88 | g2.setFont(labelFont); | ||||||||||||||
89 | g2.setPaint(marker.getLabelPaint()); | 89 | g2.setPaint(marker.getLabelPaint()); | ||||||||||||||
90 | Point2D coordinates = calculateDomainMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor); |
| 90 | Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor); | |||||||||||||
91 | TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor()); | 91 | TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor()); | ||||||||||||||
92 | g2.setComposite(originalComposite); | 92 | g2.setComposite(originalComposite); |
Row | Violation |
---|---|
1 | Expression calculateDomainMarkerTextAnchorPoint(g2,orientation,dataArea,line.getBounds2D(),marker.getLabelOffset(),LengthAdjustmentType.EXPAND,anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression calculateRangeMarkerTextAnchorPoint(g2,orientation,dataArea,line.getBounds2D(),marker.getLabelOffset(),LengthAdjustmentType.EXPAND,anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression orientation == PlotOrientation.VERTICAL cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression orientation == PlotOrientation.VERTICAL cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression calculateDomainMarkerTextAnchorPoint(g2,orientation,dataArea,rect,marker.getLabelOffset(),marker.getLabelOffsetType(),anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression calculateRangeMarkerTextAnchorPoint(g2,orientation,dataArea,rect,marker.getLabelOffset(),marker.getLabelOffsetType(),anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted |