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
8   59   4   2
0   26   0.5   4
4     1  
1    
 
  VerticalJScrollBarLocation       Line # 34 8 0% 4 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Jul 31, 2008
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 @2008-2010 the original author or authors.
15    */
16    package org.fest.swing.driver;
17   
18    import java.awt.Point;
19   
20    import javax.swing.JScrollBar;
21   
22    import org.fest.swing.annotation.RunsInCurrentThread;
23   
24    /**
25    * Understands a location in a horizontal <code>{@link JScrollBar}</code>.
26    * <p>
27    * <b>Note:</b> Methods in this class are <b>not</b> executed in the event dispatch thread (EDT.) Clients are
28    * responsible for invoking them in the EDT.
29    * </p>
30    *
31    * @author Alex Ruiz
32    * @author Yvonne Wang
33    */
 
34    class VerticalJScrollBarLocation extends JScrollBarLocationStrategy {
35   
 
36  6 toggle @RunsInCurrentThread
37    Point thumbLocation(JScrollBar scrollBar, double fraction) {
38  6 int arrow = arrow(scrollBar);
39  6 return new Point(arrow / 2, arrow + (int) (fraction * (scrollBar.getHeight() - 2 * arrow)));
40    }
41   
 
42  12 toggle @RunsInCurrentThread
43    Point blockLocation(JScrollBar scrollBar, Point unitLocation, int offset) {
44  12 Point p = new Point(unitLocation);
45  12 p.y += offset;
46  12 return p;
47    }
48   
 
49  6 toggle @RunsInCurrentThread
50    Point unitLocationToScrollDown(JScrollBar scrollBar) {
51  6 int arrow = arrow(scrollBar);
52  6 return new Point(arrow / 2, scrollBar.getHeight() - arrow / 2);
53    }
54   
 
55  18 toggle @RunsInCurrentThread
56    int arrow(JScrollBar scrollBar) {
57  18 return scrollBar.getWidth();
58    }
59    }