303-1-2

protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation, CategoryDataset dataset, int row, int column, double x, double y, boolean negative) { CategoryItemLabelGenerator generator = getItemLabelGenerator(row, column); if (generator != null) { Font labelFont = getItemLabelFont(row, column); Paint paint = getItemLabelPaint(row, column); g2.setFont(labelFont); g2.setPaint(paint); String label = generator.generateLabel(dataset, row, column); ItemLabelPosition position = null; if (!negative) { position = getPositiveItemLabelPosition(row, column); } else { position = getNegativeItemLabelPosition(row, column); } Point2D anchorPoint = calculateLabelAnchorPoint( position.getItemLabelAnchor(), x, y, orientation); TextUtilities.drawRotatedString(label, g2, (float) anchorPoint.getX(), (float) anchorPoint.getY(), position.getTextAnchor(), position.getAngle(), position.getRotationAnchor());
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation, XYDataset dataset, int series, int item, double x, double y, boolean negative) { XYItemLabelGenerator generator = getItemLabelGenerator(series, item); if (generator != null) { Font labelFont = getItemLabelFont(series, item); Paint paint = getItemLabelPaint(series, item); g2.setFont(labelFont); g2.setPaint(paint); String label = generator.generateLabel(dataset, series, item); // get the label position.. ItemLabelPosition position = null; if (!negative) { position = getPositiveItemLabelPosition(series, item); } else { position = getNegativeItemLabelPosition(series, item); } // work out the label anchor point... Point2D anchorPoint = calculateLabelAnchorPoint( position.getItemLabelAnchor(), x, y, orientation); TextUtilities.drawRotatedString(label, g2, (float) anchorPoint.getX(), (float) anchorPoint.getY(), position.getTextAnchor(), position.getAngle(), position.getRotationAnchor());

Clone fragments detected by clone detection tool
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: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    protected void drawItemLabel(Graphics2D g2,↵

1

    protected void drawItemLabel(Graphics2D g2,↵

2

                                     PlotOrientation orientation,↵

2

     PlotOrientation orientation,↵

3

                                     CategoryDataset dataset,↵

3

                ↵

4

                                     int row, int column,↵

5

                                     double x, double y,↵

4

    XYDataset dataset, int series, int item, double x, double y,↵

6

                                     boolean negative) {↵

5

                boolean negative) {↵

7

            CategoryItemLabelGenerator generator↵

6

            XYItemLabelGenerator generator↵

8

                = getItemLabelGenerator(row, column);↵

7

     = getItemLabelGenerator(series, item);↵

9

            if (generator != null) {↵

8

            if (generator != null) {↵

10

                Font labelFont = getItemLabelFont(row, column);↵

9

                Font labelFont = getItemLabelFont(series, item);↵

11

                Paint paint = getItemLabelPaint(row, column);↵

10

                Paint paint = getItemLabelPaint(series, item);↵

12

                g2.setFont(labelFont);↵

11

                g2.setFont(labelFont);↵

13

                g2.setPaint(paint);↵

12

                g2.setPaint(paint);↵

14

                String label = generator.generateLabel(dataset, row, column);↵

13

                String label = generator.generateLabel(dataset, series, item);↵

14

                // get the label position..↵

15

                ItemLabelPosition position = null;↵

15

                ItemLabelPosition position = null;↵

16

                if (!negative) {↵

16

                if (!negative) {↵

17

                    position = getPositiveItemLabelPosition(row, column);↵

17

                    position = getPositiveItemLabelPosition(series, item);↵

18

                }↵

18

                }↵

19

                else {↵

19

                else {↵

20

                    position = getNegativeItemLabelPosition(row, column);↵

20

                    position = getNegativeItemLabelPosition(series, item);↵

21

                }
    ↵

21

                }
    ↵

22

                // work out the label anchor point...
    ↵

22

                Point2D anchorPoint = calculateLabelAnchorPoint(↵

23

                Point2D anchorPoint = calculateLabelAnchorPoint(↵

23

                        position.getItemLabelAnchor(), x, y, orientation);↵

24

                        position.getItemLabelAnchor(), x, y, orientation);↵

24

                TextUtilities.drawRotatedString(label, g2,↵

25

                TextUtilities.drawRotatedString(label, g2,↵

25

                        (float) anchorPoint.getX(), (float) anchorPoint.getY(),↵

26

                        (float) anchorPoint.getX(), (float) anchorPoint.getY(),↵

26

                        position.getTextAnchor(),↵

27

                        position.getTextAnchor(),↵

27

                        position.getAngle(),↵

28

     position.getAngle(),↵

28

     position.getRotationAnchor());↵

29

                        position.getRotationAnchor());↵

29

30

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.0
Clones location |
Number of node comparisons | 0