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

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


  }


  @Test
  public void testNoneTbarEnd() throws ParseException {
    IPolyline line = (IPolyline)parser.parsePSTCode("\\psline{-|*}(1,1)").get().getShapeAt(0); //$NON-NLS-1$
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
    assertEquals(ArrowStyle.BAR_END, line.getArrowStyle(1));
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here


  }


  @Test
  public void testTbarEndNone() throws ParseException {
    IPolyline line = (IPolyline)parser.parsePSTCode("\\psline{|*-}(1,1)").get().getShapeAt(0); //$NON-NLS-1$
    assertEquals(ArrowStyle.BAR_END, line.getArrowStyle(0));
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(1));
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testNoneTbar() throws ParseException {
    IPolyline line = (IPolyline)parser.parsePSTCode("\\psline{-|}(1,1)").get().getShapeAt(0); //$NON-NLS-1$
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(0));
    assertEquals(ArrowStyle.BAR_IN, line.getArrowStyle(1));
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testTbarNone() throws ParseException {
    IPolyline line = (IPolyline)parser.parsePSTCode("\\psline{|-}(1,1)").get().getShapeAt(0); //$NON-NLS-1$
    assertEquals(ArrowStyle.BAR_IN, line.getArrowStyle(0));
    assertEquals(ArrowStyle.NONE, line.getArrowStyle(1));
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testPsCustomMustConsiderParametersCommand() throws ParseException {
    IPolyline line = (IPolyline)parser.parsePSTCode("\\"+getCommandName()+"[linewidth=10cm]{%\n\\psline(4,3)}").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(10.*IShape.PPC, line.getThickness(), 0.001);
    assertEquals(0, PSTParser.errorLogs().size());
  }
View Full Code Here

import org.junit.Test;

public class TestParsingQline extends TestPSTParser {
  @Test
  public void testCoordinatesCm() throws ParseException {
    IPolyline line =  (IPolyline)parser.parsePSTCode("\\"+getCommandName()+"(35cm,20cm)(11.12cm,-2cm)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(2, line.getNbPoints());
    assertEquals(35.*IShape.PPC, line.getPtAt(0).getX(), 0.001);
    assertEquals(20.*IShape.PPC*-1., line.getPtAt(0).getY(), 0.001);
    assertEquals(11.12*IShape.PPC, line.getPtAt(1).getX(), 0.001);
    assertEquals(-2.*IShape.PPC*-1., line.getPtAt(1).getY(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testNoDbleBord() throws ParseException {
    IPolyline line =  (IPolyline)parser.parsePSTCode("\\psset{doubleline=true}\\"+getCommandName()+"(35cm,20cm)(11.12cm,-2cm)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertFalse(line.hasDbleBord());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here



  @Test
  public void testNoShadow() throws ParseException {
    IPolyline line =  (IPolyline)parser.parsePSTCode("\\psset{shadow=true}\\"+getCommandName()+"(35cm,20cm)(11.12cm,-2cm)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertFalse(line.hasShadow());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testMustNotBeFilled() throws ParseException {
    IPolyline line =  (IPolyline)parser.parsePSTCode("\\"+getCommandName()+"(35cm,20cm)(11.12cm,-2cm)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(FillingStyle.NONE, line.getFillingStyle());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

      i++;
    }

    if(l1!=null && l2!=null)
      try {
        final IPolyline la = new LPolylinesSVGGenerator(l1, false).shape;
        final IPolyline lb = new LPolylinesSVGGenerator(l2, false).shape;

        shape.setPosition(ShapeFactory.createPoint(lb.getPtAt(0).getX(), la.getPtAt(0).getY()));
        shape.setLineStyle(la.getLineStyle());
        shape.getArrowAt(1).setArrowStyle(la.getArrowAt(0).getArrowStyle());
        shape.getArrowAt(3).setArrowStyle(la.getArrowAt(1).getArrowStyle());
        shape.getArrowAt(0).setArrowStyle(lb.getArrowAt(0).getArrowStyle());
        shape.getArrowAt(2).setArrowStyle(lb.getArrowAt(1).getArrowStyle());
      }
      catch(final IllegalArgumentException e) { BadaboomCollector.INSTANCE.add(e); }

    homogeniseArrows(shape.getArrowAt(0), shape.getArrowAt(1));
    homogeniseArrows(shape.getArrowAt(1), shape.getArrowAt(2));
View Full Code Here

TOP

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

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.