Search in sources :

Example 36 with IArrowableSingleShape

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

the class TestParsingArrow method testCcNone.

@Theory
public void testCcNone(final Tuple<String, String> cmd) {
    parser(cmd.a + "{cc-}" + cmd.b);
    final IArrowableSingleShape line = (IArrowableSingleShape) listener.getShapes().get(0);
    assertEquals(ArrowStyle.ROUND_IN, 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 37 with IArrowableSingleShape

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

the class TestParsingArrow method testNoneRightSquareBracket.

@Theory
public void testNoneRightSquareBracket(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.LEFT_SQUARE_BRACKET, line.getArrowStyle(1));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) Theory(org.junit.experimental.theories.Theory)

Example 38 with IArrowableSingleShape

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

the class TestParsingArrow method testParamArrowsizeDim.

@Theory
public void testParamArrowsizeDim(final Tuple<String, String> cmd) {
    parser(cmd.a + "[arrows=<->, arrowsize=2cm]" + cmd.b);
    final IArrowableSingleShape line = (IArrowableSingleShape) listener.getShapes().get(0);
    assertEquals(2d * IShape.PPC, line.getArrowSizeDim(), 0.0001);
    assertEquals(0d, line.getArrowSizeNum(), 0.0001);
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) Theory(org.junit.experimental.theories.Theory)

Example 39 with IArrowableSingleShape

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

the class TestSVGArrowable method testArrowRBracketParamsArr1.

@Theory
public void testArrowRBracketParamsArr1(@ArrowableData(withParamVariants = true) final IArrowableSingleShape sh, final ArrowStyle arr1, final ArrowStyle arr2) {
    assumeTrue(arr1.isRoundBracket());
    assumeFalse(sh instanceof IAxes);
    sh.setArrowStyle(arr1, 0);
    sh.setArrowStyle(arr2, -1);
    final IArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowRBracket(sh.getArrowAt(0), s2.getArrowAt(0));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Theory(org.junit.experimental.theories.Theory)

Example 40 with IArrowableSingleShape

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

the class TestSVGArrowable method testArrowBracketParamsArr2.

@Theory
public void testArrowBracketParamsArr2(@ArrowableData(withParamVariants = true) final IArrowableSingleShape sh, final ArrowStyle arr1, final ArrowStyle arr2) {
    assumeTrue(arr2.isSquareBracket());
    assumeFalse(sh instanceof IAxes);
    sh.setArrowStyle(arr1, 0);
    sh.setArrowStyle(arr2, -1);
    final IArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowBracket(sh.getArrowAt(-1), s2.getArrowAt(-1));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) 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