Esempio n. 1
0
 public UPath toUPath() {
   final UPath result = new UPath();
   boolean start = true;
   for (CubicCurve2D.Double bez : beziers) {
     if (start) {
       result.add(new double[] {bez.x1, bez.y1}, USegmentType.SEG_MOVETO);
       start = false;
     }
     result.add(
         new double[] {bez.ctrlx1, bez.ctrly1, bez.ctrlx2, bez.ctrly2, bez.x2, bez.y2},
         USegmentType.SEG_CUBICTO);
   }
   return result;
 }
Esempio n. 2
0
 public void arcTo(
     double rx,
     double ry,
     double x_axis_rotation,
     double large_arc_flag,
     double sweep_flag,
     double x,
     double y) {
   add(
       new double[] {rx, ry, x_axis_rotation, large_arc_flag, sweep_flag, x, y},
       USegmentType.SEG_ARCTO);
   // lineTo(x, y);
 }
Esempio n. 3
0
  public UPath getUPath(FontRenderContext frc) {
    final UPath result = new UPath();

    final PathIterator path = getPathIteratorCharacter(frc);

    final double coord[] = new double[6];
    while (path.isDone() == false) {
      final int code = path.currentSegment(coord);
      result.add(coord, USegmentType.getByCode(code));
      path.next();
    }

    return result;
  }
Esempio n. 4
0
 public void quadTo(double ctrlx, double ctrly, double x2, double y2) {
   add(new double[] {ctrlx, ctrly, ctrlx, ctrly, x2, y2}, USegmentType.SEG_CUBICTO);
 }
Esempio n. 5
0
 public void cubicTo(
     double ctrlx1, double ctrly1, double ctrlx2, double ctrly2, double x2, double y2) {
   add(new double[] {ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2}, USegmentType.SEG_CUBICTO);
 }
Esempio n. 6
0
 public void lineTo(double x, double y) {
   add(new double[] {x, y}, USegmentType.SEG_LINETO);
 }
Esempio n. 7
0
 public void moveTo(double x, double y) {
   add(new double[] {x, y}, USegmentType.SEG_MOVETO);
 }
Esempio n. 8
0
 public void arcTo(Point2D pt, double radius, double large_arc_flag, double sweep_flag) {
   add(
       new double[] {radius, radius, 0, large_arc_flag, sweep_flag, pt.getX(), pt.getY()},
       USegmentType.SEG_ARCTO);
   // lineTo(x, y);
 }