Search in sources :

Example 11 with Box

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

the class SingleLineTextModelTest method canGetTheSelectedRegion.

@Test
public void canGetTheSelectedRegion() {
    model.setText("blah");
    model.startSelection(TextLocation.origin);
    assertEquals(new Box(0, 0, 40, 11), model.getSelectionRegions().get(0));
}
Also used : Box(limelight.util.Box) Test(org.junit.Test)

Example 12 with Box

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

the class TextInputPanelTest method consumableBoundsAreCachedAndRefreshed.

@Test
public void consumableBoundsAreCachedAndRefreshed() throws Exception {
    final Box original = panel.getConsumableBounds();
    assertSame(panel.getConsumableBounds(), original);
    panel.clearCache();
    assertNotSame(panel.getConsumableBounds(), original);
}
Also used : Box(limelight.util.Box) Test(org.junit.Test)

Example 13 with Box

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

the class ScrollBarPainterTest method shouldBuildIncreaseBoxForHorizontal.

@Test
public void shouldBuildIncreaseBoxForHorizontal() throws Exception {
    setUpHorizontally();
    scrollBar.setSize(100, 15);
    Box increasing = painter.getIncreasingBox(scrollBar);
    assertEquals(new Box(84, 0, 16, 15), increasing);
}
Also used : Box(limelight.util.Box) Test(org.junit.Test)

Example 14 with Box

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

the class ScrollBarPainterTest method buildsTrackBoxHorizontally.

@Test
public void buildsTrackBoxHorizontally() throws Exception {
    setUpHorizontally();
    scrollBar.setSize(100, 15);
    Box track = painter.getTrackBox(scrollBar);
    assertEquals(new Box(5, 0, 62, 15), track);
}
Also used : Box(limelight.util.Box) Test(org.junit.Test)

Example 15 with Box

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

the class ScrollBarPainterTest method shouldBuildIncreaseBoxForVertical.

@Test
public void shouldBuildIncreaseBoxForVertical() throws Exception {
    setUpVertically();
    scrollBar.setSize(15, 100);
    Box increasing = painter.getIncreasingBox(scrollBar);
    assertEquals(new Box(0, 84, 15, 16), increasing);
}
Also used : Box(limelight.util.Box) Test(org.junit.Test)

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