File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.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: 12 | Number of AST nodes: 12 | |||
1 | for (int i = 0; i < n; i++) {↵ | 1 | for (int i = 0; i < n; i++) {↵ | |
2 | XYPlot plot = (XYPlot) this.subplots.get(i);↵ | 2 | XYPlot plot = (XYPlot) this.subplots.get(i);↵ | |
3 | // calculate sub-plot area↵ | 3 | // calculate sub-plot area↵ | |
4 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 4 | if (orientation == PlotOrientation.VERTICAL) {↵ | |
5 | double w = usableSize * plot.getWeight() / this.totalWeight;↵ | 5 | double w = usableSize * plot.getWeight() / this.totalWeight;↵ | |
6 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w,↵ | 6 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w,↵ | |
7 | adjustedPlotArea.getHeight());↵ | 7 | adjustedPlotArea.getHeight());↵ | |
8 | x = x + w + this.gap;↵ | 8 | x = x + w + this.gap;↵ | |
9 | }↵ | 9 | }↵ | |
10 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 10 | else if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
11 | double h = usableSize * plot.getWeight() / this.totalWeight;↵ | 11 | double h = usableSize * plot.getWeight() / this.totalWeight;↵ | |
12 | this.subplotAreas[i] = new Rectangle2D.Double(x, y,↵ | 12 | this.subplotAreas[i] = new Rectangle2D.Double(x, y,↵ | |
13 | adjustedPlotArea.getWidth(), h);↵ | 13 | adjustedPlotArea.getWidth(), h);↵ | |
14 | y = y + h + this.gap;↵ | 14 | y = y + h + this.gap;↵ | |
15 | }↵ | 15 | }↵ | |
16 | AxisSpace subSpace = plot.calculateRangeAxisSpace(g2,↵ | 16 | AxisSpace subSpace = plot.calculateDomainAxisSpace(g2,↵ | |
17 | this.subplotAreas[i], null);↵ | 17 | this.subplotAreas[i], null);↵ | |
18 | space.ensureAtLeast(subSpace);↵ | 18 | space.ensureAtLeast(subSpace);↵ | |
19 | } | 19 |
| |
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 | 65 |
Number of mapped statements | 12 |
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) | 7.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25 | for (int i = 0; i < n; i++) | 25 | for (int i = 0; i < n; i++) | |||||||||||||
26 | XYPlot plot = (XYPlot)this.subplots.get(i); | 26 | XYPlot plot = (XYPlot)this.subplots.get(i); | |||||||||||||
27 | if (orientation == PlotOrientation.HORIZONTAL) |
| 27 | if (orientation == PlotOrientation.VERTICAL) | ||||||||||||
28 | double w = usableSize * plot.getWeight() / this.totalWeight; | 28 | double w = usableSize * plot.getWeight() / this.totalWeight; | |||||||||||||
29 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight()); | 29 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, w, adjustedPlotArea.getHeight()); | |||||||||||||
30 | x = x + w + this.gap; | 30 | x = x + w + this.gap; | |||||||||||||
31 | else if (orientation == PlotOrientation.VERTICAL) |
| 31 | else if (orientation == PlotOrientation.HORIZONTAL) | ||||||||||||
32 | double h = usableSize * plot.getWeight() / this.totalWeight; | 32 | double h = usableSize * plot.getWeight() / this.totalWeight; | |||||||||||||
33 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h); | 33 | this.subplotAreas[i] = new Rectangle2D.Double(x, y, adjustedPlotArea.getWidth(), h); | |||||||||||||
34 | y = y + h + this.gap; | 34 | y = y + h + this.gap; | |||||||||||||
35 | AxisSpace subSpace = plot.calculateRangeAxisSpace(g2, this.subplotAreas[i], null); |
| 35 | AxisSpace subSpace = plot.calculateDomainAxisSpace(g2, this.subplotAreas[i], null); | ||||||||||||
36 | space.ensureAtLeast(subSpace); | 36 | space.ensureAtLeast(subSpace); |
Row | Violation |
---|---|
1 | Expression plot.calculateRangeAxisSpace(g2,this.subplotAreas[i],null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression plot.calculateDomainAxisSpace(g2,this.subplotAreas[i],null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |