File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBarRenderer.java | |||
Method name: Point2D calculateLabelAnchorPoint(ItemLabelAnchor, Rectangle2D, PlotOrientation)
|
Method name: Point2D calculateLabelAnchorPoint(ItemLabelAnchor, Rectangle2D, PlotOrientation)
|
|||
Number of AST nodes: 67 | Number of AST nodes: 67 | |||
1 | Point2D result = null;↵ | 1 | Point2D result = null;↵ | |
2 | double offset = getItemLabelAnchorOffset();↵ | 2 | double offset = getItemLabelAnchorOffset();↵ | |
3 | double x0 = bar.getX() - offset;↵ | 3 | double x0 = bar.getX() - offset;↵ | |
4 | double x1 = bar.getX();↵ | 4 | double x1 = bar.getX();↵ | |
5 | double x2 = bar.getX() + offset;↵ | 5 | double x2 = bar.getX() + offset;↵ | |
6 | double x3 = bar.getCenterX();↵ | 6 | double x3 = bar.getCenterX();↵ | |
7 | double x4 = bar.getMaxX() - offset;↵ | 7 | double x4 = bar.getMaxX() - offset;↵ | |
8 | double x5 = bar.getMaxX();↵ | 8 | double x5 = bar.getMaxX();↵ | |
9 | double x6 = bar.getMaxX() + offset;↵ | 9 | double x6 = bar.getMaxX() + offset;↵ | |
10 | double y0 = bar.getMaxY() + offset;↵ | 10 | double y0 = bar.getMaxY() + offset;↵ | |
11 | double y1 = bar.getMaxY();↵ | 11 | double y1 = bar.getMaxY();↵ | |
12 | double y2 = bar.getMaxY() - offset;↵ | 12 | double y2 = bar.getMaxY() - offset;↵ | |
13 | double y3 = bar.getCenterY();↵ | 13 | double y3 = bar.getCenterY();↵ | |
14 | double y4 = bar.getMinY() + offset;↵ | 14 | double y4 = bar.getMinY() + offset;↵ | |
15 | double y5 = bar.getMinY();↵ | 15 | double y5 = bar.getMinY();↵ | |
16 | double y6 = bar.getMinY() - offset;↵ | 16 | double y6 = bar.getMinY() - offset;↵ | |
17 | if (anchor == ItemLabelAnchor.CENTER) {↵ | 17 | if (anchor == ItemLabelAnchor.CENTER) {↵ | |
18 | result = new Point2D.Double(x3, y3);↵ | 18 | result = new Point2D.Double(x3, y3);↵ | |
19 | }↵ | 19 | }↵ | |
20 | else if (anchor == ItemLabelAnchor.INSIDE1) {↵ | 20 | else if (anchor == ItemLabelAnchor.INSIDE1) {↵ | |
21 | result = new Point2D.Double(x4, y4);↵ | 21 | result = new Point2D.Double(x4, y4);↵ | |
22 | }↵ | 22 | }↵ | |
23 | else if (anchor == ItemLabelAnchor.INSIDE2) {↵ | 23 | else if (anchor == ItemLabelAnchor.INSIDE2) {↵ | |
24 | result = new Point2D.Double(x4, y4);↵ | 24 | result = new Point2D.Double(x4, y4);↵ | |
25 | }↵ | 25 | }↵ | |
26 | else if (anchor == ItemLabelAnchor.INSIDE3) {↵ | 26 | else if (anchor == ItemLabelAnchor.INSIDE3) {↵ | |
27 | result = new Point2D.Double(x4, y3);↵ | 27 | result = new Point2D.Double(x4, y3);↵ | |
28 | }↵ | 28 | }↵ | |
29 | else if (anchor == ItemLabelAnchor.INSIDE4) {↵ | 29 | else if (anchor == ItemLabelAnchor.INSIDE4) {↵ | |
30 | result = new Point2D.Double(x4, y2);↵ | 30 | result = new Point2D.Double(x4, y2);↵ | |
31 | }↵ | 31 | }↵ | |
32 | else if (anchor == ItemLabelAnchor.INSIDE5) {↵ | 32 | else if (anchor == ItemLabelAnchor.INSIDE5) {↵ | |
33 | result = new Point2D.Double(x4, y2);↵ | 33 | result = new Point2D.Double(x4, y2);↵ | |
34 | }↵ | 34 | }↵ | |
35 | else if (anchor == ItemLabelAnchor.INSIDE6) {↵ | 35 | else if (anchor == ItemLabelAnchor.INSIDE6) {↵ | |
36 | result = new Point2D.Double(x3, y2);↵ | 36 | result = new Point2D.Double(x3, y2);↵ | |
37 | }↵ | 37 | }↵ | |
38 | else if (anchor == ItemLabelAnchor.INSIDE7) {↵ | 38 | else if (anchor == ItemLabelAnchor.INSIDE7) {↵ | |
39 | result = new Point2D.Double(x2, y2);↵ | 39 | result = new Point2D.Double(x2, y2);↵ | |
40 | }↵ | 40 | }↵ | |
41 | else if (anchor == ItemLabelAnchor.INSIDE8) {↵ | 41 | else if (anchor == ItemLabelAnchor.INSIDE8) {↵ | |
42 | result = new Point2D.Double(x2, y2);↵ | 42 | result = new Point2D.Double(x2, y2);↵ | |
43 | }↵ | 43 | }↵ | |
44 | else if (anchor == ItemLabelAnchor.INSIDE9) {↵ | 44 | else if (anchor == ItemLabelAnchor.INSIDE9) {↵ | |
45 | result = new Point2D.Double(x2, y3);↵ | 45 | result = new Point2D.Double(x2, y3);↵ | |
46 | }↵ | 46 | }↵ | |
47 | else if (anchor == ItemLabelAnchor.INSIDE10) {↵ | 47 | else if (anchor == ItemLabelAnchor.INSIDE10) {↵ | |
48 | result = new Point2D.Double(x2, y4);↵ | 48 | result = new Point2D.Double(x2, y4);↵ | |
49 | }↵ | 49 | }↵ | |
50 | else if (anchor == ItemLabelAnchor.INSIDE11) {↵ | 50 | else if (anchor == ItemLabelAnchor.INSIDE11) {↵ | |
51 | result = new Point2D.Double(x2, y4);↵ | 51 | result = new Point2D.Double(x2, y4);↵ | |
52 | }↵ | 52 | }↵ | |
53 | else if (anchor == ItemLabelAnchor.INSIDE12) {↵ | 53 | else if (anchor == ItemLabelAnchor.INSIDE12) {↵ | |
54 | result = new Point2D.Double(x3, y4);↵ | 54 | result = new Point2D.Double(x3, y4);↵ | |
55 | }↵ | 55 | }↵ | |
56 | else if (anchor == ItemLabelAnchor.OUTSIDE1) {↵ | 56 | else if (anchor == ItemLabelAnchor.OUTSIDE1) {↵ | |
57 | result = new Point2D.Double(x5, y6);↵ | 57 | result = new Point2D.Double(x5, y6);↵ | |
58 | }↵ | 58 | }↵ | |
59 | else if (anchor == ItemLabelAnchor.OUTSIDE2) {↵ | 59 | else if (anchor == ItemLabelAnchor.OUTSIDE2) {↵ | |
60 | result = new Point2D.Double(x6, y5);↵ | 60 | result = new Point2D.Double(x6, y5);↵ | |
61 | }↵ | 61 | }↵ | |
62 | else if (anchor == ItemLabelAnchor.OUTSIDE3) {↵ | 62 | else if (anchor == ItemLabelAnchor.OUTSIDE3) {↵ | |
63 | result = new Point2D.Double(x6, y3);↵ | 63 | result = new Point2D.Double(x6, y3);↵ | |
64 | }↵ | 64 | }↵ | |
65 | else if (anchor == ItemLabelAnchor.OUTSIDE4) {↵ | 65 | else if (anchor == ItemLabelAnchor.OUTSIDE4) {↵ | |
66 | result = new Point2D.Double(x6, y1);↵ | 66 | result = new Point2D.Double(x6, y1);↵ | |
67 | }↵ | 67 | }↵ | |
68 | else if (anchor == ItemLabelAnchor.OUTSIDE5) {↵ | 68 | else if (anchor == ItemLabelAnchor.OUTSIDE5) {↵ | |
69 | result = new Point2D.Double(x5, y0);↵ | 69 | result = new Point2D.Double(x5, y0);↵ | |
70 | }↵ | 70 | }↵ | |
71 | else if (anchor == ItemLabelAnchor.OUTSIDE6) {↵ | 71 | else if (anchor == ItemLabelAnchor.OUTSIDE6) {↵ | |
72 | result = new Point2D.Double(x3, y0);↵ | 72 | result = new Point2D.Double(x3, y0);↵ | |
73 | }↵ | 73 | }↵ | |
74 | else if (anchor == ItemLabelAnchor.OUTSIDE7) {↵ | 74 | else if (anchor == ItemLabelAnchor.OUTSIDE7) {↵ | |
75 | result = new Point2D.Double(x1, y0);↵ | 75 | result = new Point2D.Double(x1, y0);↵ | |
76 | }↵ | 76 | }↵ | |
77 | else if (anchor == ItemLabelAnchor.OUTSIDE8) {↵ | 77 | else if (anchor == ItemLabelAnchor.OUTSIDE8) {↵ | |
78 | result = new Point2D.Double(x0, y1);↵ | 78 | result = new Point2D.Double(x0, y1);↵ | |
79 | }↵ | 79 | }↵ | |
80 | else if (anchor == ItemLabelAnchor.OUTSIDE9) {↵ | 80 | else if (anchor == ItemLabelAnchor.OUTSIDE9) {↵ | |
81 | result = new Point2D.Double(x0, y3);↵ | 81 | result = new Point2D.Double(x0, y3);↵ | |
82 | }↵ | 82 | }↵ | |
83 | else if (anchor == ItemLabelAnchor.OUTSIDE10) {↵ | 83 | else if (anchor == ItemLabelAnchor.OUTSIDE10) {↵ | |
84 | result = new Point2D.Double(x0, y5);↵ | 84 | result = new Point2D.Double(x0, y5);↵ | |
85 | }↵ | 85 | }↵ | |
86 | else if (anchor == ItemLabelAnchor.OUTSIDE11) {↵ | 86 | else if (anchor == ItemLabelAnchor.OUTSIDE11) {↵ | |
87 | result = new Point2D.Double(x1, y6);↵ | 87 | result = new Point2D.Double(x1, y6);↵ | |
88 | }↵ | 88 | }↵ | |
89 | else if (anchor == ItemLabelAnchor.OUTSIDE12) {↵ | 89 | else if (anchor == ItemLabelAnchor.OUTSIDE12) {↵ | |
90 | result = new Point2D.Double(x3, y6);↵ | 90 | result = new Point2D.Double(x3, y6);↵ | |
91 | }↵ | 91 | }↵ | |
92 | return result; | 92 |
| |
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) | 72.8 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 1889 |
Number of mapped statements | 67 |
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) | 251.9 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | Point2D result = null; | 1 | Point2D result = null; | |
2 | double offset = getItemLabelAnchorOffset(); | 2 | double offset = getItemLabelAnchorOffset(); | |
3 | double x0 = bar.getX() - offset; | 3 | double x0 = bar.getX() - offset; | |
4 | double x1 = bar.getX(); | 4 | double x1 = bar.getX(); | |
5 | double x2 = bar.getX() + offset; | 5 | double x2 = bar.getX() + offset; | |
6 | double x3 = bar.getCenterX(); | 6 | double x3 = bar.getCenterX(); | |
7 | double x4 = bar.getMaxX() - offset; | 7 | double x4 = bar.getMaxX() - offset; | |
8 | double x5 = bar.getMaxX(); | 8 | double x5 = bar.getMaxX(); | |
9 | double x6 = bar.getMaxX() + offset; | 9 | double x6 = bar.getMaxX() + offset; | |
10 | double y0 = bar.getMaxY() + offset; | 10 | double y0 = bar.getMaxY() + offset; | |
11 | double y1 = bar.getMaxY(); | 11 | double y1 = bar.getMaxY(); | |
12 | double y2 = bar.getMaxY() - offset; | 12 | double y2 = bar.getMaxY() - offset; | |
13 | double y3 = bar.getCenterY(); | 13 | double y3 = bar.getCenterY(); | |
14 | double y4 = bar.getMinY() + offset; | 14 | double y4 = bar.getMinY() + offset; | |
15 | double y5 = bar.getMinY(); | 15 | double y5 = bar.getMinY(); | |
16 | double y6 = bar.getMinY() - offset; | 16 | double y6 = bar.getMinY() - offset; | |
17 | if (anchor == ItemLabelAnchor.CENTER) | 17 | if (anchor == ItemLabelAnchor.CENTER) | |
18 | result = new Point2D.Double(x3, y3); | 18 | result = new Point2D.Double(x3, y3); | |
19 | else if (anchor == ItemLabelAnchor.INSIDE1) | 19 | else if (anchor == ItemLabelAnchor.INSIDE1) | |
20 | result = new Point2D.Double(x4, y4); | 20 | result = new Point2D.Double(x4, y4); | |
21 | else if (anchor == ItemLabelAnchor.INSIDE2) | 21 | else if (anchor == ItemLabelAnchor.INSIDE2) | |
22 | result = new Point2D.Double(x4, y4); | 22 | result = new Point2D.Double(x4, y4); | |
23 | else if (anchor == ItemLabelAnchor.INSIDE3) | 23 | else if (anchor == ItemLabelAnchor.INSIDE3) | |
24 | result = new Point2D.Double(x4, y3); | 24 | result = new Point2D.Double(x4, y3); | |
25 | else if (anchor == ItemLabelAnchor.INSIDE4) | 25 | else if (anchor == ItemLabelAnchor.INSIDE4) | |
26 | result = new Point2D.Double(x4, y2); | 26 | result = new Point2D.Double(x4, y2); | |
27 | else if (anchor == ItemLabelAnchor.INSIDE5) | 27 | else if (anchor == ItemLabelAnchor.INSIDE5) | |
28 | result = new Point2D.Double(x4, y2); | 28 | result = new Point2D.Double(x4, y2); | |
29 | else if (anchor == ItemLabelAnchor.INSIDE6) | 29 | else if (anchor == ItemLabelAnchor.INSIDE6) | |
30 | result = new Point2D.Double(x3, y2); | 30 | result = new Point2D.Double(x3, y2); | |
31 | else if (anchor == ItemLabelAnchor.INSIDE7) | 31 | else if (anchor == ItemLabelAnchor.INSIDE7) | |
32 | result = new Point2D.Double(x2, y2); | 32 | result = new Point2D.Double(x2, y2); | |
33 | else if (anchor == ItemLabelAnchor.INSIDE8) | 33 | else if (anchor == ItemLabelAnchor.INSIDE8) | |
34 | result = new Point2D.Double(x2, y2); | 34 | result = new Point2D.Double(x2, y2); | |
35 | else if (anchor == ItemLabelAnchor.INSIDE9) | 35 | else if (anchor == ItemLabelAnchor.INSIDE9) | |
36 | result = new Point2D.Double(x2, y3); | 36 | result = new Point2D.Double(x2, y3); | |
37 | else if (anchor == ItemLabelAnchor.INSIDE10) | 37 | else if (anchor == ItemLabelAnchor.INSIDE10) | |
38 | result = new Point2D.Double(x2, y4); | 38 | result = new Point2D.Double(x2, y4); | |
39 | else if (anchor == ItemLabelAnchor.INSIDE11) | 39 | else if (anchor == ItemLabelAnchor.INSIDE11) | |
40 | result = new Point2D.Double(x2, y4); | 40 | result = new Point2D.Double(x2, y4); | |
41 | else if (anchor == ItemLabelAnchor.INSIDE12) | 41 | else if (anchor == ItemLabelAnchor.INSIDE12) | |
42 | result = new Point2D.Double(x3, y4); | 42 | result = new Point2D.Double(x3, y4); | |
43 | else if (anchor == ItemLabelAnchor.OUTSIDE1) | 43 | else if (anchor == ItemLabelAnchor.OUTSIDE1) | |
44 | result = new Point2D.Double(x5, y6); | 44 | result = new Point2D.Double(x5, y6); | |
45 | else if (anchor == ItemLabelAnchor.OUTSIDE2) | 45 | else if (anchor == ItemLabelAnchor.OUTSIDE2) | |
46 | result = new Point2D.Double(x6, y5); | 46 | result = new Point2D.Double(x6, y5); | |
47 | else if (anchor == ItemLabelAnchor.OUTSIDE3) | 47 | else if (anchor == ItemLabelAnchor.OUTSIDE3) | |
48 | result = new Point2D.Double(x6, y3); | 48 | result = new Point2D.Double(x6, y3); | |
49 | else if (anchor == ItemLabelAnchor.OUTSIDE4) | 49 | else if (anchor == ItemLabelAnchor.OUTSIDE4) | |
50 | result = new Point2D.Double(x6, y1); | 50 | result = new Point2D.Double(x6, y1); | |
51 | else if (anchor == ItemLabelAnchor.OUTSIDE5) | 51 | else if (anchor == ItemLabelAnchor.OUTSIDE5) | |
52 | result = new Point2D.Double(x5, y0); | 52 | result = new Point2D.Double(x5, y0); | |
53 | else if (anchor == ItemLabelAnchor.OUTSIDE6) | 53 | else if (anchor == ItemLabelAnchor.OUTSIDE6) | |
54 | result = new Point2D.Double(x3, y0); | 54 | result = new Point2D.Double(x3, y0); | |
55 | else if (anchor == ItemLabelAnchor.OUTSIDE7) | 55 | else if (anchor == ItemLabelAnchor.OUTSIDE7) | |
56 | result = new Point2D.Double(x1, y0); | 56 | result = new Point2D.Double(x1, y0); | |
57 | else if (anchor == ItemLabelAnchor.OUTSIDE8) | 57 | else if (anchor == ItemLabelAnchor.OUTSIDE8) | |
58 | result = new Point2D.Double(x0, y1); | 58 | result = new Point2D.Double(x0, y1); | |
59 | else if (anchor == ItemLabelAnchor.OUTSIDE9) | 59 | else if (anchor == ItemLabelAnchor.OUTSIDE9) | |
60 | result = new Point2D.Double(x0, y3); | 60 | result = new Point2D.Double(x0, y3); | |
61 | else if (anchor == ItemLabelAnchor.OUTSIDE10) | 61 | else if (anchor == ItemLabelAnchor.OUTSIDE10) | |
62 | result = new Point2D.Double(x0, y5); | 62 | result = new Point2D.Double(x0, y5); | |
63 | else if (anchor == ItemLabelAnchor.OUTSIDE11) | 63 | else if (anchor == ItemLabelAnchor.OUTSIDE11) | |
64 | result = new Point2D.Double(x1, y6); | 64 | result = new Point2D.Double(x1, y6); | |
65 | else if (anchor == ItemLabelAnchor.OUTSIDE12) | 65 | else if (anchor == ItemLabelAnchor.OUTSIDE12) | |
66 | result = new Point2D.Double(x3, y6); | 66 | result = new Point2D.Double(x3, y6); | |
67 | return result; | 67 | return result; |
Row | Violation |
---|