Package com.jgraph.gaeawt.java.awt

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


    public Rectangle getBounds() {
        int x1 = (int)Math.floor(getMinX());
        int y1 = (int)Math.floor(getMinY());
        int x2 = (int)Math.ceil(getMaxX());
        int y2 = (int)Math.ceil(getMaxY());
        return new Rectangle(x1, y1, x2 - x1, y2 - y1);
    }
View Full Code Here


  private int slowFilter(Raster src, WritableRaster dst)
  {
    // TODO: make correct interpolation
    // TODO: what if there are different data types?

    Rectangle srcBounds = src.getBounds();
    Rectangle dstBounds = dst.getBounds();
    Rectangle normDstBounds = new Rectangle(0, 0, dstBounds.width,
        dstBounds.height);
    Rectangle bounds = getBounds2D(src).getBounds().intersection(
        normDstBounds);

    AffineTransform inv = null;
    try
    {
View Full Code Here

        int minX = (int)Math.floor(visualRect.getMinX() + x);
        int minY = (int)Math.floor(visualRect.getMinY() + y);
        int width = (int)Math.ceil(visualRect.getMaxX() + x) - minX;
        int height = (int)Math.ceil(visualRect.getMaxY() + y) - minY;

        return new Rectangle(minX, minY, width, height);
    }
View Full Code Here

        int minX = (int)Math.floor(visualRect.getMinX() + x);
        int minY = (int)Math.floor(visualRect.getMinY() + y);
        int width = (int)Math.ceil(visualRect.getMaxX() + x) - minX;
        int height = (int)Math.ceil(visualRect.getMaxY() + y) - minY;

        return new Rectangle(minX, minY, width, height);
    }
View Full Code Here

  }

  private void ring(Graphics g, FEPoint p, Coords c) {
    g.setColor(Color.red);
    if (cfg_shape == SQUARE) {
      Rectangle r = new Rectangle(p.getX() - CP_SIZE, p.getY() - CP_SIZE, CP_SIZE << 1, CP_SIZE << 1);
      drawRect(g, r, LINE_WIDTH, LINE_WIDTH, c);
    } else {
      drawCircle(g, p, (CP_SIZE * 6) >> 3, CP_SIZE, c);
    }
  }
View Full Code Here

            if (!src1.sorted || !src2.sorted ||
               src1.getRectCount() <= MAX_SIMPLE || src2.getRectCount() <= MAX_SIMPLE)
            {
                dst.setRect(simpleIntersect(src1, src2), false);
            } else {
                Rectangle bounds1 = src1.getBounds();
                Rectangle bounds2 = src2.getBounds();
                Rectangle bounds3 = bounds1.intersection(bounds2);
                if (bounds3.width > 0 && bounds3.height > 0) {
                    intersectRegions(src1.rect, src2.rect, dst, bounds1.height + 2, bounds2.height + 2);
                }
            }
View Full Code Here

            if (!src1.sorted || !src2.sorted ||
               src1.getRectCount() <= MAX_SIMPLE || src2.getRectCount() <= MAX_SIMPLE)
            {
                simpleUnion(src1, src2, dst);
            } else {
                Rectangle bounds1 = src1.getBounds();
                Rectangle bounds2 = src2.getBounds();
                Rectangle bounds3 = bounds1.intersection(bounds2);

                if (bounds3.width < 0 || bounds3.height < 0) {
                    if (bounds1.y + bounds1.height < bounds2.y) {
                        dst.setRect(addVerRegion(src1.rect, src2.rect), false);
                    } else
View Full Code Here

            if (!src1.sorted || !src2.sorted ||
               src1.getRectCount() <= MAX_SIMPLE || src2.getRectCount() <= MAX_SIMPLE)
            {
                simpleSubtract(src1, src2, dst);
            } else {
                Rectangle bounds1 = src1.getBounds();
                Rectangle bounds2 = src2.getBounds();
                Rectangle bounds3 = bounds1.intersection(bounds2);

                if (bounds3.width > 0 && bounds3.height > 0) {
                    subtractRegions(src1.rect, src2.rect, dst, bounds1.height + 2, bounds2.height + 2);
                } else {
                    dst.setRect(src1.rect, true);
View Full Code Here

        double minY = 0;
        double maxX = 0;
        double maxY = 0;

        for (int i = 0; i < this.getNumGlyphs(); i++) {
            Rectangle glyphBounds = this.getGlyphPixelBounds(i, frc, 0, 0);
            xm = glyphBounds.getMinX();
            ym = glyphBounds.getMinY();
            xM = glyphBounds.getMaxX();
            yM = glyphBounds.getMaxY();

            if (i == 0) {
                minX = xm;
                minY = ym;
                maxX = xM;
                maxY = yM;
            }

            if (minX > xm) {
                minX = xm;
            }
            if (minY > ym) {
                minY = ym;
            }
            if (maxX < xM) {
                maxX = xM;
            }
            if (maxY < yM) {
                maxY = yM;
            }
        }
        return new Rectangle((int)(minX + x), (int)(minY + y), (int)(maxX - minX), (int)(maxY - minY));

    }
View Full Code Here

        if (vector[glyphIndex].getWidth() == 0){
            AffineTransform fontTransform = this.transform;
            double xOffs = x + visualPositions[idx] + fontTransform.getTranslateX();
            double yOffs = y + visualPositions[idx+1] + fontTransform.getTranslateY();
            return new Rectangle((int)xOffs, (int)yOffs, 0, 0);
        }

        GeneralPath shape = (GeneralPath)this.getGlyphOutline(glyphIndex);

        AffineTransform at = AffineTransform.getTranslateInstance(x, y);

        if (frc != null){
            at.concatenate(frc.getTransform());
       
/*          if (frc.usesFractionalMetrics()){
                shape.transform(at);
                Rectangle2D bounds = shape.getBounds2D();
                Rectangle rect = new Rectangle();
                rect.setRect(bounds);
                return rect;
            }*/
        }
       
        shape.transform(at);

        Rectangle bounds = shape.getBounds();
        return new Rectangle((int)bounds.getX(), (int)bounds.getY(),
                            (int)bounds.getWidth()-1, (int)bounds.getHeight()-1);
        }
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.