Package com.eclipsesource.tabris.passepartout.internal.unit

Examples of com.eclipsesource.tabris.passepartout.internal.unit.Pixel


    new MaxWidthCondition( null );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWidthZeroMaxWidth() {
    new MaxWidthCondition( new Pixel( 0 ) );
  }
View Full Code Here


    new MaxWidthCondition( new Pixel( 0 ) );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWidthNegativeMaxWidth() {
    new MaxWidthCondition( new Pixel( -1 ) );
  }
View Full Code Here

    new MaxWidthCondition( new Pixel( -1 ) );
  }

  @Test
  public void testCompliesNotWithWidthBiggerThanMaxWidth() {
    MaxWidthCondition condition = new MaxWidthCondition( new Pixel( 100 ) );
    Bounds bounds = new Bounds( 10, 10, 110, 0 );

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

    assertFalse( complies );
View Full Code Here

    assertFalse( complies );
  }

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

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

    assertTrue( complies );
View Full Code Here

    assertTrue( complies );
  }

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

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

    assertTrue( complies );
View Full Code Here

    new MinWidthCondition( null );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testFailsWidthNegativeMinWidth() {
    new MinWidthCondition( new Pixel( -1 ) );
  }
View Full Code Here

    new MinWidthCondition( new Pixel( -1 ) );
  }

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

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

    assertTrue( complies );
View Full Code Here

    assertTrue( complies );
  }

  @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

    assertTrue( complies );
  }

  @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

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

  @Test
  public void testUsesPixelToComputeMargins() {
    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() );
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.passepartout.internal.unit.Pixel

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.