File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeCategoryPlot.java | |||
Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)
|
Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)
|
|||
Number of AST nodes: 24 | Number of AST nodes: 23 | |||
1 | if (info != null) {↵ | 1 | if (info != null) {↵ | |
2 | info.setPlotArea(area);↵ | 2 | info.setPlotArea(area);↵ | |
3 | }↵ | 3 | }↵ | |
4 | // adjust the drawing area for plot insets (if any)...↵ | 4 | // adjust the drawing area for plot insets (if any)...↵ | |
5 | RectangleInsets insets = getInsets();↵ | 5 | RectangleInsets insets = getInsets();↵ | |
6 | insets.trim(area);↵ | 6 | insets.trim(area);↵ | |
7 | setFixedRangeAxisSpaceForSubplots(null);↵ | 7 | // calculate the data area...↵ | |
8 | AxisSpace space = calculateAxisSpace(g2, area);↵ | 8 | AxisSpace space = calculateAxisSpace(g2, area);↵ | |
9 | Rectangle2D dataArea = space.shrink(area, null);↵ | 9 | Rectangle2D dataArea = space.shrink(area, null);↵ | |
10 | // set the width and height of non-shared axis of all sub-plots↵ | 10 | // set the width and height of non-shared axis of all sub-plots↵ | |
11 | setFixedRangeAxisSpaceForSubplots(space);↵ | 11 | setFixedDomainAxisSpaceForSubplots(space);↵ | |
12 | // draw the shared axis↵ | 12 | // draw the shared axis↵ | |
13 | ValueAxis axis = getDomainAxis();↵ | 13 | ValueAxis axis = getRangeAxis();↵ | |
14 | RectangleEdge edge = getDomainAxisEdge();↵ | 14 | RectangleEdge rangeEdge = getRangeAxisEdge();↵ | |
15 | double cursor = RectangleEdge.coordinate(dataArea, edge);↵ | 15 | double cursor = RectangleEdge.coordinate(dataArea, rangeEdge);↵ | |
16 | AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge,↵ | 16 | AxisState state = axis.draw(g2, cursor, area, dataArea, rangeEdge, ↵ | |
17 | info);↵ | 17 | info);↵ | |
18 | if (parentState == null) {↵ | 18 | if (parentState == null) {↵ | |
19 | parentState = new PlotState();↵ | 19 | parentState = new PlotState();↵ | |
20 | }↵ | 20 | }↵ | |
21 | parentState.getSharedAxisStates().put(axis, axisState);↵ | 21 | parentState.getSharedAxisStates().put(axis, state);↵ | |
22 | ↵ | |||
22 | // draw all the subplots↵ | 23 | // draw all the charts↵ | |
23 | for (int i = 0; i < this.subplots.size(); i++) {↵ | 24 | for (int i = 0; i < this.subplots.size(); i++) {↵ | |
24 | XYPlot plot = (XYPlot) this.subplots.get(i);↵ | 25 | CategoryPlot plot = (CategoryPlot) this.subplots.get(i);↵ | |
25 | PlotRenderingInfo subplotInfo = null;↵ | 26 | PlotRenderingInfo subplotInfo = null;↵ | |
26 | if (info != null) {↵ | 27 | if (info != null) {↵ | |
27 | subplotInfo = new PlotRenderingInfo(info.getOwner());↵ | 28 | subplotInfo = new PlotRenderingInfo(info.getOwner());↵ | |
28 | info.addSubplotInfo(subplotInfo);↵ | 29 | info.addSubplotInfo(subplotInfo);↵ | |
29 | }↵ | 30 | }↵ | |
30 | plot.draw(g2, this.subplotAreas[i], anchor, parentState,↵ | 31 | plot.draw(g2, this.subplotArea[i], null, parentState,↵ | |
31 | subplotInfo);↵ | 32 | subplotInfo);↵ | |
32 | }↵ | 33 | }↵ | |
33 | if (info != null) {↵ | 34 | if (info != null) {↵ | |
34 | info.setDataArea(dataArea);↵ | 35 | info.setDataArea(dataArea);↵ | |
35 | } | 36 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 137 |
Number of mapped statements | 23 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 167.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (info != null) | 1 | if (info != null) | |||||||||||||||||||
2 | info.setPlotArea(area); | 2 | info.setPlotArea(area); | |||||||||||||||||||
3 | RectangleInsets insets = getInsets(); | 3 | RectangleInsets insets = getInsets(); | |||||||||||||||||||
4 | insets.trim(area); | 4 | insets.trim(area); | |||||||||||||||||||
5 | setFixedRangeAxisSpaceForSubplots(null); | | ||||||||||||||||||||
6 | AxisSpace space = calculateAxisSpace(g2, area); | 5 | AxisSpace space = calculateAxisSpace(g2, area); | |||||||||||||||||||
7 | Rectangle2D dataArea = space.shrink(area, null); | 6 | Rectangle2D dataArea = space.shrink(area, null); | |||||||||||||||||||
8 | setFixedRangeAxisSpaceForSubplots(space); |
| 7 | setFixedDomainAxisSpaceForSubplots(space); | ||||||||||||||||||
9 | ValueAxis axis = getDomainAxis(); |
| 8 | ValueAxis axis = getRangeAxis(); | ||||||||||||||||||
10 | RectangleEdge edge = getDomainAxisEdge(); |
| 9 | RectangleEdge rangeEdge = getRangeAxisEdge(); | ||||||||||||||||||
11 | double cursor = RectangleEdge.coordinate(dataArea, edge); |
| 10 | double cursor = RectangleEdge.coordinate(dataArea, rangeEdge); | ||||||||||||||||||
12 | AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info); |
| 11 | AxisState state = axis.draw(g2, cursor, area, dataArea, rangeEdge, info); | ||||||||||||||||||
13 | if (parentState == null) | 12 | if (parentState == null) | |||||||||||||||||||
14 | parentState = new PlotState(); | 13 | parentState = new PlotState(); | |||||||||||||||||||
15 | parentState.getSharedAxisStates().put(axis, axisState); |
| 14 | parentState.getSharedAxisStates().put(axis, state); | ||||||||||||||||||
16 | for (int i = 0; i < this.subplots.size(); i++) | 15 | for (int i = 0; i < this.subplots.size(); i++) | |||||||||||||||||||
17 | XYPlot plot = (XYPlot)this.subplots.get(i); |
| 16 | CategoryPlot plot = (CategoryPlot)this.subplots.get(i); | ||||||||||||||||||
18 | PlotRenderingInfo subplotInfo = null; | 17 | PlotRenderingInfo subplotInfo = null; | |||||||||||||||||||
19 | if (info != null) | 18 | if (info != null) | |||||||||||||||||||
20 | subplotInfo = new PlotRenderingInfo(info.getOwner()); | 19 | subplotInfo = new PlotRenderingInfo(info.getOwner()); | |||||||||||||||||||
21 | info.addSubplotInfo(subplotInfo); | 20 | info.addSubplotInfo(subplotInfo); | |||||||||||||||||||
22 | plot.draw(g2, this.subplotAreas[i], anchor, parentState, subplotInfo); |
| 21 | plot.draw(g2, this.subplotArea[i], null, parentState, subplotInfo); | ||||||||||||||||||
23 | if (info != null) | 22 | if (info != null) | |||||||||||||||||||
24 | info.setDataArea(dataArea); | 23 | info.setDataArea(dataArea); |
Row | Violation |
---|---|
1 | Expression setFixedRangeAxisSpaceForSubplots(space) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression setFixedDomainAxisSpaceForSubplots(space) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression setFixedRangeAxisSpaceForSubplots(space) is a void method call, and thus it cannot be parameterized |
4 | Expression setFixedDomainAxisSpaceForSubplots(space) is a void method call, and thus it cannot be parameterized |
5 | Expression (XYPlot)this.subplots.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression (CategoryPlot)this.subplots.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression this.subplotAreas cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression this.subplotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted |