Package org.eclipse.wb.draw2d.geometry

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


    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    Rectangle tabSetBounds = tabSet.getModelBounds();
    assertThat(selectedTab.getModelBounds()).isEqualTo(
        new Rectangle(insets.left,
            insets.right,
            tabSetBounds.width - insets.getWidth(),
            tabSetBounds.height - barThickness - insets.getHeight()));
  }
View Full Code Here


    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    Rectangle tabSetBounds = tabSet.getModelBounds();
    assertThat(selectedTab.getModelBounds()).isEqualTo(
        new Rectangle(insets.left, insets.right, tabSetBounds.width
            - barThickness
            - insets.getWidth(), tabSetBounds.height - insets.getHeight()));
  }
View Full Code Here

            "}"});
    canvas.refresh();
    //
    TabSetInfo tabSet = canvas.getChildren(TabSetInfo.class).get(0);
    // check bounds
    Rectangle tabSetBounds = tabSet.getModelBounds();
    Insets insets = tabSet.getTabInsets();
    int barThickness = tabSet.getTabBarThickness();
    TabInfo selectedTab = tabSet.getSelectedTab();
    assertThat(selectedTab.getModelBounds()).isEqualTo(
        new Rectangle(insets.left, barThickness + insets.right, tabSetBounds.width
            - insets.getWidth(),//Canvas_Test.BUTTON_WIDTH,
            tabSetBounds.height - barThickness - insets.getHeight()//Canvas_Test.BUTTON_HEIGHT
        ));
  }
View Full Code Here

            "  }",
            "}");
    panel.refresh();
    // initial size
    {
      Rectangle bounds = panel.getBounds();
      assertEquals(450, bounds.width);
      assertEquals(300, bounds.height);
    }
    // set bounds
    int newWidth = 500;
    int newHeight = 350;
    panel.getTopBoundsSupport().setSize(newWidth, newHeight);
    assertEditor(
        "// filler filler filler filler filler",
        "public class Test extends HorizontalPanel {",
        "  public Test() {",
        "  }",
        "}");
    // check that size applied
    panel.refresh();
    {
      Rectangle bounds = panel.getBounds();
      assertEquals(newWidth, bounds.width);
      assertEquals(newHeight, bounds.height);
    }
  }
View Full Code Here

            "  }",
            "}");
    panel.refresh();
    // initial size
    {
      Rectangle bounds = panel.getBounds();
      assertEquals(300, bounds.width);
      assertEquals(200, bounds.height);
    }
    // set bounds
    int newWidth = 500;
    int newHeight = 350;
    panel.getTopBoundsSupport().setSize(newWidth, newHeight);
    assertEditor(
        "// filler filler filler filler filler",
        "public class Test extends HorizontalPanel {",
        "  public Test() {",
        "    setSize('500px', '350px');",
        "  }",
        "}");
    // check that size applied
    panel.refresh();
    {
      Rectangle bounds = panel.getBounds();
      assertEquals(newWidth, bounds.width);
      assertEquals(newHeight, bounds.height);
    }
  }
View Full Code Here

            "  }",
            "}");
    panel.refresh();
    // initial size
    {
      Rectangle bounds = panel.getBounds();
      assertEquals(300, bounds.width);
      assertEquals(200, bounds.height);
    }
    // set bounds
    int newWidth = 500;
    int newHeight = 350;
    panel.getTopBoundsSupport().setSize(newWidth, newHeight);
    assertEditor(
        "// filler filler filler filler filler",
        "public class Test extends HorizontalPanel {",
        "  public Test() {",
        "    setWidth('500px');",
        "    setHeight('350px');",
        "  }",
        "}");
    // check that size applied
    panel.refresh();
    {
      Rectangle bounds = panel.getBounds();
      assertEquals(newWidth, bounds.width);
      assertEquals(newHeight, bounds.height);
    }
  }
View Full Code Here

      assertEquals(A_HEIGHT, intervals[1].length);
    }
    // getCellsRectangle()
    {
      {
        Rectangle cells = new Rectangle(0, 0, 1, 1);
        Rectangle expected = new Rectangle(1, 1, A_WIDTH, A_HEIGHT);
        assertEquals(expected, gridInfo.getCellsRectangle(cells));
      }
      {
        Rectangle cells = new Rectangle(0, 0, 2, 1);
        Rectangle expected = new Rectangle(1, 1, A_WIDTH + 2 * A_WIDTH, A_HEIGHT);
        assertEquals(expected, gridInfo.getCellsRectangle(cells));
      }
      {
        Rectangle cells = new Rectangle(0, 0, 1, 2);
        Rectangle expected = new Rectangle(1, 1, A_WIDTH, A_HEIGHT + A_HEIGHT);
        assertEquals(expected, gridInfo.getCellsRectangle(cells));
      }
    }
    // getComponentCells()
    {
      assertEquals(
          new Rectangle(0, 0, 1, 1),
          gridInfo.getComponentCells(panel.getChildrenWidgets().get(0)));
      assertEquals(
          new Rectangle(1, 0, 1, 1),
          gridInfo.getComponentCells(panel.getChildrenWidgets().get(1)));
      assertEquals(
          new Rectangle(0, 1, 1, 1),
          gridInfo.getComponentCells(panel.getChildrenWidgets().get(2)));
    }
    // getOccupied()
    {
      assertSame(panel.getChildrenWidgets().get(0), gridInfo.getOccupied(0, 0));
View Full Code Here

      assertEquals(0, getInt(tableData, "y"));
      assertEquals(1, getInt(tableData, "width"));
      assertEquals(1, getInt(tableData, "height"));
    }
    // set horizontal span
    layout.command_setCells(button, new Rectangle(0, 0, 2, 1), true);
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
        "  public Test() {",
        "    setLayout(new TableLayout(2));",
