Rectangle2D bb = TextUtilities.getTextBounds(label, g2,
g2.getFontMetrics());
if ((x + bb.getWidth() / 2) > dataArea.getMaxX()) {
float xstart = (float) valueToJava2D(Math.max(first,
axisMin), dataArea, edge);
if (bb.getWidth() < (dataArea.getMaxX() - xstart)) {
x = ((float) dataArea.getMaxX() + xstart) / 2.0f;
}
else {
label = null;
}
}
Rectangle2D bb = TextUtilities.getTextBounds(label, g2,
g2.getFontMetrics());
if ((x - bb.getWidth() / 2) < dataArea.getX()) {
float xlast = (float) valueToJava2D(Math.min(last,
axisMax), dataArea, edge);
if (bb.getWidth() < (xlast - dataArea.getX())) {
x = (xlast + (float) dataArea.getX()) / 2.0f;
}
else {
label = null;
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/PeriodAxis.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/PeriodAxis.java
|
Method name: AxisState drawTickLabels(int, Graphics2D, AxisState, Rectangle2D, RectangleEdge)
|
|
Method name: AxisState drawTickLabels(int, Graphics2D, AxisState, Rectangle2D, RectangleEdge)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | Rectangle2D bb = TextUtilities.getTextBounds(label, g2, ↵ | | 1 | Rectangle2D bb = TextUtilities.getTextBounds(label, g2, ↵
|
2 | g2.getFontMetrics());↵ | | 2 | g2.getFontMetrics());↵
|
3 | if ((x + bb.getWidth() / 2) > dataArea.getMaxX()) {↵ | | 3 | if ((x - bb.getWidth() / 2) < dataArea.getX()) {↵
|
4 | float xstart = (float) valueToJava2D(Math.max(first, ↵ | | 4 | float xlast = (float) valueToJava2D(Math.min(last, ↵
|
5 | axisMin), dataArea, edge);↵ | | 5 | axisMax), dataArea, edge);↵
|
6 | if (bb.getWidth() < (dataArea.getMaxX() - xstart)) {↵ | | 6 | if (bb.getWidth() < (xlast - dataArea.getX())) {↵
|
7 | x = ((float) dataArea.getMaxX() + xstart) / 2.0f; ↵ | | 7 | x = (xlast + (float) dataArea.getX()) / 2.0f; ↵
|
8 | }↵ | | 8 | }↵
|
9 | else {↵ | | 9 | else {↵
|
10 | label = null;↵ | | 10 | label = null;↵
|
11 | }↵ | | 11 | }↵
|
12 | } | | 12 | }
|
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) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 1 |