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

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


  }


  @Test
  public void testStarFillingParametershaveNoEffect() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"*["+"fillstyle=gradient]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertEquals(FillingStyle.PLAIN, sh.getFillingStyle());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here


  }


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

  }


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



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



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



  @Test
  public void testParamFillingStyle() throws ParseException {
    IShape sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle =gradient]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    if(sh.isFillable()) {
      assertTrue(sh.hasGradient());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$
      assertFalse(sh.isFilled());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.CLINES, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=clines*]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.CLINES_PLAIN, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=hlines*]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.HLINES_PLAIN, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=hlines]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.HLINES, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=vlines*]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.VLINES_PLAIN, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=vlines]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.VLINES, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=none]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.NONE, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=gradient,fillstyle=clines]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.CLINES, sh.getFillingStyle());
      assertTrue(PSTParser.errorLogs().isEmpty());
      sh = parser.parsePSTCode("\\"+getCommandName()+"[fillstyle=solid]"+getBasicCoordinates()).get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals(FillingStyle.PLAIN, sh.getFillingStyle());
      assertTrue(sh.isFilled());
      assertTrue(PSTParser.errorLogs().isEmpty());
    }
  }
View Full Code Here

  }


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

  }


  @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

  }


  @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

  }


  @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

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.