use of org.graphstream.ui.javafx.renderer.shape.javafx.baseShapes.Form.Path2D in project gs-ui-javafx by graphstream.
the class PolylineEdgeShape method make.
@Override
public void make(Backend backend, DefaultCamera2D camera) {
int n = skel.size();
theShape = new Path2D(n + 2, false);
theShape.moveTo(skel.apply(0).x, skel.apply(0).y);
for (int i = 0; i < n; i++) {
theShape.lineTo(skel.apply(i).x, skel.apply(i).y);
}
}
use of org.graphstream.ui.javafx.renderer.shape.javafx.baseShapes.Form.Path2D in project gs-ui-javafx by graphstream.
the class DiamondShape method make.
@Override
public void make(Backend backend, DefaultCamera2D camera) {
double x = area.theCenter.x;
double y = area.theCenter.y;
double w2 = area.theSize.x / 2;
double h2 = area.theSize.y / 2;
theShape = new Path2D(10, true);
theShape().moveTo(x - w2, y);
theShape().lineTo(x, y - h2);
theShape().lineTo(x + w2, y);
theShape().lineTo(x, y + h2);
theShape.closePath();
}
use of org.graphstream.ui.javafx.renderer.shape.javafx.baseShapes.Form.Path2D in project gs-ui-javafx by graphstream.
the class PolygonShape method makeShadow.
@Override
public void makeShadow(Backend backend, DefaultCamera2D camera) {
double n = theValues.length;
double x = area.theCenter.x + shadowable.theShadowOff.x;
double y = area.theCenter.y + shadowable.theShadowOff.y;
theShape = new Path2D((int) n + 2, true);
if (n > 0) {
theShape().moveTo(x + theValues[0].x, y + theValues[0].y);
for (int i = 0; i < n; i++) {
theShape().lineTo(x + theValues[i].x, y + theValues[i].y);
}
}
theShape.closePath();
}
use of org.graphstream.ui.javafx.renderer.shape.javafx.baseShapes.Form.Path2D in project gs-ui-javafx by graphstream.
the class PolygonShape method make.
@Override
public void make(Backend backend, DefaultCamera2D camera) {
double x = area.theCenter.x;
double y = area.theCenter.y;
double n = theValues.length;
theShape = new Path2D((int) n + 2, true);
if (n > 0) {
theShape().moveTo(x + theValues[0].x, y + theValues[0].y);
for (int i = 0; i < n; i++) {
theShape().lineTo(x + theValues[i].x, y + theValues[i].y);
}
}
theShape.closePath();
}
use of org.graphstream.ui.javafx.renderer.shape.javafx.baseShapes.Form.Path2D in project gs-ui-javafx by graphstream.
the class SpriteArrowShape method make.
@Override
public void make(Backend backend, DefaultCamera2D camera) {
double x = area.theCenter.x;
double y = area.theCenter.y;
Vector2 dir = new Vector2(orientable.target.x - x, orientable.target.y - y);
dir.normalize();
Vector2 per = new Vector2(dir.y(), -dir.x());
dir.scalarMult(area.theSize.x);
per.scalarMult(area.theSize.y / 2);
theShape = new Path2D(5, true);
theShape().moveTo(x + per.x(), y + per.y());
theShape().lineTo(x + dir.x(), y + dir.y());
theShape().lineTo(x - per.x(), y - per.y());
theShape.closePath();
}
Aggregations