Examples of QuadCurve2D


Examples of java.awt.geom.QuadCurve2D

    return ret;
  }
 
  @Override
  public void paint(Graphics g, HandleGesture gesture) {
    QuadCurve2D curve = getCurve(gesture);
    if (setForFill(g)) {
      ((Graphics2D) g).fill(curve);
    }
    if (setForStroke(g)) {
      ((Graphics2D) g).draw(curve);
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

    /* (non-Javadoc)
     * @see org.jpox.store.mapping.JavaTypeMapping#setObject(org.jpox.ObjectManager, java.lang.Object, int[], java.lang.Object)
     */
    public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)
    {
      QuadCurve2D line = (QuadCurve2D)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.getCtrlX());
            getDataStoreMapping(3).setDouble(preparedStatement,exprIndex[3],line.getCtrlY());
            getDataStoreMapping(4).setDouble(preparedStatement,exprIndex[4],line.getX2());
            getDataStoreMapping(5).setDouble(preparedStatement,exprIndex[5],line.getY2());
        }
    }
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

    /* (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)
    {
      QuadCurve2D line = (QuadCurve2D)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.getCtrlX());
            getDatastoreMapping(3).setDouble(preparedStatement,exprIndex[3],line.getCtrlY());
            getDatastoreMapping(4).setDouble(preparedStatement,exprIndex[4],line.getX2());
            getDatastoreMapping(5).setDouble(preparedStatement,exprIndex[5],line.getY2());
        }
    }
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

  /**
   * Checks whether the zero-argument constructor works as specified.
   */
  public void testZeroArgs()
  {
    QuadCurve2D curve;

    h.checkPoint("noArgs");
    curve = new QuadCurve2D.Double();
    h.check(curve.getX1(), 0);     // 1
    h.check(curve.getY1(), 0);     // 2
    h.check(curve.getCtrlX(), 0)// 3
    h.check(curve.getCtrlY(), 0)// 4
    h.check(curve.getX2(), 0);     // 5
    h.check(curve.getY2(), 0);     // 6
  }
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

  }


  private void test_array(TestHarness harness)
  {
    QuadCurve2D curve;

    harness.checkPoint("array");

    curve = new QuadCurve2D.Double();
    curve.setCurve(new double[] { 1, 2, 3, 11, 12, 13, 14, 15, 16, 17 },
                   /* offset */ 3);
    harness.check(curve.getX1(), 11);    // Check 1
    harness.check(curve.getY1(), 12);    // Check 2
    harness.check(curve.getCtrlX(), 13); // Check 3
    harness.check(curve.getCtrlY(), 14); // Check 4
    harness.check(curve.getX2(), 15);    // Check 5
    harness.check(curve.getY2(), 16);    // Check 6
  }
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

  }


  private void test_threePoints(TestHarness harness)
  {
    QuadCurve2D curve;

    harness.checkPoint("threePoints");

    curve = new QuadCurve2D.Double();
    curve.setCurve(new Point2D.Float(1,2),
                   new Point2D.Double(3,4),
                   new Point(5, 6));

    harness.check(curve.getX1(), 1);    // Check 1
    harness.check(curve.getY1(), 2);    // Check 2
    harness.check(curve.getCtrlX(), 3); // Check 3
    harness.check(curve.getCtrlY(), 4); // Check 4
    harness.check(curve.getX2(), 5);    // Check 5
    harness.check(curve.getY2(), 6);    // Check 6
  }
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

  }


  private void test_PointArray(TestHarness harness)
  {
    QuadCurve2D curve;
    Point2D[] pts = new Point2D[20];

    harness.checkPoint("PointArray");

    curve = new QuadCurve2D.Double();
    pts[11] = new Point2D.Float(1,2);
    pts[12] = new Point2D.Double(3,4);
    pts[13] = new Point(5, 6);
    curve.setCurve(pts, 11);

    harness.check(curve.getX1(), 1);    // Check 1
    harness.check(curve.getY1(), 2);    // Check 2
    harness.check(curve.getCtrlX(), 3); // Check 3
    harness.check(curve.getCtrlY(), 4); // Check 4
    harness.check(curve.getX2(), 5);    // Check 5
    harness.check(curve.getY2(), 6);    // Check 6
  }
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

  }


  private void test_curve2()
  {
    QuadCurve2D src, left, right;

    harness.checkPoint("curve2");
    src = new QuadCurve2D.Double(42, 24, 123, 321, -78011, -11087);
    left = new QuadCurve2D.Double();
    right = new QuadCurve2D.Float();
    src.subdivide(left, right);
    chkeps(left.getX1(), 42);           // 1
    chkeps(left.getY1(), 24);           // 2
    chkeps(left.getCtrlX(), 82.5);      // 3
    chkeps(left.getCtrlY(), 172.5);     // 4
    chkeps(left.getX2(),-19430.75);     // 5
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

  }


  private void test_curve3()
  {
    QuadCurve2D src, left, right;

    harness.checkPoint("curve3");
    src = new QuadCurve2D.Double(23, -23, 42, -42, 1968.5, -1968.5);
    left = new QuadCurve2D.Float();
    right = new QuadCurve2D.Float();
View Full Code Here

Examples of java.awt.geom.QuadCurve2D

public class clone
  implements Testlet
{
  public void test(TestHarness harness)
  {
    QuadCurve2D curve;

    // Checks 1 to 7: Clone a QuadCurve2D.Double
    curve = (QuadCurve2D) (new QuadCurve2D.Double(4,3,9,1,7,8)).clone();
    harness.check(curve instanceof QuadCurve2D.Double); // 1
    harness.check(curve.getX1(), 4.0);                  // 2
    harness.check(curve.getY1(), 3.0);                  // 3
    harness.check(curve.getCtrlX(), 9.0);               // 4
    harness.check(curve.getCtrlY(), 1.0);               // 5
    harness.check(curve.getX2(), 7.0);                  // 6
    harness.check(curve.getY2(), 8.0);                  // 7

    // Checks 8 to 14: Clone a QuadCurve2D.Float
    curve = (QuadCurve2D) (new QuadCurve2D.Float(-4,3,-9,1,7,-8)).clone();
    harness.check(curve instanceof QuadCurve2D.Float)// 1
    harness.check(curve.getX1(), -4.0);                 // 2
    harness.check(curve.getY1(), 3.0);                  // 3
    harness.check(curve.getCtrlX(), -9.0);              // 4
    harness.check(curve.getCtrlY(), 1.0);               // 5
    harness.check(curve.getX2(), 7.0);                  // 6
    harness.check(curve.getY2(), -8.0);                 // 7
  }
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.