CloneSet74


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
61201.000class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
163742
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/LogAxis.java
261967
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java
Next
Last
Clone Instance
1
Line Count
63
Source Line
742
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/LogAxis.java

/**
 * Estimates the maximum tick label height.
 * 
 * @param g2  the graphics device.
 * 
 * @return The maximum height.
 *
 * @since 1.0.7
 */
protected double estimateMaximumTickLabelHeight(Graphics2D g2) {
  RectangleInsets tickLabelInsets = getTickLabelInsets();
  double result = tickLabelInsets.getTop() + tickLabelInsets.getBottom();
  Font tickLabelFont = getTickLabelFont();
  FontRenderContext frc = g2.getFontRenderContext();
  result += tickLabelFont.getLineMetrics("123", frc).getHeight();
  return result;
}

/**
 * Estimates the maximum width of the tick labels, assuming the specified 
 * tick unit is used.
 * <P>
 * Rather than computing the string bounds of every tick on the axis, we 
 * just look at two values: the lower bound and the upper bound for the 
 * axis.  These two values will usually be representative.
 *
 * @param g2  the graphics device.
 * @param unit  the tick unit to use for calculation.
 *
 * @return The estimated maximum width of the tick labels.
 *
 * @since 1.0.7
 */
protected double estimateMaximumTickLabelWidth(Graphics2D g2, TickUnit unit) {
  RectangleInsets tickLabelInsets = getTickLabelInsets();
  double result = tickLabelInsets.getLeft() + tickLabelInsets.getRight();
  if (isVerticalTickLabels()) {
    // all tick labels have the same width (equal to the height of the 
    // font)...
    FontRenderContext frc = g2.getFontRenderContext();
    LineMetrics lm = getTickLabelFont().getLineMetrics("0", frc);
    result += lm.getHeight();
  }
  else {
    // look at lower and upper bounds...
    FontMetrics fm = g2.getFontMetrics(getTickLabelFont());
    Range range = getRange();
    double lower = range.getLowerBound();
    double upper = range.getUpperBound();
    String lowerStr = "";
    String upperStr = "";
    NumberFormat formatter = getNumberFormatOverride();
    if (formatter != null) {
      lowerStr = formatter.format(lower);
      upperStr = formatter.format(upper);
    }
    else {
      lowerStr = unit.valueToString(lower);
      upperStr = unit.valueToString(upper);
    }
    double w1 = fm.stringWidth(lowerStr);
    double w2 = fm.stringWidth(upperStr);
    result += Math.max(w1, w2);
  }
  return result;
}


First
Previous
Clone Instance
2
Line Count
61
Source Line
967
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java

/**
 * Estimates the maximum tick label height.
 *
 * @param g2  the graphics device.
 *
 * @return The maximum height.
 */
protected double estimateMaximumTickLabelHeight(Graphics2D g2) {
  RectangleInsets tickLabelInsets = getTickLabelInsets();
  double result = tickLabelInsets.getTop() + tickLabelInsets.getBottom();
  Font tickLabelFont = getTickLabelFont();
  FontRenderContext frc = g2.getFontRenderContext();
  result += tickLabelFont.getLineMetrics("123", frc).getHeight();
  return result;
}

/**
 * Estimates the maximum width of the tick labels, assuming the specified
 * tick unit is used.
 * <P>
 * Rather than computing the string bounds of every tick on the axis, we
 * just look at two values: the lower bound and the upper bound for the
 * axis.  These two values will usually be representative.
 *
 * @param g2  the graphics device.
 * @param unit  the tick unit to use for calculation.
 *
 * @return The estimated maximum width of the tick labels.
 */
