| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.core; |
| 17 |
|
|
| 18 |
|
|
| 19 |
|
import static org.fest.swing.core.MouseButton.*; |
| 20 |
|
import static org.fest.util.Strings.concat; |
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
@author |
| 43 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (24) |
Complexity: 10 |
Complexity Density: 0.77 |
|
| 44 |
|
public final class MouseClickInfo { |
| 45 |
|
|
| 46 |
|
private final MouseButton button; |
| 47 |
|
private int times; |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
@return |
| 52 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 53 |
14
|
public static MouseClickInfo leftButton() {... |
| 54 |
14
|
return button(LEFT_BUTTON); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
|
| 58 |
|
|
| 59 |
|
@return |
| 60 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 61 |
24
|
public static MouseClickInfo middleButton() {... |
| 62 |
24
|
return button(MIDDLE_BUTTON); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
|
@return |
| 68 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 69 |
4
|
public static MouseClickInfo rightButton() {... |
| 70 |
4
|
return button(RIGHT_BUTTON); |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
@param |
| 76 |
|
@return |
| 77 |
|
@throws |
| 78 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 79 |
43
|
public static MouseClickInfo button(MouseButton button) {... |
| 80 |
43
|
return new MouseClickInfo(button, 1); |
| 81 |
|
} |
| 82 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 83 |
43
|
private MouseClickInfo(MouseButton button, int times) {... |
| 84 |
1
|
if (button == null) throw new NullPointerException("The MouseButton should not be null"); |
| 85 |
42
|
this.button = button; |
| 86 |
42
|
this.times = times; |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
@return |
| 92 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 93 |
21
|
public MouseButton button() { return button; }... |
| 94 |
|
|
| 95 |
|
|
| 96 |
|
@link |
| 97 |
|
@return@link |
| 98 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 99 |
21
|
public int times() { return times; }... |
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
@param |
| 104 |
|
@return |
| 105 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 106 |
32
|
public MouseClickInfo times(int newTimes) { ... |
| 107 |
32
|
times = newTimes; |
| 108 |
32
|
return this; |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
@see |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 112 |
1
|
@Override public String toString() {... |
| 113 |
1
|
return concat( |
| 114 |
|
getClass().getSimpleName(), "[", |
| 115 |
|
"button=", button, ",", |
| 116 |
|
"times=", String.valueOf(times), "]"); |
| 117 |
|
} |
| 118 |
|
} |