View Full Code Here

      // label
      AbstractComponentInfo label = children.get(0);
      assertThat(label).isInstanceOf(CanvasInfo.class);
      Integer x = Expectations.get(13, new IntValue[]{new IntValue("flanker-desktop", 12)});
      Integer y = Expectations.get(0, new IntValue[]{new IntValue("flanker-desktop", 1)});
      assertThat(label.getModelBounds()).isEqualTo(new Rectangle(x, y, 198, 100));
    }
    {
      // resizer
      AbstractComponentInfo resizer = children.get(1);
      assertThat(resizer).isInstanceOf(ToolStripResizerInfo.class);
      Integer y = Expectations.get(100, new IntValue[]{new IntValue("flanker-desktop", 101)});
      assertThat(resizer.getModelBounds()).isEqualTo(
          new Rectangle(0, y, toolStrip.getModelBounds().width, ToolStripResizerInfo.DEFAULT_SIZE));
    }
    {
      // text item
      AbstractComponentInfo text = children.get(2);
      assertThat(text).isInstanceOf(FormItemInfo.class);
      Integer width = Expectations.get(225, new IntValue[]{new IntValue("flanker-desktop", 221)});
      assertThat(text.getModelBounds()).isEqualTo(new Rectangle(-3, 111, width, 22));
    }
    {
      // button
      AbstractComponentInfo button = children.get(3);
      assertThat(button).isInstanceOf(CanvasInfo.class);
      Integer x = Expectations.get(77, new IntValue[]{new IntValue("flanker-desktop", 76)});
      Integer y = Expectations.get(136, new IntValue[]{new IntValue("flanker-desktop", 137)});
      Integer width = Expectations.get(71, new IntValue[]{new IntValue("flanker-desktop", 70)});
      assertThat(button.getModelBounds()).isEqualTo(
          new Rectangle(x, y, width, CanvasTest.BUTTON_HEIGHT));
    }
    {
      // fill
      AbstractComponentInfo fill = children.get(4);
      assertThat(fill).isInstanceOf(ToolStripCanvasInfo.class);
      Integer x = Expectations.get(14, new IntValue[]{new IntValue("flanker-desktop", 12)});
      assertThat(fill.getModelBounds()).isEqualTo(new Rectangle(x, 159, 198, 40));
    }
  }
View Full Code Here

    {
      // label
      AbstractComponentInfo label = children.get(0);
      assertThat(label).isInstanceOf(CanvasInfo.class);
      Integer expected = Expectations.get(0, new IntValue[]{new IntValue("flanker-desktop", 1)});
      assertThat(label.getModelBounds()).isEqualTo(new Rectangle(expected, expected, 100, 198));
    }
    {
      // resizer
      AbstractComponentInfo resizer = children.get(1);
      assertThat(resizer).isInstanceOf(ToolStripResizerInfo.class);
      Integer expected = Expectations.get(100, new IntValue[]{new IntValue("flanker-desktop", 101)});
      assertThat(resizer.getModelBounds()).isEqualTo(
          new Rectangle(expected,
              0,
              ToolStripResizerInfo.DEFAULT_SIZE,
              toolStrip.getModelBounds().height));
    }
    {
      // button
      AbstractComponentInfo button = children.get(2);
      assertThat(button).isInstanceOf(CanvasInfo.class);
      Integer x = Expectations.get(114, new IntValue[]{new IntValue("flanker-desktop", 115)});
      Integer y = Expectations.get(88, new IntValue[]{new IntValue("flanker-desktop", 89)});
      Integer width = Expectations.get(71, new IntValue[]{new IntValue("flanker-desktop", 70)});
      assertThat(button.getModelBounds()).isEqualTo(
          new Rectangle(x, y, width, CanvasTest.BUTTON_HEIGHT));
    }
    {
      // fill
      AbstractComponentInfo fill = children.get(3);
      assertThat(fill).isInstanceOf(ToolStripCanvasInfo.class);
      Integer x = Expectations.get(186, new IntValue[]{new IntValue("flanker-desktop", 185)});
      Integer width = Expectations.get(13, new IntValue[]{new IntValue("flanker-desktop", 14)});
      assertThat(fill.getModelBounds()).isEqualTo(new Rectangle(x, 1, width, 198));
    }
  }
View Full Code Here

TOP

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

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.