use of limelight.util.Box in project limelight by slagyr.
the class ParentPanelTest method shouldRactanglesAreCached.
@Test
public void shouldRactanglesAreCached() throws Exception {
Box rectangle = panel.getBounds();
assertSame(rectangle, panel.getBounds());
panel.setSize(123, 456);
assertNotSame(rectangle, panel.getBounds());
}
use of limelight.util.Box in project limelight by slagyr.
the class ParentPanelTest method shouldClearingCacheIsRecursive.
@Test
public void shouldClearingCacheIsRecursive() throws Exception {
panel.setLocation(20, 21);
Box parentBounds = panel.getAbsoluteBounds();
MockPanel child = new MockPanel();
panel.add(child);
child.setLocation(10, 11);
Box childBounds = child.getAbsoluteBounds();
panel.setLocation(30, 31);
assertNotSame(parentBounds, panel.getAbsoluteBounds());
assertNotSame(childBounds, child.getAbsoluteBounds());
}
use of limelight.util.Box in project limelight by slagyr.
the class MockGraphics method clipRect.
public void clipRect(int x, int y, int width, int height) {
clippedRectangle = new Box(x, y, width, height);
clip = clippedRectangle;
}
use of limelight.util.Box in project limelight by slagyr.
the class MockGraphics method create.
public Graphics create(int x, int y, int width, int height) {
MockGraphics createdGraphics = new MockGraphics();
subGraphics.add(createdGraphics);
createdGraphics.clip = new Box(x, y, width, height);
return createdGraphics;
}
use of limelight.util.Box in project limelight by slagyr.
the class ImagePanelLayoutTest method hasConstrainedProportionsWhenHeightIsNotAuto.
@Test
public void hasConstrainedProportionsWhenHeightIsNotAuto() throws Exception {
panel.setFilename(TestUtil.DATA_DIR + "/star.gif");
parent.style.setHeight("100");
parent.childConsumableBounds = new Box(0, 0, 200, 100);
Layouts.on(parent, parent.getDefaultLayout());
AffineTransform tranform = panel.getTransform();
assertEquals(0.5, tranform.getScaleX(), 0.001);
assertEquals(0.5, tranform.getScaleY(), 0.001);
}
Aggregations