Search in sources :

Example 31 with Axes

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

the class TestParsingPsaxes method testParamDx.

@ParameterizedTest
@ValueSource(doubles = { 2d, 3.5 })
public void testParamDx(final double dx) {
    parser("\\psaxes[Dx=" + dx + "](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(dx, axes.getIncrementX(), 0.00001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 32 with Axes

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

the class TestParsingPsaxes method testOy.

@ParameterizedTest
@ValueSource(doubles = { 2d, 3.5 })
public void testOy(final double oy) {
    parser("\\psaxes[Oy=" + oy + "](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(oy, axes.getOriginY(), 0.00001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 33 with Axes

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

the class TestGroup method testSetAxesdistLabels.

@Test
public void testSetAxesdistLabels() {
    init4setAxes();
    final Point pt = ShapeFactory.INST.createPoint(13d, 14d);
    shape.setDistLabels(pt);
    shape.getShapes().stream().filter(sh -> sh instanceof Axes).map(sh -> (Axes) sh).forEach(sh -> assertEquals(pt, sh.getDistLabels()));
}
Also used : FillingStyle(net.sf.latexdraw.model.api.shape.FillingStyle) ShapeData(net.sf.latexdraw.data.ShapeData) BorderPos(net.sf.latexdraw.model.api.shape.BorderPos) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) RunWith(org.junit.runner.RunWith) Group(net.sf.latexdraw.model.api.shape.Group) ShapeFactory(net.sf.latexdraw.model.ShapeFactory) Dot(net.sf.latexdraw.model.api.shape.Dot) Shape(net.sf.latexdraw.model.api.shape.Shape) PlottingStyle(net.sf.latexdraw.model.api.shape.PlottingStyle) HelperTest(net.sf.latexdraw.HelperTest) DviPsColors(net.sf.latexdraw.view.latex.DviPsColors) Theories(org.junit.experimental.theories.Theories) AxesStyle(net.sf.latexdraw.model.api.shape.AxesStyle) LineStyle(net.sf.latexdraw.model.api.shape.LineStyle) TicksStyle(net.sf.latexdraw.model.api.shape.TicksStyle) Before(org.junit.Before) Theory(org.junit.experimental.theories.Theory) PSTricksConstants(net.sf.latexdraw.view.pst.PSTricksConstants) Axes(net.sf.latexdraw.model.api.shape.Axes) Assert.assertNotNull(org.junit.Assert.assertNotNull) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Assertions.within(org.assertj.core.api.Assertions.within) Point(net.sf.latexdraw.model.api.shape.Point) Assert.assertNull(org.junit.Assert.assertNull) Assert.assertFalse(org.junit.Assert.assertFalse) DotStyle(net.sf.latexdraw.model.api.shape.DotStyle) Collections(java.util.Collections) ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) Assert.assertEquals(org.junit.Assert.assertEquals) Rectangle(net.sf.latexdraw.model.api.shape.Rectangle) Axes(net.sf.latexdraw.model.api.shape.Axes) Point(net.sf.latexdraw.model.api.shape.Point) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 34 with Axes

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

the class TestGroup method init4setFill.

private void init4setFill() {
    final Axes sh2 = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint());
    final Shape sh1 = ShapeFactory.INST.createRectangle();
    final Shape sh1b = ShapeFactory.INST.createRectangle();
    shape.getShapes().add(sh2);
    shape.getShapes().add(sh1);
    shape.getShapes().add(sh1b);
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) Axes(net.sf.latexdraw.model.api.shape.Axes)

Example 35 with Axes

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

the class TestGroup method init4getAxes.

private Axes init4getAxes() {
    final Shape sh1 = ShapeFactory.INST.createRectangle();
    final Axes sh2 = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint());
    final Axes sh3 = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint());
    shape.getShapes().add(sh1);
    shape.getShapes().add(sh2);
    shape.getShapes().add(sh3);
    return sh2;
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) Axes(net.sf.latexdraw.model.api.shape.Axes)

Aggregations

Axes (net.sf.latexdraw.model.api.shape.Axes)40 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)28 Test (org.junit.Test)8 EnumSource (org.junit.jupiter.params.provider.EnumSource)8 MethodSource (org.junit.jupiter.params.provider.MethodSource)8 HelperTest (net.sf.latexdraw.HelperTest)7 ArrowableSingleShape (net.sf.latexdraw.model.api.shape.ArrowableSingleShape)7 ValueSource (org.junit.jupiter.params.provider.ValueSource)6 Shape (net.sf.latexdraw.model.api.shape.Shape)5 Test (org.junit.jupiter.api.Test)5 Dot (net.sf.latexdraw.model.api.shape.Dot)3 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)3 Collections (java.util.Collections)2 ShapeData (net.sf.latexdraw.data.ShapeData)2 ShapeFactory (net.sf.latexdraw.model.ShapeFactory)2 ArrowStyle (net.sf.latexdraw.model.api.shape.ArrowStyle)2 AxesStyle (net.sf.latexdraw.model.api.shape.AxesStyle)2 BorderPos (net.sf.latexdraw.model.api.shape.BorderPos)2 DotStyle (net.sf.latexdraw.model.api.shape.DotStyle)2 FillingStyle (net.sf.latexdraw.model.api.shape.FillingStyle)2