Search in sources :

Example 6 with Point

use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.

the class GroupShapeBase method addToRotationAngle.

@Override
default void addToRotationAngle(final Point gravCentre, final double angle) {
    rotationAngleProperty().setValue(rotationAngleProperty().get() + angle);
    final Point gc = getGravityCentre();
    getShapes().forEach(sh -> sh.addToRotationAngle(gc, angle));
}
Also used : Point(net.sf.latexdraw.model.api.shape.Point)

Example 7 with Point

use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.

the class GroupShapeBase method getFullBottomRightPoint.

@Override
@NotNull
default Point getFullBottomRightPoint() {
    final double gap = getBorderGap();
    final Point br = getBottomRightPoint();
    br.translate(gap, gap);
    return br;
}
Also used : Point(net.sf.latexdraw.model.api.shape.Point) NotNull(org.jetbrains.annotations.NotNull)

Example 8 with Point

use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.

the class EllipseImpl method setCentre.

@Override
public void setCentre(@NotNull final Point centre) {
    if (MathUtils.INST.isValidPt(centre)) {
        final Point gc = getGravityCentre();
        translate(centre.getX() - gc.getX(), centre.getY() - gc.getY());
    }
}
Also used : Point(net.sf.latexdraw.model.api.shape.Point)

Example 9 with Point

use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.

the class GridBase method mirrorVertical.

@Override
public void mirrorVertical(final double y) {
    if (MathUtils.INST.isValidCoord(y)) {
        final Point bl = points.get(0).verticalSymmetry(y);
        final Point tl = getTopLeftPoint().verticalSymmetry(y);
        points.get(0).setPoint(bl.getX(), Math.max(bl.getY(), tl.getY()));
    }
}
Also used : Point(net.sf.latexdraw.model.api.shape.Point)

Example 10 with Point

use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.

the class GridBase method getTopRightPoint.

@Override
@NotNull
public Point getTopRightPoint() {
    final Point pos = getPosition();
    final double step = getStep();
    return ShapeFactory.INST.createPoint(pos.getX() + step * (getGridEndX() - getGridStartX()), pos.getY() - step * (getGridEndY() - getGridStartY()));
}
Also used : Point(net.sf.latexdraw.model.api.shape.Point) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Point (net.sf.latexdraw.model.api.shape.Point)139 Test (org.junit.Test)52 HelperTest (net.sf.latexdraw.HelperTest)27 Theory (org.junit.experimental.theories.Theory)23 NotNull (org.jetbrains.annotations.NotNull)19 Line (net.sf.latexdraw.model.api.shape.Line)10 Shape (net.sf.latexdraw.model.api.shape.Shape)9 SVGElement (net.sf.latexdraw.parser.svg.SVGElement)9 SVGGElement (net.sf.latexdraw.parser.svg.SVGGElement)9 Test (org.junit.jupiter.api.Test)8 ArrayList (java.util.ArrayList)7 Polyline (net.sf.latexdraw.model.api.shape.Polyline)5 Color (javafx.scene.paint.Color)4 MathUtils (net.sf.latexdraw.model.MathUtils)4 ShapeFactory (net.sf.latexdraw.model.ShapeFactory)4 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)4 Canvas (net.sf.latexdraw.view.jfx.Canvas)4 Point2D (java.awt.geom.Point2D)3 List (java.util.List)3 ShapeData (net.sf.latexdraw.data.ShapeData)3