Search in sources :

Example 51 with CompositeGUIVoidCommand

use of net.sf.latexdraw.instruments.CompositeGUIVoidCommand in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectLeftArrowStyleBARINPencil.

@Test
public void testSelectLeftArrowStyleBARINPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    selectArrowLeftCB.execute(ArrowStyle.BAR_IN);
    ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.BAR_IN, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Test(org.junit.Test)

Example 52 with CompositeGUIVoidCommand

use of net.sf.latexdraw.instruments.CompositeGUIVoidCommand in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectRightArrowStyleCIRCLEENDPencil.

@Test
public void testSelectRightArrowStyleCIRCLEENDPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    selectArrowRightCB.execute(ArrowStyle.CIRCLE_END);
    ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.CIRCLE_END, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertTrue(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Test(org.junit.Test)

Example 53 with CompositeGUIVoidCommand

use of net.sf.latexdraw.instruments.CompositeGUIVoidCommand in project latexdraw by arnobl.

the class TestPencilAxesStyle method testSelectLineStylePencil.

@Test
public void testSelectLineStylePencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesAxes, updateIns).execute();
    AxesStyle style = shapeAxes.getSelectionModel().getSelectedItem();
    selectAxeStyle.execute();
    AxesStyle newStyle = shapeAxes.getSelectionModel().getSelectedItem();
    assertEquals(newStyle, ((IAxesProp) pencil.createShapeInstance()).getAxesStyle());
    assertNotEquals(style, newStyle);
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) AxesStyle(net.sf.latexdraw.models.interfaces.shape.AxesStyle) Test(org.junit.Test)

Example 54 with CompositeGUIVoidCommand

use of net.sf.latexdraw.instruments.CompositeGUIVoidCommand in project latexdraw by arnobl.

the class TestPencilAxesStyle method testSelectShowLabelsPencil.

@Test
public void testSelectShowLabelsPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesAxes, updateIns).execute();
    PlottingStyle style = showLabels.getSelectionModel().getSelectedItem();
    selectPlotLabel.execute();
    PlottingStyle newStyle = showLabels.getSelectionModel().getSelectedItem();
    assertEquals(newStyle, ((IAxesProp) pencil.createShapeInstance()).getLabelsDisplayed());
    assertNotEquals(style, newStyle);
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) PlottingStyle(net.sf.latexdraw.models.interfaces.shape.PlottingStyle) Test(org.junit.Test)

Example 55 with CompositeGUIVoidCommand

use of net.sf.latexdraw.instruments.CompositeGUIVoidCommand in project latexdraw by arnobl.

the class TestPencilAxesStyle method testWidgetsGoodStateWhenGoodPencilUsed.

@Test
public void testWidgetsGoodStateWhenGoodPencilUsed() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesAxes, updateIns).execute();
    assertTrue(mainPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) Test(org.junit.Test)

Aggregations

CompositeGUIVoidCommand (net.sf.latexdraw.instruments.CompositeGUIVoidCommand)218 Test (org.junit.Test)218 ArrowStyle (net.sf.latexdraw.models.interfaces.shape.ArrowStyle)34 IArrowableSingleShape (net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape)34 Color (javafx.scene.paint.Color)20 PlotStyle (net.sf.latexdraw.models.interfaces.shape.PlotStyle)12 IGrid (net.sf.latexdraw.models.interfaces.shape.IGrid)4 PlottingStyle (net.sf.latexdraw.models.interfaces.shape.PlottingStyle)4 AxesStyle (net.sf.latexdraw.models.interfaces.shape.AxesStyle)2 BorderPos (net.sf.latexdraw.models.interfaces.shape.BorderPos)2 FillingStyle (net.sf.latexdraw.models.interfaces.shape.FillingStyle)2 IDot (net.sf.latexdraw.models.interfaces.shape.IDot)2 LineStyle (net.sf.latexdraw.models.interfaces.shape.LineStyle)2 TicksStyle (net.sf.latexdraw.models.interfaces.shape.TicksStyle)2 DotStyle (net.sf.latexdraw.models.interfaces.shape.DotStyle)1