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

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


  }

  public void preProcessing(Orientation orientation) {

    // process auto tokens
    IntervalList intervals = new IntervalList();
    for (LayoutComponent component : getLayoutContainer().getComponents()) {

      if (component != null) {
        if (component instanceof LayoutContainer) {
          ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
View Full Code Here


        } else {
          heads[i].setCurrent(Measure.ZERO);
        }
      }

      IntervalList intervalList = new IntervalList();
      for (int j = 0; j < heads2.length; j++) {
        Cell cell = grid.getCell(i, j, orientation);
        if (cell instanceof OriginCell) {
          OriginCell origin = (OriginCell) cell;
          LayoutComponent component = cell.getComponent();

          if (component instanceof LayoutContainer && (component.isRendered() || isRigid())) {
            ((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
              }
            }
          }
        }
      }

      intervalList.evaluate();
      if (token instanceof AutoLayoutToken || token instanceof RelativeLayoutToken) {
        heads[i].setIntervalList(intervalList);
      }
      if (token instanceof AutoLayoutToken) {
        heads[i].setCurrent(intervalList.getCurrent());
      }
      i++;
    }

/*
 
View Full Code Here

  }

  public void preProcessing(Orientation orientation) {

    // process auto tokens
    IntervalList intervals = new IntervalList();
    for (LayoutComponent component : getLayoutContainer().getComponents()) {

      if (component != null) {
        if (component instanceof LayoutContainer && component.isRendered()) {
          ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
View Full Code Here

  }

  public void preProcessing(Orientation orientation) {

    // process auto tokens
    IntervalList intervals = new IntervalList();
    for (LayoutComponent component : getLayoutContainer().getComponents()) {

      if (component instanceof LayoutContainer && component.isRendered()) {
        ((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();
      Measure size = intervals.getCurrent();
/*
      size = size.add(LayoutUtils.getBorderBegin(orientation, getLayoutContainer()));
      size = size.add(LayoutUtils.getBorderEnd(orientation, getLayoutContainer()));
*/
      LayoutUtils.setCurrentSize(orientation, getLayoutContainer(), size);
View Full Code Here

   * 10/100/1000
   * 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

   * 10/100/1000
   * 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

   * ./200/.
   * ././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

   * 20/222/2000
   * 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

   * 120/222/220
   * 130/333/230
   */
  @Test
  public void test6Squeeze() {
    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(210), null));
    list.add(new Interval(px(120), px(222), px(220), null));
    list.add(new Interval(px(130), px(333), px(230), null));
    list.evaluate();
    Assert.assertEquals(px(300), list.getCurrent());
    Assert.assertEquals(px(300), list.getMinimum());
  }
View Full Code Here

   * 120/222/220
   * 130/333/230
   */
  @Test
  public void test5Squeeze() {
    IntervalList list = new IntervalList();
    list.add(new Interval(null, null, null, px(100)));
    list.add(new Interval(null, null, null, px(300)));
    list.add(new Interval(px(10), px(111), px(210), null));
    list.add(new Interval(px(120), px(222), px(220), null));
    list.add(new Interval(px(130), px(333), px(230), null));
    list.evaluate();
    Assert.assertEquals(px(300), list.getCurrent());
    Assert.assertEquals(px(300), list.getMinimum());
  }
View Full Code Here

TOP

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

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.