Search in sources :

Example 36 with Rectangle

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

the class TestPSTGeneralFeatures method testPssetlinewidth.

@Test
void testPssetlinewidth() {
    parser("\\psset{linewidth=2cm}\\psframe(10,10)");
    final Rectangle rec = getShapeAt(0);
    assertEquals(2d * Shape.PPC, rec.getThickness(), 0.0001);
}
Also used : Rectangle(net.sf.latexdraw.model.api.shape.Rectangle) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 37 with Rectangle

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

the class TestPlot method testCopyFromOther.

@Test
public void testCopyFromOther() {
    final Rectangle rec = ShapeFactory.INST.createRectangle();
    rec.setFillingCol(DviPsColors.BLUE);
    shape.copy(rec);
    assertEquals(DviPsColors.BLUE, shape.getFillingCol());
}
Also used : Rectangle(net.sf.latexdraw.model.api.shape.Rectangle) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 38 with Rectangle

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

the class TestParsingPSRotate method testPSRotation10Angle.

@Test
public void testPSRotation10Angle() {
    parser("\\psrotate(1,1){10}{\\psframe(2,2)}\\psframe(2,2)");
    assertEquals(2, parsedShapes.size());
    final Rectangle rec = getShapeAt(0);
    assertEquals(-10d, Math.toDegrees(rec.getRotationAngle()), 0.001);
    assertEquals(parsedShapes.get(1).getGravityCentre(), rec.getGravityCentre());
}
Also used : Rectangle(net.sf.latexdraw.model.api.shape.Rectangle) Test(org.junit.jupiter.api.Test)

Example 39 with Rectangle

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

the class TestParsingPSRotate method testPSRotationNegAngle.

@Test
public void testPSRotationNegAngle() {
    parser("\\psrotate(1,2){-110.2}{\\psframe(2,4)}\\psframe(2,4)");
    assertEquals(2, parsedShapes.size());
    final Rectangle rec = getShapeAt(0);
    assertEquals(110.2, Math.toDegrees(rec.getRotationAngle()), 0.001);
    assertEquals(parsedShapes.get(1).getGravityCentre(), rec.getGravityCentre());
}
Also used : Rectangle(net.sf.latexdraw.model.api.shape.Rectangle) Test(org.junit.jupiter.api.Test)

Aggregations

Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)39 Test (org.junit.jupiter.api.Test)29 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)23 Test (org.junit.Test)7 HelperTest (net.sf.latexdraw.HelperTest)5 Grid (net.sf.latexdraw.model.api.shape.Grid)5 Circle (net.sf.latexdraw.model.api.shape.Circle)2 Dot (net.sf.latexdraw.model.api.shape.Dot)2 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)2 Text (net.sf.latexdraw.model.api.shape.Text)2 ValueSource (org.junit.jupiter.params.provider.ValueSource)2 Point2D (javafx.geometry.Point2D)1 LineArcProp (net.sf.latexdraw.model.api.property.LineArcProp)1 Axes (net.sf.latexdraw.model.api.shape.Axes)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 CircleArc (net.sf.latexdraw.model.api.shape.CircleArc)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Plot (net.sf.latexdraw.model.api.shape.Plot)1 Polygon (net.sf.latexdraw.model.api.shape.Polygon)1 Polyline (net.sf.latexdraw.model.api.shape.Polyline)1