Search in sources :

Example 11 with Axes

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

the class PolymorphArrowableTest method testArrowBracketParamsArr2.

@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowBracketParamsArr2(final ArrowableSingleShape sh, final ArrowStyle arr) {
    assumeTrue(arr.isSquareBracket());
    assumeFalse(sh instanceof Axes);
    sh.setArrowStyle(arr, 1);
    final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowBracket(sh.getArrowAt(1), s2.getArrowAt(1));
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 12 with Axes

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

the class PolymorphArrowableTest method testArrowBarParamsArr2.

@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowBarParamsArr2(final ArrowableSingleShape sh, final ArrowStyle arr) {
    assumeTrue(arr.isBar());
    assumeFalse(sh instanceof Axes);
    sh.setArrowStyle(ArrowStyle.ROUND_END, 0);
    sh.setArrowStyle(arr, 1);
    final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowBar(sh.getArrowAt(1), s2.getArrowAt(1));
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 13 with Axes

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

the class PolymorphArrowableTest method testArrowRBracketParamsArr2.

@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowRBracketParamsArr2(final ArrowableSingleShape sh, final ArrowStyle arr) {
    assumeTrue(arr.isRoundBracket());
    assumeFalse(sh instanceof Axes);
    sh.setArrowStyle(arr, 0);
    final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowRBracket(sh.getArrowAt(0), s2.getArrowAt(1));
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 14 with Axes

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

the class TestAxes method testDuplicate.

@Test
public void testDuplicate() {
    shape.setIncrementX(24);
    shape.setIncrementY(28);
    shape.setAxesStyle(AxesStyle.FRAME);
    shape.setTicksStyle(TicksStyle.BOTTOM);
    shape.setDistLabelsX(12);
    shape.setDistLabelsY(112);
    shape.setShowOrigin(false);
    shape.setTicksDisplayed(PlottingStyle.NONE);
    shape.setTicksSize(34);
    final Axes s2 = shape.duplicate();
    assertNotNull(s2);
    assertEqualsDouble(s2.getIncrementX(), shape.getIncrementX());
    assertEqualsDouble(s2.getIncrementY(), shape.getIncrementY());
    assertEquals(s2.getAxesStyle(), shape.getAxesStyle());
    assertEqualsDouble(s2.getTicksSize(), shape.getTicksSize());
    assertEquals(s2.getTicksDisplayed(), shape.getTicksDisplayed());
    assertEquals(s2.getTicksStyle(), shape.getTicksStyle());
    assertEqualsDouble(s2.getDistLabelsX(), shape.getDistLabelsX());
    assertEqualsDouble(s2.getDistLabelsY(), shape.getDistLabelsY());
    assertEquals(s2.isShowOrigin(), shape.isShowOrigin());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 15 with Axes

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

the class TestAxes method testConstructor3NotOKNAN0.

@Test
public void testConstructor3NotOKNAN0() {
    final Axes axes = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint(Double.NaN, 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)

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