CloneSet164


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
32220.960method_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
132225
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedBarRenderer.java
232229
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedBarRenderer3D.java
Next
Last
Clone Instance
1
Line Count
32
Source Line
225
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedBarRenderer.java

/**
 * Calculates the bar width and stores it in the renderer state.
 *
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param rendererIndex  the renderer index.
 * @param state  the renderer state.
 */
protected void calculateBarWidth(CategoryPlot plot, Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state) {
  // calculate the bar width
  CategoryAxis xAxis = plot.getDomainAxisForDataset(rendererIndex);
  CategoryDataset data = plot.getDataset(rendererIndex);
  if (data != null) {
    PlotOrientation orientation = plot.getOrientation();
    double space = 0.0;
    if (orientation == PlotOrientation.HORIZONTAL) {
      space = dataArea.getHeight();
    }
    else
      if (orientation == PlotOrientation.VERTICAL) {
        space = dataArea.getWidth();
      }
    double maxWidth = space * getMaximumBarWidth();
    int columns = data.getColumnCount();
    double categoryMargin = 0.0;
    if (columns > 1) {
      categoryMargin = xAxis.getCategoryMargin();
    }
    double used = space * (1 - xAxis.getLowerMargin() - xAxis.getUpperMargin() - categoryMargin);
    if (columns > 0) {
      state.setBarWidth(Math.min(used / columns, maxWidth));
    }
    else {
      state.setBarWidth(Math.min(used, maxWidth));
    }
  }
}


First
Previous
Clone Instance
2
Line Count
32
Source Line
229
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedBarRenderer3D.java

/**
 * Calculates the bar width and stores it in the renderer state.
 *
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param rendererIndex  the renderer index.
 * @param state  the renderer state.
 */
protected void calculateBarWidth(CategoryPlot plot, Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state) {
  // calculate the bar width
  CategoryAxis domainAxis = getDomainAxis(plot, rendererIndex);
  CategoryDataset data = plot.getDataset(rendererIndex);
  if (data != null) {
    PlotOrientation orientation = plot.getOrientation();
    double space = 0.0;
    if (orientation == PlotOrientation.HORIZONTAL) {
      space = dataArea.getHeight();
    }
    else
      if (orientation == PlotOrientation.VERTICAL) {
        space = dataArea.getWidth();
      }
    double maxWidth = space * getMaximumBarWidth();
    int columns = data.getColumnCount();
    double categoryMargin = 0.0;
    if (columns > 1) {
      categoryMargin = domainAxis.getCategoryMargin();
    }
    double used = space * (1 - domainAxis.getLowerMargin() - domainAxis.getUpperMargin() - categoryMargin);
    if (columns > 0) {
      state.setBarWidth(Math.min(used / columns, maxWidth));
    }
    else {
      state.setBarWidth(Math.min(used, maxWidth));
    }
  }
}


Clone AbstractionParameter Count: 2Parameter Bindings

/**
     * Calculates the bar width and stores it in the renderer state.
     *
     * @param plot  the plot.
     * @param dataArea  the data area.
     * @param rendererIndex  the renderer index.
     * @param state  the renderer state.
     */
protected void calculateBarWidth(CategoryPlot plot, Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state) {
  // calculate the bar width
  CategoryAxis  [[#variable1aab72e0]]= [[#variable1aab72c0]];
  CategoryDataset data = plot.getDataset(rendererIndex);
  if (data != null) {
    PlotOrientation orientation = plot.getOrientation();
    double space = 0.0;
    if (orientation == PlotOrientation.HORIZONTAL) {
      space = dataArea.getHeight();
    }
    else
      if (orientation == PlotOrientation.VERTICAL) {
        space = dataArea.getWidth();
      }
    double maxWidth = space * getMaximumBarWidth();
    int columns = data.getColumnCount();
    double categoryMargin = 0.0;
    if (columns > 1) {
      categoryMargin = [[#variable1aab72e0]].getCategoryMargin();
    }
    double used = space * (1 -  [[#variable1aab72e0]].getLowerMargin() -  [[#variable1aab72e0]].getUpperMargin() - categoryMargin);
    if (columns > 0) {
      state.setBarWidth(Math.min(used / columns, maxWidth));
    }
    else {
      state.setBarWidth(Math.min(used, maxWidth));
    }
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#1aab72e0]]
xAxis 
12[[#1aab72e0]]
domainAxis 
21[[#1aab72c0]]
plot.getDomainAxisForDataset(rendererIndex) 
22[[#1aab72c0]]
getDomainAxis(plot, rendererIndex)