use of limelight.util.Box in project limelight by slagyr.
the class ScaleXFillStrategyValueTest method setUp.
public void setUp() throws Exception {
attribute = new ScaleXFillStrategyValue();
graphics = new MockGraphics();
clip = new Box(0, 0, 60, 60);
graphics.clip = clip;
}
use of limelight.util.Box in project limelight by slagyr.
the class SimpleHorizontalAlignmentValueTest method testStartingX.
public void testStartingX() throws Exception {
Box area = new Box(0, 0, 100, 100);
assertEquals(0, left.getX(100, area));
assertEquals(0, left.getX(1, area));
assertEquals(0, center.getX(100, area));
assertEquals(25, center.getX(50, area));
assertEquals(37, center.getX(25, area));
assertEquals(49, center.getX(1, area));
assertEquals(0, right.getX(100, area));
assertEquals(50, right.getX(50, area));
assertEquals(99, right.getX(1, area));
}
use of limelight.util.Box in project limelight by slagyr.
the class PaintJobTest method testCreation.
public void testCreation() throws Exception {
Box clip = new Box(1, 2, 3, 4);
PaintJob job = new PaintJob(clip, Colors.TRANSPARENT);
assertSame(clip, job.getClip());
BufferedImage buffer = job.getBuffer();
assertEquals(3, buffer.getWidth());
assertEquals(4, buffer.getHeight());
Graphics2D graphics = job.getGraphics();
assertNotNull(graphics);
assertEquals(Colors.TRANSPARENT, graphics.getBackground());
}
use of limelight.util.Box in project limelight by slagyr.
the class PanelBaseTest method getBounds.
@Test
public void getBounds() throws Exception {
Box bounds = panel.getBounds();
assertEquals(panel.getX(), bounds.x);
assertEquals(panel.getY(), bounds.y);
assertEquals(panel.getWidth(), bounds.width);
assertEquals(panel.getHeight(), bounds.height);
}
use of limelight.util.Box in project limelight by slagyr.
the class ParentPanelTest method shouldAbsoluteBoundsChangesWhenLocationChanges.
@Test
public void shouldAbsoluteBoundsChangesWhenLocationChanges() throws Exception {
Box bounds = panel.getAbsoluteBounds();
panel.setLocation(123, 456);
assertNotSame(bounds, panel.getAbsoluteBounds());
assertEquals(123, panel.getAbsoluteBounds().x);
assertEquals(456, panel.getAbsoluteBounds().y);
}
Aggregations