Search in sources :

Example 66 with Box

use of limelight.util.Box in project limelight by slagyr.

the class ParentPanelTest method shouldAbsoluteBoundsChangesWhenSizeChanges.

@Test
public void shouldAbsoluteBoundsChangesWhenSizeChanges() throws Exception {
    Box bounds = panel.getAbsoluteBounds();
    assertSame(bounds, panel.getAbsoluteBounds());
    panel.setSize(123, 456);
    assertNotSame(bounds, panel.getBounds());
    assertEquals(123, panel.getAbsoluteBounds().width);
    assertEquals(456, panel.getAbsoluteBounds().height);
}
Also used : Box(limelight.util.Box) Test(org.junit.Test)

Example 67 with Box

use of limelight.util.Box in project limelight by slagyr.

the class RepeatFillStrategyValueTest method setUp.

public void setUp() throws Exception {
    attribute = new RepeatFillStrategyValue();
    graphics = new MockGraphics();
    clip = new Box(0, 0, 60, 60);
    graphics.clip = clip;
}
Also used : MockGraphics(limelight.ui.MockGraphics) Box(limelight.util.Box)

Example 68 with Box

use of limelight.util.Box in project limelight by slagyr.

the class RepeatXFillStrategyValueTest method setUp.

public void setUp() throws Exception {
    attribute = new RepeatXFillStrategyValue();
    graphics = new MockGraphics();
    clip = new Box(0, 0, 60, 60);
    graphics.clip = clip;
}
Also used : MockGraphics(limelight.ui.MockGraphics) Box(limelight.util.Box)

Example 69 with Box

use of limelight.util.Box in project limelight by slagyr.

the class ScaleYFillStrategyValueTest method setUp.

public void setUp() throws Exception {
    attribute = new ScaleYFillStrategyValue();
    graphics = new MockGraphics();
    clip = new Box(0, 0, 60, 60);
    graphics.clip = clip;
}
Also used : MockGraphics(limelight.ui.MockGraphics) Box(limelight.util.Box)

Example 70 with Box

use of limelight.util.Box in project limelight by slagyr.

the class SimpleVerticalAlignmentValueTest method testStartingY.

public void testStartingY() throws Exception {
    Box area = new Box(0, 0, 100, 100);
    assertEquals(0, top.getY(100, area));
    assertEquals(0, top.getY(1, area));
    assertEquals(0, center.getY(100, area));
    assertEquals(25, center.getY(50, area));
    assertEquals(37, center.getY(25, area));
    assertEquals(49, center.getY(1, area));
    assertEquals(0, bottom.getY(100, area));
    assertEquals(50, bottom.getY(50, area));
    assertEquals(99, bottom.getY(1, area));
}
Also used : Box(limelight.util.Box)

Aggregations

Box (limelight.util.Box)80 Test (org.junit.Test)31 MockGraphics (limelight.ui.MockGraphics)11 Before (org.junit.Before)6 AffineTransform (java.awt.geom.AffineTransform)5 Style (limelight.styles.Style)3 TextLocation (limelight.ui.text.TextLocation)3 TypedLayout (limelight.ui.text.TypedLayout)3 BufferedImage (java.awt.image.BufferedImage)2 Panel (limelight.ui.Panel)2 TextLayout (java.awt.font.TextLayout)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 LimelightException (limelight.LimelightException)1 FlatStyle (limelight.styles.FlatStyle)1 StringValue (limelight.styles.abstrstyling.StringValue)1 AutoDimensionValue (limelight.styles.values.AutoDimensionValue)1 GreedyDimensionValue (limelight.styles.values.GreedyDimensionValue)1 BufferedImagePool (limelight.ui.BufferedImagePool)1 MockPanel (limelight.ui.MockPanel)1