Package limelight.util

Examples of limelight.util.Box


    child1.floater = true;
    child3.floater = true;

    MockParentPanel.paintCount = 0;
    panel.setSize(100, 100);
    job = new PaintJob(new Box(0, 0, 100, 100), Colors.TRANSPARENT);
    job.paintChildren(panel, graphics);

    assertEquals(0, child2.paintIndex);
    assertEquals(1, child4.paintIndex);
    assertEquals(2, child5.paintIndex);
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, 20);
    model = new SingleLineTextModel(container);
    model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
    model.setText("Bob Dole likes to hear Bob Dole say 'Bob Dole'  ");
  }
View Full Code Here

  @Before
  public void setUp() throws Exception
  {
    assumeTrue(TestUtil.notHeadless());
    textContainer = new limelight.ui.model.text.MockTextContainer(new Box(0, 0, 100, 15));
    model = new limelight.ui.model.text.MultiLineTextModel(textContainer);
    model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
  }
View Full Code Here

  }

  @Test
  public void shouldNotGoNutsWhenTextIsBiggetThanHeight() throws Exception
  {
    textContainer.bounds = new Box(0, 0, 100, 6);
    model.setText("blah");
    model.setCaretLocation(TextLocation.at(0, 2));
    model.setOffset(0, 0);

    assertEquals(-2, YOffsetStrategy.FITTING.calculateYOffset(model));
View Full Code Here

  public void setUp() throws Exception
  {
    assumeTrue(TestUtil.notHeadless());
    strategy = XOffsetStrategy.FITTING;
    container = new limelight.ui.model.text.MockTextContainer();
    container.bounds = new Box(0, 0, 100, 50);
    model = new limelight.ui.model.text.SingleLineTextModel(container);
    model.setTypedLayoutFactory(MockTypedLayoutFactory.instance);
    model.setText("0123456789012345678901234567890");
  }
View Full Code Here

  }

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

  public void mouseInSliderScrollConditionVertical() throws Exception
  {
    setUpVertically();
    scrollBar.setValue(10);

    Box sliderBounds = scrollBar.getSliderBounds();
    final ScrollRepeater.ScrollCondition condition = processor.getNotInSliderScrollCondition();

    processor.setMouseLocation(7, sliderBounds.top() - 1);
    assertEquals(true, condition.canScroll());

    processor.setMouseLocation(7, sliderBounds.top() + 1);
    assertEquals(false, condition.canScroll());

    processor.setMouseLocation(7, sliderBounds.bottom() - 1);
    assertEquals(false, condition.canScroll());

    processor.setMouseLocation(7, sliderBounds.bottom() + 1);
    assertEquals(true, condition.canScroll());
  }
View Full Code Here

  public void mouseInSliderScrollConditionHorizontal() throws Exception
  {
    setUpHorizontally();
    scrollBar.setValue(10);

    Box sliderBounds = scrollBar.getSliderBounds();
    final ScrollRepeater.ScrollCondition condition = processor.getNotInSliderScrollCondition();

    processor.setMouseLocation(sliderBounds.left() - 1, 7);
    assertEquals(true, condition.canScroll());

    processor.setMouseLocation(sliderBounds.left() + 1, 7);
    assertEquals(false, condition.canScroll());

    processor.setMouseLocation(sliderBounds.right() - 1, 7);
    assertEquals(false, condition.canScroll());

    processor.setMouseLocation(sliderBounds.right() + 1, 7);
    assertEquals(true, condition.canScroll());
  }
View Full Code Here

    return this;
  }

  private TextInputKeyProcessorTest setupSingleLine(String text)
  {
    container.bounds = new Box(0, 0, 150, 20);
    return setUp(new SingleLineTextModel(container), text);
  }
View Full Code Here

    return setUp(new SingleLineTextModel(container), text);
  }

  private TextInputKeyProcessorTest setupMultiLine(String text)
  {
    container.bounds = new Box(0, 0, 150, 75);
    return setUp(new MultiLineTextModel(container), text);
  }
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.