Package org.eclipse.wb.draw2d.geometry

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


  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected void refresh_fetch() throws Exception {
    super.refresh_fetch();
    {
      Rectangle panelBounds = getAbsoluteBounds(getObject());
      Object body = ReflectionUtils.invokeMethod(getObject(), "getBody()");
      Rectangle bodyBounds = getAbsoluteBounds(body);
      setClientAreaInsets(new Insets(bodyBounds.y - panelBounds.y,
          bodyBounds.x - panelBounds.x,
          panelBounds.bottom() - bodyBounds.bottom(),
          panelBounds.right() - bodyBounds.right()));
    }
  }
View Full Code Here


    Object box = ReflectionUtils.invokeMethod(boxObject, "getBox()");
    int x = (Integer) ReflectionUtils.invokeMethod(box, "getX()");
    int y = (Integer) ReflectionUtils.invokeMethod(box, "getY()");
    int width = (Integer) ReflectionUtils.invokeMethod(box, "getWidth()");
    int height = (Integer) ReflectionUtils.invokeMethod(box, "getHeight()");
    return new Rectangle(x, y, width, height);
  }
View Full Code Here

              "grid.getView().getHeaderCell(index)",
              "grid",
              getObject(),
              "index",
              i);
      Rectangle bounds = getState().getAbsoluteBounds(columnElement);
      absoluteToRelative(bounds);
      column.setBounds(bounds);
    }
  }
View Full Code Here

    }
    super.refresh_fetch();
    {
      Object element = getElement();
      Image browserScreenshot = getState().createBrowserScreenshot();
      Rectangle absoluteBounds = getState().getAbsoluteBounds(element);
      Image objectImage =
          UiUtils.getCroppedImage(browserScreenshot, absoluteBounds.getSwtRectangle());
      setImage(objectImage);
    }
    if (!isSubMenu()) {
      JavaInfoUtils.executeScript(this, "object.hide();");
    }
View Full Code Here

    public Rectangle getBounds() {
      // prepare information about parent
      ComponentInfo parentControl = (ComponentInfo) getParent();
      Insets parentInsets = parentControl.getClientAreaInsets();
      Rectangle parentArea = parentControl.getBounds().getCropped(parentInsets);
      // prepare size of "popup"
      int width;
      int height;
      {
        Image image = getImage();
        width = image.getBounds().width;
        height = image.getBounds().height;
      }
      // prepare bounds for "popup"
      int x = parentInsets.left + 3;
      int y = parentArea.height - parentInsets.bottom - 3 - height;
      return new Rectangle(x, y, width, height);
    }
View Full Code Here

  @Override
  protected void fetchClientAreaInsets() throws Exception {
    if (!isPlaceholder() && isRendered()) {
      Object panelEl = JavaInfoUtils.executeScript(this, "object.el()");
      Object bodyEl = JavaInfoUtils.executeScript(this, "object.getBody()");
      Rectangle panelBounds = GxtUtils.getAbsoluteBounds(panelEl);
      Rectangle bodyBounds = GxtUtils.getAbsoluteBounds(bodyEl);
      Insets insets =
          new Insets(bodyBounds.y - panelBounds.y,
              bodyBounds.x - panelBounds.x,
              panelBounds.bottom() - bodyBounds.bottom(),
              panelBounds.right() - bodyBounds.right());
      insets.add(m_margins);
      insets.add(GxtUtils.getBorders(bodyEl));
      setClientAreaInsets(insets);
    }
  }
View Full Code Here

   * @return the bounds of "ButtonBar" relative to panel, may be empty, but not <code>null</code>.
   */
  public Rectangle getButtonBarBounds() {
    Object buttonBar = ReflectionUtils.invokeMethodEx(getObject(), "getButtonBar()");
    Object buttonBarElement = getUIObjectUtils().getElement(buttonBar);
    Rectangle bounds = getState().getAbsoluteBounds(buttonBarElement);
    bounds.translate(getModelBounds().getLocation().getNegated());
    return bounds;
  }
View Full Code Here

      Object widgetElement = widget.getElement();
      Object td = dom.getParent(widgetElement);
      // prepare row interval
      if (rowIntervals[row] == null) {
        Object trElement = dom.getParent(td);
        Rectangle trBounds = state.getAbsoluteBounds(trElement);
        container.absoluteToRelative(trBounds);
        Interval trInterval = new Interval(trBounds.y, trBounds.height);
        if (rowSpan == 1) {
          rowIntervals[row] = trInterval;
        } else {
          Rectangle tdBounds = state.getAbsoluteBounds(td);
          Interval spannedInterval = new Interval(trBounds.y, tdBounds.height);
          spannedRowIntervals.put(new Interval(row, rowSpan), spannedInterval);
        }
      }
      // prepare column interval
      if (columnIntervals[column] == null) {
        Rectangle tdBounds = state.getAbsoluteBounds(td);
        container.absoluteToRelative(tdBounds);
        Interval columnInterval = new Interval(tdBounds.x, tdBounds.width);
        if (colSpan == 1) {
          columnIntervals[column] = columnInterval;
        } else {
View Full Code Here

      ComponentInfo prevItem = GenericsUtils.getPrevOrNull(items, index);
      ComponentInfo nextItem = GenericsUtils.getNextOrNull(items, index);
      // prepare bounds
      int x = prevItem != null ? prevItem.getBounds().right() : 0;
      int right = nextItem != null ? nextItem.getBounds().left() : bar.getBounds().width;
      setBounds(new Rectangle(x, 0, right - x, bar.getBounds().height));
    }
  }
View Full Code Here

  private Figure m_resizeFeedback;
  private TextFeedback m_textFeedback;

  //
  private Command getResizeCommand(ChangeBoundsRequest request) {
    final Rectangle newBounds = request.getTransformedRectangle(getHostFigure().getBounds());
    return new EditCommand(m_column) {
      @Override
      protected void executeEdit() throws Exception {
        int newWidth = Math.max(newBounds.width, 0);
        m_column.setWidth(newWidth);
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.