Search in sources :

Example 31 with IAxes

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

the class TestSVGArrowable method testArrowCircleDiskParamsArr1.

@Theory
public void testArrowCircleDiskParamsArr1(@ArrowableData(withParamVariants = true) final IArrowableSingleShape sh, final ArrowStyle arr1, final ArrowStyle arr2) {
    assumeTrue(arr1.isCircleDisk());
    assumeFalse(sh instanceof IAxes);
    sh.setArrowStyle(arr1, 0);
    sh.setArrowStyle(arr2, -1);
    final IArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowCircleDisk(sh.getArrowAt(0), s2.getArrowAt(0));
}
Also used : IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Theory(org.junit.experimental.theories.Theory)

Example 32 with IAxes

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

the class TestCanvasCreation method testDrawAxes.

@Test
public void testDrawAxes() {
    pencil.setCurrentChoice(EditionChoice.AXES);
    final Point2D pos = point(canvas).query();
    moveTo(pos).clickOn(MouseButton.PRIMARY).sleep(SLEEP);
    assertEquals(1, drawing.size());
    assertTrue(drawing.getShapeAt(0) instanceof IAxes);
    final IAxes sh = (IAxes) drawing.getShapeAt(0);
    assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getX(), sh.getPosition().getX(), 1d);
    assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getY(), sh.getPosition().getY(), 1d);
}
Also used : Point2D(javafx.geometry.Point2D) IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test)

Example 33 with IAxes

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

the class TestIAxes method testConstructor3NotOK0NAN.

@Test
public void testConstructor3NotOK0NAN() {
    IAxes 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 : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 34 with IAxes

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

the class TestIAxes method testConstructor3NotOKNAN0.

@Test
public void testConstructor3NotOKNAN0() {
    IAxes 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 : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 35 with IAxes

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

the class TestIAxes method testConstructor3NotOKINF0.

@Test
public void testConstructor3NotOKINF0() {
    IAxes 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 : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Aggregations

IAxes (net.sf.latexdraw.models.interfaces.shape.IAxes)50 Theory (org.junit.experimental.theories.Theory)28 Test (org.junit.Test)12 IArrowableSingleShape (net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape)10 HelperTest (net.sf.latexdraw.HelperTest)7 IShape (net.sf.latexdraw.models.interfaces.shape.IShape)5 PlottingStyle (net.sf.latexdraw.models.interfaces.shape.PlottingStyle)4 TicksStyle (net.sf.latexdraw.models.interfaces.shape.TicksStyle)4 IDot (net.sf.latexdraw.models.interfaces.shape.IDot)3 IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)3 IRectangle (net.sf.latexdraw.models.interfaces.shape.IRectangle)3 Collections (java.util.Collections)2 ShapeData (net.sf.latexdraw.data.ShapeData)2 ShapeFactory (net.sf.latexdraw.models.ShapeFactory)2 ArrowStyle (net.sf.latexdraw.models.interfaces.shape.ArrowStyle)2 AxesStyle (net.sf.latexdraw.models.interfaces.shape.AxesStyle)2 BorderPos (net.sf.latexdraw.models.interfaces.shape.BorderPos)2 DotStyle (net.sf.latexdraw.models.interfaces.shape.DotStyle)2 FillingStyle (net.sf.latexdraw.models.interfaces.shape.FillingStyle)2 IGroup (net.sf.latexdraw.models.interfaces.shape.IGroup)2