Examples of intersection()


Examples of java.awt.Rectangle.intersection()

            } else {
                clipR   = clip.getBounds();

                if (clipR.intersects(crR) == false)
                    return; // Nothing to draw...
                clipR = clipR.intersection(crR);
            }

            Rectangle gcR = getDestinationBounds(g2d);
            // System.out.println("ClipRects: " + clipR + " -> " + gcR);
            if (gcR != null) {
View Full Code Here

Examples of java.awt.Rectangle.intersection()

        devShapeBounds = at.createTransformedShape(shape).getBounds();
        devClipBounds  = at.createTransformedShape(clip).getBounds();
        if (!devClipBounds.intersects(devShapeBounds)) {
            return true;
        }
        devBounds = devShapeBounds.intersection(devClipBounds);
        int devX = devBounds.x;
        int devY = devBounds.y;
        int devW = devBounds.width;
        int devH = devBounds.height;
View Full Code Here

Examples of java.awt.Rectangle.intersection()

    public Raster getData(Rectangle rect) {
        Rectangle r = (Rectangle)rect.clone();

        if (!r.intersects(getBounds()))
            return null;
        r = r.intersection(getBounds());
        r.translate(-getMinX(), - getMinY());

        Raster ret = bi.getData(r);
        return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                                         ret.getMinY()+getMinY());
View Full Code Here

Examples of java.awt.Rectangle.intersection()

    final int spaceOnX = Math.max(s.width - f.width, 0);
    final int spaceOnY = Math.max(s.height - f.height, 0);
    final int x = (int) (horizontalPercent * spaceOnX) + s.x;
    final int y = (int) (verticalPercent * spaceOnY) + s.y;
    frame.setBounds(x, y, f.width, f.height);
    frame.setBounds(s.intersection(frame.getBounds()));
  }

  /**
   * Positions the specified frame at a random location on the screen while ensuring that the entire frame is visible
   * (provided that the frame is smaller than the screen).
View Full Code Here

Examples of java.awt.Rectangle.intersection()

    final int spaceOnX = Math.max(s.width - f.width, 0);
    final int spaceOnY = Math.max(s.height - f.height, 0);
    final int x = (int) (horizontalPercent * spaceOnX) + s.x;
    final int y = (int) (verticalPercent * spaceOnY) + s.y;
    frame.setBounds(x, y, f.width, f.height);
    frame.setBounds(s.intersection(frame.getBounds()));
  }

  /**
   * Positions the specified frame at a random location on the screen while ensuring that the entire frame is visible
   * (provided that the frame is smaller than the screen).
View Full Code Here

Examples of kiss.lang.Type.intersection()

    this.body=body;
  }
 
  public static Cast create(Type type, Expression body) {
    Type bt=body.getType();
    if (bt.intersection(type)==Nothing.INSTANCE) {
      throw new KissException("Can't cast type "+bt+" to "+type);
    }
    return new Cast(type,body.specialise(type));
  }
 
View Full Code Here

Examples of kodkod.ast.Expression.intersection()

                      return IntConstant.constant(min);
                obj=visitThis(a);
                if (obj instanceof IntExpression) { i=(IntExpression)obj; return i.minus(cint(b));}
                s=(Expression)obj; return s.difference(cset(b));
            case INTERSECT:
                s=cset(a); return s.intersection(cset(b));
            case ANY_ARROW_SOME: case ANY_ARROW_ONE: case ANY_ARROW_LONE:
            case SOME_ARROW_ANY: case SOME_ARROW_SOME: case SOME_ARROW_ONE: case SOME_ARROW_LONE:
            case ONE_ARROW_ANY: case ONE_ARROW_SOME: case ONE_ARROW_ONE: case ONE_ARROW_LONE:
            case LONE_ARROW_ANY: case LONE_ARROW_SOME: case LONE_ARROW_ONE: case LONE_ARROW_LONE:
            case ISSEQ_ARROW_LONE:
View Full Code Here

Examples of kodkod.ast.Variable.intersection()

        while(n>0) {
           n--;
           Variable v = Variable.unary("");
           kodkod.ast.Decl dd = v.oneOf(a);
           if (d==null) d=dd; else d=dd.and(d);
           if (sum==null) sum=v; else { if (f!=null) f=v.intersection(sum).no().and(f); sum=v.union(sum); }
        }
        if (f!=null) return sum.eq(a).and(f).forSome(d); else return a.no().or(sum.eq(a).forSome(d));
    }

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

Examples of org.apache.cocoon.util.ByteRange.intersection()

        if (byteRange != null) {
            String entityLength;
            String entityRange;
            if (contentLength != -1) {
                entityLength = "" + contentLength;
                entityRange = byteRange.intersection(new ByteRange(0, contentLength)).toString();
            } else {
                entityLength = "*";
                entityRange = byteRange.toString();
            }

View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.threed.Line.intersection()

    }

    @Test
    public void testIntersection() throws MathIllegalArgumentException {
        Line l = new Line(new Vector3D(0, 1, 1), new Vector3D(0, 2, 2), 1.0e-10);
        Assert.assertNull(l.intersection(new Line(new Vector3D(1, 0, 1), new Vector3D(1, 0, 2), 1.0e-10)));
        Assert.assertNull(l.intersection(new Line(new Vector3D(-0.5, 0, 0), new Vector3D(-0.5, -1, -1), 1.0e-10)));
        Assert.assertEquals(0.0,
                            l.intersection(l).distance(new Vector3D(0, 0, 0)),
                            1.0e-10);
        Assert.assertEquals(0.0,
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.