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: 12 | Number of AST nodes: 11 | |||
1 | if (axisEdge == RectangleEdge.BOTTOM) {↵ | |||
2 | for (int i = 0; i < SUBDIVISIONS; i++) {↵ | 1 | for (int i = 0; i < SUBDIVISIONS; i++) {↵ | |
3 | double v = base + (i * increment);↵ | 2 | double v = base + (i * increment);↵ | |
4 | Paint p = this.scale.getPaint(v);↵ | 3 | Paint p = this.scale.getPaint(v);↵ | |
5 | double vv = this.axis.valueToJava2D(v, target, ↵ | 4 | double vv = this.axis.valueToJava2D(v, target, ↵ | |
6 | RectangleEdge.BOTTOM);↵ | 5 | RectangleEdge.LEFT);↵ | |
7 | r.setRect(vv, target.getMinY(), ww, this.stripWidth);↵ | 6 | r.setRect(target.getMinX(), vv - hh, this.stripWidth, hh);↵ | |
8 | g2.setPaint(p);↵ | 7 | g2.setPaint(p);↵ | |
9 | g2.fill(r);↵ | 8 | g2.fill(r);↵ | |
10 | }↵ | 9 | }↵ | |
11 | g2.setPaint(this.stripOutlinePaint);↵ | 10 | g2.setPaint(this.stripOutlinePaint);↵ | |
12 | g2.setStroke(this.stripOutlineStroke);↵ | 11 | g2.setStroke(this.stripOutlineStroke);↵ | |
13 | g2.draw(new Rectangle2D.Double(target.getMinX(), ↵ | 12 | g2.draw(new Rectangle2D.Double(target.getMinX(), ↵ | |
14 | target.getMinY(), target.getWidth(), this.stripWidth));↵ | 13 | target.getMinY(), this.stripWidth, target.getHeight()));↵ | |
15 | this.axis.draw(g2, target.getMinY() + this.stripWidth ↵ | 14 | this.axis.draw(g2, target.getMinX() + this.stripWidth ↵ | |
16 | + this.axisOffset, target, target, ↵ | 15 | + this.axisOffset, target, target, ↵ | |
17 | RectangleEdge.BOTTOM, null); ↵ | |||
18 | } | 16 | RectangleEdge.RIGHT,↵ | |
17 |
| |||
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) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 66 |
Number of mapped statements | 11 |
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) | 7.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 - hh cannot be parameterized, because it has dependencies to/from statements that will be extracted |