| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.monitor; |
| 17 |
|
|
| 18 |
|
import java.awt.Window; |
| 19 |
|
import java.awt.event.*; |
| 20 |
|
|
| 21 |
|
import org.fest.swing.annotation.RunsInEDT; |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
@author |
| 27 |
|
@author |
| 28 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (22) |
Complexity: 8 |
Complexity Density: 0.67 |
|
| 29 |
|
class WindowVisibilityMonitor extends WindowAdapter implements ComponentListener { |
| 30 |
|
|
| 31 |
|
private final Windows windows; |
| 32 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 33 |
1319
|
WindowVisibilityMonitor(Windows windows) {... |
| 34 |
1319
|
this.windows = windows; |
| 35 |
|
} |
| 36 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 37 |
259
|
public void componentShown(ComponentEvent e) {... |
| 38 |
259
|
Object source = e.getSource(); |
| 39 |
1
|
if (!(source instanceof Window)) return; |
| 40 |
258
|
windows.markAsShowing((Window)source); |
| 41 |
|
} |
| 42 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 43 |
113
|
public void componentHidden(ComponentEvent e) {... |
| 44 |
113
|
Object source = e.getSource(); |
| 45 |
1
|
if (!(source instanceof Window)) return; |
| 46 |
112
|
windows.markAsHidden((Window)source); |
| 47 |
|
} |
| 48 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 49 |
1308
|
@RunsInEDT... |
| 50 |
|
@Override public void windowClosed(WindowEvent e) { |
| 51 |
1308
|
Window w = e.getWindow(); |
| 52 |
1308
|
w.removeComponentListener(this); |
| 53 |
1308
|
w.removeWindowListener(this); |
| 54 |
|
} |
| 55 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 56 |
43
|
public void componentResized(ComponentEvent e) {}... |
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 57 |
153
|
public void componentMoved(ComponentEvent e) {}... |
| 58 |
|
|
| 59 |
|
} |