Examples of translateToAbsolute()


Examples of org.eclipse.draw2d.IFigure.translateToAbsolute()

    // translate pos to absolute, and then make it relative to fig.
    int position = pos.intValue();
    PrecisionPoint loc = new PrecisionPoint(position, position);
    IFigure contentPane = ((GraphicalEditPart) getHost()).getContentPane();
    contentPane.translateToParent(loc);
    contentPane.translateToAbsolute(loc);

    if (location[offset] == null || !location[offset].equals(pos)) {
      location[offset] = pos;
      if (guide[offset] != null) {
        removeFeedback(guide[offset]);
View Full Code Here

Examples of org.eclipse.draw2d.IFigure.translateToAbsolute()

 
  private Rectangle getRectangle(EditPart editPart) {
    if (editPart instanceof GraphicalEditPart) {
      IFigure figure = ((GraphicalEditPart)editPart).getFigure();
      Rectangle r = figure.getBounds().getCopy();
      figure.translateToAbsolute(r);
      return r;
    }
    return null;
  }
 
View Full Code Here

Examples of org.eclipse.draw2d.IFigure.translateToAbsolute()

      @Override
      public Rectangle getBounds()
      {
        IFigure partFigure = this.editPart.getFigure();
          final org.eclipse.draw2d.geometry.Rectangle bounds = partFigure.getBounds().getCopy();
          partFigure.translateToAbsolute(bounds);
          Point viewerOrigin = this.diagramEditor.getGraphicalViewer().getControl().getLocation();
          viewerOrigin = this.diagramEditor.getGraphicalViewer().getControl().toDisplay(viewerOrigin);
          bounds.x += viewerOrigin.x;
          bounds.y += viewerOrigin.y;
          return new Rectangle( bounds.x, bounds.y, bounds.width, 20 );
View Full Code Here

Examples of org.eclipse.draw2d.IFigure.translateToAbsolute()

  }

  private Rectangle getBounds() {
    final IFigure figure = ((GraphicalEditPart) part).getFigure();
    final Rectangle bounds = figure.getBounds().getCopy();
    figure.translateToAbsolute(bounds);
    return bounds;
  }

  public SWTBotGefEditPart activateDirectEdit() {
    return activateDirectEdit(null);
View Full Code Here

Examples of org.eclipse.draw2d.IFigure.translateToAbsolute()

*/
protected Point getPasteLocation(GraphicalEditPart container) {
  Point result = new Point(10, 10);
  IFigure fig = container.getContentPane();
  result.translate(fig.getClientArea(Rectangle.SINGLETON).getLocation());
  fig.translateToAbsolute(result);
  return result;
}

}
View Full Code Here

Examples of org.eclipse.draw2d.IFigure.translateToAbsolute()

   * @return the absolute bounds
   */
  private Rectangle getAbsoluteBounds(final SWTBotGefEditPart editPart) {
    IFigure figure = ((GraphicalEditPart) editPart.part()).getFigure();
    Rectangle bounds = figure.getBounds().getCopy();
    figure.translateToAbsolute(bounds);
    return bounds;
  }

  /**
   * Drag and drop the edit part which owns the specified label to the specified location
View Full Code Here

Examples of org.eclipse.draw2d.Label.translateToAbsolute()

      pref = text.computeSize(-1, -1);
    }

    Label label = vertexFigure.getLabelId();
    Rectangle labelBounds = label.getBounds().getCopy();
    label.translateToAbsolute(labelBounds);

    Rectangle figureBounds = vertexFigure.getBounds().getCopy();
    vertexFigure.translateToAbsolute(figureBounds);
    int start = (figureBounds.width - pref.x) / 2;
View Full Code Here

Examples of org.eclipse.draw2d.Label.translateToAbsolute()

        Rectangle bounds = label.getBounds();
        int x = bounds.x + bounds.width + 5;
        int y = bounds.y + bounds.height / 2;

        Point ref = new Point(x, y);
        label.translateToAbsolute(ref);

        return ref;
      } else {
        label = figure.getInputPortLabel(portName);
        if (label == null) {
View Full Code Here

Examples of org.eclipse.draw2d.Label.translateToAbsolute()

        Rectangle bounds = label.getBounds();
        int x = bounds.x - 5;
        int y = bounds.y + bounds.height / 2;

        Point ref = new Point(x, y);
        label.translateToAbsolute(ref);

        return ref;
      }
    }
  }
View Full Code Here

Examples of org.eclipse.draw2d.Label.translateToAbsolute()

              Text text = (Text) celleditor.getControl();
              Point sel = text.getSelection();
              Point pref = text.computeSize(-1, -1);
              Label label = getDirectEditLabel();
              Rectangle rect = label.getTextBounds().getCopy();
              label.translateToAbsolute(rect);
              text.setBounds(rect.x - 4, rect.y - 1, pref.x + 1, pref.y + 1);
              text.setSelection(0);
              text.setSelection(sel);
            }
          });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.