Package net.sf.latexdraw.glib.models.interfaces.shape

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IAxes


import org.junit.Test;

public class TestParsingPsaxes extends TestPSTParser {
  @Test public void testArrows() throws ParseException {
    final IAxes grid = (IAxes)parser.parsePSTCode("\\"+getCommandName()+"{|->}(0,0)(0,0)(3,4)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$

    assertEquals(grid.getArrowAt(0).getArrowStyle(), IArrow.ArrowStyle.BAR_IN);
    assertEquals(grid.getArrowAt(2).getArrowStyle(), IArrow.ArrowStyle.RIGHT_ARROW);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here


    assertTrue(PSTParser.errorLogs().isEmpty());
  }
 
 
  @Test public void test3Coord() throws ParseException {
    IAxes grid = (IAxes)parser.parsePSTCode("\\"+getCommandName()+"(0,0)(0,0)(3,4)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$

    assertEquals(0., grid.getOriginX(), 0.0001);
    assertEquals(0., grid.getOriginY(), 0.0001);
    assertEquals(0., grid.getGridStartX(), 0.0001);
    assertEquals(0., grid.getGridStartY(), 0.0001);
    assertEquals(3., grid.getGridEndX(), 0.0001);
    assertEquals(4., grid.getGridEndY(), 0.0001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

    assertEquals(4., grid.getGridEndY(), 0.0001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }

  @Test public void test3Coord2() throws ParseException {
    IAxes grid = (IAxes)parser.parsePSTCode("\\"+getCommandName()+"(0,0)(1,2)(3,4)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$

    assertEquals(0., grid.getOriginX(), 0.0001);
    assertEquals(0., grid.getOriginY(), 0.0001);
    assertEquals(1., grid.getGridStartX(), 0.0001);
    assertEquals(2., grid.getGridStartY(), 0.0001);
    assertEquals(3., grid.getGridEndX(), 0.0001);
    assertEquals(4., grid.getGridEndY(), 0.0001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testConstructor3() {
    IAxes axes = ShapeFactory.createAxes(ShapeFactory.createPoint(10, -20));

    assertNotNull(axes.getPtAt(0));
    HelperTest.assertEqualsDouble(10., axes.getPtAt(0).getX());
    HelperTest.assertEqualsDouble(-20., axes.getPtAt(0).getY());
    axes = ShapeFactory.createAxes(null);
    assertNotNull(axes.getPtAt(0));
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getX());
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getY());
    axes = ShapeFactory.createAxes(null);
    assertNotNull(axes.getPtAt(0));
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getX());
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getY());
    axes = ShapeFactory.createAxes(ShapeFactory.createPoint(Double.NaN, 0));
    assertNotNull(axes.getPtAt(0));
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getX());
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getY());
    axes = ShapeFactory.createAxes(ShapeFactory.createPoint(0, Double.NaN));
    assertNotNull(axes.getPtAt(0));
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getX());
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getY());
    axes = ShapeFactory.createAxes(ShapeFactory.createPoint(Double.POSITIVE_INFINITY, 0));
    assertNotNull(axes.getPtAt(0));
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getX());
    HelperTest.assertEqualsDouble(0., axes.getPtAt(0).getY());
  }
View Full Code Here

    shape.setDistLabelsY(112);
    shape.setShowOrigin(false);
    shape.setTicksDisplayed(PlottingStyle.NONE);
    shape.setTicksSize(34);

    IAxes s2 = (IAxes)shape.duplicate();

    assertNotNull(s2);
    HelperTest.assertEqualsDouble(s2.getIncrementX(), shape.getIncrementX());
    HelperTest.assertEqualsDouble(s2.getIncrementY(), shape.getIncrementY());
    assertEquals(s2.getAxesStyle(), shape.getAxesStyle());
    HelperTest.assertEqualsDouble(s2.getTicksSize(), shape.getTicksSize());
    assertEquals(s2.getTicksDisplayed(), shape.getTicksDisplayed());
    assertEquals(s2.getTicksStyle(), shape.getTicksStyle());
    HelperTest.assertEqualsDouble(s2.getDistLabelsX(), shape.getDistLabelsX());
    HelperTest.assertEqualsDouble(s2.getDistLabelsY(), shape.getDistLabelsY());
    assertEquals(s2.isShowOrigin(), shape.isShowOrigin());
  }
View Full Code Here

TOP

Related Classes of net.sf.latexdraw.glib.models.interfaces.shape.IAxes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.