CloneSet113


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
37220.969block
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
137549
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/title/TextTitle.java
237623
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/title/TextTitle.java
Next
Last
Clone Instance
1
Line Count
37
Source Line
549
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/title/TextTitle.java

{
  RectangleEdge position = getPosition();
  if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) {
    float maxWidth = (float) w;
    g2.setFont(this.font);
    this.content = TextUtilities.createTextBlock(this.text, this.font, this.paint, maxWidth, this.maximumLinesToDisplay, new G2TextMeasurer(g2));
    this.content.setLineAlignment(this.textAlignment);
    Size2D contentSize = this.content.calculateDimensions(g2);
    if (this.expandToFitSpace) {
      return new Size2D(maxWidth, contentSize.getHeight());
    }
    else {
      return contentSize;
    }
  }
  else
    if (position == RectangleEdge.LEFT || position == RectangleEdge.RIGHT) {
      float maxWidth = Float.MAX_VALUE;
      g2.setFont(this.font);
      this.content = TextUtilities.createTextBlock(this.text, this.font, this.paint, maxWidth, this.maximumLinesToDisplay, new G2TextMeasurer(g2));
      this.content.setLineAlignment(this.textAlignment);
      Size2D contentSize = this.content.calculateDimensions(g2);
      // transpose the dimensions, because the title is rotated
      if (this.expandToFitSpace) {
        return new Size2D(contentSize.getHeight(), maxWidth);
      }
      else {
        return new Size2D(contentSize.height, contentSize.width);
      }
    }
    else {
      throw new RuntimeException("Unrecognised exception.");
    }
}


First
Previous
Clone Instance
2
Line Count
37
Source Line
623
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/title/TextTitle.java

{
  RectangleEdge position = getPosition();
  if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) {
    float maxWidth = (float) widthRange.getUpperBound();
    g2.setFont(this.font);
    this.content = TextUtilities.createTextBlock(this.text, this.font, this.paint, maxWidth, this.maximumLinesToDisplay, new G2TextMeasurer(g2));
    this.content.setLineAlignment(this.textAlignment);
    Size2D contentSize = this.content.calculateDimensions(g2);
    if (this.expandToFitSpace) {
      return new Size2D(maxWidth, contentSize.getHeight());
    }
    else {
      return contentSize;
    }
  }
  else
    if (position == RectangleEdge.LEFT || position == RectangleEdge.RIGHT) {
      float maxWidth = (float) heightRange.getUpperBound();
      g2.setFont(this.font);
      this.content = TextUtilities.createTextBlock(this.text, this.font, this.paint, maxWidth, this.maximumLinesToDisplay, new G2TextMeasurer(g2));
      this.content.setLineAlignment(this.textAlignment);
      Size2D contentSize = this.content.calculateDimensions(g2);
      // transpose the dimensions, because the title is rotated
      if (this.expandToFitSpace) {
        return new Size2D(contentSize.getHeight(), maxWidth);
      }
      else {
        return new Size2D(contentSize.height, contentSize.width);
      }
    }
    else {
      throw new RuntimeException("Unrecognised exception.");
    }
}


Clone AbstractionParameter Count: 2Parameter Bindings

{
  RectangleEdge position = getPosition();
  if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) {
    float maxWidth = (float)  [[#variable1aa29e20]];
    g2.setFont(this.font);
    this.content = TextUtilities.createTextBlock(this.text, this.font, this.paint, maxWidth, this.maximumLinesToDisplay, new G2TextMeasurer(g2));
    this.content.setLineAlignment(this.textAlignment);
    Size2D contentSize = this.content.calculateDimensions(g2);
    if (this.expandToFitSpace) {
      return new Size2D(maxWidth, contentSize.getHeight());
    }
    else {
      return contentSize;
    }
  }
  else
    if (position == RectangleEdge.LEFT || position == RectangleEdge.RIGHT) {
      float maxWidth = [[#variable1aa29e00]];
      g2.setFont(this.font);
      this.content = TextUtilities.createTextBlock(this.text, this.font, this.paint, maxWidth, this.maximumLinesToDisplay, new G2TextMeasurer(g2));
      this.content.setLineAlignment(this.textAlignment);
      Size2D contentSize = this.content.calculateDimensions(g2);
      // transpose the dimensions, because the title is rotated
      if (this.expandToFitSpace) {
        return new Size2D(contentSize.getHeight(), maxWidth);
      }
      else {
        return new Size2D(contentSize.height, contentSize.width);
      }
    }
    else {
      throw new RuntimeException("Unrecognised exception.");
    }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#1aa29e20]]
w 
12[[#1aa29e20]]
widthRange.getUpperBound() 
21[[#1aa29e00]]
Float.MAX_VALUE 
22[[#1aa29e00]]
(float) heightRange.getUpperBound()