protected double estimateMaximumTickLabelWidth(Graphics2D g2, TickUnit unit) {
  RectangleInsets tickLabelInsets = getTickLabelInsets();
  double result = tickLabelInsets.getLeft() + tickLabelInsets.getRight();
  if (isVerticalTickLabels()) {
    // all tick labels have the same width (equal to the height of the
    // font)...
    FontRenderContext frc = g2.getFontRenderContext();
    LineMetrics lm = getTickLabelFont().getLineMetrics("0", frc);
    result += lm.getHeight();
  }
  else {
    // look at lower and upper bounds...
    FontMetrics fm = g2.getFontMetrics(getTickLabelFont());
    Range range = getRange();
    double lower = range.getLowerBound();
    double upper = range.getUpperBound();
    String lowerStr = "";
    String upperStr = "";
    NumberFormat formatter = getNumberFormatOverride();
    if (formatter != null) {
      lowerStr = formatter.format(lower);
      upperStr = formatter.format(upper);
    }
    else {
      lowerStr = unit.valueToString(lower);
      upperStr = unit.valueToString(upper);
    }
    double w1 = fm.stringWidth(lowerStr);
    double w2 = fm.stringWidth(upperStr);
    result += Math.max(w1, w2);
  }
  return result;
}


Clone AbstractionParameter Count: 0Parameter Bindings

/**
     * Estimates the maximum tick label height.
     *
     * @param g2  the graphics device.
     *
     * @return The maximum height.
     */
/**
     * Estimates the maximum tick label height.
     * 
     * @param g2  the graphics device.
     * 
     * @return The maximum height.
     *
     * @since 1.0.7
     */
protected double estimateMaximumTickLabelHeight(Graphics2D g2) {
  RectangleInsets tickLabelInsets = getTickLabelInsets();
  double result = tickLabelInsets.getTop() + tickLabelInsets.getBottom();
  Font tickLabelFont = getTickLabelFont();
  FontRenderContext frc = g2.getFontRenderContext();
  result += tickLabelFont.getLineMetrics("123", frc).getHeight();
  return result;
}

/**
     * Estimates the maximum width of the tick labels, assuming the specified
     * tick unit is used.
     * <P>
     * Rather than computing the string bounds of every tick on the axis, we
     * just look at two values: the lower bound and the upper bound for the
     * axis.  These two values will usually be representative.
     *
     * @param g2  the graphics device.
     * @param unit  the tick unit to use for calculation.
     *
     * @return The estimated maximum width of the tick labels.
     */
/**
     * Estimates the maximum width of the tick labels, assuming the specified 
     * tick unit is used.
     * <P>
     * Rather than computing the string bounds of every tick on the axis, we 
     * just look at two values: the lower bound and the upper bound for the 
     * axis.  These two values will usually be representative.
     *
     * @param g2  the graphics device.
     * @param unit  the tick unit to use for calculation.
     *
     * @return The estimated maximum width of the tick labels.
     *
     * @since 1.0.7
     */
protected double estimateMaximumTickLabelWidth(Graphics2D g2, TickUnit unit) {
  RectangleInsets tickLabelInsets = getTickLabelInsets();
  double result = tickLabelInsets.getLeft() + tickLabelInsets.getRight();
  if (isVerticalTickLabels()) {
    // all tick labels have the same width (equal to the height of the
    // all tick labels have the same width (equal to the height of the 
    // font)...
    FontRenderContext frc = g2.getFontRenderContext();
    LineMetrics lm = getTickLabelFont().getLineMetrics("0", frc);
    result += lm.getHeight();
  }
  else {
    // look at lower and upper bounds...
    FontMetrics fm = g2.getFontMetrics(getTickLabelFont());
    Range range = getRange();
    double lower = range.getLowerBound();
    double upper = range.getUpperBound();
    String lowerStr = "";
    String upperStr = "";
    NumberFormat formatter = getNumberFormatOverride();
    if (formatter != null) {
      lowerStr = formatter.format(lower);
      upperStr = formatter.format(upper);
    }
    else {
      lowerStr = unit.valueToString(lower);
      upperStr = unit.valueToString(upper);
    }
    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
None