| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
package org.fest.swing.driver; |
| 7 |
|
|
| 8 |
|
import static javax.swing.JSplitPane.VERTICAL_SPLIT; |
| 9 |
|
import static org.fest.swing.driver.HorizontalJSplitPaneDividerLocation.locationToMoveDividerToHorizontally; |
| 10 |
|
import static org.fest.swing.driver.VerticalJSplitPaneDividerLocation.locationToMoveDividerToVertically; |
| 11 |
|
import static org.fest.swing.edt.GuiActionRunner.execute; |
| 12 |
|
|
| 13 |
|
import javax.swing.JSplitPane; |
| 14 |
|
|
| 15 |
|
import org.fest.swing.annotation.RunsInEDT; |
| 16 |
|
import org.fest.swing.edt.GuiQuery; |
| 17 |
|
|
| 18 |
|
|
| 19 |
|
@link |
| 20 |
|
|
| 21 |
|
|
| 22 |
|
@author |
| 23 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
| 24 |
|
final class JSplitPaneLocationCalculator { |
| 25 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 26 |
10
|
@RunsInEDT... |
| 27 |
|
static int locationToMoveDividerTo(final JSplitPane splitPane, final int desiredLocation) { |
| 28 |
10
|
return execute(new GuiQuery<Integer>() { |
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 29 |
10
|
protected Integer executeInEDT() {... |
| 30 |
10
|
switch (splitPane.getOrientation()) { |
| 31 |
5
|
case VERTICAL_SPLIT: |
| 32 |
5
|
return locationToMoveDividerToVertically(splitPane, desiredLocation); |
| 33 |
|
|
| 34 |
5
|
default: |
| 35 |
5
|
return locationToMoveDividerToHorizontally(splitPane, desiredLocation); |
| 36 |
|
} |
| 37 |
|
} |
| 38 |
|
}); |
| 39 |
|
} |
| 40 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 41 |
|
private JSplitPaneLocationCalculator() {}... |
| 42 |
|
} |