File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java | |||
Method name: void drawAxisLine(Graphics2D, double, Rectangle2D, RectangleEdge)
|
Method name: void drawAxisLine(Graphics2D, double, Rectangle2D, RectangleEdge)
|
|||
Number of AST nodes: 17 | Number of AST nodes: 17 | |||
1 | if (drawUpOrRight) {↵ | 1 | if (drawDownOrLeft) {↵ | |
2 | double x = 0.0;↵ | 2 | double x = 0.0;↵ | |
3 | double y = 0.0;↵ | 3 | double y = 0.0;↵ | |
4 | Shape arrow = null;↵ | 4 | Shape arrow = null;↵ | |
5 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {↵ | 5 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {↵ | |
6 | x = dataArea.getMaxX();↵ | 6 | x = dataArea.getMinX();↵ | |
7 | y = cursor;↵ | 7 | y = cursor;↵ | |
8 | arrow = this.rightArrow;↵ | 8 | arrow = this.leftArrow;↵ | |
9 | }↵ | 9 | }↵ | |
10 | else if (edge == RectangleEdge.LEFT↵ | 10 | else if (edge == RectangleEdge.LEFT↵ | |
11 | || edge == RectangleEdge.RIGHT) {↵ | 11 | || edge == RectangleEdge.RIGHT) {↵ | |
12 | x = cursor;↵ | 12 | x = cursor;↵ | |
13 | y = dataArea.getMinY();↵ | 13 | y = dataArea.getMaxY();↵ | |
14 | arrow = this.upArrow;↵ | 14 | arrow = this.downArrow;↵ | |
15 | }↵ | 15 | }↵ | |
16 | // draw the arrow...↵ | 16 | // draw the arrow...↵ | |
17 | AffineTransform transformer = new AffineTransform();↵ | 17 | AffineTransform transformer = new AffineTransform();↵ | |
18 | transformer.setToTranslation(x, y);↵ | 18 | transformer.setToTranslation(x, y);↵ | |
19 | Shape shape = transformer.createTransformedShape(arrow);↵ | 19 | Shape shape = transformer.createTransformedShape(arrow);↵ | |
20 | g2.fill(shape);↵ | 20 | g2.fill(shape);↵ | |
21 | g2.draw(shape);↵ | 21 | g2.draw(shape);↵ | |
22 | } | 22 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.8 |
Clones location | Clones are in the same method |
Number of node comparisons | 130 |
Number of mapped statements | 17 |
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) | 10.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23 | if (drawUpOrRight) |
| 40 | if (drawDownOrLeft) | ||||||||||
24 | double x = 0.0; | 41 | double x = 0.0; | |||||||||||
25 | double y = 0.0; | 42 | double y = 0.0; | |||||||||||
26 | Shape arrow = null; | 43 | Shape arrow = null; | |||||||||||
27 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) | 44 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) | |||||||||||
28 | x = dataArea.getMaxX(); |
| 45 | x = dataArea.getMinX(); | ||||||||||
29 | y = cursor; | 46 | y = cursor; | |||||||||||
30 | arrow = this.rightArrow; |
| 47 | arrow = this.leftArrow; | ||||||||||
31 | else if (edge == RectangleEdge.LEFT || edge == RectangleEdge.RIGHT) | 48 | else if (edge == RectangleEdge.LEFT || edge == RectangleEdge.RIGHT) | |||||||||||
32 | x = cursor; | 49 | x = cursor; | |||||||||||
33 | y = dataArea.getMinY(); |
| 50 | y = dataArea.getMaxY(); | ||||||||||
34 | arrow = this.upArrow; |
| 51 | arrow = this.downArrow; | ||||||||||
35 | AffineTransform transformer = new AffineTransform(); | 52 | AffineTransform transformer = new AffineTransform(); | |||||||||||
36 | transformer.setToTranslation(x, y); | 53 | transformer.setToTranslation(x, y); | |||||||||||
37 | Shape shape = transformer.createTransformedShape(arrow); | 54 | Shape shape = transformer.createTransformedShape(arrow); | |||||||||||
38 | g2.fill(shape); | 55 | g2.fill(shape); | |||||||||||
39 | g2.draw(shape); | 56 | g2.draw(shape); |
Row | Violation |
---|