Clover Coverage Report - FEST Swing 1.2
Coverage timestamp: Tue Jun 1 2010 15:19:25 PDT
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   59   8   2
4   28   0.67   6
6     1.33  
1    
 
  WindowVisibilityMonitor       Line # 29 12 0% 8 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Oct 8, 2007
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11    * or implied. See the License for the specific language governing permissions and limitations under
12    * the License.
13    *
14    * Copyright @2007-2010 the original author or authors.
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    * Understands tracking of window visibility state.
25    *
26    * @author Alex Ruiz
27    * @author Yvonne Wang
28    */
 
29    class WindowVisibilityMonitor extends WindowAdapter implements ComponentListener {
30   
31    private final Windows windows;
32   
 
33  1319 toggle WindowVisibilityMonitor(Windows windows) {
34  1319 this.windows = windows;
35    }
36   
 
37  259 toggle 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   
 
43  113 toggle 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   
 
49  1308 toggle @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   
 
56  43 toggle public void componentResized(ComponentEvent e) {}
 
57  153 toggle public void componentMoved(ComponentEvent e) {}
58   
59    }