use of limelight.util.Box in project limelight by slagyr.
the class ImagePanelLayoutTest method getDimensionsWhenNotAuto.
@Test
public void getDimensionsWhenNotAuto() throws Exception {
panel.setFilename(TestUtil.DATA_DIR + "/star.gif");
parent.style.setWidth("100");
parent.style.setHeight("150");
parent.childConsumableBounds = new Box(0, 0, 100, 150);
Layouts.on(parent, parent.getDefaultLayout());
assertEquals(100, panel.getWidth());
assertEquals(150, panel.getHeight());
}
use of limelight.util.Box in project limelight by slagyr.
the class ScrollMouseProcessorTest method mouseInSliderScrollConditionHorizontal.
@Test
public void mouseInSliderScrollConditionHorizontal() throws Exception {
setUpHorizontally();
scrollBar.setValue(10);
Box sliderBounds = scrollBar.getSliderBounds();
final ScrollRepeater.ScrollCondition condition = processor.getNotInSliderScrollCondition();
processor.setMouseLocation(sliderBounds.left() - 1, 7);
assertEquals(true, condition.canScroll());
processor.setMouseLocation(sliderBounds.left() + 1, 7);
assertEquals(false, condition.canScroll());
processor.setMouseLocation(sliderBounds.right() - 1, 7);
assertEquals(false, condition.canScroll());
processor.setMouseLocation(sliderBounds.right() + 1, 7);
assertEquals(true, condition.canScroll());
}
use of limelight.util.Box in project limelight by slagyr.
the class ScrollMouseProcessorTest method mouseInSliderScrollConditionVertical.
@Test
public void mouseInSliderScrollConditionVertical() throws Exception {
setUpVertically();
scrollBar.setValue(10);
Box sliderBounds = scrollBar.getSliderBounds();
final ScrollRepeater.ScrollCondition condition = processor.getNotInSliderScrollCondition();
processor.setMouseLocation(7, sliderBounds.top() - 1);
assertEquals(true, condition.canScroll());
processor.setMouseLocation(7, sliderBounds.top() + 1);
assertEquals(false, condition.canScroll());
processor.setMouseLocation(7, sliderBounds.bottom() - 1);
assertEquals(false, condition.canScroll());
processor.setMouseLocation(7, sliderBounds.bottom() + 1);
assertEquals(true, condition.canScroll());
}
use of limelight.util.Box in project limelight by slagyr.
the class PropPanelTest method marginedBoundsIncludeMarginButIgnoreLocation.
@Test
public void marginedBoundsIncludeMarginButIgnoreLocation() throws Exception {
panel.setLocation(3, 3);
panel.setSize(50, 50);
panel.getStyle().setMargin(5);
final Box bounds = panel.getMarginedBounds();
assertEquals(5, bounds.x);
assertEquals(5, bounds.y);
assertEquals(40, bounds.width);
assertEquals(40, bounds.height);
}
use of limelight.util.Box in project limelight by slagyr.
the class PanelPainterLoop method paintDirtyRegions.
public void paintDirtyRegions(Scene root) {
regionBuffer.clear();
root.getAndClearDirtyRegions(regionBuffer);
for (Rectangle rectangle : regionBuffer) {
if (rectangle.width <= 0 || rectangle.height <= 0)
continue;
Graphics2D rootGraphics = root.getGraphics();
if (rootGraphics != null) {
doPaintJob(root, new Box(rectangle), rootGraphics);
}
}
}
Aggregations