File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainCategoryPlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java | |||
Method name: AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)
|
Method name: AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | CategoryPlot plot = (CategoryPlot) this.subplots.get(i);↵ | 1 | XYPlot plot = (XYPlot) this.subplots.get(i);↵ | |
2 | // calculate sub-plot area↵ | 2 | // calculate sub-plot area↵ | |
3 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 3 | if (orientation == PlotOrientation.VERTICAL) {↵ | |
4 | double w = usableSize * plot.getWeight() / this.totalWeight;↵ | 4 | double w = usableSize * plot.getWeight() / this.totalWeight;↵ | |
5 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w,↵ | 5 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w,↵ | |
6 | adjustedPlotArea.getHeight());↵ | 6 | adjustedPlotArea.getHeight());↵ | |
7 | x = x + w + this.gap;↵ | 7 | x = x + w + this.gap;↵ | |
8 | }↵ | 8 | }↵ | |
9 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 9 | else if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
10 | double h = usableSize * plot.getWeight() / this.totalWeight;↵ | 10 | double h = usableSize * plot.getWeight() / this.totalWeight;↵ | |
11 | this.subplotAreas[i] = new Rectangle2D.Double(x, y,↵ | 11 | this.subplotAreas[i] = new Rectangle2D.Double(x, y,↵ | |
12 | adjustedPlotArea.getWidth(), h);↵ | 12 | adjustedPlotArea.getWidth(), h);↵ | |
13 | y = y + h + this.gap;↵ | 13 | y = y + h + this.gap;↵ | |
14 | }↵ | 14 | }↵ | |
15 | AxisSpace subSpace = plot.calculateRangeAxisSpace(g2,↵ | 15 | AxisSpace subSpace = plot.calculateDomainAxisSpace(g2,↵ | |
16 | this.subplotAreas[i], null);↵ | 16 | this.subplotAreas[i], null);↵ | |
17 | space.ensureAtLeast(subSpace); | 17 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 59 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 281.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28 | CategoryPlot plot = (CategoryPlot)this.subplots.get(i); |
| 26 | XYPlot plot = (XYPlot)this.subplots.get(i); | ||||||||||||||||
29 | if (orientation == PlotOrientation.HORIZONTAL) |
| 27 | if (orientation == PlotOrientation.VERTICAL) | ||||||||||||||||
30 | double w = usableSize * plot.getWeight() / this.totalWeight; |
| 28 | double w = usableSize * plot.getWeight() / this.totalWeight; | ||||||||||||||||
31 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight()); | 29 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight()); | |||||||||||||||||
32 | x = x + w + this.gap; | 30 | x = x + w + this.gap; | |||||||||||||||||
33 | else if (orientation == PlotOrientation.VERTICAL) |
| 31 | else if (orientation == PlotOrientation.HORIZONTAL) | ||||||||||||||||
34 | double h = usableSize * plot.getWeight() / this.totalWeight; |
| 32 | double h = usableSize * plot.getWeight() / this.totalWeight; | ||||||||||||||||
35 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h); | 33 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h); | |||||||||||||||||
36 | y = y + h + this.gap; | 34 | y = y + h + this.gap; | |||||||||||||||||
37 | AxisSpace subSpace = plot.calculateRangeAxisSpace(g2, this.subplotAreas[i], null); |
| 35 | AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotAreas[i], null); | ||||||||||||||||
38 | space.ensureAtLeast(subSpace); | 36 | space.ensureAtLeast(subSpace); |
Row | Violation |
---|---|
1 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight() |
2 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight() |
3 | Expression plot.calculateRangeAxisSpace(g2,this.subplotAreas[i],null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression plot.calculateDomainAxisSpace(g2,this.subplotAreas[i],null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) protected org.jfree.chart.axis.AxisSpace calculateRangeAxisSpace(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.axis.AxisSpace) , protected org.jfree.chart.axis.AxisSpace calculateDomainAxisSpace(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.axis.AxisSpace) |
6 | Clone fragment #1 returns variables x, y , while Clone fragment #2 returns variables x, y |