Package com.eclipsesource.tabris.passepartout

Examples of com.eclipsesource.tabris.passepartout.Bounds


    assertEquals( new Bounds( 30, 5, 110, 75 ), bounds );
  }

  @Test
  public void testComputesBoundsWithExcludeInstrutions() {
    Layouter layouter = new Layouter( createEnvironment( new Bounds( 0, 0, 600, 200 ) ), createConfig() );
    ArrayList<Instruction> instructions = new ArrayList<Instruction>();
    instructions.add( new ExcludeInstruction() );

    Bounds bounds = layouter.computeBounds( new Bounds( 0, 0, 100, 100 ), instructions );

    assertEquals( new Bounds( 0, 0, 0, 0 ), bounds );
  }
View Full Code Here


  @Test
  public void testConvertsRectangleToBounds() {
    Rectangle rectangle = new Rectangle( 10, 20, 30, 40 );

    Bounds bounds = BoundsUtil.getBounds( rectangle );

    assertEquals( 10, bounds.getX() );
    assertEquals( 20, bounds.getY() );
    assertEquals( 30, bounds.getWidth() );
    assertEquals( 40, bounds.getHeight() );
  }
View Full Code Here

    assertEquals( 40, bounds.getHeight() );
  }

  @Test
  public void testConvertsBoundsToRectangle() {
    Bounds bounds = new Bounds( 10, 20, 30, 40 );

    Rectangle rectangle = BoundsUtil.getRectangle( bounds );

    assertEquals( 10, rectangle.x );
    assertEquals( 20, rectangle.y );
View Full Code Here

  @Test
  public void testConvertsPointToBounds() {
    Point point = new Point( 10, 20 );

    Bounds bounds = BoundsUtil.getBounds( point );

    assertEquals( 0, bounds.getX() );
    assertEquals( 0, bounds.getY() );
    assertEquals( 10, bounds.getWidth() );
    assertEquals( 20, bounds.getHeight() );
  }
View Full Code Here

public class UIEnvironmentImplTest {

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithNullBounds() {
    new UIEnvironmentImpl( null, new Bounds( 0, 0, 0, 0 ), 16 );
  }
View Full Code Here

    new UIEnvironmentImpl( null, new Bounds( 0, 0, 0, 0 ), 16 );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithNullReferenceBounds() {
    new UIEnvironmentImpl( new Bounds( 0, 0, 0, 0 ), null, 16 );
  }
View Full Code Here

    new UIEnvironmentImpl( new Bounds( 0, 0, 0, 0 ), null, 16 );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWithNegativeFontSize() {
    new UIEnvironmentImpl( new Bounds( 0, 0, 0, 0 ), new Bounds( 0, 0, 0, 0 ), -1 );
  }
View Full Code Here

    new UIEnvironmentImpl( new Bounds( 0, 0, 0, 0 ), new Bounds( 0, 0, 0, 0 ), -1 );
  }

  @Test
  public void testHasBounds() {
    Bounds bounds = new Bounds( 0, 0, 0, 0 );
    UIEnvironmentImpl uiEnvironment = new UIEnvironmentImpl( bounds, bounds, 16 );

    Bounds actualBounds = uiEnvironment.getParentBounds();

    assertSame( bounds, actualBounds );
  }
View Full Code Here

    assertSame( bounds, actualBounds );
  }

  @Test
  public void testHasReferenceBounds() {
    Bounds bounds = new Bounds( 0, 0, 0, 0 );
    UIEnvironmentImpl uiEnvironment = new UIEnvironmentImpl( bounds, bounds, 16 );

    Bounds actualBounds = uiEnvironment.getReferenceBounds();

    assertSame( bounds, actualBounds );
  }
View Full Code Here

    assertSame( bounds, actualBounds );
  }

  @Test
  public void testHasFontSize() {
    UIEnvironmentImpl uiEnvironment = new UIEnvironmentImpl( new Bounds( 0, 0, 0, 0 ), new Bounds( 0, 0, 0, 0 ), 16 );

    int parentFontSize = uiEnvironment.getParentFontSize();

    assertEquals( 16, parentFontSize );
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.passepartout.Bounds

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.