Examples of IShape


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

  }


  @Test
  public void testParamShadow() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow =true]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isShadowable()) {
      assertTrue(sh.hasShadow());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow  =false]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertFalse(sh.hasShadow());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true,shadow  =false]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertFalse(sh.hasShadow());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamshadowcolor() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowcolor =blue]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isShadowable()) {
      assertEquals(Color.BLUE, sh.getShadowCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowcolor=\\psfillcolor]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.WHITE, sh.getShadowCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowcolor=\\psfillcolor,shadowcolor=red]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.RED, sh.getShadowCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamDoublecolor() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublecolor =blue]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isDbleBorderable()) {
      assertEquals(Color.BLUE, sh.getDbleBordCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublecolor=\\psfillcolor]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.WHITE, sh.getDbleBordCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[doubleline=true, doublecolor=\\psfillcolor,doublecolor=red]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.RED, sh.getDbleBordCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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



  @Test
  public void testParamFillingcolor() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=solid, fillcolor =blue]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isFillable()) {
      assertEquals(Color.BLUE, sh.getFillingCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=solid, fillcolor=\\psfillcolor]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.WHITE, sh.getFillingCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=solid, fillcolor=\\psfillcolor,fillcolor=red]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.RED, sh.getFillingCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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



  @Test
  public void testParamGradbegin() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradbegin =blue]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(Color.BLUE, sh.getGradColStart());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradbegin=\\psfillcolor]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.WHITE, sh.getGradColStart());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradbegin=\\psfillcolor,gradbegin=red]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.RED, sh.getGradColStart());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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



  @Test
  public void testParamGradend() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradend =blue]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(Color.BLUE, sh.getGradColEnd());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradend=\\psfillcolor]"+getBasicCoordinates()).get().getShapeAt(0)//$NON-NLS-1$//$NON-NLS-2$
      assertEquals(Color.WHITE, sh.getGradColEnd());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradend=\\psfillcolor,gradend=red]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.RED, sh.getGradColEnd());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


  @Test
  public void testParamHatchcolor() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchcolor =blue]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertEquals(Color.BLUE, sh.getHatchingsCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchcolor=\\psfillcolor]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.WHITE, sh.getHatchingsCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines, hatchcolor=\\psfillcolor,hatchcolor=red]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Color.RED, sh.getHatchingsCol());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

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

  }


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

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


public abstract class TestParsingShape extends TestPSTParser {
  @Test
  public void testParamGradlines() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradlines=100]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isInteriorStylable()) {
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradlines=200]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient, gradlines=300]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertTrue(PSTParser.errorLogs().isEmpty());
View Full Code Here

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

  }


  @Test
  public void testParamShadowangle() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowangle=10]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isShadowable()) {
      assertEquals(Math.toRadians(10.), sh.getShadowAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowangle=20.]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(20.), sh.getShadowAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowangle=0.5]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(0.5), sh.getShadowAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowangle=+---123.1]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(-123.1), sh.getShadowAngle(), 0.00001);
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[shadow=true, shadowangle=10, shadowangle=-12]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(Math.toRadians(-12.), sh.getShadowAngle(), 0.00001);
      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.