if (hAlign == HorizontalAlignment.LEFT) {
x = frame.getX();
}
else if (hAlign == HorizontalAlignment.CENTER) {
x = frame.getCenterX() - (dimensions.width / 2.0);
}
else if (hAlign == HorizontalAlignment.RIGHT) {
x = frame.getMaxX() - dimensions.width;
}
if (vAlign == VerticalAlignment.TOP) {
y = frame.getY();
}
else if (vAlign == VerticalAlignment.CENTER) {
y = frame.getCenterY() - (dimensions.height / 2.0);
}
else if (vAlign == VerticalAlignment.BOTTOM) {
y = frame.getMaxY() - dimensions.height;
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/JFreeChart.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/JFreeChart.java
|
Method name: Rectangle2D createAlignedRectangle2D(Size2D, Rectangle2D, HorizontalAlignment, VerticalAlignment)
|
|
Method name: Rectangle2D createAlignedRectangle2D(Size2D, Rectangle2D, HorizontalAlignment, VerticalAlignment)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (hAlign == HorizontalAlignment.LEFT) {↵ | | 1 | if (vAlign == VerticalAlignment.TOP) {↵
|
2 | x = frame.getX();↵ | | 2 | y = frame.getY();↵
|
3 | }↵ | | 3 | }↵
|
4 | else if (hAlign == HorizontalAlignment.CENTER) {↵ | | 4 | else if (vAlign == VerticalAlignment.CENTER) {↵
|
5 | x = frame.getCenterX() - (dimensions.width / 2.0);↵ | | 5 | y = frame.getCenterY() - (dimensions.height / 2.0);↵
|
6 | }↵ | | 6 | }↵
|
7 | else if (hAlign == HorizontalAlignment.RIGHT) {↵ | | 7 | else if (vAlign == VerticalAlignment.BOTTOM) {↵
|
8 | x = frame.getMaxX() - dimensions.width;↵ | | 8 | y = frame.getMaxY() - dimensions.height;↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |