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: 27 | |||
1 | if (this.popup != null) {↵ | |||
2 | // go through each zoom menu item and decide whether or not to↵ | |||
3 | // enable it...↵ | |||
4 | Plot plot = this.chart.getPlot(); ↵ | 1 | Plot plot = this.chart.getPlot();↵ | |
5 | boolean isDomainZoomable = false; ↵ | 2 | boolean isDomainZoomable = false;↵ | |
6 | boolean isRangeZoomable = false; ↵ | 3 | boolean isRangeZoomable = false;↵ | |
7 | if (plot instanceof Zoomable) { ↵ | 4 | if (plot instanceof Zoomable) {↵ | |
8 | Zoomable z = (Zoomable) plot; ↵ | 5 | Zoomable z = (Zoomable) plot;↵ | |
9 | isDomainZoomable = z.isDomainZoomable(); ↵ | 6 | isDomainZoomable = z.isDomainZoomable();↵ | |
10 | isRangeZoomable = z.isRangeZoomable(); ↵ | 7 | isRangeZoomable = z.isRangeZoomable();↵ | |
11 | }↵ | 8 | }↵ | |
12 | ↵ | |||
13 | if (this.zoomInDomainMenuItem != null) { ↵ | 9 | if (this.zoomInDomainMenuItem != null) {↵ | |
14 | this.zoomInDomainMenuItem.setEnabled(isDomainZoomable); ↵ | 10 | this.zoomInDomainMenuItem.setEnabled(isDomainZoomable);↵ | |
15 | } ↵ | 11 | }↵ | |
16 | if (this.zoomOutDomainMenuItem != null) { ↵ | 12 | if (this.zoomOutDomainMenuItem != null) {↵ | |
17 | this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable); ↵ | 13 | this.zoomOutDomainMenuItem.setEnabled(isDomainZoomable);↵ | |
18 | } ↵ | 14 | } ↵ | |
19 | if (this.zoomResetDomainMenuItem != null) { ↵ | 15 | if (this.zoomResetDomainMenuItem != null) {↵ | |
20 | this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable); ↵ | 16 | this.zoomResetDomainMenuItem.setEnabled(isDomainZoomable);↵ | |
21 | }↵ | 17 | }↵ | |
22 | ↵ | |||
23 | if (this.zoomInRangeMenuItem != null) { ↵ | 18 | if (this.zoomInRangeMenuItem != null) {↵ | |
24 | this.zoomInRangeMenuItem.setEnabled(isRangeZoomable); ↵ | 19 | this.zoomInRangeMenuItem.setEnabled(isRangeZoomable);↵ | |
25 | } ↵ | 20 | }↵ | |
26 | if (this.zoomOutRangeMenuItem != null) { ↵ | 21 | if (this.zoomOutRangeMenuItem != null) {↵ | |
27 | this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable); ↵ | 22 | this.zoomOutRangeMenuItem.setEnabled(isRangeZoomable);↵ | |
28 | }↵ | 23 | }↵ | |
29 | ↵ | |||
30 | if (this.zoomResetRangeMenuItem != null) { ↵ | 24 | if (this.zoomResetRangeMenuItem != null) {↵ | |
31 | this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable); ↵ | 25 | this.zoomResetRangeMenuItem.setEnabled(isRangeZoomable);↵ | |
32 | }↵ | 26 | }↵ | |
33 | ↵ | |||
34 | if (this.zoomInBothMenuItem != null) { ↵ | 27 | if (this.zoomInBothMenuItem != null) {↵ | |
35 | this.zoomInBothMenuItem.setEnabled(isDomainZoomable ↵ | 28 | this.zoomInBothMenuItem.setEnabled(isDomainZoomable ↵ | |
36 | && isRangeZoomable); ↵ | 29 | & isRangeZoomable);↵ | |
37 | } ↵ | 30 | }↵ | |
38 | if (this.zoomOutBothMenuItem != null) { ↵ | 31 | if (this.zoomOutBothMenuItem != null) {↵ | |
39 | this.zoomOutBothMenuItem.setEnabled(isDomainZoomable ↵ | 32 | this.zoomOutBothMenuItem.setEnabled(isDomainZoomable ↵ | |
40 | && isRangeZoomable); ↵ | 33 | & isRangeZoomable);↵ | |
41 | } ↵ | 34 | }↵ | |
42 | if (this.zoomResetBothMenuItem != null) { ↵ | 35 | if (this.zoomResetBothMenuItem != null) {↵ | |
43 | this.zoomResetBothMenuItem.setEnabled(isDomainZoomable ↵ | 36 | this.zoomResetBothMenuItem.setEnabled(isDomainZoomable ↵ | |
44 | && isRangeZoomable); ↵ | 37 | & isRangeZoomable);↵ | |
45 | }↵ | 38 | }↵ | |
46 | ↵ | |||
47 | this.popup.show(this, x, y); ↵ | 39 | this.popup.setLocation(x, y);↵ | |
48 | } | 40 | this.popup.setVisible(true); | |
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) | 29.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 271 |
Number of mapped statements | 22 |
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) | 38.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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.JMenuItem of variable this.zoomInDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInDomainMenuItem |
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.zoomOutDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutDomainMenuItem |
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.zoomResetDomainMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetDomainMenuItem |
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.zoomInRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInRangeMenuItem |
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.zoomOutRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutRangeMenuItem |
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.zoomResetRangeMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetRangeMenuItem |
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.zoomInBothMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomInBothMenuItem |
14 | 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 |
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 | Type javax.swing.JMenuItem of variable this.zoomOutBothMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomOutBothMenuItem |
17 | 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 |
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 | Type javax.swing.JMenuItem of variable this.zoomResetBothMenuItem does not match with type org.eclipse.swt.widgets.MenuItem of variable this.zoomResetBothMenuItem |
20 | 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 |
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.popup.show(this,x,y); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
23 | 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 |