Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Rectangle.shrink()


  public void paintFigure(Graphics g) {
    g.setAntialias(SWT.ON);
    g.setLineWidth(1);

    Rectangle r = getBounds();
    r.shrink(1, 1);
    try {
      g.setForegroundColor(getBorderColor());
      g.setBackgroundColor(getFillColor());
      g.fillOval(r);
      g.drawOval(r);
View Full Code Here


  public void paintFigure(Graphics g) {
    g.setAntialias(SWT.ON);
    g.setLineWidth(1);

    Rectangle r = getBounds();
    r.shrink(1, 1);
    try {
      g.setForegroundColor(getBorderColor());
      g.setBackgroundColor(getFillColor());
      g.fillOval(r);
      g.drawOval(r);
View Full Code Here

    g.setLineWidth(getLineWidth());

    Rectangle r = new Rectangle(getBounds());
    int zoom = this.configManager.getDiagramEditor().getPart().getZoomLevel();
    int scaledInset = -getLineOffset() * zoom / 100;
    r.shrink(scaledInset, scaledInset);
    r = FigureUtil.getAdjustedRectangle(r, 1.0, getLineWidth());

    prepareForDrawing(g, PositionConstants.NORTH);
    g.drawLine(r.getTopLeft(), r.getTopRight());
    prepareForDrawing(g, PositionConstants.SOUTH);
View Full Code Here

    Rectangle target = new Rectangle(source.x, source.y, source.width, source.height);
    target.scale(zoom);
    // shrink, but take care not to end up with a negative width or height
    int widthShrink = Math.min(target.width / 2, lw);
    int heightShrink = Math.min(target.height / 2, lw);
    target.shrink(widthShrink, heightShrink);
    return target;
  }

  // ============================== painting ================================
View Full Code Here

      return;
    }
   
    final Dimension cornerDimension = new Dimension(1, 1);
    Rectangle fillRectangle = new Rectangle(getBounds());
    fillRectangle = fillRectangle.shrink(cornerDimension.width, cornerDimension.height);
   
    final Color foregroundSave = graphics.getForegroundColor();
    final Color backgroundSave = graphics.getBackgroundColor();
   
    if (selected) {
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.