Package org.eclipse.wb.draw2d.geometry

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


      @Override
      protected void executeEdit() throws Exception {
        placementsSupport.commitAdd();
        Rectangle widgetModelBounds = widget.getModelBounds();
        m_panel.command_CREATE2(widget, null);
        Point location = widgetModelBounds.getLocation();
        Dimension size = getSize(widgetModelBounds);
        m_panel.command_BOUNDS(widget, location, size);
      }

      private Dimension getSize(Rectangle widgetModelBounds) {
View Full Code Here


  @Override
  protected Point getLocationHintLocation(EditPart editPart,
      Rectangle widgetBounds,
      Dimension hintSize) {
    Point location = new Point();
    W widget = toWidget(editPart);
    if (m_panel.getLocationHint_isTrailing(widget, true)) {
      location.x = widgetBounds.right() - hintSize.width;
    } else {
      location.x = widgetBounds.left();
View Full Code Here

      protected void executeEdit() throws Exception {
        placementsSupport.commitAdd();
        Rectangle widgetModelBounds = component.getModelBounds();
        m_panel.command_CREATE2(component, null);
        {
          Point location = widgetModelBounds.getLocation();
          m_panel.command_LOCATION(component, location);
        }
        if (m_resizeOnCreate) {
          Dimension size = widgetModelBounds.getSize();
          m_panel.command_SIZE(component, size, ResizeDirection.TRAILING, ResizeDirection.TRAILING);
View Full Code Here

  protected void doPasteComponent(Point pasteLocation, PastedComponentInfo pastedWidget)
      throws Exception {
    W widget = toWidget(pastedWidget.getComponent());
    m_panel.command_CREATE2(widget, null);
    {
      Point widgetLocation_inPasteBounds = pastedWidget.getBounds().getLocation();
      Point widgetLocation = pasteLocation.getTranslated(widgetLocation_inPasteBounds);
      m_panel.command_LOCATION(widget, widgetLocation);
    }
    {
      Dimension size = pastedWidget.getBounds().getSize();
      m_panel.command_SIZE(widget, size, ResizeDirection.TRAILING, ResizeDirection.TRAILING);
View Full Code Here

    return new EditCommand(m_panel) {
      @Override
      protected void executeEdit() throws Exception {
        placementsSupport.commit();
        for (W widget : toWidgets(editParts)) {
          Point location = widget.getModelBounds().getLocation();
          m_panel.command_LOCATION(widget, location);
        }
      }
    };
  }
View Full Code Here

      return new Rectangle();
    }
    Dimension size = getUIObjectSize(element);
    // for BODY we assume (0,0) as top-left
    if (isBody(element)) {
      return new Rectangle(new Point(0, 0), size);
    }
    // for any inner element
    {
      Insets margins = getMargins(element);
      int x = m_domUtils.getIntAttribute(element, "offsetLeft") - margins.left;
View Full Code Here

      int y = 0;
      if (isStrictMode()) {
        size.width += margins.getWidth() + getBorders(element).getWidth();
        size.height += margins.getHeight() + getBorders(element).getHeight();
      }
      return new Rectangle(new Point(x, y), size);
    }
    // for any inner element
    {
      int x = m_domUtils.getAbsoluteLeft(element);
      int y = m_domUtils.getAbsoluteTop(element);
View Full Code Here

        }
      }
    });
    // add component on RootPanel
    panel.command_CREATE2(widget, null);
    panel.command_BOUNDS(widget, new Point(100, 100), null);
    // remove "live" mark from RootPanel,
    // because only one instance of RootPanel exists, so we update it also for "main" hierarchy
    panel.getPropertyByTitle("title").setValue(null);
    // check for forced size
    {
View Full Code Here

    {
      cellRect = component.getModelBounds().getCopy();
      PolicyUtils.translateModelToFeedback(m_policy, cellRect);
    }
    // prepare location and size
    Point figureLocation;
    {
      Dimension figureSize = figure.getSize();
      figureLocation = new Point(cellRect.right() - offset, cellRect.y - figureSize.height / 2);
      if (figureLocation.x < cellRect.x + MIN_LEFT_SPACE) {
        return;
      }
    }
    // add alignment figure
View Full Code Here

  @Override
  protected Point getTextWidgetLocation(Rectangle hostBounds, Dimension textSize) {
    int x = hostBounds.getCenter().x - textSize.width / 2;
    int y = hostBounds.getCenter().y - textSize.height / 2;
    return new Point(x, y);
  }
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.