use of limelight.util.Box in project limelight by slagyr.
the class ScrollBarPainterTest method shouldBuildDecreaseBoxForVertical.
@Test
public void shouldBuildDecreaseBoxForVertical() throws Exception {
setUpVertically();
scrollBar.setSize(15, 100);
Box increasing = painter.getDecreasingBox(scrollBar);
assertEquals(new Box(0, 67, 15, 16), increasing);
}
use of limelight.util.Box in project limelight by slagyr.
the class ScrollBarPainterTest method buildsTrackBoxVertically.
@Test
public void buildsTrackBoxVertically() throws Exception {
setUpVertically();
scrollBar.setSize(15, 100);
Box track = painter.getTrackBox(scrollBar);
assertEquals(new Box(0, 5, 15, 62), track);
}
use of limelight.util.Box in project limelight by slagyr.
the class ScrollBarPainterTest method shouldBuildDecreaseBoxForHorizontal.
@Test
public void shouldBuildDecreaseBoxForHorizontal() throws Exception {
setUpHorizontally();
scrollBar.setSize(100, 15);
Box increasing = painter.getDecreasingBox(scrollBar);
assertEquals(new Box(67, 0, 17, 15), increasing);
}
use of limelight.util.Box in project limelight by slagyr.
the class TextPanelCaretPainterTest method setUp.
@Before
public void setUp() {
assumeTrue(TestUtil.notHeadless());
container = new limelight.ui.model.text.MockTextContainer();
container.bounds = new Box(0, 0, 150, 20);
model = new MockTextModel(container);
model.setText("Some Text");
model.setCaretLocation(TextLocation.at(0, 4));
graphics = new MockGraphics();
container.cursorOn = true;
painter = TextPanelCaretPainter.instance;
}
use of limelight.util.Box in project limelight by slagyr.
the class TextPanelSelectionPainterTest method willFillMultipleBoxesForMultiLinedSelectedText.
@Test
public void willFillMultipleBoxesForMultiLinedSelectedText() {
container = new limelight.ui.model.text.MockTextContainer();
container.bounds = new Box(0, 0, 150, 30);
model = new limelight.ui.model.text.MultiLineTextModel(container);
model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
model.setText("This is some\nMulti lined text");
model.startSelection(TextLocation.at(0, 2));
model.setCaretLocation(TextLocation.at(1, 5));
painter.paint(graphics, model);
assertEquals(new Box(20, 0, 130, 10), graphics.filledShapes.get(0).shape);
assertEquals(new Box(0, 11, 50, 10), graphics.filledShapes.get(1).shape);
}
Aggregations