CloneSet45


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
69220.991method_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
169251
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java
270288
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java
Next
Last
Clone Instance
1
Line Count
69
Source Line
251
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java

/**
 * Calculates the space required for the axes.
 * 
 * @param g2  the graphics device.
 * @param plotArea  the plot area.
 * 
 * @return The space required for the axes.
 */
protected AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) {
  AxisSpace space = new AxisSpace();
  PlotOrientation orientation = getOrientation();
  // work out the space required by the domain axis...
  AxisSpace fixed = getFixedRangeAxisSpace();
  if (fixed != null) {
    if (orientation == PlotOrientation.VERTICAL) {
      space.setLeft(fixed.getLeft());
      space.setRight(fixed.getRight());
    }
    else
      if (orientation == PlotOrientation.HORIZONTAL) {
        space.setTop(fixed.getTop());
        space.setBottom(fixed.getBottom());
      }
  }
  else {
    ValueAxis valueAxis = getRangeAxis();
    RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(getRangeAxisLocation(), orientation);
    if (valueAxis != null) {
      space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space);
    }
  }
  Rectangle2D adjustedPlotArea = space.shrink(plotArea, null);
  // work out the maximum height or width of the non-shared axes...
  int n = this.subplots.size();
  // calculate plotAreas of all sub-plots, maximum vertical/horizontal 
  // axis width/height
  this.subplotArea = new Rectangle2D[n];
  double x = adjustedPlotArea.getX();
  double y = adjustedPlotArea.getY();
  double usableSize = 0.0;
  if (orientation == PlotOrientation.VERTICAL) {
    usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);
  }
  else
    if (orientation == PlotOrientation.HORIZONTAL) {
      usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);
    }
  for (int i = 0; i < n; i++) {
    CategoryPlot plot = (CategoryPlot) this.subplots.get(i);
    // calculate sub-plot area
    if (orientation == PlotOrientation.VERTICAL) {
      double w = usableSize * plot.getWeight() / this.totalWeight;
      this.subplotArea[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
      x = x + w + this.gap;
    }
    else
      if (orientation == PlotOrientation.HORIZONTAL) {
        double h = usableSize * plot.getWeight() / this.totalWeight;
        this.subplotArea[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
        y = y + h + this.gap;
      }
    AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotArea[i], null);
    space.ensureAtLeast(subSpace);
  }
  return space;
}


First
Previous
Clone Instance
2
Line Count
70
Source Line
288
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java

/**
 * Calculates the space required for the axes.
 *
 * @param g2  the graphics device.
 * @param plotArea  the plot area.
 *
 * @return The space required for the axes.
 */
protected AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) {
  AxisSpace space = new AxisSpace();
  PlotOrientation orientation = getOrientation();
  // work out the space required by the domain axis...
  AxisSpace fixed = getFixedRangeAxisSpace();
  if (fixed != null) {
    if (orientation == PlotOrientation.VERTICAL) {
      space.setLeft(fixed.getLeft());
      space.setRight(fixed.getRight());
    }
    else
      if (orientation == PlotOrientation.HORIZONTAL) {
        space.setTop(fixed.getTop());
        space.setBottom(fixed.getBottom());
      }
  }
  else {
    ValueAxis valueAxis = getRangeAxis();
    RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(getRangeAxisLocation(), orientation);
    if (valueAxis != null) {
      space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space);
    }
  }
  Rectangle2D adjustedPlotArea = space.shrink(plotArea, null);
  // work out the maximum height or width of the non-shared axes...
  int n = this.subplots.size();
  // calculate plotAreas of all sub-plots, maximum vertical/horizontal
  // axis width/height
  this.subplotAreas = new Rectangle2D[n];
  double x = adjustedPlotArea.getX();
  double y = adjustedPlotArea.getY();
  double usableSize = 0.0;
  if (orientation == PlotOrientation.VERTICAL) {
    usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);
  }
  else
    if (orientation == PlotOrientation.HORIZONTAL) {
      usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);
    }
  for (int i = 0; i < n; i++) {
    XYPlot plot = (XYPlot) this.subplots.get(i);
    // calculate sub-plot area
    if (orientation == PlotOrientation.VERTICAL) {
      double w = usableSize * plot.getWeight() / this.totalWeight;
      this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
      x = x + w + this.gap;
    }
    else
      if (orientation == PlotOrientation.HORIZONTAL) {
        double h = usableSize * plot.getWeight() / this.totalWeight;
        this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
        y = y + h + this.gap;
      }
    AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotAreas[i], null);
    space.ensureAtLeast(subSpace);
  }
  return space;
}


Clone AbstractionParameter Count: 2Parameter Bindings

/**
     * Calculates the space required for the axes.
     * 
     * @param g2  the graphics device.
     * @param plotArea  the plot area.
     * 
     * @return The space required for the axes.
     */
/**
     * Calculates the space required for the axes.
     *
     * @param g2  the graphics device.
     * @param plotArea  the plot area.
     *
     * @return The space required for the axes.
     */
protected AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) {
  AxisSpace space = new AxisSpace();
  PlotOrientation orientation = getOrientation();
  // work out the space required by the domain axis...
  AxisSpace fixed = getFixedRangeAxisSpace();
  if (fixed != null) {
    if (orientation == PlotOrientation.VERTICAL) {
      space.setLeft(fixed.getLeft());
      space.setRight(fixed.getRight());
    }
    else
      if (orientation == PlotOrientation.HORIZONTAL) {
        space.setTop(fixed.getTop());
        space.setBottom(fixed.getBottom());
      }
  }
  else {
    ValueAxis valueAxis = getRangeAxis();
    RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(getRangeAxisLocation(), orientation);
    if (valueAxis != null) {
      space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space);
    }
  }
  Rectangle2D adjustedPlotArea = space.shrink(plotArea, null);
  // work out the maximum height or width of the non-shared axes...
  int n = this.subplots.size();
  // calculate plotAreas of all sub-plots, maximum vertical/horizontal 
  // calculate plotAreas of all sub-plots, maximum vertical/horizontal
  // axis width/height
  this. [[#variable1512e240]]= new Rectangle2D[n];
  double x = adjustedPlotArea.getX();
  double y = adjustedPlotArea.getY();
  double usableSize = 0.0;
  if (orientation == PlotOrientation.VERTICAL) {
    usableSize = adjustedPlotArea.getWidth() - this.gap * (n - 1);
  }
  else
    if (orientation == PlotOrientation.HORIZONTAL) {
      usableSize = adjustedPlotArea.getHeight() - this.gap * (n - 1);
    }
  for (int i = 0; i < n; i++) {
     [[#variable1512e060]] plot = ( [[#variable1512e060]]) this.subplots.get(i);
    // calculate sub-plot area
    if (orientation == PlotOrientation.VERTICAL) {
      double w = usableSize * plot.getWeight() / this.totalWeight;
      this. [[#variable1512e240]][i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight());
      x = x + w + this.gap;
    }
    else
      if (orientation == PlotOrientation.HORIZONTAL) {
        double h = usableSize * plot.getWeight() / this.totalWeight;
        this. [[#variable1512e240]][i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h);
        y = y + h + this.gap;
      }
    AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this. [[#variable1512e240]][i], null);
    space.ensureAtLeast(subSpace);
  }
  return space;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#1512e240]]
subplotArea 
12[[#1512e240]]
subplotAreas 
21[[#1512e060]]
CategoryPlot 
22[[#1512e060]]
XYPlot