Search in sources :

Example 11 with Plot

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

the class TestPlot method testDuplicate.

@Test
public void testDuplicate() {
    shape.setPlotEquation("2 x mul");
    shape.setPolar(true);
    shape.setNbPlottedPoints(73);
    shape.setPlotStyle(PlotStyle.ECURVE);
    shape.setPlotMinX(-234.0);
    shape.setPlotMaxX(123.0);
    shape.setDotStyle(DotStyle.BAR);
    shape.setDiametre(23.0);
    shape.setDotFillingCol(DviPsColors.YELLOW);
    shape.setPlotEquation("x");
    final Plot plot = shape.duplicate();
    assertEquals("x", plot.getPlotEquation());
    assertTrue(plot.isPolar());
    assertEquals(DviPsColors.YELLOW, plot.getDotFillingCol());
    assertEquals(23.0, plot.getDiametre(), 0.0001);
    assertEquals(DotStyle.BAR, plot.getDotStyle());
    assertEquals(123.0, plot.getPlotMaxX(), 0.0001);
    assertEquals(-234.0, plot.getPlotMinX(), 0.0001);
    assertEquals(PlotStyle.ECURVE, plot.getPlotStyle());
    assertEquals(73, plot.getNbPlottedPoints());
}
Also used : Plot(net.sf.latexdraw.model.api.shape.Plot) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 12 with Plot

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

the class TestParsingPlotCommands method testPsplotXUnit.

@Test
public void testPsplotXUnit() {
    parser("\\psplot[xunit=0.1]{0}{720}{x sin}");
    final Plot plot = getShapeAt(0);
    assertEquals(0.1, plot.getXScale(), 0.00001);
}
Also used : Plot(net.sf.latexdraw.model.api.shape.Plot) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 13 with Plot

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

the class TestParsingPlotCommands method testPsplotPlotStyle.

@ParameterizedTest
@EnumSource(value = PlotStyle.class)
public void testPsplotPlotStyle(final PlotStyle style) {
    parser("\\psplot[plotstyle=" + style.getPSTToken() + "]{0}{720}{x sin}");
    final Plot plot = getShapeAt(0);
    assertEquals(style, plot.getPlotStyle());
}
Also used : Plot(net.sf.latexdraw.model.api.shape.Plot) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 14 with Plot

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

the class TestParsingPlotCommands method testPsplotPolar.

@Test
public void testPsplotPolar() {
    parser("\\psplot[polarplot=true]{0}{720}{x sin}");
    final Plot plot = getShapeAt(0);
    assertTrue(plot.isPolar());
}
Also used : Plot(net.sf.latexdraw.model.api.shape.Plot) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Plot (net.sf.latexdraw.model.api.shape.Plot)14 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)10 Test (org.junit.jupiter.api.Test)7 Test (org.junit.Test)3 HelperTest (net.sf.latexdraw.HelperTest)2 EnumSource (org.junit.jupiter.params.provider.EnumSource)2 Axes (net.sf.latexdraw.model.api.shape.Axes)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 Circle (net.sf.latexdraw.model.api.shape.Circle)1 CircleArc (net.sf.latexdraw.model.api.shape.CircleArc)1 Dot (net.sf.latexdraw.model.api.shape.Dot)1 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Grid (net.sf.latexdraw.model.api.shape.Grid)1 Polygon (net.sf.latexdraw.model.api.shape.Polygon)1 Polyline (net.sf.latexdraw.model.api.shape.Polyline)1 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)1 Rhombus (net.sf.latexdraw.model.api.shape.Rhombus)1 Square (net.sf.latexdraw.model.api.shape.Square)1 Text (net.sf.latexdraw.model.api.shape.Text)1