Package com.jgraph.gaeawt.java.awt

Examples of com.jgraph.gaeawt.java.awt.Rectangle


        if (bounds != null) {
            return bounds;
        }

        if (isEmpty()) {
            return bounds = new Rectangle();
        }

        int x1 = rect[1];
        int y1 = rect[2];
        int x2 = rect[3];
        int y2 = rect[4];
       
        for(int i = 5; i < rect[0]; i += 4) {
            int rx1 = rect[i + 0];
            int ry1 = rect[i + 1];
            int rx2 = rect[i + 2];
            int ry2 = rect[i + 3];
            if (rx1 < x1) {
                x1 = rx1;
            }
            if (rx2 > x2) {
                x2 = rx2;
            }
            if (ry1 < y1) {
                y1 = ry1;
            }
            if (ry2 > y2) {
                y2 = ry2;
            }
        }
       
        return bounds = new Rectangle(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
    }
View Full Code Here


        }

        rectangles = new Rectangle[(rect[0] - 1) / 4];
        int j = 0;
        for(int i = 1; i < rect[0]; i += 4) {
            rectangles[j++] = new Rectangle(
                    rect[i],
                    rect[i + 1],
                    rect[i + 2] - rect[i] + 1,
                    rect[i + 3] - rect[i + 1] + 1);
        }
View Full Code Here

    /**
     * Tests does rectangle intersect MultiRectArea object
     */
    public boolean intersects(double x, double y, double w, double h) {
        Rectangle r = new Rectangle();
        r.setRect(x, y, w, h);
        return intersects(r);
    }
View Full Code Here

    private Rectangle bounds = null;

    public BufferedImageGraphics2D(BufferedImage bi) {
        super();
        this.bi = bi;
        this.bounds = new Rectangle(0, 0, bi.getWidth(), bi.getHeight());
        clip(bounds);
        dstSurf = bi.getImageSurface();
        blitter = JavaBlitter.getInstance();
    }
View Full Code Here

  }

  @Override
  public void clipRect(int x, int y, int width, int height)
  {
    clip(new Rectangle(x, y, width, height));
  }
View Full Code Here

    {
      System.err
          .println("CommonGraphics2D.fillRect(" + x + ", " + y + ", " + width + ", " + height + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
    }

    fill(new Rectangle(x, y, width, height));
  }
View Full Code Here

    if (clip == null)
    {
      return null;
    }

    Rectangle res = (Rectangle) clip.getBounds().clone();
    res.translate(-Math.round((float) transform.getTranslateX()),
        -Math.round((float) transform.getTranslateY()));
    return res;
  }
View Full Code Here

  }

  @Override
  public void setClip(int x, int y, int width, int height)
  {
    setClip(new Rectangle(x, y, width, height));
  }
View Full Code Here

   * This method fills the given MultiRectArea with any paint.
   * @param mra MultiRectArea to fill
   */
  protected void fillMultiRectAreaPaint(MultiRectArea mra)
  {
    Rectangle rec = mra.getBounds();
    int x = rec.x;
    int y = rec.y;
    int w = rec.width;
    int h = rec.height;
    if (w <= 0 || h <= 0)
View Full Code Here

TOP

Related Classes of com.jgraph.gaeawt.java.awt.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.