Search in sources :

Example 41 with IAxes

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

the class TestParsingPsaxes method testParse3Coord.

@Test
public void testParse3Coord() {
    parser("\\psaxes(0,0)(0,0)(3,4)");
    final IAxes axes = getShapeAt(0);
    assertEquals(0d, axes.getOriginX(), 0.0001);
    assertEquals(0d, axes.getOriginY(), 0.0001);
    assertEquals(0d, axes.getGridStartX(), 0.0001);
    assertEquals(0d, axes.getGridStartY(), 0.0001);
    assertEquals(3d, axes.getGridEndX(), 0.0001);
    assertEquals(4d, axes.getGridEndY(), 0.0001);
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test)

Example 42 with IAxes

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

the class TestParsingPsaxes method testParamDY.

@Theory
public void testParamDY(@DoubleData(vals = { 2d, 3.5 }) final double dy) {
    parser("\\psaxes[Dy=" + dy + "](0,0)(0,0)(2,2)");
    final IAxes axes = getShapeAt(0);
    assertEquals(dy, axes.getIncrementY(), 0.00001);
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Theory(org.junit.experimental.theories.Theory)

Example 43 with IAxes

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

the class TestParsingPsaxes method testParse1Coord.

@Test
public void testParse1Coord() {
    parser("\\psaxes(1,2)");
    final IAxes axes = getShapeAt(0);
    assertEquals(0d, axes.getOriginX(), 0.0001);
    assertEquals(0d, axes.getOriginY(), 0.0001);
    assertEquals(0d, axes.getGridMinX(), 0.0001);
    assertEquals(0d, axes.getGridMinY(), 0.0001);
    assertEquals(1d, axes.getGridMaxX(), 0.0001);
    assertEquals(2d, axes.getGridMaxY(), 0.0001);
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test)

Example 44 with IAxes

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

the class TestIGroup method init4setAxes.

private void init4setAxes() {
    IShape sh1 = ShapeFactory.INST.createRectangle();
    IAxes sh2 = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint());
    IShape sh1b = ShapeFactory.INST.createRectangle();
    IAxes 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 : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) IShape(net.sf.latexdraw.models.interfaces.shape.IShape)

Example 45 with IAxes

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

the class TestIGroup method init4setFill.

private void init4setFill() {
    IAxes sh2 = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint());
    IShape sh1 = ShapeFactory.INST.createRectangle();
    IShape sh1b = ShapeFactory.INST.createRectangle();
    shape.getShapes().add(sh2);
    shape.getShapes().add(sh1);
    shape.getShapes().add(sh1b);
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) IShape(net.sf.latexdraw.models.interfaces.shape.IShape)

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