Package java.awt.geom

Examples of java.awt.geom.Line2D$Double


    /* (non-Javadoc)
     * @see org.datanucleus.store.mapping.JavaTypeMapping#setObject(org.datanucleus.ObjectManager, java.lang.Object, int[], java.lang.Object)
     */
    public void setObject(ExecutionContext ec, Object preparedStatement, int[] exprIndex, Object value)
    {
      Line2D line = (Line2D)value;
        if (line == null)
        {
        for (int i = 0; i < exprIndex.length; i++)
        {
          getDatastoreMapping(i).setObject(preparedStatement, exprIndex[i], null);         
      }
        }
        else
        {
            getDatastoreMapping(0).setDouble(preparedStatement,exprIndex[0],line.getX1());
            getDatastoreMapping(1).setDouble(preparedStatement,exprIndex[1],line.getY1());
            getDatastoreMapping(2).setDouble(preparedStatement,exprIndex[2],line.getX2());
            getDatastoreMapping(3).setDouble(preparedStatement,exprIndex[3],line.getY2());
        }
    }
View Full Code Here


    rules[6] = AlphaComposite.SRC_OUT;
    rules[7] = AlphaComposite.DST_OUT;
   
    g2d.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC,alpha));
    g2d.setStroke(new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
    Line2D line = new Line2D.Double(x1, y1, x2, y2);
      g2d.draw(line);
  }
View Full Code Here

    rules[6] = AlphaComposite.SRC_OUT;
    rules[7] = AlphaComposite.DST_OUT;
   
    g2d.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC,alpha));
    g2d.setStroke(new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
    Line2D line = new Line2D.Double(x1+xObj, y1+yObj, x2+xObj, y2+yObj);
      g2d.draw(line);
  }
