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());
}
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);
}
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());
}
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);
}
Aggregations