Package limelight.util

Examples of limelight.util.Box


  public void buildsTrackBoxHorizontally() throws Exception
  {
    setUpHorizontally();
    scrollBar.setSize(100, 15);

    Box track = painter.getTrackBox(scrollBar);

    assertEquals(new Box(5, 0, 62, 15), track);
  }
View Full Code Here


  @Before
  public void setUp()
  {
    assumeTrue(TestUtil.notHeadless());
    container = new limelight.ui.model.text.MockTextContainer();
    container.bounds = new Box(0, 0, 150, 50);

    model = new limelight.ui.model.text.MultiLineTextModel(container);
    model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
    model.setText("Some Text");
    model.setCaretLocation(TextLocation.at(0, 4));
View Full Code Here

  @Before
  public void setUp()
  {
    assumeTrue(TestUtil.notHeadless());
    container = new limelight.ui.model.text.MockTextContainer();
    container.bounds = new Box(0, 0, 150, 28);

    model = new limelight.ui.model.text.MultiLineTextModel(container);
    model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
    model.setText("Some Text");
    model.setCaretLocation(TextLocation.at(0, 4));
View Full Code Here

  @Test
  public void willFillABoxAroundSelectedText()
  {
    painter.paint(graphics, model);

    assertEquals(new Box(40, 0, 20, 10), graphics.filledShapes.get(0).shape);
  }
View Full Code Here

  @Test
  public void willFillMultipleBoxesForMultiLinedSelectedText()
  {
    container = new limelight.ui.model.text.MockTextContainer();
    container.bounds = new Box(0, 0, 150, 30);
    model = new limelight.ui.model.text.MultiLineTextModel(container);
    model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
    model.setText("This is some\nMulti lined text");
    model.startSelection(TextLocation.at(0, 2));
    model.setCaretLocation(TextLocation.at(1, 5));

    painter.paint(graphics, model);

    assertEquals(new Box(20, 0, 130, 10), graphics.filledShapes.get(0).shape);
    assertEquals(new Box(0, 11, 50, 10), graphics.filledShapes.get(1).shape);
  }
View Full Code Here

  public void getDimensionsWhenNotAuto() 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());

    assertEquals(100, panel.getWidth());
    assertEquals(150, panel.getHeight());
  }
View Full Code Here

  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);
View Full Code Here

  {
    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);
View Full Code Here

  @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);
View Full Code Here

  @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);
View Full Code Here

TOP

Related Classes of limelight.util.Box

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.