Search in sources :

Example 26 with IArrowableSingleShape

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

the class TestParsingArrow method testNoneC.

@Theory
public void testNoneC(final Tuple<String, String> cmd) {
    parser(cmd.a + "{-C}" + cmd.b);
    final IArrowableSingleShape line = (IArrowableSingleShape) listener.getShapes().get(0);
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
    assertEquals(ArrowStyle.SQUARE_END, line.getArrowStyle(1));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) Theory(org.junit.experimental.theories.Theory)

Example 27 with IArrowableSingleShape

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

the class TestParsingArrow method testNoneArrowheadRight.

@Theory
public void testNoneArrowheadRight(final Tuple<String, String> cmd) {
    parser(cmd.a + "{->}" + cmd.b);
    final IArrowableSingleShape line = (IArrowableSingleShape) listener.getShapes().get(0);
    assertEquals(ArrowStyle.RIGHT_ARROW, line.getArrowStyle(1));
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) Theory(org.junit.experimental.theories.Theory)

Example 28 with IArrowableSingleShape

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

the class TestParsingArrow method testNoneTbar.

@Theory
public void testNoneTbar(final Tuple<String, String> cmd) {
    parser(cmd.a + "{-|}" + cmd.b);
    final IArrowableSingleShape line = (IArrowableSingleShape) listener.getShapes().get(0);
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
    assertEquals(ArrowStyle.BAR_IN, line.getArrowStyle(1));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) Theory(org.junit.experimental.theories.Theory)

Example 29 with IArrowableSingleShape

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

the class TestParsingArrow method testParamArrowsSLBracket.

@Theory
public void testParamArrowsSLBracket(final Tuple<String, String> cmd) {
    parser(cmd.a + "[arrows=[-]" + cmd.b);
    final IArrowableSingleShape line = (IArrowableSingleShape) listener.getShapes().get(0);
    assertEquals(ArrowStyle.LEFT_SQUARE_BRACKET, line.getArrowStyle(0));
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(1));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) Theory(org.junit.experimental.theories.Theory)

Example 30 with IArrowableSingleShape

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

the class TestParsingArrow method testParamArrowBracketLength.

@Theory
public void testParamArrowBracketLength(final Tuple<String, String> cmd) {
    parser(cmd.a + "[arrows=<->, bracketlength=2.55]" + cmd.b);
    final IArrowableSingleShape line = (IArrowableSingleShape) listener.getShapes().get(0);
    assertEquals(2.55, line.getBracketNum(), 0.0001);
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) Theory(org.junit.experimental.theories.Theory)

Aggregations

IArrowableSingleShape (net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape)93 Theory (org.junit.experimental.theories.Theory)57 ArrowStyle (net.sf.latexdraw.models.interfaces.shape.ArrowStyle)36 CompositeGUIVoidCommand (net.sf.latexdraw.instruments.CompositeGUIVoidCommand)34 Test (org.junit.Test)34 IAxes (net.sf.latexdraw.models.interfaces.shape.IAxes)10