Package org.eclipse.wb.draw2d.geometry

Examples of org.eclipse.wb.draw2d.geometry.Dimension


  /**
   * If there are components that span multiple columns/rows, and no other "real" components in
   * these columns/rows, then removes these excess columns/rows.
   */
  public void command_normalizeSpanning() throws Exception {
    Dimension gridSize = getWidgetsGridSize();
    boolean[] filledColumns = new boolean[gridSize.width];
    boolean[] filledRows = new boolean[gridSize.height];
    for (WidgetInfo widget : getContainer().getChildrenWidgets()) {
      if (!isFiller(widget)) {
        TableLayoutDataInfo tableData = getTableData(widget);
View Full Code Here


  void prepareCell(int column, boolean insertColumn, int row, boolean insertRow) throws Exception {
    // prepare count of columns/rows
    int columnCount;
    int rowCount;
    {
      Dimension gridSize = getWidgetsGridSize();
      columnCount = gridSize.width;
      rowCount = gridSize.height;
    }
    // append
    {
View Full Code Here

      //
      columnCount = Math.max(columnCount, tableData.x + tableData.width);
      rowCount = Math.max(rowCount, tableData.y + tableData.height);
    }
    // OK, we have grid
    return new Dimension(columnCount, rowCount);
  }
View Full Code Here

  /**
   * @return the double array of {@link WidgetInfo} where each element contains {@link WidgetInfo}
   *         that occupies this cell.
   */
  private WidgetInfo[][] getWidgetsGrid() throws Exception {
    Dimension gridSize = getWidgetsGridSize();
    // prepare empty grid
    WidgetInfo[][] grid;
    {
      grid = new WidgetInfo[gridSize.height][];
      for (int rowIndex = 0; rowIndex < grid.length; rowIndex++) {
View Full Code Here

   */
  private static void applyDevice(IUIObjectInfo object) throws Exception {
    IDeviceView device = getDeviceView(object);
    // set size
    if (device != null) {
      Dimension size = device.getDisplayBounds().getSize();
      object.getTopBoundsSupport().setSize(size.width, size.height);
    }
    // refresh
    object.getUnderlyingModel().refresh();
  }
View Full Code Here

        "    textItem.setTop(20);",
        "    setFields(new FormItem[] { textItem});",
        "  }",
        "}");
    // set size
    form.command_BOUNDS(formItem, null, new Dimension(60, 50));
    form.refresh();
    assertThat(formItem.getBounds().getSize()).isEqualTo(new Dimension(60, 50));
    assertEditor(
        "public class Test extends DynamicForm {",
        "  public Test() {",
        "    setItemLayout(FormLayoutType.ABSOLUTE);",
        "    TextItem textItem = new TextItem('newTextItem');",
View Full Code Here

        "  }",
        "}");
    refresh();
    WidgetInfo button = getJavaInfoByName("button");
    // set new size
    button.getSizeSupport().setSize(new Dimension(100, 50));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

        "      rootPanel.add(button);",
        "      button.setSize('100px', '50px');",
        "    }",
        "  }",
        "}");
    assertEquals(new Dimension(100, 50), button.getBounds().getSize());
  }
View Full Code Here

    assertEquals(new Insets(2), widget.getMargins());
    assertEquals(new Insets(3), widget.getBorders());
    assertEquals(new Insets(4), widget.getPaddings());
    // set new size, tweak to take decorations into account
    widget.getSizeSupport().setSize(100, 50);
    assertEquals(new Dimension(100, 50), widget.getBounds().getSize());
    // source
    int clientWidth = 100 - (2 + 3 + 4) * 2;
    int clientHeight = 50 - (2 + 3 + 4) * 2;
    assertEditor(
        "public class Test implements EntryPoint {",
View Full Code Here

    assertEquals(new Insets(2), widget.getMargins());
    assertEquals(new Insets(3), widget.getBorders());
    assertEquals(new Insets(4), widget.getPaddings());
    // set new size, tweak to take decorations into account
    widget.getSizeSupport().setSize(100, 50);
    assertEquals(new Dimension(100, 50), widget.getBounds().getSize());
    // source
    int clientWidth = 100 - (2 + 3 + 4) * 2;
    int clientHeight = 50 - (2 + 3 + 4) * 2;
    assertEditor(
        "public class Test implements EntryPoint {",
View Full Code Here

TOP

Related Classes of org.eclipse.wb.draw2d.geometry.Dimension

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.