Examples of Line2D


Examples of ae.java.awt.geom.Line2D

                                float x1,
                                float x2,
                                float y) {

            Stroke ulStroke = getStroke(thickness);
            Line2D line = new Line2D.Float(x1, y + shift, x2, y + shift);
            return ulStroke.createStrokedShape(line);
        }
View Full Code Here

Examples of com.google.code.appengine.awt.geom.Line2D

        }
        if (absExtent <= 180.0 && !containsAngle) {
            return false;
        }

        Line2D l = new Line2D.Double(getStartPoint(), getEndPoint());
        int ccw1 = l.relativeCCW(px, py);
        int ccw2 = l.relativeCCW(getCenterX(), getCenterY());
        return ccw1 == 0 || ccw2 == 0
                || ((ccw1 + ccw2) == 0 ^ absExtent > 180.0);
    }
View Full Code Here

Examples of com.szuppe.jakub.common.Line2D

      // TOP CHECK
      final Coordinates2D paddleLeftTopCo = verticesList.get(1).moveAlongVector(
          new Coordinates2D(0, radius));
      final Coordinates2D paddleRightTopCo = verticesList.get(2).moveAlongVector(
          new Coordinates2D(0, radius));
      Line2D paddleTop = new Line2D(paddleLeftTopCo, paddleRightTopCo);
      Coordinates2D pointOfIntersection = paddleTop
          .intersectionPoint(ballMovementRay);
      double distance = Math.sqrt(Math.pow(
          pointOfIntersection.getX() - ball.getX(), 2)
          + Math.pow(pointOfIntersection.getY() - ball.getY(), 2));
      long timeTillCollision = (long) (distance / ballSpeed.getSpeedValue());
View Full Code Here

Examples of java.awt.geom.Line2D

    private void draw(Shape s) {
        followPath(s, STROKE);
    }
   
    protected void drawLine(int x1, int y1, int x2, int y2) {
        Line2D line = new Line2D.Double((double)x1, (double)y1, (double)x2, (double)y2);
        draw(line);
    }
View Full Code Here

Examples of java.awt.geom.Line2D

   *
   * @return The object.
   */
  public Object createObject()
  {
    final Line2D line = new Line2D.Float();

    final float x1 = getFloatParameter("x1");
    final float x2 = getFloatParameter("x2");
    final float y1 = getFloatParameter("y1");
    final float y2 = getFloatParameter("y2");
    line.setLine(x1, y1, x2, y2);
    return line;
  }
View Full Code Here

Examples of java.awt.geom.Line2D

  {
    if (!(o instanceof Line2D))
    {
      throw new ObjectFactoryException("The given object is no java.awt.geom.Line2D.");
    }
    final Line2D line = (Line2D) o;
    final float x1 = (float) line.getX1();
    final float x2 = (float) line.getX2();
    final float y1 = (float) line.getY1();
    final float y2 = (float) line.getY2();

    setParameter("x1", new Float(x1));
    setParameter("x2", new Float(x2));
    setParameter("y1", new Float(y1));
    setParameter("y2", new Float(y2));
View Full Code Here

Examples of java.awt.geom.Line2D

    final boolean draw = styleSheet.getBooleanStyleProperty(ElementStyleKeys.DRAW_SHAPE);
    if (draw && rawObject instanceof Line2D)
    {
      final int lineType;
      final long coordinate;
      final Line2D line = (Line2D) rawObject;

      final boolean vertical = line.getX1() == line.getX2();
      final boolean horizontal = line.getY1() == line.getY2();
      if (vertical && horizontal)
      {
        return null;
      }
      if (vertical)
      {
        lineType = SheetLayoutTableCellDefinition.LINE_HINT_VERTICAL;
        coordinate = StrictGeomUtility.toInternalValue(line.getX1()) + box.getX();
      }
      else if (horizontal)
      {
        lineType = SheetLayoutTableCellDefinition.LINE_HINT_HORIZONTAL;
        coordinate = StrictGeomUtility.toInternalValue(line.getY1()) + box.getY() + shift;
      }
      else
      {
        return null;
      }
View Full Code Here

Examples of java.awt.geom.Line2D

      if (rawObject instanceof Line2D)
      {
        if (hasBorderEdge(styleSheet))
        {
          final Line2D line = (Line2D) rawObject;
          if (line.getY1() == line.getY2())
          {
            return false;
          }
          else if (line.getX1() == line.getX2())
          {
            return false;
          }
        }
      }
View Full Code Here

Examples of java.awt.geom.Line2D

      graphics.draw(imageableArea);

      final int pcH = pageDefinition.getPageCountHorizontal();
      final int pcW = pageDefinition.getPageCountVertical();

      final Line2D line = new Line2D.Double();
      for (int splitH = 1; splitH < pcH; splitH += 1)
      {
        final double xPos = gpf.getImageableX() + (splitH * gpf.getImageableWidth());
        line.setLine(xPos, gpf.getImageableY(),
            xPos, gpf.getImageableY() + gpf.getImageableHeight());
        graphics.draw(line);
      }

      for (int splitW = 1; splitW < pcW; splitW += 1)
      {
        final double yPos = gpf.getImageableY() + (splitW * gpf.getImageableHeight());
        line.setLine(gpf.getImageableX(), yPos,
            gpf.getImageableX() + gpf.getImageableWidth(), yPos);
        graphics.draw(line);
      }
    }
View Full Code Here

Examples of java.awt.geom.Line2D

      final int UnderlineThickness = 50;
      //
      final double d = PdfGraphics2D.asPoints((double) UnderlineThickness, (int) fontSize);
      setStroke(new BasicStroke((float) d));
      y = (float) ((double) (y) + PdfGraphics2D.asPoints((double) (UnderlineThickness), (int) fontSize));
      final Line2D line = new Line2D.Double((double) x, (double) y, (width + x), (double) y);
      draw(line);
    }
  }
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.