Package org.eclipse.draw2d

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


     */
    protected Rectangle getCurrentTargetBounds(IFigure relocateFigure)
    {
        IFigure reference = getReferenceFigure();
        Rectangle targetBounds = new PrecisionRectangle(getReferenceBox().getResized(-1, -1));
        reference.translateToAbsolute(targetBounds);
        relocateFigure.translateToRelative(targetBounds);
        return targetBounds;
    }
   
    /**
 
View Full Code Here


          }

          ret = new Rectangle(bounds.x + CARET_OFFSET, bounds.y,
              CaretUpdater.CARET_WIDTH, bounds.height);

          figure.translateToAbsolute(ret);
        } else if (offset >= 0
            && offset <= containerEditPart.getChildren().size()) {
          ret = getRefRect(position);
        }
      }
View Full Code Here

            CaretUpdater.CARET_WIDTH, bounds.height);// new
      } else {
        rect = new Rectangle(bounds.getRight().x + CARET_OFFSET,
            bounds.y, CaretUpdater.CARET_WIDTH, bounds.height);// new
      }
      figure.translateToAbsolute(rect);
    } else {
      System.out.println("No concrete part?"); //$NON-NLS-1$
    }
    return rect;
  }
View Full Code Here

      fig.setLineWidth(1);
      fig.setForegroundColor(HOVER_FEEDBACK_COLOR);
      addFeedback(fig);

      Rectangle r = rects[i].getCopy();
      figure.translateToAbsolute(r);
      fig.translateToRelative(r);
      fig.setBounds(r);

      figures[i] = fig;
    }
View Full Code Here

          0, adapter.getColumnResizeWidth(), bounds.height
              - insets.getHeight());
    }
    rect.translate(bounds.x + insets.left, bounds.y + insets.top);

    figure.translateToAbsolute(rect);
    getMarqueeRectangleFigure().translateToRelative(rect);
    return rect;
  }

  /**
 
View Full Code Here

       
        addFeedback(_mouseOverBorder);
       
        IFigure hostFigure = getHostFigure();
        Rectangle r = hostFigure.getBounds().getCopy().expand(1, 1);
        hostFigure.translateToAbsolute(r);
        _mouseOverBorder.translateToRelative(r);

        _mouseOverBorder.setBounds(r);
    }
   
View Full Code Here

  public Rectangle getAbsoluteBounds(FlowBox box) {
    if (box != null) {
      IFigure figure = ((GraphicalEditPart) _part).getFigure();
      Rectangle rect = new Rectangle(box.getX(), box.getY(), box.getWidth(), box
          .getHeight());
      figure.translateToAbsolute(rect);
      return rect;
    }
    return null;
  }
View Full Code Here

  public void relocate(IFigure target) {

    IFigure reference = getReferenceFigure();
    Rectangle targetBounds = new PrecisionRectangle(getReferenceBox()
        .getResized(-1, -1));
    reference.translateToAbsolute(targetBounds);
    target.translateToRelative(targetBounds);
    targetBounds.resize(1, 1);

    Dimension targetSize = target.getPreferredSize();
View Full Code Here

    // 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

 
  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

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.