Search in sources :

Example 36 with ArrowableSingleShape

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

the class TestPencilArrowStyle method testSelectRightArrowStyleRIGHTROUNDBRACKETPencil.

@Test
public void testSelectRightArrowStyleRIGHTROUNDBRACKETPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.RIGHT_ROUND_BRACKET)).execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.RIGHT_ROUND_BRACKET, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertTrue(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 37 with ArrowableSingleShape

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

the class TestPencilArrowStyle method testSelectLeftArrowStyleBARINPencil.

@Test
public void testSelectLeftArrowStyleBARINPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowLeftCB.execute(ArrowStyle.BAR_IN)).execute();
    final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.BAR_IN, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 38 with ArrowableSingleShape

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

the class TestPencilArrowStyle method testSelectLeftArrowStyleRIGHTSQUAREBRACKETPencil.

@Test
public void testSelectLeftArrowStyleRIGHTSQUAREBRACKETPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowLeftCB.execute(ArrowStyle.RIGHT_SQUARE_BRACKET)).execute();
    final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.RIGHT_SQUARE_BRACKET, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertTrue(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 39 with ArrowableSingleShape

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

the class TestPencilArrowStyle method testSelectRightArrowStyleROUNDINPencil.

@Test
public void testSelectRightArrowStyleROUNDINPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.ROUND_IN)).execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.ROUND_IN, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 40 with ArrowableSingleShape

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

the class TestPencilArrowStyle method testSelectRightArrowStyleRIGHTARROWPencil.

@Test
public void testSelectRightArrowStyleRIGHTARROWPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.RIGHT_ARROW)).execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.RIGHT_ARROW, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertTrue(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

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