| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 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 |
|
@link |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
@author |
| 32 |
|
@author |
| 33 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
| 34 |
|
class VerticalJScrollBarLocation extends JScrollBarLocationStrategy { |
| 35 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 36 |
6
|
@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 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 42 |
12
|
@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 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 49 |
6
|
@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 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 55 |
18
|
@RunsInCurrentThread... |
| 56 |
|
int arrow(JScrollBar scrollBar) { |
| 57 |
18
|
return scrollBar.getWidth(); |
| 58 |
|
} |
| 59 |
|
} |