Examples of Double


Examples of java.awt.geom.Point2D.Double

  public void drawLifeLine(double vEnd) {
   
    SVGAttributeKeys.STROKE_COLOR.set(lifeline, SVGConstants.DEFAULT_LIFELINE_STROKE_COLOR);
    SVGAttributeKeys.STROKE_OPACITY.set(lifeline, SVGConstants.DEFAULT_LIFELINE_OPACITY);
    SVGAttributeKeys.STROKE_DASHES.set(lifeline, SVGConstants.DEFAULT_LIFELINE_DASHES);
    Double lifelineStartPosition = new Double();
    lifelineStartPosition.x = getLifelineHPos();
    lifelineStartPosition.y = instanceBox.getBounds().height;
    Double lifelineEndPosition = new Double();
    lifelineEndPosition.x = lifelineStartPosition.x;
    lifelineEndPosition.y = vEnd;
    BezierFigure pathFigure = new BezierFigure();
    pathFigure.addNode(new BezierPath.Node(lifelineStartPosition));
    pathFigure.addNode(new BezierPath.Node(lifelineEndPosition));
View Full Code Here

Examples of java.awt.geom.Point2D.Double

      double targetHPosition = (target != null) ? target
          .getLifelineHPos() : SVGConstants.DIAGRAM_ORIGIN_X;
      double length = targetHPosition - callerHPosition;

      SVGPathFigure interactionLine = new SVGPathFigure();
      Double interactionLineStartPosition = new Double();
      interactionLineStartPosition.x = 0;
      interactionLineStartPosition.y = 0;

      BezierFigure linePath = new BezierFigure();
      linePath.addNode(new BezierPath.Node(interactionLineStartPosition));

      boolean selfCall = caller == target;

      if (selfCall) {
        Double selfCallIntermidiateTopPosition = new Double();
        length = heightIncrement;
        selfCallIntermidiateTopPosition.x = interactionLineStartPosition.x
            + length;
        selfCallIntermidiateTopPosition.y = interactionLineStartPosition.y;
        linePath.addNode(new BezierPath.Node(
            selfCallIntermidiateTopPosition));
        Double selfCallIntermidiateBottomPosition = new Double();
        height = heightIncrement;
        selfCallIntermidiateBottomPosition.x = interactionLineStartPosition.x
            + length;
        selfCallIntermidiateBottomPosition.y = interactionLineStartPosition.y
            + height;
        linePath.addNode(new BezierPath.Node(
            selfCallIntermidiateBottomPosition));
        length = 0;
      }

      Double interacitonlineEndPosition = new Double();
      interacitonlineEndPosition.x = interactionLineStartPosition.x
          + length;
      interacitonlineEndPosition.y = interactionLineStartPosition.y
          + height;
View Full Code Here

Examples of java.awt.geom.Point2D.Double

    if (offset != null){  // correct offset it required
      output = new PointImpl(output.getX()-offset.getX(),output.getY()-offset.getY());
    }
    if (proj != null){
      // magic
      Double projout = new Double();
      proj.inverseTransform(new Double(output.getX(),output.getY()), projout);
      output = new PointImpl(projout.x,projout.y);
    }
    return output;
  }
View Full Code Here

Examples of java.awt.geom.Point2D.Double

 
  public Point transform(Point input){
    PointImpl output = new PointImpl(input.getX(),input.getY());
    if (proj != null){
      // magic
      Double projout = new Double();
      proj.transform(new Double(output.getX(),output.getY()), projout);
      output = new PointImpl(projout.x,projout.y);
    }
    if (offset != null){  // correct offset it required
      output = new PointImpl(output.getX()+offset.getX(),output.getY()+offset.getY());
    }
View Full Code Here

Examples of java.awt.geom.Point2D.Double

 
  public Point transform(double lon, double lat){
    PointImpl output = new PointImpl(lon, lat);
    if (proj != null){
      // magic
      Double projout = new Double();
      proj.transform(new Double(lon,lat), projout);
      output = new PointImpl(projout.x,projout.y);
    }
    if (offset != null){  // correct offset it required
      output = new PointImpl(output.getX()+offset.getX(),output.getY()+offset.getY());
    }
View Full Code Here

Examples of java.awt.geom.Point2D.Double

        RasterInfo pyramid = new RasterInfo(1L, 1013, 1021);

        final CoordinateReferenceSystem crs = DefaultEngineeringCRS.CARTESIAN_2D;

        final Point imageOffset = new Point(0, 0);
        final Point2D extentOffset = new Double(0, 0);

        pyramid.addPyramidLevel(0, new ReferencedEnvelope(0, 2026, 0, 2042, crs), imageOffset,
                extentOffset, 17, 17, new Dimension(1013, 1021));
        pyramid.addPyramidLevel(1, new ReferencedEnvelope(0, 2026.0000000000002, 0, 2042, crs),
                imageOffset, extentOffset, 9, 9, new Dimension(507, 511));
View Full Code Here

Examples of java.awt.geom.Rectangle2D.Double

  InteractionDiagramModel<SVGInteraction, SVGInstance> interactionDiagramModel;

  private void updateExtents() {
    for (Figure f : getFigures()) {
      if (!f.equals(background)) {
        Double figureBounds = f.getBounds();
        Double newExtents = new Double();
        Double currentExtents = background.getBounds();
        // TODO: cleanup re-extenting
        newExtents.width = (((currentExtents.x - newExtents.x) + currentExtents.width) < ((figureBounds.x - newExtents.x)
            + figureBounds.width + (2 * SVGConstants.DEFAULT_DRAWING_MARGINE))) ? ((figureBounds.x - newExtents.x)
            + figureBounds.width + (2 * SVGConstants.DEFAULT_DRAWING_MARGINE))
            : ((currentExtents.x - newExtents.x) + currentExtents.width);
View Full Code Here

Examples of java.lang.Double

        String answer;
      if ("1+2".equals(question)) {
        answer = "3";
      } else {
            Random r = new Random(new Date().getTime());
            Double d = new Double((r.nextDouble() * 20) - 1);
            answer = new String(answers[d.intValue()]);
      }
    System.out.println("EightBall answer: " + answer);
    return answer;
    }
View Full Code Here

Examples of java.lang.Double

    static final boolean USE_POLAR_RANDOM = true;
    static final Hashtable NEXT_GAUSSIANS = new Hashtable();

    static double polar_random( uniform PRNG )
    {
        Double d = (Double) NEXT_GAUSSIANS.remove(PRNG);
        if (d != null) return d.doubleValue();

        double v1, v2, s;
        do {
            v1 = 2 * PRNG.random() - 1; // between -1 and 1
            v2 = 2 * PRNG.random() - 1; // between -1 and 1
            s = v1 * v1 + v2 * v2;
        } while (s >= 1 || s == 0);
        double multiplier = Math.sqrt(-2 * Math.log(s)/s);
        Double nextNextGaussian = new Double(v2 * multiplier);
        NEXT_GAUSSIANS.put(PRNG, nextNextGaussian);
        return v1 * multiplier;
    }
View Full Code Here

Examples of java.lang.Double

  }


  private void reset()
  {
    Double rate = (Double)rates_.get(c2_);
    Date date = new Date();
   
    rate_ = rate.doubleValue();
    dealData_.setSpotRate(rateValidator_.formatRate(rate_));
    rateValidator_.set(rate_);
    dateValidator_.reset();
    dealData_.setValueDate(date);
    dealData_.setTradingDate(date);
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.