Examples of SVGPathElement


Examples of net.sf.latexdraw.parsers.svg.SVGPathElement

    root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE+':'+LNamespace.XML_TYPE, LNamespace.XML_TYPE_BEZIER_CURVE);
    root.setAttribute(SVGAttributes.SVG_ID, getSVGID());

         if(shape.hasShadow()) {
           final SVGElement shad = new SVGPathElement(doc);

      shad.setAttribute(SVGAttributes.SVG_D, path);
      setSVGShadowAttributes(shad, false);
      root.appendChild(shad);

      if(!shape.isClosed()) {
        setSVGArrow(shape, shad, 0, true, doc, defs);
        setSVGArrow(shape, shad, 1, true, doc, defs);
      }
    }

        if(shape.hasShadow() && !shape.getLineStyle().getLatexToken().equals(PSTricksConstants.LINE_NONE_STYLE) && shape.isFilled()) {
          // The background of the borders must be filled is there is a shadow.
        elt = new SVGPathElement(doc);
        elt.setAttribute(SVGAttributes.SVG_D, path);
        setSVGBorderBackground(elt, root);
        }

    elt = new SVGPathElement(doc);
    elt.setAttribute(SVGAttributes.SVG_D, path);
    root.appendChild(elt);

    if(shape.hasDbleBord()) {
      final SVGElement dblBord = new SVGPathElement(doc);
      dblBord.setAttribute(SVGAttributes.SVG_D, path);
      setSVGDoubleBordersAttributes(dblBord);
      root.appendChild(dblBord);
    }

    setSVGAttributes(doc, elt, false);
View Full Code Here

Examples of net.sf.latexdraw.parsers.svg.SVGPathElement

    final SVGElement elt2 = getLaTeXDrawElement(elt, null);

    if(elt==null || elt2==null || !(elt2 instanceof SVGPathElement))
      throw new IllegalArgumentException();

    final SVGPathElement main = (SVGPathElement)elt2;
    String v = elt.getAttribute(LNamespace.LATEXDRAW_NAMESPACE+':'+LNamespace.XML_INTERVAL);

    if(v!=null)
      try{ shape.setInterval(Double.valueOf(v).intValue()); }
    catch(final NumberFormatException ex) { BadaboomCollector.INSTANCE.add(ex); }
View Full Code Here

Examples of net.sf.latexdraw.parsers.svg.SVGPathElement

        pts.append(shape.getPtAt(i).getX()).append(' ').append(shape.getPtAt(i).getY()).append(' ');

    root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_POINTS, pts.toString());

    if(shape.hasShadow()) {
      final SVGElement shad = new SVGPathElement(doc);
      shad.setAttribute(SVGAttributes.SVG_D, path);
      setSVGShadowAttributes(shad, false);
      root.appendChild(shad);
    }

        if(shape.hasShadow() && shape.getLineStyle()!=LineStyle.NONE && shape.isFilled())
        {// The background of the borders must be filled is there is a shadow.
        elt = new SVGPathElement(doc);
        elt.setAttribute(SVGAttributes.SVG_D, path);
        setSVGBorderBackground(elt, root);
        }

    elt = new SVGPathElement(doc);
    elt.setAttribute(SVGAttributes.SVG_D, path);
    root.appendChild(elt);

    setSVGAttributes(doc, elt, false);
    elt.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_ROTATION, String.valueOf(shape.getRotationAngle()));
View Full Code Here

Examples of net.sf.latexdraw.parsers.svg.SVGPathElement

  @Override
  public void parse() throws ParseException {
    final PathIterator pi     = shape.getPathIterator(null);
    final double[] coords       = new double[6];
    final SVGPathSegList list   = new SVGPathSegList();
    element           = new SVGPathElement(document);

    while(!pi.isDone()) {
      switch(pi.currentSegment(coords)) {
        case PathIterator.SEG_CLOSE  : list.add(new SVGPathSegClosePath()); break;
        case PathIterator.SEG_LINETO: list.add(new SVGPathSegLineto(coords[0], coords[1], false)); break;
View Full Code Here

Examples of net.sf.latexdraw.parsers.svg.SVGPathElement

    if(sh==null) return ;
    if(sh instanceof Path2D) {
      final Path2D2SVGPath parser = new Path2D2SVGPath((Path2D)sh, document);
      try{
        parser.parse();
        final SVGPathElement shapeElt = parser.getSVGElement();

        if(lastPathPainted!=null && fill!=lastPathPaintedFilled && shapeElt.getPathData().equals(lastPathPainted.getPathData())) {
          setShapeAttributes(lastPathPainted, fill, draw);
          // The shape was both filled and painted so the optimisation ends.
          lastPathPainted = null;
        }else {
          setShapeAttributes(shapeElt, fill, draw);
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.