Package com.eclipsesource.tabris.passepartout

Examples of com.eclipsesource.tabris.passepartout.Bounds


  }

  @Test
  public void testCompliesWithWidthSameThanMinWidth() {
    MinWidthCondition condition = new MinWidthCondition( new Pixel( 100 ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( createEnvironment( bounds ) );

    assertTrue( complies );
  }
View Full Code Here


  }

  @Test
  public void testCompliesNotWithWidthSmallerThanMinWidth() {
    MinWidthCondition condition = new MinWidthCondition( new Pixel( 100 ) );
    Bounds bounds = new Bounds( 10, 10, 90, 0 );

    boolean complies = condition.compliesWith( createEnvironment( bounds ) );

    assertFalse( complies );
  }
View Full Code Here

  }

  @Test
  public void testCompliesWithWidthBiggerThanMinWidthInEm() {
    MinWidthCondition condition = new MinWidthCondition( new Em( BigDecimal.valueOf( 3 ) ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, mock( Bounds.class ), 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  }

  @Test
  public void testCompliesWithWidthSameThanMinWidthInEm() {
    MinWidthCondition condition = new MinWidthCondition( new Em( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 160, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, mock( Bounds.class ), 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  }

  @Test
  public void testCompliesNotWithWidthSmallerThanMinWidthInEm() {
    MinWidthCondition condition = new MinWidthCondition( new Em( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, mock( Bounds.class ), 16 ) );

    assertFalse( complies );
  }
View Full Code Here

  }

  @Test
  public void testCompliesWithWidthBiggerThanMinWidthInPercentage() {
    MinWidthCondition condition = new MinWidthCondition( new Percentage( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 11, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  }

  @Test
  public void testCompliesWithWidthSameThanMinWidthInPercentage() {
    MinWidthCondition condition = new MinWidthCondition( new Percentage( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 10, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  }

  @Test
  public void testCompliesNotWithWidthSmallerThanMinWidthInPercentage() {
    MinWidthCondition condition = new MinWidthCondition( new Percentage( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 9, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertFalse( complies );
  }
View Full Code Here

    MarginInstruction instruction = new MarginInstruction( mock( Unit.class ),
                                                                     mock( Unit.class ),
                                                                     mock( Unit.class ),
                                                                     mock( Unit.class ) );

    Bounds bounds = instruction.computeBounds( new Bounds( 0, 0, 100, 100 ), 16 );

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

    MarginInstruction instruction = new MarginInstruction( new Pixel( 5 ),
                                                                     new Pixel( 5 ),
                                                                     new Pixel( 5 ),
                                                                     new Pixel( 5 ) );

    Bounds bounds = instruction.computeBounds( new Bounds( 0, 0, 100, 100 ), 16 );

    assertEquals( 5, bounds.getX() );
    assertEquals( 5, bounds.getY() );
    assertEquals( 90, bounds.getWidth() );
    assertEquals( 90, bounds.getHeight() );
  }
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.