Package org.apache.myfaces.tobago.internal.layout

Examples of org.apache.myfaces.tobago.internal.layout.Interval


            ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
          }

          if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
            if (origin.getSpan(orientation) == 1 && (component.isRendered() || isRigid())) {
              intervalList.add(new Interval(component, orientation));
            } else {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Components with span > 1 will be ignored in 'auto' layout rows/columns.");
                // todo: give this information to the developer
              }
View Full Code Here


        ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
      }

      if (orientation == Orientation.HORIZONTAL && horizontalAuto
          || orientation == Orientation.VERTICAL && verticalAuto) {
        intervals.add(new Interval(component, orientation));
      }
    }

    if (intervals.size() >= 1) {
      intervals.evaluate();
View Full Code Here

   * f=100
   */
  @Test
  public void test1Fixed() {
    IntervalList list = new IntervalList();
    list.add(new Interval(null, null, null, px(100)));
    list.evaluate();
    Assert.assertEquals(px(100), list.getCurrent());
    Assert.assertEquals(px(100), list.getMinimum());
  }
View Full Code Here

   * f=300
   */
  @Test
  public void test3Fixed() {
    IntervalList list = new IntervalList();
    list.add(new Interval(null, null, null, px(100)));
    list.add(new Interval(null, null, null, px(200)));
    list.add(new Interval(null, null, null, px(300)));
    list.evaluate();
    Assert.assertEquals(px(300), list.getCurrent());
    Assert.assertEquals(px(300), list.getMinimum());
  }
View Full Code Here

   * 10/100/1000
   */
  @Test
  public void test1MinPrefMax() {
    IntervalList list = new IntervalList();
    list.add(new Interval(px(10), px(100), px(1000), null));
    list.evaluate();
    Assert.assertEquals(px(100), list.getCurrent());
    Assert.assertEquals(px(10), list.getMinimum());
  }
View Full Code Here

   * 30/300/3000
   */
  @Test
  public void test3MinPrefMax() {
    IntervalList list = new IntervalList();
    list.add(new Interval(px(10), px(100), px(1000), null));
    list.add(new Interval(px(20), px(200), px(2000), null));
    list.add(new Interval(px(30), px(300), px(3000), null));
    list.evaluate();
    Assert.assertEquals(px(300), list.getCurrent());
    Assert.assertEquals(px(30), list.getMinimum());
  }
View Full Code Here

   * 1000/10000/100000
   */
  @Test
  public void test2MinPrefMax() {
    IntervalList list = new IntervalList();
    list.add(new Interval(px(10), px(100), px(1000), null));
    list.add(new Interval(px(1000), px(10000), px(100000), null));
    list.evaluate();
    Assert.assertEquals(px(1000), list.getCurrent());
    Assert.assertEquals(px(1000), list.getMinimum());
  }
View Full Code Here

   * 2000/20000/200000
   */
  @Test
  public void test4MinPrefMax() {
    IntervalList list = new IntervalList();
    list.add(new Interval(px(10), px(100), px(1000), null));
    list.add(new Interval(px(2000), px(20000), px(200000), null));
    list.evaluate();
    Assert.assertEquals(px(2000), list.getCurrent());
    Assert.assertEquals(px(2000), list.getMinimum());
  }
View Full Code Here

   * ././3000
   */
  @Test
  public void test3MinPrefMaxWithGaps() {
    IntervalList list = new IntervalList();
    list.add(new Interval(px(10), null, null, null));
    list.add(new Interval(null, px(200), null, null));
    list.add(new Interval(null, null, px(3000), null));
    list.evaluate();
    Assert.assertEquals(px(200), list.getCurrent());
    Assert.assertEquals(px(10), list.getMinimum());
  }
View Full Code Here

   * 30/333/3000
   */
  @Test
  public void test6Mixed() {
    IntervalList list = new IntervalList();
    list.add(new Interval(null, null, null, px(100)));
    list.add(new Interval(null, null, null, px(200)));
    list.add(new Interval(null, null, null, px(300)));
    list.add(new Interval(px(10), px(111), px(1000), null));
    list.add(new Interval(px(20), px(222), px(2000), null));
    list.add(new Interval(px(30), px(333), px(3000), null));
    list.evaluate();
    Assert.assertEquals(px(333), list.getCurrent());
    Assert.assertEquals(px(300), list.getMinimum());
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.internal.layout.Interval

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.