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

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootLayoutPanelInfo


  //
  // Commands
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_MOVE_out() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      FlowPanel panel = new FlowPanel();",
            "      rootPanel.add(panel);",
            "      rootPanel.setWidgetLeftRight(panel, 10, Unit.PX, 10, Unit.PX);",
            "      rootPanel.setWidgetTopHeight(panel, 10, Unit.PX, 100, Unit.PX);",
            "    }",
            "    {",
            "      Button button_1 = new Button();",
            "      rootPanel.add(button_1);",
            "      rootPanel.setWidgetLeftWidth(button_1, 10, Unit.PX, 150, Unit.PX);",
            "      rootPanel.setWidgetTopHeight(button_1, 150, Unit.PX, 50, Unit.PX);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      rootPanel.add(button_2);",
            "      rootPanel.setWidgetLeftWidth(button_2, 200, Unit.PX, 150, Unit.PX);",
            "      rootPanel.setWidgetTopHeight(button_2, 150, Unit.PX, 50, Unit.PX);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    ComplexPanelInfo panel = getJavaInfoByName("panel");
    WidgetInfo button = getJavaInfoByName("button_1");
    //
    panel.command_MOVE2(button, null);
    assertEditor(
View Full Code Here


  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link LayoutPanelInfo#getLocationHint(WidgetInfo, int, int)}.
   */
  public void test_getLocationHint() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "    }",
            "    {",
            "      Button button_LW_TH = new Button();",
            "      rootPanel.add(button_LW_TH);",
            "      rootPanel.setWidgetLeftWidth(button_LW_TH, 1.0, Unit.MM, 1.0, Unit.CM);",
            "      rootPanel.setWidgetTopHeight(button_LW_TH, 2.0, Unit.PX, 1.0, Unit.CM);",
            "    }",
            "    {",
            "      Button button_LR_TB = new Button();",
            "      rootPanel.add(button_LR_TB);",
            "      rootPanel.setWidgetLeftRight(button_LR_TB, 1.0, Unit.MM, 1.0, Unit.CM);",
            "      rootPanel.setWidgetTopBottom(button_LR_TB, 2.0, Unit.CM, 1.0, Unit.CM);",
            "    }",
            "    {",
            "      Button button_RW_BH = new Button();",
            "      rootPanel.add(button_RW_BH);",
            "      rootPanel.setWidgetRightWidth(button_RW_BH, 10.0, Unit.PX, 100, Unit.PX);",
            "      rootPanel.setWidgetBottomHeight(button_RW_BH, 20.0, Unit.PX, 50, Unit.PX);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    {
      WidgetInfo button = getJavaInfoByName("button");
      assertEquals("100.0px x 50.0px", frame.getLocationHint(button, 100, 50));
      assertEquals(false, frame.getLocationHint_isTrailing(button, true));
      assertEquals(false, frame.getLocationHint_isTrailing(button, false));
    }
    {
      WidgetInfo button = getJavaInfoByName("button_LW_TH");
      assertEquals(MM_100 + "mm" + " x 50.0px", frame.getLocationHint(button, 100, 50));
      assertEquals(false, frame.getLocationHint_isTrailing(button, true));
      assertEquals(false, frame.getLocationHint_isTrailing(button, false));
    }
    {
      WidgetInfo button = getJavaInfoByName("button_LR_TB");
      assertEquals(MM_50 + "mm" + " x " + CM_100 + "cm", frame.getLocationHint(button, 50, 100));
      assertEquals(false, frame.getLocationHint_isTrailing(button, true));
      assertEquals(false, frame.getLocationHint_isTrailing(button, false));
    }
    {
      WidgetInfo button = getJavaInfoByName("button_RW_BH");
      assertEquals(
          "80.0px x 40.0px",
          frame.getLocationHint(button, 450 - (100 + 80), 300 - (50 + 40)));
      assertEquals(true, frame.getLocationHint_isTrailing(button, true));
      assertEquals(true, frame.getLocationHint_isTrailing(button, false));
    }
  }
View Full Code Here

  //
  // LOCATION
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_LOCATION_new() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo button = getJavaInfoByName("button");
    button.getBounds().setSize(150, 150);
    frame.command_LOCATION(button, new Point(10, 20));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_LOCATION_update_LeftTop_PX() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetLeftWidth(button, 1.0, Unit.PX, 1.0, Unit.CM);",
            "      rootPanel.setWidgetTopHeight(button, 2.0, Unit.PX, 1.0, Unit.CM);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo button = getJavaInfoByName("button");
    frame.command_LOCATION(button, new Point(10, 20));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_LOCATION_update_LeftTop_MM() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetLeftWidth(button, 1.0, Unit.MM, 1.0, Unit.CM);",
            "      rootPanel.setWidgetTopHeight(button, 2.0, Unit.MM, 1.0, Unit.CM);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo button = getJavaInfoByName("button");
    frame.command_LOCATION(button, new Point(100, 50));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_LOCATION_update_RightBottom_PX() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetRightWidth(button, 1.0, Unit.PX, 100, Unit.PX);",
            "      rootPanel.setWidgetBottomHeight(button, 2.0, Unit.PX, 50, Unit.PX);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo box = getJavaInfoByName("button");
    frame.command_LOCATION(box, new Point(200, 150));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_LOCATION_update_LeftRight_TopBottom_PX() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetLeftRight(button, 100.0, Unit.PX, 200, Unit.PX);",
            "      rootPanel.setWidgetTopBottom(button, 100.0, Unit.PX, 150, Unit.PX);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo box = getJavaInfoByName("button");
    frame.command_LOCATION(box, new Point(200, 150));
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    {",
View Full Code Here

  //
  // SIZE
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_SIZE_new() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo button = getJavaInfoByName("button");
    frame.command_SIZE(
        button,
        new Dimension(200, 50),
        ResizeDirection.TRAILING,
        ResizeDirection.TRAILING);
    assertEditor(
View Full Code Here

        "  }",
        "}");
  }

  public void test_SIZE_update_LeftWidth_TopHeight_TT_PX() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetLeftWidth(button, 0.0, Unit.PX, 100.0, Unit.PX);",
            "      rootPanel.setWidgetTopHeight(button, 0.0, Unit.PX, 50.0, Unit.PX);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo button = getJavaInfoByName("button");
    frame.command_SIZE(
        button,
        new Dimension(150, 75),
        ResizeDirection.TRAILING,
        ResizeDirection.TRAILING);
    assertEditor(
View Full Code Here

        "  }",
        "}");
  }

  public void test_SIZE_update_LeftWidth_TopHeight_TT_MM() throws Exception {
    RootLayoutPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "    {",
            "      Button button = new Button();",
            "      rootPanel.add(button);",
            "      rootPanel.setWidgetLeftWidth(button, 0.0, Unit.PX, 10.0, Unit.MM);",
            "      rootPanel.setWidgetTopHeight(button, 0.0, Unit.PX, 10.0, Unit.MM);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    //
    WidgetInfo button = getJavaInfoByName("button");
    frame.command_SIZE(
        button,
        new Dimension(100, 50),
        ResizeDirection.TRAILING,
        ResizeDirection.TRAILING);
    assertEditor(
View Full Code Here

TOP

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

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.