Examples of Float


Examples of com.google.gwt.dom.client.Style.Float

      @Override
      public void onChange(ChangeEvent event) {
        int selectedIndex = listBox.getSelectedIndex();
     
        if (selectedWidget != null) {
          Float floatStyle = null;
          String selectedStyle = listBox.getItemText(selectedIndex);
          if (selectedStyle.equals("LEFT")) {
            floatStyle = Float.LEFT;
          }
         
View Full Code Here

Examples of java.awt.geom.Point2D.Float

            ((Graphics2D) g).translate(tw/2, th/2);
        }

        PathIterator pi = trajectory.getPathIterator(null);
        float[] coords = new float[6];
        Float cp = new Point2D.Float();
        Point2D.Float sp = new Point2D.Float();
        int ret;
        float totalDist = 0;
        List<float[]> segStack = new ArrayList<float[]>();
        do {
            try {
                ret = pi.currentSegment(coords);
            } catch (NoSuchElementException e) {
                // invalid object definition - one of the bounds is zero or less
                return;
            }
            if (ret == PathIterator.SEG_LINETO || (ret == PathIterator.SEG_CLOSE && (sp.x != cp.x || sp.y != cp.y))) {
                //close by line
                float c = calcLine(coords, cp);
                totalDist += c;
                // move the point to the end (just so it is same for all of them
                segStack.add(new float[] { c, 0, 0, 0, 0, coords[0], coords[1], ret });
                cp.x = coords[0];
                cp.y = coords[1];
            }
            if (ret == PathIterator.SEG_MOVETO) {
                sp.x = cp.x = coords[0];
                sp.y = cp.y = coords[1];

            }
            if (ret == PathIterator.SEG_CUBICTO) {
                float c = calcCube(coords, cp);
                totalDist += c;
                segStack.add(new float[] { c, coords[0], coords[1], coords[2],
                        coords[3], coords[4], coords[5], ret });
                cp.x = coords[4];
                cp.y = coords[5];
            }
            if (ret == PathIterator.SEG_QUADTO) {
                float c = calcLengthOfQuad(coords, cp);
                totalDist += c;
                segStack.add(new float[] { c, coords[0], coords[1], 0 ,0 , coords[2],
                        coords[3], ret });
                cp.x = coords[2];
                cp.y = coords[3];
            }
            // got a starting point, center point on it.
            pi.next();
        } while (!pi.isDone());
        float nxtP = totalDist / getPoints();
        List<Point2D.Float> pList = new ArrayList<Point2D.Float>();
        pList.add(new Float(sp.x, sp.y));
        int sgIdx = 0;
        float[] sgmt = segStack.get(sgIdx);
        float len = sgmt[0];
        float travDist = nxtP;
        Float center = new Float(sp.x, sp.y);
        for (int i = 1; i < getPoints(); i++) {
            while (len < nxtP) {
                sgIdx++;
                // Be carefull when messing around with points.
                sp.x = sgmt[5];
                sp.y = sgmt[6];
                sgmt = segStack.get(sgIdx);
                travDist = nxtP - len;
                len += sgmt[0];
            }
            len -= nxtP;
            Float p = calcPoint(travDist, sp, sgmt, width, height);
            pList.add(p);
            center.x += p.x;
            center.y += p.y;
            travDist += nxtP;
        }
View Full Code Here

Examples of java.awt.geom.Point2D.Float

    }

    private Point2D.Float calcPoint(float dist2go, Point2D.Float startPoint,
            float[] sgmt, int w, int h) {
        Float f = new Point2D.Float();
        if (sgmt[7] == PathIterator.SEG_LINETO) {
            // linear
            float a = sgmt[5] - startPoint.x;
            float b = sgmt[6] - startPoint.y;
            float pathLen = sgmt[0];
            f.x = startPoint.x + a * dist2go / pathLen;
            f.y = startPoint.y + b * dist2go / pathLen;
        } else if (sgmt[7] == PathIterator.SEG_QUADTO) {
            // quadratic curve
            Float ctrl = new Point2D.Float(sgmt[1]/w, sgmt[2]/h);
            Float end = new Point2D.Float(sgmt[5]/w, sgmt[6]/h);
            Float start = new Float(startPoint.x/w, startPoint.y/h);

            // trans coords from abs to rel
            f = getXY(dist2go / sgmt[0], start, ctrl, end);
            f.x *= w;
            f.y *= h;
View Full Code Here

Examples of java.awt.geom.Point2D.Float

     * @param coords Segment coordinates
     * @param cp Start point.
     * @return Length of the segment.
     */
    private float calcLengthOfQuad(float[] coords, Point2D.Float cp) {
        Float ctrl = new Point2D.Float(coords[0], coords[1]);
        Float end = new Point2D.Float(coords[2], coords[3]);
        // get abs values
        // ctrl1
        float c1ax = Math.abs(cp.x - ctrl.x) ;
        float c1ay = Math.abs(cp.y - ctrl.y) ;
        // end1
        float e1ax = Math.abs(cp.x - end.x) ;
        float e1ay = Math.abs(cp.y - end.y) ;
        // get max value on each axis
        float maxX = Math.max(c1ax, e1ax);
        float maxY = Math.max(c1ay, e1ay);

        // trans coords from abs to rel
        // ctrl1
        ctrl.x = c1ax / maxX;
        ctrl.y = c1ay / maxY;
        // end1
        end.x = e1ax / maxX;
        end.y = e1ay / maxY;

        // claculate length
        float prevLength = 0, prevX = 0, prevY = 0;
        for (float t = 0.01f; t <= 1.0f; t += .01f) {
            Point2D.Float xy = getXY(t, new Float(0,0), ctrl, end);
            prevLength += (float) Math.sqrt((xy.x - prevX) * (xy.x - prevX)
                    + (xy.y - prevY) * (xy.y - prevY));
            prevX = xy.x;
            prevY = xy.y;
        }
View Full Code Here

Examples of java.awt.geom.Point2D.Float

    /**
     * {@inheritDoc}
     */
    @Override
    Float getCharMetrics(char ch){
        return new Float(getCodePointAdvance(ch), 0);
    }
View Full Code Here

Examples of java.awt.geom.Rectangle2D.Float

  /**
   * Transform to the position of the stamp annotation
   * @return
   */
  private AffineTransform getPositionTransformation() {
    Float rect2 = getRect();
    double[] f = new double[] {1,
        0,
        0,
        1,
        rect2.getMinX(),
        rect2.getMinY()};
    return new AffineTransform(f);
  }
View Full Code Here

Examples of java.awt.geom.Rectangle2D.Float

          result.add(PDFPage.createImageCmd(img));
        } else if (type.equals("Form")) {
         
            // rats.  parse it.
            PDFObject bobj = obj.getDictRef("BBox");
            Float bbox = new Rectangle2D.Float(bobj.getAt(0).getFloatValue(),
                    bobj.getAt(1).getFloatValue(),
                    bobj.getAt(2).getFloatValue(),
                    bobj.getAt(3).getFloatValue());
            PDFPage formCmds = new PDFPage(bbox, 0);
            // stamp annotation transformation
View Full Code Here

Examples of java.awt.geom.Rectangle2D.Float

  /**
   * Transform to the position of the stamp annotation
   * @return
   */
  private AffineTransform getPositionTransformation() {
    Float rect2 = getRect();
    double[] f = new double[] {1,
        0,
        0,
        1,
        rect2.getMinX(),
        rect2.getMinY()};
    return new AffineTransform(f);
  }
View Full Code Here

Examples of java.awt.geom.Rectangle2D.Float

/*     */   {
/* 335 */     if ((index == 0) || (index == 1) || (index == 3) || (index == 5) || (index == 6) || (index == 8) || (index == 10) || (index == 11))
/*     */     {
/* 337 */       return null;
/* 338 */     }if (index == 2)
/* 339 */       return new Float(-3.402824E+038F);
/* 340 */     if (index == 7)
/* 341 */       return new Float(0.0F);
/* 342 */     if (index == 4)
/* 343 */       return new Float(1.0F);
/* 344 */     if ((index == 12) || (index == 9))
/* 345 */       return new Integer(0);
/* 346 */     if (index == 13) {
/* 347 */       return new Integer(1);
/*     */     }
View Full Code Here

Examples of java.awt.geom.Rectangle2D.Float

/*     */   {
/* 363 */     if ((index == 0) || (index == 1) || (index == 3) || (index == 5) || (index == 6) || (index == 8) || (index == 10) || (index == 11))
/*     */     {
/* 365 */       return null;
/* 366 */     }if ((index == 2) || (index == 4) || (index == 7))
/* 367 */       return new Float(3.4028235E+38F);
/* 368 */     if (index == 9)
/* 369 */       return new Integer(270);
/* 370 */     if (index == 12)
/* 371 */       return new Integer(100);
/* 372 */     if (index == 13) {
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.