Search in sources :

Example 36 with Axes

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

the class TestGroup method testSetAxesIncrement.

@Test
public void testSetAxesIncrement() {
    init4setAxes();
    final Point pt = ShapeFactory.INST.createPoint(13d, 14d);
    shape.setIncrement(pt);
    shape.getShapes().stream().filter(sh -> sh instanceof Axes).map(sh -> (Axes) sh).forEach(sh -> assertEquals(pt, sh.getIncrement()));
}
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 37 with Axes

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

the class TestGroup method init4setAxes.

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

Example 38 with Axes

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

the class TestAxes method testConstructor3NotOKINF0.

@Test
public void testConstructor3NotOKINF0() {
    final Axes axes = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint(Double.POSITIVE_INFINITY, 0));
    assertNotNull(axes.getPtAt(0));
    assertEqualsDouble(0d, axes.getPtAt(0).getX());
    assertEqualsDouble(0d, axes.getPtAt(0).getY());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 39 with Axes

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

the class TestAxes method testConstructor3NotOK0NAN.

@Test
public void testConstructor3NotOK0NAN() {
    final Axes axes = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint(0, Double.NaN));
    assertNotNull(axes.getPtAt(0));
    assertEqualsDouble(0d, axes.getPtAt(0).getX());
    assertEqualsDouble(0d, axes.getPtAt(0).getY());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 40 with Axes

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

the class TestAxes method testConstructor3OK.

@Test
public void testConstructor3OK() {
    final Axes axes = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint(10, -20));
    assertNotNull(axes.getPtAt(0));
    assertEqualsDouble(10d, axes.getPtAt(0).getX());
    assertEqualsDouble(-20d, axes.getPtAt(0).getY());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

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