Package org.eclipse.wb.draw2d.geometry

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


  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected void fetchClientAreaInsets() throws Exception {
    Object panelEl = JavaInfoUtils.executeScript(this, "object.el()");
    Object bodyEl = ReflectionUtils.getFieldObject(getObject(), "body");
    Rectangle panelBounds = GxtUtils.getAbsoluteBounds(panelEl);
    Rectangle bodyBounds = GxtUtils.getAbsoluteBounds(bodyEl);
    {
      int top = bodyBounds.y - panelBounds.y;
      int left = bodyBounds.x - panelBounds.x;
      int bottom = panelBounds.bottom() - bodyBounds.bottom();
      int right = panelBounds.right() - bodyBounds.right();
      /*if (bottom < 0) {
        bottom *= -1;
      }*/
      setClientAreaInsets(new Insets(top, left, bottom, right));
    }
View Full Code Here


  @Override
  protected void refresh_fetch() throws Exception {
    super.refresh_fetch();
    ObjectInfo parent = getParent();
    if (parent instanceof CycleButtonInfo) {
      Rectangle parentBounds = ((CycleButtonInfo) parent).getModelBounds();
      setModelBounds(new Rectangle(0, parentBounds.height, parentBounds.width, 0));
    }
  }
View Full Code Here

      Assert.equals(1, displayElements.length, "Exactly one \"display\" element expected, but "
          + displayElements.length
          + " found.");
      IConfigurationElement displayElement = displayElements[0];
      m_displayBounds =
          new Rectangle(ExternalFactoriesHelper.getRequiredAttributeInteger(displayElement, "x"),
              ExternalFactoriesHelper.getRequiredAttributeInteger(displayElement, "y"),
              ExternalFactoriesHelper.getRequiredAttributeInteger(displayElement, "width"),
              ExternalFactoriesHelper.getRequiredAttributeInteger(displayElement, "height"));
    }
  }
View Full Code Here

  //
  // Command
  //
  ////////////////////////////////////////////////////////////////////////////
  public Command getCommand(CategoryInfo targetCategory) {
    Rectangle displayBounds =
        new Rectangle(Integer.parseInt(m_displayField_x.getText()),
            Integer.parseInt(m_displayField_y.getText()),
            Integer.parseInt(m_displayField_width.getText()),
            Integer.parseInt(m_displayField_height.getText()));
    return new DeviceAddCommand(targetCategory,
        "device_" + System.currentTimeMillis(),
View Full Code Here

  //
  // Command
  //
  ////////////////////////////////////////////////////////////////////////////
  public Command getCommand() {
    Rectangle displayBounds =
        new Rectangle(Integer.parseInt(m_displayField_x.getText()),
            Integer.parseInt(m_displayField_y.getText()),
            Integer.parseInt(m_displayField_width.getText()),
            Integer.parseInt(m_displayField_height.getText()));
    return new DeviceEditCommand(m_device.getId(),
        m_nameField.getText(),
View Full Code Here

          m_deviceFigure.setLocation(DEVICE_LOCATION);
          m_deviceFigure.setSize(image.getBounds().width, image.getBounds().height);
        }
        // update EditPart figure
        {
          Rectangle bounds = device.getDisplayBounds().getCopy();
          bounds.translate(DEVICE_LOCATION);
          m_editPart.getFigure().setBounds(bounds);
        }
      } else {
        Rectangle bounds = m_object.getBounds();
        bounds =
            new Rectangle(AbstractComponentEditPart.TOP_LOCATION.x,
                AbstractComponentEditPart.TOP_LOCATION.y,
                bounds.width,
                bounds.height);
        m_editPart.getFigure().setBounds(bounds);
      }
View Full Code Here

            "}");
    frame.refresh();
    assertNoErrors(frame);
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // Unit property
    {
      GenericProperty unitProperty = (GenericProperty) panel.getPropertyByTitle("Unit");
      assertNotNull(unitProperty);
      {
View Full Code Here

            "  }",
            "}");
    panel.refresh();
    assertNoErrors(panel);
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // Unit property
    {
      GenericProperty unitProperty = (GenericProperty) panel.getPropertyByTitle("Unit");
      assertNotNull(unitProperty);
      {
View Full Code Here

    List<WidgetHandle> handles = panel.getWidgetHandles();
    assertThat(handles).hasSize(2);
    {
      WidgetHandle handle = handles.get(0);
      assertSame(button_1, handle.getWidget());
      Rectangle bounds = handle.getBounds();
      assertThat(bounds.x).isEqualTo(0);
      assertThat(bounds.y).isEqualTo(0);
      assertThat(bounds.width).isGreaterThan(390);
      assertThat(bounds.height).isGreaterThan(15);
    }
    {
      WidgetHandle handle = handles.get(1);
      assertSame(button_2, handle.getWidget());
      Rectangle bounds = handle.getBounds();
      assertThat(bounds.x).isEqualTo(0);
      assertThat(bounds.y).isGreaterThan(250);
      assertThat(bounds.width).isGreaterThan(390);
      assertThat(bounds.height).isGreaterThan(15);
    }
View Full Code Here

    //
    List<WidgetHandle> handles = panel.getWidgetHandles();
    assertThat(handles).hasSize(1);
    {
      WidgetHandle handle = handles.get(0);
      Rectangle bounds = handle.getBounds();
      assertThat(bounds.x).isEqualTo(0);
      assertThat(bounds.y).isEqualTo(0);
      assertThat(bounds.width).isEqualTo(250);
      assertThat(bounds.height).isGreaterThan(30);
    }
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.