Examples of IGrid


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

  }


  @Test
  public void testGridLabelColor() throws ParseException {
    IGrid grid = (IGrid)parser.parsePSTCode("\\"+getCommandName()+"[gridlabelcolor=green]" +getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(Color.GREEN, grid.getGridLabelsColour());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


  @Test
  public void testGridColor() throws ParseException {
    IGrid grid = (IGrid)parser.parsePSTCode("\\"+getCommandName()+"[gridcolor=green]" +getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(Color.GREEN, grid.getLineColour());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


  @Test
  public void testGridWidth() throws ParseException {
    IGrid grid = (IGrid)parser.parsePSTCode("\\"+getCommandName()+"[gridwidth=1.3cm]" +getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(1.3*IShape.PPC, grid.getGridWidth(), 0.001);
    grid = (IGrid)parser.parsePSTCode("\\"+getCommandName()+"[gridwidth=.3in]" +getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(.3*IShape.PPC/PSTricksConstants.INCH_VAL_CM, grid.getGridWidth(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

    assertTrue(PSTParser.errorLogs().isEmpty());
  }

  @Test
  public void test0CoordDoubleValue() throws ParseException {
    IGrid grid = (IGrid)parser.parsePSTCode("\\begin{pspicture}(2.1,2.6)(5.6,5.5)\\"+getCommandName()+"\\end{pspicture}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$

    assertEquals(0., grid.getOriginX(), 0.0001);
    assertEquals(0., grid.getOriginY(), 0.0001);
    assertEquals(2., grid.getGridMinX(), 0.0001);
    assertEquals(3., grid.getGridMinY(), 0.0001);
    assertEquals(6., grid.getGridMaxX(), 0.0001);
    assertEquals(6., grid.getGridMaxY(), 0.0001);
    assertTrue(grid.isXLabelSouth());
    assertTrue(grid.isYLabelWest());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


  @Test
  public void test0Coord() throws ParseException {
    IGrid grid = (IGrid)parser.parsePSTCode("\\begin{pspicture}(2,2)(5,5)\\"+getCommandName()+"\\end{pspicture}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$

    assertEquals(0., grid.getOriginX(), 0.0001);
    assertEquals(0., grid.getOriginY(), 0.0001);
    assertEquals(2., grid.getGridMinX(), 0.0001);
    assertEquals(2., grid.getGridMinY(), 0.0001);
    assertEquals(5., grid.getGridMaxX(), 0.0001);
    assertEquals(5., grid.getGridMaxY(), 0.0001);
    assertTrue(grid.isXLabelSouth());
    assertTrue(grid.isYLabelWest());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


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

    assertEquals(0., grid.getOriginX(), 0.0001);
    assertEquals(0., grid.getOriginY(), 0.0001);
    assertEquals(0., grid.getGridMinX(), 0.0001);
    assertEquals(0., grid.getGridMinY(), 0.0001);
    assertEquals(1., grid.getGridMaxX(), 0.0001);
    assertEquals(2., grid.getGridMaxY(), 0.0001);
    assertTrue(grid.isXLabelSouth());
    assertTrue(grid.isYLabelWest());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


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

    assertEquals(3., grid.getOriginX(), 0.0001);
    assertEquals(4., grid.getOriginY(), 0.0001);
    assertEquals(1., grid.getGridMinX(), 0.0001);
    assertEquals(2., grid.getGridMinY(), 0.0001);
    assertEquals(3., grid.getGridMaxX(), 0.0001);
    assertEquals(4., grid.getGridMaxY(), 0.0001);
    assertFalse(grid.isXLabelSouth());
    assertFalse(grid.isYLabelWest());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


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

    assertEquals(1., grid.getOriginX(), 0.0001);
    assertEquals(2., grid.getOriginY(), 0.0001);
    assertEquals(1., grid.getGridMinX(), 0.0001);
    assertEquals(2., grid.getGridMinY(), 0.0001);
    assertEquals(3., grid.getGridMaxX(), 0.0001);
    assertEquals(4., grid.getGridMaxY(), 0.0001);
    assertTrue(grid.isXLabelSouth());
    assertTrue(grid.isYLabelWest());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


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

    assertEquals(0., grid.getOriginX(), 0.0001);
    assertEquals(-1., 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);
    assertFalse(grid.isXLabelSouth());
    assertFalse(grid.isYLabelWest());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

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

  }


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

    assertEquals(0., grid.getOriginX(), 0.0001);
    assertEquals(-1., 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(grid.isXLabelSouth());
    assertTrue(grid.isYLabelWest());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.