Search in sources :

Example 6 with PlotStyle

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

the class TestHandPlotStyle method testSelectCURVEStyleHand.

@Test
public void testSelectCURVEStyleHand() {
    new CompositeGUIVoidCommand(activateHand, selectionAddDot, selectionAddPlot, selectionAddPlot, updateIns).execute();
    selectplotStyleCB.execute(PlotStyle.ECURVE);
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.CURVE);
    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 7 with PlotStyle

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

the class TestHandPlotStyle method testSelectDOTSStyleHand.

@Test
public void testSelectDOTSStyleHand() {
    new CompositeGUIVoidCommand(activateHand, selectionAddDot, selectionAddPlot, selectionAddPlot, updateIns).execute();
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.DOTS);
    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 8 with PlotStyle

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

the class TestHandPlotStyle method testSelectLINEStyleHand.

@Test
public void testSelectLINEStyleHand() {
    new CompositeGUIVoidCommand(activateHand, selectionAddDot, selectionAddPlot, selectionAddPlot, updateIns).execute();
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.LINE);
    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 9 with PlotStyle

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

the class TestPencilPlotStyle method testSelectCURVEStylePencil.

@Test
public void testSelectCURVEStylePencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesPlot, updateIns).execute();
    selectplotStyleCB.execute(PlotStyle.ECURVE);
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.CURVE);
    PlotStyle newStyle = plotStyleCB.getSelectionModel().getSelectedItem();
    assertEquals(newStyle, ((IPlot) pencil.createShapeInstance()).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 10 with PlotStyle

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

the class TestPencilPlotStyle method testSelectECURVEStylePencil.

@Test
public void testSelectECURVEStylePencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesPlot, updateIns).execute();
    PlotStyle style = plotStyleCB.getSelectionModel().getSelectedItem();
    selectplotStyleCB.execute(PlotStyle.ECURVE);
    PlotStyle newStyle = plotStyleCB.getSelectionModel().getSelectedItem();
    assertEquals(newStyle, ((IPlot) pencil.createShapeInstance()).getPlotStyle());
    assertNotEquals(style, newStyle);
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) PlotStyle(net.sf.latexdraw.models.interfaces.shape.PlotStyle) Test(org.junit.Test)

Aggregations

CompositeGUIVoidCommand (net.sf.latexdraw.instruments.CompositeGUIVoidCommand)12 PlotStyle (net.sf.latexdraw.models.interfaces.shape.PlotStyle)12 Test (org.junit.Test)12