use of limelight.util.Box in project limelight by slagyr.
the class ImagePanelLayoutTest method getScalleTransformWhenDimensionsAreNotAutoAndScalingIsOff.
@Test
public void getScalleTransformWhenDimensionsAreNotAutoAndScalingIsOff() throws Exception {
panel.setFilename(TestUtil.DATA_DIR + "/star.gif");
panel.setScaled(false);
parent.style.setWidth("100");
parent.style.setHeight("150");
parent.childConsumableBounds = new Box(0, 0, 100, 150);
Layouts.on(parent, parent.getDefaultLayout());
AffineTransform tranform = panel.getTransform();
assertEquals(1.0, tranform.getScaleX(), 0.001);
assertEquals(1.0, tranform.getScaleY(), 0.001);
}
use of limelight.util.Box in project limelight by slagyr.
the class ImagePanelLayoutTest method hasConstrainedProportionsWhenWidthIsNotAuto.
@Test
public void hasConstrainedProportionsWhenWidthIsNotAuto() throws Exception {
panel.setFilename(TestUtil.DATA_DIR + "/star.gif");
parent.style.setWidth("100");
parent.childConsumableBounds = new Box(0, 0, 100, 200);
Layouts.on(parent, parent.getDefaultLayout());
AffineTransform tranform = panel.getTransform();
assertEquals(0.5, tranform.getScaleX(), 0.001);
assertEquals(0.5, tranform.getScaleY(), 0.001);
}
use of limelight.util.Box in project limelight by slagyr.
the class ImagePanelLayoutTest method sizeRemainsWhenStaticAndNotScaled.
@Test
public void sizeRemainsWhenStaticAndNotScaled() throws Exception {
panel.setFilename(TestUtil.DATA_DIR + "/star.gif");
panel.setScaled(false);
parent.style.setHeight("400");
parent.style.setHeight("400");
parent.childConsumableBounds = new Box(0, 0, 400, 400);
Layouts.on(parent, parent.getDefaultLayout());
AffineTransform tranform = panel.getTransform();
assertEquals(1.0, tranform.getScaleX(), 0.001);
assertEquals(1.0, tranform.getScaleY(), 0.001);
assertEquals(200, panel.getWidth());
assertEquals(200, panel.getHeight());
}
use of limelight.util.Box in project limelight by slagyr.
the class ImagePanelLayoutTest method getScaleTransformWhenDimensionsAreNotAuto.
@Test
public void getScaleTransformWhenDimensionsAreNotAuto() 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());
AffineTransform tranform = panel.getTransform();
assertEquals(0.5, tranform.getScaleX(), 0.001);
assertEquals(0.75, tranform.getScaleY(), 0.001);
}
use of limelight.util.Box in project limelight by slagyr.
the class PropPanelTest method rectanglesAreCached.
@Test
public void rectanglesAreCached() throws Exception {
Box rectangle = panel.getBounds();
Box insideMargins = panel.getMarginedBounds();
Box insideBorders = panel.getBorderedBounds();
Box insidePadding = panel.getPaddedBounds();
assertSame(rectangle, panel.getBounds());
assertSame(insideMargins, panel.getMarginedBounds());
assertSame(insideBorders, panel.getBorderedBounds());
assertSame(insidePadding, panel.getPaddedBounds());
panel.setSize(123, 456);
assertNotSame(rectangle, panel.getBounds());
assertNotSame(insideMargins, panel.getMarginedBounds());
assertNotSame(insideBorders, panel.getBorderedBounds());
assertNotSame(insidePadding, panel.getPaddedBounds());
}
Aggregations