View Full Code Here

        CropBounds oldCrop, Rectangle2D underlay
    ) {
        if (underlayContains(oldCrop, underlay)) {
            return oldCrop;
        }
        Line2D top = getTopUnderlayLine(underlay);
        Line2D left = getLeftUnderlayLine(underlay);
        Line2D bottom = getBottomUnderlayLine(underlay);
        Line2D right = getRightUnderlayLine(underlay);

        Line2D north = getNorthCropLine(oldCrop);
        Line2D south = getSouthCropLine(oldCrop);
        Line2D east = getEastCropLine(oldCrop);
        Line2D west = getWestCropLine(oldCrop);

        Point2D nt = getIntersection(north, top);
        Point2D nl = getIntersection(north, left);
        Point2D nb = getIntersection(north, bottom);
        Point2D nr = getIntersection(north, right);
View Full Code Here

        CropBounds oldCrop, Rectangle2D underlay
    ) {
        if (underlayContains(oldCrop, underlay)) {
            return oldCrop;
        }
        Line2D south = getSouthCropLine(oldCrop);
        Point2D midSouth = new Point2D.Double(
            (south.getP1().getX() + south.getP2().getX()) / 2,
            (south.getP1().getY() + south.getP2().getY()) / 2
        );
        Line2D neLine = new Line2D.Double(midSouth, oldCrop.getUpperRight());
        Line2D nwLine = new Line2D.Double(midSouth, oldCrop.getUpperLeft());
        Line2D seLine = new Line2D.Double(midSouth, oldCrop.getLowerRight());
        Line2D swLine = new Line2D.Double(midSouth, oldCrop.getLowerLeft());

        LinkedList<Line2D> lines = new LinkedList<Line2D>();
        lines.add(neLine);
        lines.add(nwLine);
        double oldDiagonalScale = midSouth.distance(oldCrop.getUpperLeft());
View Full Code Here

        CropBounds oldCrop, Rectangle2D underlay
    ) {
        if (underlayContains(oldCrop, underlay)) {
            return oldCrop;
        }
        Line2D north = getNorthCropLine(oldCrop);
        Point2D midNorth = new Point2D.Double(
            (north.getP1().getX() + north.getP2().getX()) / 2,
            (north.getP1().getY() + north.getP2().getY()) / 2
        );
        Line2D neLine = new Line2D.Double(midNorth, oldCrop.getUpperRight());
        Line2D nwLine = new Line2D.Double(midNorth, oldCrop.getUpperLeft());
        Line2D seLine = new Line2D.Double(midNorth, oldCrop.getLowerRight());
        Line2D swLine = new Line2D.Double(midNorth, oldCrop.getLowerLeft());

        LinkedList<Line2D> lines = new LinkedList<Line2D>();
        lines.add(seLine);
        lines.add(swLine);
        double oldDiagonalScale = midNorth.distance(oldCrop.getLowerLeft());
View Full Code Here

        CropBounds oldCrop, Rectangle2D underlay
    ) {
        if (underlayContains(oldCrop, underlay)) {
            return oldCrop;
        }
        Line2D west = getWestCropLine(oldCrop);
        Point2D midWest = new Point2D.Double(
            (west.getP1().getX() + west.getP2().getX()) / 2,
            (west.getP1().getY() + west.getP2().getY()) / 2
        );
        Line2D neLine = new Line2D.Double(midWest, oldCrop.getUpperRight());
        Line2D nwLine = new Line2D.Double(midWest, oldCrop.getUpperLeft());
        Line2D seLine = new Line2D.Double(midWest, oldCrop.getLowerRight());
        Line2D swLine = new Line2D.Double(midWest, oldCrop.getLowerLeft());

        LinkedList<Line2D> lines = new LinkedList<Line2D>();
        lines.add(neLine);
        lines.add(seLine);
        double oldDiagonalScale = midWest.distance(oldCrop.getUpperRight());
View Full Code Here

        CropBounds oldCrop, Rectangle2D underlay
    ) {
        if (underlayContains(oldCrop, underlay)) {
            return oldCrop;
        }
        Line2D east = getEastCropLine(oldCrop);
        Point2D midEast = new Point2D.Double(
            (east.getP1().getX() + east.getP2().getX()) / 2,
            (east.getP1().getY() + east.getP2().getY()) / 2
        );
        Line2D neLine = new Line2D.Double(midEast, oldCrop.getUpperRight());
        Line2D nwLine = new Line2D.Double(midEast, oldCrop.getUpperLeft());
        Line2D seLine = new Line2D.Double(midEast, oldCrop.getLowerRight());
        Line2D swLine = new Line2D.Double(midEast, oldCrop.getLowerLeft());

        LinkedList<Line2D> lines = new LinkedList<Line2D>();
        lines.add(nwLine);
        lines.add(swLine);
        double oldDiagonalScale = midEast.distance(oldCrop.getUpperLeft());
View Full Code Here

        if (underlayContains(oldCrop, underlay)) {
            return oldCrop;
        }
        Point2D sw = oldCrop.getLowerLeft();
        Point2D ne = oldCrop.getUpperRight();
        Line2D diagonal = new Line2D.Double(sw, ne);

        double oldDiag = sw.distance(ne);
        double newDiag = getMinimumDistance(
            sw, Collections.singleton(diagonal), underlay
        );
        double diagScale = newDiag / oldDiag;

        Point2D se = oldCrop.getLowerRight();
        Line2D south = getSouthCropLine(oldCrop);

        double oldSouth = sw.distance(se);
        double newSouth = getMinimumDistance(
            sw, Collections.singleton(south), underlay
        );
        double southScale = newSouth / oldSouth;

        Point2D nw = oldCrop.getUpperLeft();
        Line2D west = getWestCropLine(oldCrop);

        double oldWest = sw.distance(nw);
        double newWest = getMinimumDistance(
            sw, Collections.singleton(west), underlay
        );
View Full Code Here

        if (underlayContains(oldCrop, underlay)) {
            return oldCrop;
        }
        Point2D se = oldCrop.getLowerRight();
        Point2D nw = oldCrop.getUpperLeft();
        Line2D diagonal = new Line2D.Double(se, nw);

        double oldDiag = se.distance(nw);
        double newDiag = getMinimumDistance(
            se, Collections.singleton(diagonal), underlay
        );
        double diagScale = newDiag / oldDiag;

        Point2D sw = oldCrop.getLowerLeft();
        Line2D south = getSouthCropLine(oldCrop);

        double oldSouth = sw.distance(se);
        double newSouth = getMinimumDistance(
            se, Collections.singleton(south), underlay
        );
        double southScale = newSouth / oldSouth;

        Point2D ne = oldCrop.getUpperRight();
        Line2D east = getEastCropLine(oldCrop);

        double oldEast = se.distance(ne);
        double newEast = getMinimumDistance(
            se, Collections.singleton(east), underlay
        );
View Full Code Here

TOP

Related Classes of java.awt.geom.Line2D$Double

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.