Search in sources :

Example 16 with CompositeGUIVoidCommand

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

the class TestHandPlotStyle method testSelectPOLYGONStyleHand.

@Test
public void testSelectPOLYGONStyleHand() {
    new CompositeGUIVoidCommand(activateHand, selectionAddDot, selectionAddPlot, selectionAddPlot, updateIns).execute();
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.POLYGON);
    PlotStyle newStyle = plotStyleCB.getSelectionModel().getSelectedItem();
    assertEquals(plotStyleCB.getSelectionModel().getSelectedItem(), ((IPlot) drawing.getSelection().getShapeAt(1)).getPlotStyle());
    assertEquals(plotStyleCB.getSelectionModel().getSelectedItem(), ((IPlot) drawing.getSelection().getShapeAt(2)).getPlotStyle());
    assertNotEquals(style, newStyle);
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) PlotStyle(net.sf.latexdraw.models.interfaces.shape.PlotStyle) Test(org.junit.Test)

Example 17 with CompositeGUIVoidCommand

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

the class TestHandPlotStyle method testSelectCCURVEStyleHand.

@Test
public void testSelectCCURVEStyleHand() {
    new CompositeGUIVoidCommand(activateHand, selectionAddDot, selectionAddPlot, selectionAddPlot, updateIns).execute();
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.CCURVE);
    PlotStyle newStyle = plotStyleCB.getSelectionModel().getSelectedItem();
    assertEquals(plotStyleCB.getSelectionModel().getSelectedItem(), ((IPlot) drawing.getSelection().getShapeAt(1)).getPlotStyle());
    assertEquals(plotStyleCB.getSelectionModel().getSelectedItem(), ((IPlot) drawing.getSelection().getShapeAt(2)).getPlotStyle());
    assertNotEquals(style, newStyle);
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) PlotStyle(net.sf.latexdraw.models.interfaces.shape.PlotStyle) Test(org.junit.Test)

Example 18 with CompositeGUIVoidCommand

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

the class TestHandPlotStyle method testSelectECURVEStyleHand.

@Test
public void testSelectECURVEStyleHand() {
    new CompositeGUIVoidCommand(activateHand, selectionAddDot, selectionAddPlot, selectionAddPlot, updateIns).execute();
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.ECURVE);
    PlotStyle newStyle = plotStyleCB.getSelectionModel().getSelectedItem();
    assertEquals(plotStyleCB.getSelectionModel().getSelectedItem(), ((IPlot) drawing.getSelection().getShapeAt(1)).getPlotStyle());
    assertEquals(plotStyleCB.getSelectionModel().getSelectedItem(), ((IPlot) drawing.getSelection().getShapeAt(2)).getPlotStyle());
    assertNotEquals(style, newStyle);
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) PlotStyle(net.sf.latexdraw.models.interfaces.shape.PlotStyle) Test(org.junit.Test)

Example 19 with CompositeGUIVoidCommand

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

the class TestHandPlotStyle method testControllerDeactivatedWhenSelectionEmpty.

@Test
public void testControllerDeactivatedWhenSelectionEmpty() {
    new CompositeGUIVoidCommand(activateHand, updateIns).execute();
    assertFalse(ins.isActivated());
    assertFalse(titledPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) Test(org.junit.Test)

Example 20 with CompositeGUIVoidCommand

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

the class TestHandPlotStyle method testControllerActivatedWhenSelectionGrid.

@Test
public void testControllerActivatedWhenSelectionGrid() {
    new CompositeGUIVoidCommand(selectionAddPlot, activateHand, updateIns).execute();
    assertTrue(ins.isActivated());
    assertTrue(titledPane.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