Search in sources :

Example 1 with Circle

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

the class TestParsingQdisk method testLineStylePlain.

@Test
public void testLineStylePlain() {
    parser("\\psset{linestyle=dotted}\\qdisk(35pt,20pt){10pt}");
    final Circle cir = getShapeAt(0);
    assertEquals(LineStyle.SOLID, cir.getLineStyle());
}
Also used : Circle(net.sf.latexdraw.model.api.shape.Circle) Test(org.junit.jupiter.api.Test)

Example 2 with Circle

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

the class TestParsingQdisk method testCoordinatesCm.

@Test
public void testCoordinatesCm() {
    parser("\\qdisk(35cm,20cm){.5cm}");
    final Circle cir = getShapeAt(0);
    assertEquals(35d * Shape.PPC - 0.5 * Shape.PPC, cir.getPosition().getX(), 0.001);
    assertEquals((20d * Shape.PPC - 0.5 * Shape.PPC) * -1d, cir.getPosition().getY(), 0.001);
    assertEquals(0.5 * Shape.PPC * 2d, cir.getWidth(), 0.0000001);
    assertEquals(0.5 * Shape.PPC * 2d, cir.getHeight(), 0.0000001);
}
Also used : Circle(net.sf.latexdraw.model.api.shape.Circle) Test(org.junit.jupiter.api.Test)

Example 3 with Circle

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

the class TestParsingQdisk method testLineColourIsFillColour.

@Test
public void testLineColourIsFillColour() {
    parser("\\psset{linecolor=green}\\qdisk(35pt,20pt){10pt}");
    final Circle cir = getShapeAt(0);
    assertEquals(DviPsColors.GREEN, cir.getFillingCol());
    assertEquals(DviPsColors.GREEN, cir.getLineColour());
}
Also used : Circle(net.sf.latexdraw.model.api.shape.Circle) Test(org.junit.jupiter.api.Test)

Example 4 with Circle

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

the class TestParsingQdisk method testMustBeFilled.

@Test
public void testMustBeFilled() {
    parser("\\qdisk(35pt,20pt){10pt}");
    final Circle cir = getShapeAt(0);
    assertEquals(FillingStyle.PLAIN, cir.getFillingStyle());
}
Also used : Circle(net.sf.latexdraw.model.api.shape.Circle) Test(org.junit.jupiter.api.Test)

Example 5 with Circle

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

the class TestParsingPscircle method testCoordinatesRadius.

@Test
public void testCoordinatesRadius() {
    parser("\\pscircle(35,20){10}");
    final Circle cir = getShapeAt(0);
    assertEquals(35d * Shape.PPC - 10d * Shape.PPC, cir.getPosition().getX(), 0.001);
    assertEquals((20d * Shape.PPC - 10d * Shape.PPC) * -1d, cir.getPosition().getY(), 0.001);
    assertEquals(10d * Shape.PPC * 2d, cir.getWidth(), 0.0000001);
    assertEquals(10d * Shape.PPC * 2d, cir.getHeight(), 0.0000001);
}
Also used : Circle(net.sf.latexdraw.model.api.shape.Circle) Test(org.junit.jupiter.api.Test)

Aggregations

Circle (net.sf.latexdraw.model.api.shape.Circle)21 Test (org.junit.jupiter.api.Test)17 Test (org.junit.Test)3 HelperTest (net.sf.latexdraw.HelperTest)2 Point2D (javafx.geometry.Point2D)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 Dot (net.sf.latexdraw.model.api.shape.Dot)1 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Grid (net.sf.latexdraw.model.api.shape.Grid)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 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)1 Rhombus (net.sf.latexdraw.model.api.shape.Rhombus)1 Square (net.sf.latexdraw.model.api.shape.Square)1 Text (net.sf.latexdraw.model.api.shape.Text)1 Triangle (net.sf.latexdraw.model.api.shape.Triangle)1