Package org.eclipse.wb.draw2d.geometry

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


    Set<Point> cellsToRemoveFillers = Sets.newHashSet();
    // replace widget with fillers
    if (forMove) {
      for (int x = tableData.x; x < tableData.x + tableData.width; x++) {
        for (int y = tableData.y; y < tableData.y + tableData.height; y++) {
          Point cell = new Point(x, y);
          cellsToAddFillers.add(cell);
        }
      }
    }
    // remove fillers from occupied cells
    for (int x = cells.x; x < cells.right(); x++) {
      for (int y = cells.y; y < cells.bottom(); y++) {
        Point cell = new Point(x, y);
        cellsToAddFillers.remove(cell);
        if (isFiller(grid[y][x])) {
          cellsToRemoveFillers.add(cell);
        }
      }
View Full Code Here


        "  }",
        "}");
    form.refresh();
    // set location
    FormItemInfo formItem = form.getItems().get(0);
    Point location = new Point(30, 20);
    form.command_BOUNDS(formItem, location, null);
    form.refresh();
    assertThat(formItem.getBounds().getLocation()).isEqualTo(location);
    assertEditor(
        "public class Test extends DynamicForm {",
        "  public Test() {",
        "    setItemLayout(FormLayoutType.ABSOLUTE);",
        "    TextItem textItem = new TextItem('newTextItem');",
        "    textItem.setLeft(30);",
        "    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');",
        "    textItem.setWidth(60);",
        "    textItem.setHeight(50);",
        "    textItem.setLeft(30);",
        "    textItem.setTop(20);",
        "    setFields(new FormItem[] { textItem});",
        "  }",
        "}");
    // change location
    form.command_BOUNDS(formItem, new Point(10, 10), null);
    form.refresh();
    assertThat(formItem.getBounds().getLocation()).isEqualTo(new Point(10, 10));
    assertEditor(
        "public class Test extends DynamicForm {",
        "  public Test() {",
        "    setItemLayout(FormLayoutType.ABSOLUTE);",
        "    TextItem textItem = new TextItem('newTextItem');",
View Full Code Here

            "  }",
            "}");
    // drag header of "button_2"
    {
      Rectangle bounds = panel.getWidgetHandles().get(1).getBounds();
      Point handleCenter = bounds.getCenter();
      canvas.moveTo(panel, handleCenter.x, handleCenter.y);
      canvas.beginDrag().dragTo(panel, 5, 0).endDrag();
    }
    assertEditor(
        "public class Test extends StackLayoutPanel {",
View Full Code Here

    assertTrue(isVisible(button_1));
    assertFalse(isVisible(button_2));
    // double click handle of "button_1"
    {
      Rectangle bounds = panel.getWidgetHandles().get(1).getBounds();
      Point handleCenter = bounds.getCenter();
      canvas.moveTo(panel, handleCenter.x, handleCenter.y).doubleClick();
    }
    // now "button_2" is visible
    assertFalse(isVisible(button_1));
    assertTrue(isVisible(button_2));
View Full Code Here

            "  }",
            "}");
    // select header
    {
      Rectangle bounds = panel.getWidgetHandles().get(0).getBounds();
      Point handleCenter = bounds.getCenter();
      canvas.moveTo(panel, handleCenter.x, handleCenter.y).click();
    }
    // do direct edit
    canvas.performDirectEdit("123");
    assertEditor(
View Full Code Here

            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    //
    canvas.command_BOUNDS(button, new Point(10, 20), new Dimension(50, 25));
    assertEditor(
        "public class Test extends Canvas {",
        "  public Test() {",
        "    {",
        "      Button button = new Button('My Button');",
View Full Code Here

            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    //
    canvas.command_BOUNDS(button, new Point(10, 20), null);
    assertEditor(
        "public class Test extends Canvas {",
        "  public Test() {",
        "    {",
        "      Button button = new Button('My Button');",
View Full Code Here

            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    //
    canvas.command_BOUNDS(button, new Point(10, 20), null);
    assertEditor(
        "public class Test extends Canvas {",
        "  public Test() {",
        "    {",
        "      Button button = new Button('My Button');",
View Full Code Here

            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    //
    canvas.command_BOUNDS(button, new Point(10, 20), null);
    assertEditor(
        "public class Test extends Canvas {",
        "  public Test() {",
        "    {",
        "      Button button = new Button('My Button');",
View Full Code Here

            "  }",
            "}");
    canvas.refresh();
    CanvasInfo button = getJavaInfoByName("button");
    //
    canvas.command_BOUNDS(button, new Point(10, 20), null);
    assertEditor(
        "public class Test extends Canvas {",
        "  public Test() {",
        "    {",
        "      Button button = new Button('My Button');",
View Full Code Here

TOP

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

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.