Search in sources :

Example 11 with ArrowableSingleShape

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

the class TestParsingArrow method testArrowheadLeftNone.

@ParameterizedTest
@MethodSource("cmds")
public void testArrowheadLeftNone(final Tuple<String, String> cmd) {
    parser(cmd.a + "{<-}" + cmd.b);
    final ArrowableSingleShape line = (ArrowableSingleShape) parsedShapes.get(0);
    assertEquals(ArrowStyle.LEFT_ARROW, line.getArrowStyle(0));
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(1));
}
Also used : ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 12 with ArrowableSingleShape

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

the class TestParsingArrow method testArrowCNone.

@ParameterizedTest
@MethodSource("cmds")
public void testArrowCNone(final Tuple<String, String> cmd) {
    parser(cmd.a + "{C-}" + cmd.b);
    final ArrowableSingleShape line = (ArrowableSingleShape) parsedShapes.get(0);
    assertEquals(ArrowStyle.SQUARE_END, line.getArrowStyle(0));
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(1));
}
Also used : ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 13 with ArrowableSingleShape

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

the class TestParsingArrow method testNoneRightSquareBracket.

@ParameterizedTest
@MethodSource("cmds")
public void testNoneRightSquareBracket(final Tuple<String, String> cmd) {
    parser(cmd.a + "{-[}" + cmd.b);
    final ArrowableSingleShape line = (ArrowableSingleShape) parsedShapes.get(0);
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
    assertEquals(ArrowStyle.LEFT_SQUARE_BRACKET, line.getArrowStyle(1));
}
Also used : ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 14 with ArrowableSingleShape

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

the class TestParsingArrow method testParamArrowsizeDim.

@ParameterizedTest
@MethodSource("cmds")
public void testParamArrowsizeDim(final Tuple<String, String> cmd) {
    parser(cmd.a + "[arrows=<->, arrowsize=2cm]" + cmd.b);
    final ArrowableSingleShape line = (ArrowableSingleShape) parsedShapes.get(0);
    assertEquals(2d * Shape.PPC, line.getArrowSizeDim(), 0.0001);
    assertEquals(0d, line.getArrowSizeNum(), 0.0001);
}
Also used : ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 15 with ArrowableSingleShape

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

the class TestParsingArrow method testNoneArrowheadRight.

@ParameterizedTest
@MethodSource("cmds")
public void testNoneArrowheadRight(final Tuple<String, String> cmd) {
    parser(cmd.a + "{->}" + cmd.b);
    final ArrowableSingleShape line = (ArrowableSingleShape) parsedShapes.get(0);
    assertEquals(ArrowStyle.RIGHT_ARROW, line.getArrowStyle(1));
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
}
Also used : ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

ArrowableSingleShape (net.sf.latexdraw.model.api.shape.ArrowableSingleShape)89 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)55 MethodSource (org.junit.jupiter.params.provider.MethodSource)55 ArrowStyle (net.sf.latexdraw.model.api.shape.ArrowStyle)34 Test (org.junit.Test)34 Axes (net.sf.latexdraw.model.api.shape.Axes)7