Examples of Line2D


Examples of java.awt.geom.Line2D

   * the point at (<code>x</code>, <code>y</code>)
   * with a given <code>margin</code> around the wall end line.
   */
  public boolean containsWallEndAt(float x, float y, float margin) {
    float [][] wallPoints = getPoints();
    Line2D endLine = new Line2D.Float(wallPoints [wallPoints.length / 2 - 1][0], wallPoints [wallPoints.length / 2 - 1][1],
        wallPoints [wallPoints.length / 2][0], wallPoints [wallPoints.length / 2][1]);
    return containsShapeAtWithMargin(endLine, x, y, margin);
  }
View Full Code Here

Examples of java.awt.geom.Line2D

   * contains the point at (<code>x</code>, <code>y</code>)
   * with a given <code>margin</code> around the extension line.
   */
  public boolean containsStartExtensionLinetAt(float x, float y, float margin) {
    double angle = Math.atan2(this.yEnd - this.yStart, this.xEnd - this.xStart);
    Line2D startExtensionLine = new Line2D.Float(this.xStart, this.yStart,
        this.xStart + (float)-Math.sin(angle) * this.offset,
        this.yStart + (float)Math.cos(angle) * this.offset);
    return containsShapeAtWithMargin(startExtensionLine, x, y, margin);
  }
View Full Code Here

Examples of java.awt.geom.Line2D

   * contains the point at (<code>x</code>, <code>y</code>)
   * with a given <code>margin</code> around the extension line.
   */
  public boolean containsEndExtensionLineAt(float x, float y, float margin) {
    double angle = Math.atan2(this.yEnd - this.yStart, this.xEnd - this.xStart);
    Line2D endExtensionLine = new Line2D.Float(this.xEnd, this.yEnd,
        this.xEnd + (float)-Math.sin(angle) * this.offset,
        this.yEnd + (float)Math.cos(angle) * this.offset);
    return containsShapeAtWithMargin(endExtensionLine, x, y, margin);
  }
View Full Code Here

Examples of java.awt.geom.Line2D

    /* (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

Examples of java.awt.geom.Line2D

    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

Examples of java.awt.geom.Line2D

    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

Examples of java.awt.geom.Line2D

        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

Examples of java.awt.geom.Line2D

        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

Examples of java.awt.geom.Line2D

        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

Examples of java.awt.geom.Line2D

        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
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.