File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | |||
Method name: void drawItemLabel(Graphics2D, PlotOrientation, CategoryDataset, int, int, double, double, boolean)
|
Method name: void drawItemLabel(Graphics2D, PlotOrientation, XYDataset, int, int, double, double, boolean)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | if (generator != null) {↵ | 1 | if (generator != null) {↵ | |
2 | Font labelFont = getItemLabelFont(row, column);↵ | 2 | Font labelFont = getItemLabelFont(series, item);↵ | |
3 | Paint paint = getItemLabelPaint(row, column);↵ | 3 | Paint paint = getItemLabelPaint(series, item);↵ | |
4 | g2.setFont(labelFont);↵ | 4 | g2.setFont(labelFont);↵ | |
5 | g2.setPaint(paint);↵ | 5 | g2.setPaint(paint);↵ | |
6 | String label = generator.generateLabel(dataset, row, column);↵ | 6 | String label = generator.generateLabel(dataset, series, item);↵ | |
7 | // get the label position..↵ | |||
7 | ItemLabelPosition position = null;↵ | 8 | ItemLabelPosition position = null;↵ | |
8 | if (!negative) {↵ | 9 | if (!negative) {↵ | |
9 | position = getPositiveItemLabelPosition(row, column);↵ | 10 | position = getPositiveItemLabelPosition(series, item);↵ | |
10 | }↵ | 11 | }↵ | |
11 | else {↵ | 12 | else {↵ | |
12 | position = getNegativeItemLabelPosition(row, column);↵ | 13 | position = getNegativeItemLabelPosition(series, item);↵ | |
13 | } ↵ | 14 | } ↵ | |
15 | // work out the label anchor point... ↵ | |||
14 | Point2D anchorPoint = calculateLabelAnchorPoint(↵ | 16 | Point2D anchorPoint = calculateLabelAnchorPoint(↵ | |
15 | position.getItemLabelAnchor(), x, y, orientation);↵ | 17 | position.getItemLabelAnchor(), x, y, orientation);↵ | |
16 | TextUtilities.drawRotatedString(label, g2,↵ | 18 | TextUtilities.drawRotatedString(label, g2,↵ | |
17 | (float) anchorPoint.getX(), (float) anchorPoint.getY(),↵ | 19 | (float) anchorPoint.getX(), (float) anchorPoint.getY(),↵ | |
18 | position.getTextAnchor(),↵ | 20 | position.getTextAnchor(),↵ | |
19 | position.getAngle(),↵ | 21 | position.getAngle(),↵ | |
20 | position.getRotationAnchor());↵ | 22 | position.getRotationAnchor());↵ | |
21 | } | 23 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 90 |
Number of mapped statements | 12 |
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) | 35.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (generator != null) |
| 2 | if (generator != null) | |||||||||||||||||||||
3 | Font labelFont = getItemLabelFont(row, column); |
| 3 | Font labelFont = getItemLabelFont(series, item); | |||||||||||||||||||||
4 | Paint paint = getItemLabelPaint(row, column); |
| 4 | Paint paint = getItemLabelPaint(series, item); | |||||||||||||||||||||
5 | g2.setFont(labelFont); | 5 | g2.setFont(labelFont); | ||||||||||||||||||||||
6 | g2.setPaint(paint); | 6 | g2.setPaint(paint); | ||||||||||||||||||||||
7 | String label = generator.generateLabel(dataset, row, column); |
| 7 | String label = generator.generateLabel(dataset, series, item); | |||||||||||||||||||||
8 | ItemLabelPosition position = null; | 8 | ItemLabelPosition position = null; | ||||||||||||||||||||||
9 | if (!negative) | 9 | if (!negative) | ||||||||||||||||||||||
10 | position = getPositiveItemLabelPosition(row, column); |
| 10 | position = getPositiveItemLabelPosition(series, item); | |||||||||||||||||||||
else | else | ||||||||||||||||||||||||
11 | position = getNegativeItemLabelPosition(row, column); |
| 11 | position = getNegativeItemLabelPosition(series, item); | |||||||||||||||||||||
12 | Point2D anchorPoint = calculateLabelAnchorPoint(position.getItemLabelAnchor(), x, y, orientation); | 12 | Point2D anchorPoint = calculateLabelAnchorPoint(position.getItemLabelAnchor(), x, y, orientation); | ||||||||||||||||||||||
13 | TextUtilities.drawRotatedString(label, g2, (float)anchorPoint.getX(), (float)anchorPoint.getY(), position.getTextAnchor(), position.getAngle(), position.getRotationAnchor()); | 13 | TextUtilities.drawRotatedString(label, g2, (float)anchorPoint.getX(), (float)anchorPoint.getY(), position.getTextAnchor(), position.getAngle(), position.getRotationAnchor()); |
Row | Violation |
---|---|
1 | Type org.jfree.chart.labels.CategoryItemLabelGenerator of variable generator does not match with type org.jfree.chart.labels.XYItemLabelGenerator of variable generator |
2 | Expression dataset cannot be unified with expression dataset , because common superclass type org.jfree.data.general.Dataset cannot be passed as an argument to public abstract java.lang.String generateLabel(org.jfree.data.category.CategoryDataset, int, int) |
3 | Type org.jfree.chart.labels.CategoryItemLabelGenerator of variable generator does not match with type org.jfree.chart.labels.XYItemLabelGenerator of variable generator |