Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Rectangle


    /**
     * @generated
     */
    public void relocate(CellEditor celleditor) {
      Text text = (Text) celleditor.getControl();
      Rectangle rect = getWrapLabel().getTextBounds().getCopy();
      getWrapLabel().translateToAbsolute(rect);
      if (getWrapLabel().isTextWrapOn()
          && getWrapLabel().getText().length() > 0) {
        rect.setSize(new Dimension(text.computeSize(rect.width,
            SWT.DEFAULT)));
      } else {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
            SWT.DEFAULT)).expand(avr * 2, 0));
      }
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
    }
View Full Code Here


    /**
     * @generated
     */
    public void relocate(CellEditor celleditor) {
      Text text = (Text) celleditor.getControl();
      Rectangle rect = getLabel().getTextBounds().getCopy();
      getLabel().translateToAbsolute(rect);
      int avr = FigureUtilities.getFontMetrics(text.getFont())
          .getAverageCharWidth();
      rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
          SWT.DEFAULT)).expand(avr * 2, 0));
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
    }
View Full Code Here

  * @generated NOT
  */ 
  public void paintFigure(Graphics graphics) {
    graphics.pushState();
    graphics.setBackgroundColor(new Color(null,0,0,0)); // RGB code of object color.
    Rectangle rect = getBounds().getCopy();
    graphics.fillOval(rect);
    graphics.popState();
  }
View Full Code Here

  /**
   * @generated
   */
  protected Rectangle getFeedbackBounds() {
    Rectangle bounds;
    if (getHostFigure() instanceof Label) {
      bounds = ((Label) getHostFigure()).getTextBounds();
      bounds.intersect(getHostFigure().getBounds());
    } else {
      bounds = getHostFigure().getBounds().getCopy();
    }
    getHostFigure().getParent().translateToAbsolute(bounds);
    getFeedbackLayer().translateToRelative(bounds);
View Full Code Here

  /**
   * @generated
   */
  protected Rectangle getFeedbackBounds() {
    Rectangle bounds;
    if (getHostFigure() instanceof Label) {
      bounds = ((Label) getHostFigure()).getTextBounds();
      bounds.intersect(getHostFigure().getBounds());
    } else {
      bounds = getHostFigure().getBounds().getCopy();
    }
    getHostFigure().getParent().translateToAbsolute(bounds);
    getFeedbackLayer().translateToRelative(bounds);
View Full Code Here

    /**
     * @generated
     */
    public void relocate(CellEditor celleditor) {
      Text text = (Text) celleditor.getControl();
      Rectangle rect = getWrapLabel().getTextBounds().getCopy();
      getWrapLabel().translateToAbsolute(rect);
      if (getWrapLabel().isTextWrapOn()
          && getWrapLabel().getText().length() > 0) {
        rect.setSize(new Dimension(text.computeSize(rect.width,
            SWT.DEFAULT)));
      } else {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
            SWT.DEFAULT)).expand(avr * 2, 0));
      }
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
    }
View Full Code Here

    /**
     * @generated
     */
    public void relocate(CellEditor celleditor) {
      Text text = (Text) celleditor.getControl();
      Rectangle rect = getLabel().getTextBounds().getCopy();
      getLabel().translateToAbsolute(rect);
      int avr = FigureUtilities.getFontMetrics(text.getFont())
          .getAverageCharWidth();
      rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
          SWT.DEFAULT)).expand(avr * 2, 0));
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
     */
    protected void refreshVisuals() {
        Rectangle bounds = new Rectangle( getCastedModel().getLocation(),
                                          getCastedModel().getSize() );
        ((GraphicalEditPart) getParent()).setLayoutConstraint( this,
                                                               getFigure(),
                                                               bounds );
    }
View Full Code Here

        layout.visit(graph);
        for (Map.Entry<Long, Node> entry: mapping.entrySet()) {
            Node node = entry.getValue();
            DefaultElementWrapper elementWrapper = (DefaultElementWrapper)
                ((ProcessWrapper) ((GenericModelEditor) editor).getModel()).getElement(entry.getKey() + "");
            elementWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
        }
        // TODO: implement changes as a command, so we can support undo
        editor.doSave(null);
    }
View Full Code Here

    }

    protected Object createModel() {
        RuleFlowProcessWrapper result = new RuleFlowProcessWrapper();
        StartNodeWrapper start = new StartNodeWrapper();
        start.setConstraint(new Rectangle(100, 100, -1, -1));
        result.addElement(start);
        start.setParent(result);
        IFile file = ((IFileEditorInput)getEditorInput()).getFile();
        String name = file.getName();
        result.setName(name.substring(0, name.length() - 3));
View Full Code Here

TOP

Related Classes of org.eclipse.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.