Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Rectangle


        }
  }

    @Override
    protected void addEllipse() {
        ellipse.setBounds(new Rectangle(3, 3, 16, 16));

        Ellipse inner = new Ellipse();
        inner.setBounds(new Rectangle(6, 6, 10, 10));
        inner.setBackgroundColor(ColorConstants.black);
        ellipse.add(inner);

        Ellipse outer = new Ellipse();
        outer.setSize(22, 22);
View Full Code Here


            pd.setDirty(true);
        }
    }

    public void setConstraint(Rectangle newConstraint) {
        Rectangle oldConstraint = this.constraint;
        this.constraint = newConstraint;
        firePropertyChange(NODE_BOUNDS_RESIZED, oldConstraint, newConstraint);
    }
View Full Code Here

public class CenteredFlowLayout extends FlowLayout {
 
    @Override
    protected void setBoundsOfChild(IFigure parent, IFigure child, Rectangle rect) {
        Rectangle copy = rect.getCopy();
        copy.y += (parent.getBounds().height - rect.height) / 2;
        super.setBoundsOfChild(parent, child, copy);
    }
View Full Code Here

        }
        return super.getReferencePoint();
    }

    private Point getPerpendicularPoint(Point reference) {
        Rectangle r = Rectangle.SINGLETON;
        r.setBounds(getOwner().getBounds());

        getOwner().translateToAbsolute(r);
        if (reference.x >= r.x && reference.x <= r.x + r.width) {
            int y;
            if (Math.abs(reference.y - r.y) < Math.abs(reference.y - (r.y + r.height))) {
View Full Code Here

        bpmn = owner.isBpmnNotation();
    }

    @Override
    public Point getReferencePoint() {
        Rectangle bounds = getOwner().getBounds().getCopy();
        getOwner().translateToAbsolute(bounds);
        //if (bpmn)
        //    return new Point(bounds.x + 3*GRID_SIZE/2, bounds.y + bounds.height - 3*GRID_SIZE/2);
        return new Point(bounds.x + GRID_SIZE, bounds.y + bounds.height - GRID_SIZE);
    }
View Full Code Here

        //    return new Point(bounds.x + 3*GRID_SIZE/2, bounds.y + bounds.height - 3*GRID_SIZE/2);
        return new Point(bounds.x + GRID_SIZE, bounds.y + bounds.height - GRID_SIZE);
    }
   
    public Point getLocation(Point reference) {
        Rectangle bounds = getOwner().getBounds().getCopy();
        getOwner().translateToAbsolute(bounds);

        Point center = getReferencePoint();
        Point ref = center.getCopy().negate().translate(reference);
        if (ref.x == 0)
            return new Point(reference.x, (ref.y > 0) ? bounds.bottom() : bounds.bottom() - 2 * GRID_SIZE);
        if (ref.y == 0)
            return new Point((ref.x > 0) ? bounds.x + 2 * GRID_SIZE : bounds.x, reference.y);

        float dx = (ref.x > 0) ? 0.5f : -0.5f;
        float dy = (ref.y > 0) ? 0.5f : -0.5f;
View Full Code Here

        g.translate(getBounds().getLocation());
    }
       
    @Override
    protected void paintUMLFigure(Graphics g, Rectangle r) {
        Rectangle rect = r.getResized(-1, -1);
        g.drawRoundRectangle(rect, 20, 10);
        g.translate(getBounds().getLocation());
    }
View Full Code Here

        }
    }

    @Override
    protected void addEllipse() {
        ellipse.setBounds(new Rectangle(3, 3, 16, 16));
        ellipse.setBackgroundColor(ColorConstants.black);
       
        Ellipse outer = new Ellipse();
        outer.setSize(22, 22);
        outer.setOutline(false);
View Full Code Here

        //paintSubprocessImage(g, getXShift(), GRID_SIZE / 2);
        if (getClass() == SubprocessFigure.class) {
            int d = 2;
            int xCenter = getXShift() + r.width/2;
            int y = r.height - GRID_SIZE;
            g.drawRectangle(new Rectangle(xCenter - GRID_SIZE/2, y, GRID_SIZE, GRID_SIZE));
            g.drawLine(xCenter - GRID_SIZE/2 + d, y + GRID_SIZE/2, xCenter + GRID_SIZE/2 - d, y + GRID_SIZE/2);
            g.drawLine(xCenter, y + d, xCenter, y + GRID_SIZE - d);
        }
    }
View Full Code Here

    protected int getXShift() {
        return bpmnNotation ? GRID_SIZE / 2 : 0;
    }
   
    private void paintSubprocessImage(Graphics g, int xShift, int yShift) {
        Rectangle r = getBounds();
        g.drawLine(r.width - 20 - xShift, r.height - 10 - yShift, r.width - 10 - xShift, r.height - 10 - yShift);
        g.drawLine(r.width - 20 - xShift, r.height - 10 - yShift, r.width - 20 - xShift, r.height - 5 - yShift);
        g.drawLine(r.width - 15 - xShift, r.height - 15 - yShift, r.width - 15 - xShift, r.height - 5 - yShift);
        g.drawLine(r.width - 10 - xShift, r.height - 10 - yShift, r.width - 10 - xShift, r.height - 5 - yShift);
    }
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.