File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java | File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/ChartComposite.java | |||
Method name: void displayPopupMenu(int, int)
|
Method name: void displayPopupMenu(int, int)
|
|||
Number of AST nodes: 27 | Number of AST nodes: 28 | |||
1 | if (this.popup != null) {↵ | 1 | if (this.popup != null) {↵ | |
2 | ↵ | |||
3 | // go through each zoom menu item and decide whether or not to ↵ | 2 | // go through each zoom menu item and decide whether or not to ↵ | |
4 | // enable it... ↵ | 3 | // enable it...↵ | |
5 | Plot plot = this.chart.getPlot(); ↵ | 4 | Plot plot = this.chart.getPlot();↵ | |
6 | boolean isDomainZoomable = false; ↵ | 5 | boolean isDomainZoomable = false;↵ | |
7 | boolean isRangeZoomable = false; ↵ | 6 | boolean isRangeZoomable = false;↵ | |
8 | if (plot instanceof Zoomable) { ↵ | 7 | if (plot instanceof Zoomable) {↵ | |
9 | Zoomable z = (Zoomable) plot; ↵ | 8 | Zoomable z = (Zoomable) plot;↵ | |
10 | isDomainZoomable = z.isDomainZoomable(); ↵ | 9 | isDomainZoomable = z.isDomainZoomable();↵ | |
11 | isRangeZoomable = z.isRangeZoomable(); ↵ | 10 | isRangeZoomable = z.isRangeZoomable();↵ | |
12 | }↵ | 11 | }↵ | |
13 | ↵ | |||
14 | if (this.zoomInDomainMenuItem != null) { ↵ | 12 | if (this.zoomInDomainMenuItem != null) {↵ | |
15 | this.zoomInDomainMenuItem.setEnabled(isDomainZoomable); ↵ | 13 | this.zoomInDomainMenuItem.setEnabled(isDomainZoomable);↵ | |
16 | } ↵ | 14 | }↵ | |
17 | if (this.zoomOutDomainMenuItem != null) { ↵ | 15 | if (this.zoomOutDomainMenuItem != null) {↵ | |
18 | this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable); ↵ | 16 | this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable);↵ | |
19 | } ↵ | 17 | } ↵ | |
20 | if (this.zoomResetDomainMenuItem != null) { ↵ | 18 | if (this.zoomResetDomainMenuItem != null) {↵ | |
21 | this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable); ↵ | 19 | this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable);↵ | |
22 | }↵ | 20 | }↵ | |
23 | ↵ | |||
24 | if (this.zoomInRangeMenuItem != null) { ↵ | 21 | if (this.zoomInRangeMenuItem != null) {↵ | |
25 | this.zoomInRangeMenuItem.setEnabled(isRangeZoomable); ↵ | 22 | this.zoomInRangeMenuItem.setEnabled(isRangeZoomable);↵ | |
26 | } ↵ | 23 | }↵ | |
27 | if (this.zoomOutRangeMenuItem != null) { ↵ | 24 | if (this.zoomOutRangeMenuItem != null) {↵ | |
28 | this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable); ↵ | 25 | this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable);↵ | |
29 | }↵ | 26 | }↵ | |
30 | ↵ | |||
31 | if (this.zoomResetRangeMenuItem != null) { ↵ | 27 | if (this.zoomResetRangeMenuItem != null) {↵ | |
32 | this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable); ↵ | 28 | this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable);↵ | |
33 | }↵ | 29 | }↵ | |
34 | ↵ | |||
35 | if (this.zoomInBothMenuItem != null) { ↵ | 30 | if (this.zoomInBothMenuItem != null) {↵ | |
36 | this.zoomInBothMenuItem.setEnabled(isDomainZoomable ↵ | 31 | this.zoomInBothMenuItem.setEnabled(isDomainZoomable ↵ | |
37 | && isRangeZoomable); ↵ | 32 | & isRangeZoomable);↵ | |
38 | } ↵ | 33 | }↵ | |
39 | if (this.zoomOutBothMenuItem != null) { ↵ | 34 | if (this.zoomOutBothMenuItem != null) {↵ | |
40 | this.zoomOutBothMenuItem.setEnabled(isDomainZoomable ↵ | 35 | this.zoomOutBothMenuItem.setEnabled(isDomainZoomable ↵ | |
41 | && isRangeZoomable); ↵ | 36 | & isRangeZoomable);↵ | |
42 | } ↵ | 37 | }↵ | |
43 | if (this.zoomResetBothMenuItem != null) { ↵ | 38 | if (this.zoomResetBothMenuItem != null) {↵ | |
44 | this.zoomResetBothMenuItem.setEnabled(isDomainZoomable ↵ | 39 | this.zoomResetBothMenuItem.setEnabled(isDomainZoomable ↵ | |
45 | && isRangeZoomable); ↵ | 40 | & isRangeZoomable);↵ | |
46 | }↵ | 41 | }↵ | |
47 | ↵ | |||
48 | this.popup.show(this, x, y); ↵ | 42 | this.popup.setLocation(x, y);↵ | |
43 | this.popup.setVisible(true);↵ | |||
49 | } | 44 |
| |
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) | 30.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 280 |
Number of mapped statements | 23 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 41.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this.popup != null) |
| 1 | if (this.popup != null) | |||||||||||
2 | Plot plot = this.chart.getPlot(); | 2 | Plot plot = this.chart.getPlot(); | ||||||||||||
3 | boolean isDomainZoomable = false; | 3 | boolean isDomainZoomable = false; | ||||||||||||
4 | boolean isRangeZoomable = false; | 4 | boolean isRangeZoomable = false; | ||||||||||||
5 | if (plot instanceof Zoomable) | 5 | if (plot instanceof Zoomable) | ||||||||||||
6 | Zoomable z = (Zoomable)plot; | 6 | Zoomable z = (Zoomable)plot; | ||||||||||||
7 | isDomainZoomable = z.isDomainZoomable(); | 7 | isDomainZoomable = z.isDomainZoomable(); | ||||||||||||
8 | isRangeZoomable = z.isRangeZoomable(); | 8 | isRangeZoomable = z.isRangeZoomable(); | ||||||||||||
9 | if (this.zoomInDomainMenuItem != null) |
| 9 | if (this.zoomInDomainMenuItem != null) | |||||||||||
10 | this.zoomInDomainMenuItem.setEnabled(isDomainZoomable); |
| 10 | this.zoomInDomainMenuItem.setEnabled(isDomainZoomable); | |||||||||||
11 | if (this.zoomOutDomainMenuItem != null) |
| 11 | if (this.zoomOutDomainMenuItem != null) | |||||||||||
12 | this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable); |
| 12 | this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable); | |||||||||||
13 | if (this.zoomResetDomainMenuItem != null) |
| 13 | if (this.zoomResetDomainMenuItem != null) | |||||||||||
14 | this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable); |
| 14 | this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable); | |||||||||||
15 | if (this.zoomInRangeMenuItem != null) |
| 15 | if (this.zoomInRangeMenuItem != null) | |||||||||||
16 | this.zoomInRangeMenuItem.setEnabled(isRangeZoomable); |
| 16 | this.zoomInRangeMenuItem.setEnabled(isRangeZoomable); | |||||||||||
17 | if (this.zoomOutRangeMenuItem != null) |
| 17 | if (this.zoomOutRangeMenuItem != null) | |||||||||||
18 | this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable); |
| 18 | this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable); | |||||||||||
19 | if (this.zoomResetRangeMenuItem != null) |
| 19 | if (this.zoomResetRangeMenuItem != null) | |||||||||||
20 | this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable); |
| 20 | this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable); | |||||||||||
21 | if (this.zoomInBothMenuItem != null) |
| 21 | if (this.zoomInBothMenuItem != null) | |||||||||||
|
| 22 | this.zoomInBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable); | ||||||||||||
22 | this.zoomInBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable); |
| | ||||||||||||
23 | if (this.zoomOutBothMenuItem != null) |
| 23 | if (this.zoomOutBothMenuItem != null) | |||||||||||
|
| 24 | this.zoomOutBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable); | ||||||||||||
24 | this.zoomOutBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable); |
| | ||||||||||||
25 | if (this.zoomResetBothMenuItem != null) |
| 25 | if (this.zoomResetBothMenuItem != null) | |||||||||||
|
| 26 | this.zoomResetBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable); | ||||||||||||
26 | this.zoomResetBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable); |
| | ||||||||||||
|
| 27 | this.popup.setLocation(x, y); | ||||||||||||
27 | this.popup.show(this, x, y); |
| | ||||||||||||
|
| 28 | this.popup.setVisible(true); |
Row | Violation |
---|---|
1 | Type javax.swing.JPopupMenu of variable this.popup does not match with type org.eclipse.swt.widgets.Menu of variable this.popup |
2 | Type javax.swing.JMenuItem of variable this.zoomInDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInDomainMenuItem |
3 | Type javax.swing.JMenuItem of variable this.zoomInDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInDomainMenuItem |
4 | Type javax.swing.JMenuItem of variable this.zoomOutDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutDomainMenuItem |
5 | Type javax.swing.JMenuItem of variable this.zoomOutDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutDomainMenuItem |
6 | Type javax.swing.JMenuItem of variable this.zoomResetDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetDomainMenuItem |
7 | Type javax.swing.JMenuItem of variable this.zoomResetDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetDomainMenuItem |
8 | Type javax.swing.JMenuItem of variable this.zoomInRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInRangeMenuItem |
9 | Type javax.swing.JMenuItem of variable this.zoomInRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInRangeMenuItem |
10 | Type javax.swing.JMenuItem of variable this.zoomOutRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutRangeMenuItem |
11 | Type javax.swing.JMenuItem of variable this.zoomOutRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutRangeMenuItem |
12 | Type javax.swing.JMenuItem of variable this.zoomResetRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetRangeMenuItem |
13 | Type javax.swing.JMenuItem of variable this.zoomResetRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetRangeMenuItem |
14 | Type javax.swing.JMenuItem of variable this.zoomInBothMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInBothMenuItem |
15 | Unmatched statement this.zoomInBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
16 | Unmatched statement this.zoomInBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
17 | Type javax.swing.JMenuItem of variable this.zoomOutBothMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutBothMenuItem |
18 | Unmatched statement this.zoomOutBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
19 | Unmatched statement this.zoomOutBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
20 | Type javax.swing.JMenuItem of variable this.zoomResetBothMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetBothMenuItem |
21 | Unmatched statement this.zoomResetBothMenuItem.setEnabled(isDomainZoomable & isRangeZoomable); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
22 | Unmatched statement this.zoomResetBothMenuItem.setEnabled(isDomainZoomable && isRangeZoomable); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
23 | Unmatched statement this.popup.setLocation(x,y); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
24 | Unmatched statement this.popup.show(this,x,y); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
25 | Unmatched statement this.popup.setVisible(true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
26 | The refactoring of the clones is infeasible, because classes org.jfree.chart.ChartPanel and org.jfree.experimental.chart.swt.ChartComposite do not have a common superclass |