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

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


  }


  @Test
  public void testParamHatchangle() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=10]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(Math.toRadians(10.), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=20.]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(20.), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=0.5]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(0.5), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=+---123.1]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(-123.1), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchangle=10, hatchangle=-12]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(-12.), sh.getHatchingsAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here


  }


  @Test
  public void testParamHatchsep() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(0.2*IShape.PPC, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchsep=2mm, hatchsep=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getHatchingsSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

  }


  @Test
  public void testParamHatchwidth() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(0.2*IShape.PPC, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchwidth=2mm, hatchwidth=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getHatchingsWidth(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

  }


  @Test
  public void testParamDoublesep() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isDbleBorderable()) {
      assertEquals(0.2*IShape.PPC, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublesep=2mm, doublesep=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getDbleBordSep(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

  }


  @Test
  public void testParamShadowsize() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isShadowable()) {
      assertEquals(0.2*IShape.PPC, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowsize=2mm, shadowsize=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getShadowSize(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

  }


  @Test
  public void testParamLinewidth() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.2]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isThicknessable()) {
      assertEquals(0.2*IShape.PPC, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.2cm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=2mm]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.2*IShape.PPC, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.1in]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.INCH_VAL_CM, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[linewidth=0.2, linewidth=0.1pt]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(0.1*IShape.PPC/PSTricksConstants.CM_VAL_PT, sh.getThickness(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

  }


  @Test
  public void testStarFillsShape() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"*"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue(sh.isFilled());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testStarBorderPosOuter() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"*["+"dimen=inner]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    if(sh.isBordersMovable()) {
      assertEquals(BorderPos.INTO, sh.getBordersPosition());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here



  @Test
  public void testStarHasNoLineStyle() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"*["+"linestyle=dashed]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    if(sh.isLineStylable()) {
      assertEquals(LineStyle.SOLID, sh.getLineStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here



  @Test
  public void testStarHasNoDoubleBorder() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"*["+"doubleline=true]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    if(sh.isDbleBorderable()) {
      assertFalse(sh.hasDbleBord());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

TOP

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

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.