File path: /jfreechart-1.0.10/src/org/jfree/chart/title/PaintScaleLegend.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/PaintScaleLegend.java | |||
Method name: Object draw(Graphics2D, Rectangle2D, Object)
|
Method name: Object draw(Graphics2D, Rectangle2D, Object)
|
|||
Number of AST nodes: 24 | Number of AST nodes: 24 | |||
1 | if (axisEdge == RectangleEdge.TOP) {↵ | 1 | if (axisEdge == RectangleEdge.LEFT) {↵ | |
2 | for (int i = 0; i < SUBDIVISIONS; i++) {↵ | 2 | for (int i = 0; i < SUBDIVISIONS; i++) {↵ | |
3 | double v = base + (i * increment);↵ | 3 | double v = base + (i * increment);↵ | |
4 | Paint p = this.scale.getPaint(v);↵ | 4 | Paint p = this.scale.getPaint(v);↵ | |
5 | double vv = this.axis.valueToJava2D(v, target, ↵ | 5 | double vv = this.axis.valueToJava2D(v, target, ↵ | |
6 | RectangleEdge.BOTTOM);↵ | 6 | RectangleEdge.LEFT);↵ | |
7 | r.setRect(vv, target.getMaxY() - this.stripWidth, ww, ↵ | 7 | r.setRect(target.getMaxX() - this.stripWidth, vv - hh, ↵ | |
8 | this.stripWidth);↵ | 8 | this.stripWidth, hh);↵ | |
9 | g2.setPaint(p);↵ | 9 | g2.setPaint(p);↵ | |
10 | g2.fill(r); ↵ | 10 | g2.fill(r);↵ | |
11 | }↵ | 11 | }↵ | |
12 | g2.setPaint(this.stripOutlinePaint);↵ | 12 | g2.setPaint(this.stripOutlinePaint);↵ | |
13 | g2.setStroke(this.stripOutlineStroke);↵ | 13 | g2.setStroke(this.stripOutlineStroke);↵ | |
14 | g2.draw(new Rectangle2D.Double(target.getMinX(), ↵ | 14 | g2.draw(new Rectangle2D.Double(target.getMaxX() ↵ | |
15 | target.getMaxY() - this.stripWidth, target.getWidth(), ↵ | 15 | - this.stripWidth, target.getMinY(), this.stripWidth, ↵ | |
16 | this.stripWidth));↵ | 16 | target.getHeight()));↵ | |
17 | this.axis.draw(g2, target.getMaxY() - this.stripWidth ↵ | 17 | this.axis.draw(g2, target.getMaxX() - this.stripWidth ↵ | |
18 | - this.axisOffset, target, target, RectangleEdge.TOP, ↵ | 18 | - this.axisOffset, target, target, RectangleEdge.LEFT, ↵ | |
19 | null); ↵ | 19 | null);↵ | |
20 | }↵ | 20 | }↵ | |
21 | else if (axisEdge == RectangleEdge.BOTTOM) {↵ | 21 | else if (axisEdge == RectangleEdge.RIGHT) {↵ | |
22 | for (int i = 0; i < SUBDIVISIONS; i++) {↵ | 22 | for (int i = 0; i < SUBDIVISIONS; i++) {↵ | |
23 | double v = base + (i * increment);↵ | 23 | double v = base + (i * increment);↵ | |
24 | Paint p = this.scale.getPaint(v);↵ | 24 | Paint p = this.scale.getPaint(v);↵ | |
25 | double vv = this.axis.valueToJava2D(v, target, ↵ | 25 | double vv = this.axis.valueToJava2D(v, target, ↵ | |
26 | RectangleEdge.BOTTOM);↵ | 26 | RectangleEdge.LEFT);↵ | |
27 | r.setRect(vv, target.getMinY(), ww, this.stripWidth);↵ | 27 | r.setRect(target.getMinX(), vv - hh, this.stripWidth, hh);↵ | |
28 | g2.setPaint(p);↵ | 28 | g2.setPaint(p);↵ | |
29 | g2.fill(r);↵ | 29 | g2.fill(r);↵ | |
30 | }↵ | 30 | }↵ | |
31 | g2.setPaint(this.stripOutlinePaint);↵ | 31 | g2.setPaint(this.stripOutlinePaint);↵ | |
32 | g2.setStroke(this.stripOutlineStroke);↵ | 32 | g2.setStroke(this.stripOutlineStroke);↵ | |
33 | g2.draw(new Rectangle2D.Double(target.getMinX(), ↵ | 33 | g2.draw(new Rectangle2D.Double(target.getMinX(), ↵ | |
34 | target.getMinY(), target.getWidth(), this.stripWidth));↵ | 34 | target.getMinY(), this.stripWidth, target.getHeight()));↵ | |
35 | this.axis.draw(g2, target.getMinY() + this.stripWidth ↵ | 35 | this.axis.draw(g2, target.getMinX() + this.stripWidth ↵ | |
36 | + this.axisOffset, target, target, ↵ | 36 | + this.axisOffset, target, target, RectangleEdge.RIGHT,↵ | |
37 | RectangleEdge.BOTTOM, null); ↵ | 37 | null); ↵ | |
38 | } | 38 |
| |
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) | 1.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 200 |
Number of mapped statements | 24 |
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) | 28.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15 | if (axisEdge == RectangleEdge.TOP) |
| 41 | if (axisEdge == RectangleEdge.LEFT) | ||||||||||||||||||||||||
16 | for (int i = 0; i < SUBDIVISIONS; i++) | 42 | for (int i = 0; i < SUBDIVISIONS; i++) | |||||||||||||||||||||||||
17 | double v = base + (i * increment); | 43 | double v = base + (i * increment); | |||||||||||||||||||||||||
18 | Paint p = this.scale.getPaint(v); | 44 | Paint p = this.scale.getPaint(v); | |||||||||||||||||||||||||
19 | double vv = this.axis.valueToJava2D(v, target, RectangleEdge.BOTTOM); |
| 45 | double vv = this.axis.valueToJava2D(v, target, RectangleEdge.LEFT); | ||||||||||||||||||||||||
20 | r.setRect(vv, target.getMaxY() - this.stripWidth, ww, this.stripWidth); |
| 46 | r.setRect(target.getMaxX() - this.stripWidth, vv - hh, this.stripWidth, hh); | ||||||||||||||||||||||||
21 | g2.setPaint(p); | 47 | g2.setPaint(p); | |||||||||||||||||||||||||
22 | g2.fill(r); | 48 | g2.fill(r); | |||||||||||||||||||||||||
23 | g2.setPaint(this.stripOutlinePaint); | 49 | g2.setPaint(this.stripOutlinePaint); | |||||||||||||||||||||||||
24 | g2.setStroke(this.stripOutlineStroke); | 50 | g2.setStroke(this.stripOutlineStroke); | |||||||||||||||||||||||||
25 | g2.draw(new Rectangle2D.Double(target.getMinX(), target.getMaxY() - this.stripWidth, target.getWidth(), this.stripWidth)); |
| 51 | g2.draw(new Rectangle2D.Double(target.getMaxX() - this.stripWidth, target.getMinY(), this.stripWidth, target.getHeight())); | ||||||||||||||||||||||||
26 | this.axis.draw(g2, target.getMaxY() - this.stripWidth - this.axisOffset, target, target, RectangleEdge.TOP, null); |
| 52 | this.axis.draw(g2, target.getMaxX() - this.stripWidth - this.axisOffset, target, target, RectangleEdge.LEFT, null); | ||||||||||||||||||||||||
27 | else if (axisEdge == RectangleEdge.BOTTOM) |
| 53 | else if (axisEdge == RectangleEdge.RIGHT) | ||||||||||||||||||||||||
28 | for (int i = 0; i < SUBDIVISIONS; i++) | 54 | for (int i = 0; i < SUBDIVISIONS; i++) | |||||||||||||||||||||||||
29 | double v = base + (i * increment); | 55 | double v = base + (i * increment); | |||||||||||||||||||||||||
30 | Paint p = this.scale.getPaint(v); | 56 | Paint p = this.scale.getPaint(v); | |||||||||||||||||||||||||
31 | double vv = this.axis.valueToJava2D(v, target, RectangleEdge.BOTTOM); |
| 57 | double vv = this.axis.valueToJava2D(v, target, RectangleEdge.LEFT); | ||||||||||||||||||||||||
32 | r.setRect(vv, target.getMinY(), ww, this.stripWidth); |
| 58 | r.setRect(target.getMinX(), vv - hh, this.stripWidth, hh); | ||||||||||||||||||||||||
33 | g2.setPaint(p); | 59 | g2.setPaint(p); | |||||||||||||||||||||||||
34 | g2.fill(r); | 60 | g2.fill(r); | |||||||||||||||||||||||||
35 | g2.setPaint(this.stripOutlinePaint); | 61 | g2.setPaint(this.stripOutlinePaint); | |||||||||||||||||||||||||
36 | g2.setStroke(this.stripOutlineStroke); | 62 | g2.setStroke(this.stripOutlineStroke); | |||||||||||||||||||||||||
37 | g2.draw(new Rectangle2D.Double(target.getMinX(), target.getMinY(), target.getWidth(), this.stripWidth)); |
| 63 | g2.draw(new Rectangle2D.Double(target.getMinX(), target.getMinY(), this.stripWidth, target.getHeight())); | ||||||||||||||||||||||||
38 | this.axis.draw(g2, target.getMinY() + this.stripWidth + this.axisOffset, target, target, RectangleEdge.BOTTOM, null); |
| 64 | this.axis.draw(g2, target.getMinX() + this.stripWidth + this.axisOffset, target, target, RectangleEdge.RIGHT, null); |
Row | Violation |
---|---|
1 | Expression vv cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression vv cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression vv cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression vv - hh cannot be parameterized, because it has dependencies to/from statements that will be extracted |