Search in sources :

Example 11 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPswedge method testCoordinatesRadius.

@Theory
public void testCoordinatesRadius(final String cmd) {
    parser(cmd + "(35,20){10}{10}{20}");
    IArc arc = getShapeAt(0);
    assertEquals(35d * IShape.PPC - 10d * IShape.PPC, arc.getPosition().getX(), 0.0000001);
    assertEquals((20d * IShape.PPC - 10d * IShape.PPC) * -1d, arc.getPosition().getY(), 0.0000001);
    assertEquals(10d * IShape.PPC * 2d, arc.getWidth(), 0.0000001);
    assertEquals(10d * IShape.PPC * 2d, arc.getHeight(), 0.0000001);
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Theory(org.junit.experimental.theories.Theory)

Example 12 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPswedge method testFloatSigns.

@Theory
public void testFloatSigns(final String cmd) {
    parser(cmd + "(+++35.5,--50.5){--+12}{10}{20}");
    IArc arc = getShapeAt(0);
    assertEquals(35.5 * IShape.PPC - 12d * IShape.PPC, arc.getPosition().getX(), 0.001);
    assertEquals((50.5 * IShape.PPC - 12d * IShape.PPC) * -1d, arc.getPosition().getY(), 0.001);
    assertEquals(12d * IShape.PPC * 2d, arc.getWidth(), 0.0000001);
    assertEquals(12d * IShape.PPC * 2d, arc.getHeight(), 0.0000001);
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Theory(org.junit.experimental.theories.Theory)

Example 13 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPsarc method testParamArrowsArrows.

@Test
public void testParamArrowsArrows() {
    parser("\\psarc[arrows=<->]{1}{30}{40}");
    final IArc arc = getShapeAt(0);
    assertEquals(ArrowStyle.LEFT_ARROW, arc.getArrowStyle(0));
    assertEquals(ArrowStyle.RIGHT_ARROW, arc.getArrowStyle(1));
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Test(org.junit.Test)

Example 14 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPsarc method testParamArrowsArrowsNoneNone.

@Test
public void testParamArrowsArrowsNoneNone() {
    parser("\\psarc[arrows=<->]{-}{1}{30}{40}");
    final IArc arc = getShapeAt(0);
    assertEquals(ArrowStyle.NONE, arc.getArrowStyle(0));
    assertEquals(ArrowStyle.NONE, arc.getArrowStyle(1));
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Test(org.junit.Test)

Example 15 with IArc

use of net.sf.latexdraw.models.interfaces.shape.IArc in project latexdraw by arnobl.

the class TestParsingPsarc method testParamBarInSqureBracket.

@Test
public void testParamBarInSqureBracket() {
    parser("\\psarc{|-]}{1}{30}{40}");
    final IArc arc = getShapeAt(0);
    assertEquals(ArrowStyle.BAR_IN, arc.getArrowStyle(0));
    assertEquals(ArrowStyle.RIGHT_SQUARE_BRACKET, arc.getArrowStyle(1));
}
Also used : IArc(net.sf.latexdraw.models.interfaces.shape.IArc) Test(org.junit.Test)

Aggregations

IArc (net.sf.latexdraw.models.interfaces.shape.IArc)17 Theory (org.junit.experimental.theories.Theory)12 Test (org.junit.Test)4