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

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


  @Test
  public void testUsesMixedUnitsToComputeMargins() {
    MarginInstruction instruction = new MarginInstruction( new Percentage( BigDecimal.valueOf( 10 ) ),
                                                                     new Em( BigDecimal.ONE ),
                                                                     new Percentage( BigDecimal.valueOf( 10 ) ),
                                                                     new Pixel( 10 ) );

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

    assertEquals( 10, bounds.getX() );
    assertEquals( 10, bounds.getY() );
View Full Code Here


    UnitUtil.percentageToPixel( new Percentage( BigDecimal.TEN ), -100 );
  }

  @Test( expected = IllegalArgumentException.class )
  public void testCalculatesPercentageFailsWithWrongUnit() {
    UnitUtil.percentageToPixel( new Pixel( 23 ), 100 );
  }
View Full Code Here

   * </p>
   *
   * @param value defines the pixel value. Must be >= 0.
   */
  public static Unit px( int value ) {
    return new Pixel( value );
  }
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.