Package org.eclipse.wb.core.gef.policy.layout.grid

Examples of org.eclipse.wb.core.gef.policy.layout.grid.IGridInfo


            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    // check IGridInfo
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(3, gridInfo.getRowCount());
    assertEquals(3, gridInfo.getColumnCount());
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
      assertEquals(new Interval(RS + RA + RS, RA), intervals[1]);
      assertEquals(new Interval(RS + RA + RS + RA + RS, RA), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CA), intervals[0]);
      assertEquals(new Interval(CS + CA + CS, CA), intervals[1]);
      assertEquals(new Interval(CS + CA + CS + CA + CS, CA), intervals[2]);
    }
    // cells
    {
      List<WidgetInfo> widgets = panel.getChildrenWidgets();
      assertEquals(new Rectangle(0, 0, 1, 1), gridInfo.getComponentCells(widgets.get(0)));
      assertEquals(new Rectangle(1, 1, 1, 1), gridInfo.getComponentCells(widgets.get(1)));
      assertEquals(new Rectangle(2, 2, 1, 1), gridInfo.getComponentCells(widgets.get(2)));
    }
  }
View Full Code Here


            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    // check IGridInfo
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(3, gridInfo.getRowCount());
    assertEquals(3, gridInfo.getColumnCount());
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
      assertEquals(new Interval(RS + RA + RS, RE), intervals[1]);
      assertEquals(new Interval(RS + RA + RS + RE + RS, RA), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CA), intervals[0]);
      assertEquals(new Interval(CS + CA + CS, CE), intervals[1]);
      assertEquals(new Interval(CS + CA + CS + CE + CS, CA), intervals[2]);
    }
    // cells
    {
      List<WidgetInfo> widgets = panel.getChildrenWidgets();
      assertEquals(new Rectangle(0, 0, 1, 1), gridInfo.getComponentCells(widgets.get(0)));
      assertEquals(new Rectangle(2, 2, 1, 1), gridInfo.getComponentCells(widgets.get(1)));
    }
  }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
      assertEquals(new Interval(RS + RA + RS, RA), intervals[1]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CE), intervals[0]);
      assertEquals(new Interval(CS + CE + CS, CA), intervals[1]);
      assertEquals(new Interval(CS + CE + CS + CA + CS, CA), intervals[2]);
    }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
      assertEquals(new Interval(RS + RA + RS, RA), intervals[1]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CE), intervals[0]);
      assertEquals(new Interval(CS + CE + CS, CA), intervals[1]);
      assertEquals(new Interval(CS + CE + CS + CA + CS, CA), intervals[2]);
    }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
      assertEquals(new Interval(RS + RA + RS, RA), intervals[1]);
      assertEquals(new Interval(RS + RA + RS + RA + RS, RA), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CA), intervals[0]);
      assertEquals(new Interval(CS + CA + CS, CE), intervals[1]);
      assertEquals(new Interval(CS + CA + CS + CE + CS, CA), intervals[2]);
    }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CA), intervals[0]);
      assertEquals(new Interval(CS + CA + CS, CA / 2), intervals[1]);
      assertEquals(new Interval(CS + CA + CS + CA / 2, CA / 2), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(1, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
    }
  }
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(
        "2 3 [1, 2, 2] {(0,0)=(2,2) (0,1)=(1,1) (1,1)=(1,1) (0,2)=(1,1) (1,2)=(1,1)}",
        panel.getStatus().toString());
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(3, intervals.length);
      int spanHeight = RA / 2;
      assertEquals(new Interval(RS, spanHeight), intervals[0]);
      assertEquals(new Interval(RS + spanHeight, spanHeight), intervals[1]);
      assertEquals(new Interval(RS + spanHeight + spanHeight, RA), intervals[2]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(CS, CE), intervals[0]);
      assertEquals(new Interval(CS + CE + CS, CA), intervals[1]);
    }
    // check TABLE element
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(2, panel.getColumns().size());
    assertEquals(1, panel.getRows().size());
    assertEquals("2 1 [1] {(0,0)=(2,1)}", panel.getStatus().toString());
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(1, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
    }
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(2, intervals.length);
      assertEquals(new Interval(CS, CA / 2), intervals[0]);
      assertEquals(new Interval(CS + CA / 2, CA / 2), intervals[1]);
    }
    // check TABLE element
View Full Code Here

    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button_1 = panel.getChildrenWidgets().get(0);
    WidgetInfo button_2 = panel.getChildrenWidgets().get(1);
    WidgetInfo button_3 = panel.getChildrenWidgets().get(2);
    // check IGridInfo cells
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(new Rectangle(0, 0, 2, 1), gridInfo.getComponentCells(button_1));
    assertEquals(new Rectangle(1, 1, 1, 1), gridInfo.getComponentCells(button_2));
    assertEquals(new Rectangle(2, 1, 1, 1), gridInfo.getComponentCells(button_3));
    // getOccupied()
    assertSame(button_1, gridInfo.getOccupied(0, 0));
    assertSame(button_1, gridInfo.getOccupied(1, 0));
    assertSame(button_2, gridInfo.getOccupied(1, 1));
    assertSame(button_3, gridInfo.getOccupied(2, 1));
    assertNull(gridInfo.getOccupied(2, 0));
    assertNull(gridInfo.getOccupied(0, 1));
  }
View Full Code Here

    assertEquals(0, constraints.getX());
    assertEquals(0, constraints.getY());
    assertEquals(2, constraints.getWidth());
    assertEquals(1, constraints.getHeight());
    // checks grid
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(new Rectangle(0, 0, 2, 1), gridInfo.getComponentCells(button));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.gef.policy.layout.grid.IGridInfo

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.