Package com.google.gdt.eclipse.designer.model.widgets.panels.grid

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.grid.FlexTableInfo


            "    FlexTableHelper.fixRowSpan(panel);",
            "  }",
            "}");
    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
    {
      assertEquals(3, ReflectionUtils.invokeMethod(panel.getObject(), "getRowCount()"));
      assertEquals(1, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 0));
      assertEquals(0, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 1));
      assertEquals(2, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 2));
    }
  }
View Full Code Here


            "    FlexTableHelper.fixRowSpan(panel);",
            "  }",
            "}");
    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
    {
      assertEquals(1, ReflectionUtils.invokeMethod(panel.getObject(), "getRowCount()"));
      assertEquals(1, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 0));
    }
  }
View Full Code Here

            "    panel.getFlexCellFormatter().setColSpan(0, 0, 2);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    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));
View Full Code Here

            "    FlexTableHelper.fixRowSpan(panel);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo buttonA = panel.getChildrenWidgets().get(0);
    WidgetInfo buttonB = panel.getChildrenWidgets().get(1);
    assertEquals(3, panel.getColumns().size());
    assertEquals(1, panel.getRows().size());
    assertEquals("3 1 [2] {(0,0)=(2,1) (1,0)=(1,1)}", panel.getStatus().toString());
    //
    IGridInfo gridInfo = panel.getGridInfo();
    assertEquals(new Rectangle(0, 0, 2, 1), gridInfo.getComponentCells(buttonA));
    assertEquals(new Rectangle(2, 0, 1, 1), gridInfo.getComponentCells(buttonB));
  }
View Full Code Here

            "    panel.setWidget(2, 2, new Button('A'));",
            "  }",
            "}");
    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

            "    panel.setWidget(2, 2, new Button('A'));",
            "  }",
            "}");
    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

            "    panel.getFlexCellFormatter().setColSpan(0, 0, 2);",
            "  }",
            "}");
    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]);
    }
    // low_getCellOfColumn()
    {
      assertEquals(0, panel.getStatus().getCellOfColumn(0, 0));
      assertEquals(1, panel.getStatus().getCellOfColumn(0, 2));
      assertEquals(0, panel.getStatus().getCellOfColumn(1, 0));
      assertEquals(1, panel.getStatus().getCellOfColumn(1, 1));
      assertEquals(2, panel.getStatus().getCellOfColumn(1, 2));
      // column in the middle of spanned cell
      assertEquals(0, panel.getStatus().getCellOfColumn(0, 1));
      // column directly after last cell
      assertEquals(2, panel.getStatus().getCellOfColumn(0, 3));
      assertEquals(3, panel.getStatus().getCellOfColumn(1, 3));
      // out of bounds
      try {
        panel.getStatus().getCellOfColumn(0, 100);
        fail();
      } catch (Throwable e) {
      }
    }
  }
View Full Code Here

            "    panel.getFlexCellFormatter().setColSpan(1, 0, 2);",
            "  }",
            "}");
    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]);
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.grid.FlexTableInfo

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.