use of com.xenoage.zong.symbols.path.QuadraticCurveTo in project Zong by Xenoage.
the class SvgPathReader method quadraticCurveTo.
private void quadraticCurveTo(Point2f cp, Point2f p) {
pCurrent = p;
elements.add(new QuadraticCurveTo(cp, p));
}
use of com.xenoage.zong.symbols.path.QuadraticCurveTo in project Zong by Xenoage.
the class AwtPath method createShape.
public static Shape createShape(Path path) {
GeneralPath shape = new GeneralPath();
for (PathElement e : path.getElements()) {
switch(e.getType()) {
case ClosePath:
shape.closePath();
break;
case CubicCurveTo:
CubicCurveTo c = (CubicCurveTo) e;
shape.curveTo(c.cp1.x, c.cp1.y, c.cp2.x, c.cp2.y, c.p.x, c.p.y);
break;
case LineTo:
LineTo l = (LineTo) e;
shape.lineTo(l.p.x, l.p.y);
break;
case MoveTo:
MoveTo m = (MoveTo) e;
shape.moveTo(m.p.x, m.p.y);
break;
case QuadraticCurveTo:
QuadraticCurveTo q = (QuadraticCurveTo) e;
shape.quadTo(q.cp.x, q.cp.y, q.p.x, q.p.y);
break;
}
}
return shape;
}
use of com.xenoage.zong.symbols.path.QuadraticCurveTo in project Zong by Xenoage.
the class JfxPath method drawPath.
public static void drawPath(Path path, GraphicsContext context) {
context.beginPath();
for (PathElement e : path.getElements()) {
switch(e.getType()) {
case ClosePath:
context.closePath();
break;
case CubicCurveTo:
CubicCurveTo c = (CubicCurveTo) e;
context.bezierCurveTo(c.cp1.x, c.cp1.y, c.cp2.x, c.cp2.y, c.p.x, c.p.y);
break;
case LineTo:
LineTo l = (LineTo) e;
context.lineTo(l.p.x, l.p.y);
break;
case MoveTo:
MoveTo m = (MoveTo) e;
context.moveTo(m.p.x, m.p.y);
break;
case QuadraticCurveTo:
QuadraticCurveTo q = (QuadraticCurveTo) e;
context.quadraticCurveTo(q.cp.x, q.cp.y, q.p.x, q.p.y);
break;
}
}
}
use of com.xenoage.zong.symbols.path.QuadraticCurveTo in project Zong by Xenoage.
the class AndroidPath method createPath.
public static Path createPath(com.xenoage.zong.symbols.path.Path path) {
Path ret = new Path();
for (PathElement e : path.getElements()) {
switch(e.getType()) {
case ClosePath:
ret.close();
break;
case CubicCurveTo:
CubicCurveTo c = (CubicCurveTo) e;
ret.cubicTo(c.cp1.x, c.cp1.y, c.cp2.x, c.cp2.y, c.p.x, c.p.y);
break;
case LineTo:
LineTo l = (LineTo) e;
ret.lineTo(l.p.x, l.p.y);
break;
case MoveTo:
MoveTo m = (MoveTo) e;
ret.moveTo(m.p.x, m.p.y);
break;
case QuadraticCurveTo:
QuadraticCurveTo q = (QuadraticCurveTo) e;
ret.quadTo(q.cp.x, q.cp.y, q.p.x, q.p.y);
break;
}
}
return ret;
}
Aggregations