File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java | |||
Method name: void drawLeftLabel(Graphics2D, PiePlotState, PieLabelRecord)
|
Method name: void drawRightLabel(Graphics2D, PiePlotState, PieLabelRecord)
|
|||
Number of AST nodes: 23 | Number of AST nodes: 23 | |||
1 | if (this.labelLinksVisible) {↵ | 1 | if (this.labelLinksVisible) {↵ | |
2 | double theta = record.getAngle();↵ | 2 | double theta = record.getAngle();↵ | |
3 | double linkX = state.getPieCenterX() + Math.cos(theta) ↵ | 3 | double linkX = state.getPieCenterX() + Math.cos(theta) ↵ | |
4 | * state.getPieWRadius() * record.getLinkPercent();↵ | 4 | * state.getPieWRadius() * record.getLinkPercent();↵ | |
5 | double linkY = state.getPieCenterY() - Math.sin(theta) ↵ | 5 | double linkY = state.getPieCenterY() - Math.sin(theta) ↵ | |
6 | * state.getPieHRadius() * record.getLinkPercent();↵ | 6 | * state.getPieHRadius() * record.getLinkPercent();↵ | |
7 | double elbowX = state.getPieCenterX() + Math.cos(theta) ↵ | 7 | double elbowX = state.getPieCenterX() + Math.cos(theta) ↵ | |
8 | * state.getLinkArea().getWidth() / 2.0;↵ | 8 | * state.getLinkArea().getWidth() / 2.0;↵ | |
9 | double elbowY = state.getPieCenterY() - Math.sin(theta) ↵ | 9 | double elbowY = state.getPieCenterY() - Math.sin(theta) ↵ | |
10 | * state.getLinkArea().getHeight() / 2.0;↵ | 10 | * state.getLinkArea().getHeight() / 2.0;↵ | |
11 | double anchorY = elbowY;↵ | 11 | double anchorY = elbowY;↵ | |
12 | g2.setPaint(this.labelLinkPaint);↵ | 12 | g2.setPaint(this.labelLinkPaint);↵ | |
13 | g2.setStroke(this.labelLinkStroke);↵ | 13 | g2.setStroke(this.labelLinkStroke);↵ | |
14 | PieLabelLinkStyle style = getLabelLinkStyle();↵ | 14 | PieLabelLinkStyle style = getLabelLinkStyle();↵ | |
15 | if (style.equals(PieLabelLinkStyle.STANDARD)) {↵ | 15 | if (style.equals(PieLabelLinkStyle.STANDARD)) {↵ | |
16 | g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY));↵ | 16 | g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY));↵ | |
17 | g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY));↵ | 17 | g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY));↵ | |
18 | g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY));↵ | 18 | g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY));↵ | |
19 | }↵ | 19 | }↵ | |
20 | else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) {↵ | 20 | else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) {↵ | |
21 | QuadCurve2D q = new QuadCurve2D.Float();↵ | 21 | QuadCurve2D q = new QuadCurve2D.Float();↵ | |
22 | q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);↵ | 22 | q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);↵ | |
23 | g2.draw(q);↵ | 23 | g2.draw(q);↵ | |
24 | g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY)); ↵ | 24 | g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY)); ↵ | |
25 | }↵ | 25 | }↵ | |
26 | else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {↵ | 26 | else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {↵ | |
27 | CubicCurve2D c = new CubicCurve2D .Float();↵ | 27 | CubicCurve2D c = new CubicCurve2D .Float();↵ | |
28 | c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, ↵ | 28 | c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, ↵ | |
29 | linkX, linkY);↵ | 29 | linkX, linkY);↵ | |
30 | g2.draw(c);↵ | 30 | g2.draw(c);↵ | |
31 | }↵ | 31 | }↵ | |
32 | } | 32 |
| |
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) | 1.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 216 |
Number of mapped statements | 23 |
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) | 15.5 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
4 | if (this.labelLinksVisible) | 4 | if (this.labelLinksVisible) | |
5 | double theta = record.getAngle(); | 5 | double theta = record.getAngle(); | |
6 | double linkX = state.getPieCenterX() + Math.cos(theta) * state.getPieWRadius() * record.getLinkPercent(); | 6 | double linkX = state.getPieCenterX() + Math.cos(theta) * state.getPieWRadius() * record.getLinkPercent(); | |
7 | double linkY = state.getPieCenterY() - Math.sin(theta) * state.getPieHRadius() * record.getLinkPercent(); | 7 | double linkY = state.getPieCenterY() - Math.sin(theta) * state.getPieHRadius() * record.getLinkPercent(); | |
8 | double elbowX = state.getPieCenterX() + Math.cos(theta) * state.getLinkArea().getWidth() / 2.0; | 8 | double elbowX = state.getPieCenterX() + Math.cos(theta) * state.getLinkArea().getWidth() / 2.0; | |
9 | double elbowY = state.getPieCenterY() - Math.sin(theta) * state.getLinkArea().getHeight() / 2.0; | 9 | double elbowY = state.getPieCenterY() - Math.sin(theta) * state.getLinkArea().getHeight() / 2.0; | |
10 | double anchorY = elbowY; | 10 | double anchorY = elbowY; | |
11 | g2.setPaint(this.labelLinkPaint); | 11 | g2.setPaint(this.labelLinkPaint); | |
12 | g2.setStroke(this.labelLinkStroke); | 12 | g2.setStroke(this.labelLinkStroke); | |
13 | PieLabelLinkStyle style = getLabelLinkStyle(); | 13 | PieLabelLinkStyle style = getLabelLinkStyle(); | |
14 | if (style.equals(PieLabelLinkStyle.STANDARD)) | 14 | if (style.equals(PieLabelLinkStyle.STANDARD)) | |
15 | g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY)); | 15 | g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY)); | |
16 | g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY)); | 16 | g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY)); | |
17 | g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY)); | 17 | g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY)); | |
18 | else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) | 18 | else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) | |
19 | QuadCurve2D q = new QuadCurve2D.Float(); | 19 | QuadCurve2D q = new QuadCurve2D.Float(); | |
20 | q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY); | 20 | q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY); | |
21 | g2.draw(q); | 21 | g2.draw(q); | |
22 | g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY)); | 22 | g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY)); | |
23 | else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) | 23 | else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) | |
24 | CubicCurve2D c = new CubicCurve2D.Float(); | 24 | CubicCurve2D c = new CubicCurve2D.Float(); | |
25 | c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, linkX, linkY); | 25 | c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, linkX, linkY); | |
26 | g2.draw(c); | 26 | g2.draw(c); |
Row | Violation |
---|