CloneSet 136

# CloneSet136

Previous CloneSet | Next CloneSet | Back to Main Report

Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length]
--- | --- | --- | --- | ---
36 | 2 | 3 | 0.982 | block

Clone Abstraction | Parameter Bindings

Clone Instance (Click to see clone) | Line Count | Source Line | Source File
--- | --- | --- | ---

1

36

1371

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java

2

36

1424

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java

Next
Last

Clone Instance
1

Line Count
36

Source Line
1371

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java

    {
      RectangleInsets tickLabelInsets = getTickLabelInsets();
      double result = tickLabelInsets.getLeft() + tickLabelInsets.getRight();
      Font tickLabelFont = getTickLabelFont();
      FontRenderContext frc = g2.getFontRenderContext();
      LineMetrics lm = tickLabelFont.getLineMetrics("ABCxyz", frc);
      if (isVerticalTickLabels()) {
        // all tick labels have the same width (equal to the height of
        // the font)...
        result += lm.getHeight();
      }
      else {
        // look at lower and upper bounds...
        DateRange range = (DateRange) getRange();
        Date lower = range.getLowerDate();
        Date upper = range.getUpperDate();
        String lowerStr = null;
        String upperStr = null;
        DateFormat formatter = getDateFormatOverride();
        if (formatter != null) {
          lowerStr = formatter.format(lower);
          upperStr = formatter.format(upper);
        }
        else {
          lowerStr = unit.dateToString(lower);
          upperStr = unit.dateToString(upper);
        }
        FontMetrics fm = g2.getFontMetrics(tickLabelFont);
        double w1 = fm.stringWidth(lowerStr);
        double w2 = fm.stringWidth(upperStr);
        result += Math.max(w1, w2);
      }
      return result;
    }

First
Previous

Clone Instance
2

Line Count
36

Source Line
1424

Source File

    E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java

    {
      RectangleInsets tickLabelInsets = getTickLabelInsets();
      double result = tickLabelInsets.getTop() + tickLabelInsets.getBottom();
      Font tickLabelFont = getTickLabelFont();
      FontRenderContext frc = g2.getFontRenderContext();
      LineMetrics lm = tickLabelFont.getLineMetrics("ABCxyz", frc);
      if ( !isVerticalTickLabels()) {
        // all tick labels have the same width (equal to the height of
        // the font)...
        result += lm.getHeight();
      }
      else {
        // look at lower and upper bounds...
        DateRange range = (DateRange) getRange();
        Date lower = range.getLowerDate();
        Date upper = range.getUpperDate();
        String lowerStr = null;
        String upperStr = null;
        DateFormat formatter = getDateFormatOverride();
        if (formatter != null) {
          lowerStr = formatter.format(lower);
          upperStr = formatter.format(upper);
        }
        else {
          lowerStr = unit.dateToString(lower);
          upperStr = unit.dateToString(upper);
        }
        FontMetrics fm = g2.getFontMetrics(tickLabelFont);
        double w1 = fm.stringWidth(lowerStr);
        double w2 = fm.stringWidth(upperStr);
        result += Math.max(w1, w2);
      }
      return result;
    }

Clone Abstraction | Parameter Count: 3 | Parameter Bindings

    {
      RectangleInsets tickLabelInsets = getTickLabelInsets();
      double result = tickLabelInsets. [[#variable1aa4f3e0]]() + tickLabelInsets. [[#variable1aa725e0]]();
      Font tickLabelFont = getTickLabelFont();
      FontRenderContext frc = g2.getFontRenderContext();
      LineMetrics lm = tickLabelFont.getLineMetrics("ABCxyz", frc);
      if ( [[#variable1aa64000]]) {
        // all tick labels have the same width (equal to the height of
        // the font)...
        result += lm.getHeight();
      }
      else {
        // look at lower and upper bounds...
        DateRange range = (DateRange) getRange();
        Date lower = range.getLowerDate();
        Date upper = range.getUpperDate();
        String lowerStr = null;
        String upperStr = null;
        DateFormat formatter = getDateFormatOverride();
        if (formatter != null) {
          lowerStr = formatter.format(lower);
          upperStr = formatter.format(upper);
        }
        else {
          lowerStr = unit.dateToString(lower);
          upperStr = unit.dateToString(upper);
        }
        FontMetrics fm = g2.getFontMetrics(tickLabelFont);
        double w1 = fm.stringWidth(lowerStr);
        double w2 = fm.stringWidth(upperStr);
        result += Math.max(w1, w2);
      }
      return result;
    }

CloneAbstraction

Parameter Bindings
Parameter Index | Clone Instance | Parameter Name | Value
--- | --- | --- | ---

1

1

`[[#1aa4f3e0]]`

    getLeft

1

2

`[[#1aa4f3e0]]`

    getTop

2

1

`[[#1aa725e0]]`

    getRight

2

2

`[[#1aa725e0]]`

    getBottom

3

1

`[[#1aa64000]]`

    isVerticalTickLabels()

3

2

`[[#1aa64000]]`

    !isVerticalTickLabels()