Search in sources :

Example 16 with IPlot

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

the class TestParsingPlotCommands method testPsplotStar.

@Test
public void testPsplotStar() {
    parser("\\psplot*[plotpoints=200]{0}{720}{x sin}");
    IPlot plot = getShapeAt(0);
    assertEquals(0d, plot.getPlotMinX(), 0.00001);
    assertEquals(720d, plot.getPlotMaxX(), 0.00001);
    assertEquals("x sin", plot.getPlotEquation());
    assertEquals(FillingStyle.PLAIN, plot.getFillingStyle());
}
Also used : IPlot(net.sf.latexdraw.models.interfaces.shape.IPlot) Test(org.junit.Test)

Example 17 with IPlot

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

the class TestParsingPlotCommands method testPsplotXUnit.

@Test
public void testPsplotXUnit() {
    parser("\\psplot[xunit=0.1]{0}{720}{x sin}");
    IPlot plot = getShapeAt(0);
    assertEquals(0.1, plot.getXScale(), 0.00001);
}
Also used : IPlot(net.sf.latexdraw.models.interfaces.shape.IPlot) Test(org.junit.Test)

Example 18 with IPlot

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

the class TestIPlot method testCopy.

@Test
public void testCopy() {
    final IPlot shape2 = ShapeFactory.INST.createPlot(ShapeFactory.INST.createPoint(), 1d, 11d, "x 2 mul", false);
    shape2.setPlotEquation("2 x mul");
    shape2.setPolar(true);
    shape2.setNbPlottedPoints(73);
    shape2.setPlotStyle(PlotStyle.ECURVE);
    shape2.setPlotMinX(-234.0);
    shape2.setPlotMaxX(123.0);
    shape2.setDotStyle(DotStyle.BAR);
    shape2.setDiametre(23.0);
    shape2.setDotFillingCol(DviPsColors.YELLOW);
    shape.setPlotEquation("x");
    shape.copy(shape2);
    assertEquals("2 x mul", shape.getPlotEquation());
    assertTrue(shape.isPolar());
    assertEquals(DviPsColors.YELLOW, shape.getDotFillingCol());
    assertEquals(23.0, shape.getDiametre(), 0.0001);
    assertEquals(DotStyle.BAR, shape.getDotStyle());
    assertEquals(123.0, shape.getPlotMaxX(), 0.0001);
    assertEquals(-234.0, shape.getPlotMinX(), 0.0001);
    assertEquals(PlotStyle.ECURVE, shape.getPlotStyle());
    assertEquals(73, shape.getNbPlottedPoints());
}
Also used : IPlot(net.sf.latexdraw.models.interfaces.shape.IPlot) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 19 with IPlot

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

the class TestSVGPlot method testPlotParamsWithAllStyle.

@Theory
public void testPlotParamsWithAllStyle(@PlotData final IPlot sh, final PlotStyle style) {
    sh.setPlotStyle(style);
    final IPlot s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsPlot(sh, s2);
}
Also used : IPlot(net.sf.latexdraw.models.interfaces.shape.IPlot) Theory(org.junit.experimental.theories.Theory)

Aggregations

IPlot (net.sf.latexdraw.models.interfaces.shape.IPlot)19 Test (org.junit.Test)9 Theory (org.junit.experimental.theories.Theory)5 IText (net.sf.latexdraw.models.interfaces.shape.IText)4 Collections (java.util.Collections)3 ShapeFactory (net.sf.latexdraw.models.ShapeFactory)3 IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)3 List (java.util.List)2 Platform (javafx.application.Platform)2 Point2D (javafx.geometry.Point2D)2 KeyCode (javafx.scene.input.KeyCode)2 HelperTest (net.sf.latexdraw.HelperTest)2 IShape (net.sf.latexdraw.models.interfaces.shape.IShape)2 URL (java.net.URL)1 ArrayDeque (java.util.ArrayDeque)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Deque (java.util.Deque)1 Optional (java.util.Optional)1 ResourceBundle (java.util.ResourceBundle)1