Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Rectangle


        Object newObject = request.getNewObject();
        if (newObject instanceof Node) {
            NodeCreateCommand createCommand = new NodeCreateCommand();
            createCommand.setNode((Node) newObject);
            createCommand.setParent((ProcessDefinition) getHost().getModel());
            Rectangle newRect = getClosestRectangle((Rectangle) getConstraintFor(request));
            createCommand.setConstraint(newRect);
            return createCommand;
        }
        return null;
    }
View Full Code Here


        if (rect.width - wCount * GEFConstants.GRID_SIZE > GEFConstants.GRID_SIZE / 2)
            wCount++;
        int hCount = rect.height / GEFConstants.GRID_SIZE;
        if (rect.height - hCount * GEFConstants.GRID_SIZE > GEFConstants.GRID_SIZE / 2)
            hCount++;
        return new Rectangle(xCount * GEFConstants.GRID_SIZE, yCount * GEFConstants.GRID_SIZE, wCount * GEFConstants.GRID_SIZE, hCount
                * GEFConstants.GRID_SIZE);
    }
View Full Code Here

        super.paint(graphics);
    }
   
    @Override
    protected final void paintFigure(Graphics graphics) {
        Rectangle r = getClientArea().getCopy();
        if (bpmnNotation) {
            graphics.setLineWidth(2);
            Color foregroundColor = graphics.getForegroundColor();
            Color backgroundColor = graphics.getBackgroundColor();
            graphics.setBackgroundColor(veryLightBlue);
View Full Code Here

      return ref;
  }

  @Override
    public Point getLocation(Point reference) {
        Rectangle r = getBox().getCopy();

        getOwner().translateToAbsolute(r);
        float centerX = r.x + 0.5f * r.width;
        float centerY = r.y + 0.5f * r.height;

        if (r.isEmpty() || (reference.x == (int) centerX && reference.y == (int) centerY))
            return new Point((int) centerX, (int) centerY); // This avoids divide-by-zero

        float dx = reference.x - centerX;
        float dy = reference.y - centerY;

View Full Code Here

        return DIM_RECTANGLE.getExpanded(GRID_SIZE, GRID_SIZE);
    }

    @Override
    protected void paintUMLFigure(Graphics g, Rectangle r) {
        Rectangle borderRect = r.getResized(-1, -1);
        if (!minimizedView) {
            g.drawRoundRectangle(borderRect, 20, 10);
            g.translate(getBounds().getLocation());
            paintTimer(g, 0);
        } else {
View Full Code Here

    protected void paintBPMNFigure(Graphics g, Rectangle r) {
        if (!minimizedView) {
            super.paintBPMNFigure(g, r);
            paintTimer(g, GRID_SIZE / 2);
        } else {
            Rectangle borderRect = r.getResized(11, 11).translate(-5, -5);
            g.drawRectangle(borderRect);
        }
    }
View Full Code Here

        }
    }

    private void paintTimer(Graphics g, int shift) {
        if (timerExist) {
            Rectangle r = getBounds();
            g.fillOval(shift, r.height - GRID_SIZE * 2 - shift, GRID_SIZE * 2, GRID_SIZE * 2);
            g.drawOval(shift + 1, 1 + r.height - GRID_SIZE * 2 - shift, GRID_SIZE * 2 - 2, GRID_SIZE * 2 - 2);
            g.drawLine(shift + GRID_SIZE, r.height - GRID_SIZE - shift, shift + GRID_SIZE, r.height - GRID_SIZE + 5 - shift);
            g.drawLine(shift + GRID_SIZE, r.height - GRID_SIZE - shift, shift + GRID_SIZE + 5, r.height - GRID_SIZE - 5 - shift);
        }
View Full Code Here

        }
    }

    private Rectangle getFrameArea(Rectangle origin) {
        if (minimizedView) {
            return new Rectangle(origin.x + GRID_SIZE/2, origin.y + GRID_SIZE/2, origin.width - GRID_SIZE, origin.height - GRID_SIZE);
        } else {
            return new Rectangle(origin.x + GRID_SIZE, origin.y, origin.width - GRID_SIZE, origin.height - GRID_SIZE);
        }
    }
View Full Code Here

        }
    }

    @Override
    public Rectangle getClientArea(Rectangle rect) {
        Rectangle r = super.getClientArea(rect);
        return getFrameArea(r);
    }
View Full Code Here

        return getFrameArea(r);
    }

    @Override
    protected Rectangle getBox() {
        Rectangle r = getBounds().getCopy();
        return getFrameArea(r);
    }
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.