Package net.sf.latexdraw.parsers.svg

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


    final double blackDash    = shape.getDashSepBlack();
    final double whiteDash    = shape.getDashSepWhite();
    final boolean hasDble     = shape.hasDbleBord();
    final Color col           = shape.getLineColour();
    final boolean isClosed    = shape.isClosed();
    final SVGGElement showPts = new SVGGElement(doc);
    final IArrow arrow1     = shape.getArrowAt(0);
    final IArrow arrow2     = shape.getArrowAt(-1);
    final double doubleSep = shape.getDbleBordSep();
    final double thick = (hasDble ? shape.getDbleBordSep()+shape.getThickness()*2. : shape.getThickness())/2.;
    final double rad   = (PSTricksConstants.DEFAULT_ARROW_DOTSIZE_DIM*IShape.PPC + PSTricksConstants.DEFAULT_ARROW_DOTSIZE_NUM*thick*2.)/2.;
    int i;
        final int size = shape.getNbPoints();

        showPts.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_TYPE, LNamespace.XML_TYPE_SHOW_PTS);

    /* Plotting the lines. */
    for(i=3; i<size; i+=2) {
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getPtAt(i-1), shape.getSecondCtrlPtAt(i-1),
                blackDash, whiteDash, hasDble, 1., doubleSep));
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getSecondCtrlPtAt(i-1), shape.getFirstCtrlPtAt(i),
                  blackDash, whiteDash, hasDble, 1., doubleSep));
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getFirstCtrlPtAt(i), shape.getPtAt(i),
                  blackDash, whiteDash, hasDble, 1., doubleSep));
    }

    for(i=2; i<size; i+=2) {
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getPtAt(i-1), shape.getSecondCtrlPtAt(i-1),
                blackDash, whiteDash, hasDble, 1., doubleSep));
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getSecondCtrlPtAt(i-1), shape.getFirstCtrlPtAt(i),
                  blackDash, whiteDash, hasDble, 1., doubleSep));
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getFirstCtrlPtAt(i), shape.getPtAt(i),
                  blackDash, whiteDash, hasDble, 1., doubleSep));
    }

    if(isClosed) {
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getPtAt(-1), shape.getSecondCtrlPtAt(-1),
                blackDash, whiteDash, hasDble, 1., doubleSep));
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getSecondCtrlPtAt(-1), shape.getSecondCtrlPtAt(0),
                  blackDash, whiteDash, hasDble, 1., doubleSep));
      showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getSecondCtrlPtAt(0), shape.getPtAt(0),
                  blackDash, whiteDash, hasDble, 1., doubleSep));
    }

    showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getPtAt(0), shape.getFirstCtrlPtAt(0),
              blackDash, whiteDash, hasDble, 1., doubleSep));
    showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getFirstCtrlPtAt(0), shape.getFirstCtrlPtAt(1),
              blackDash, whiteDash, hasDble, 1., doubleSep));
    showPts.appendChild(getShowPointsLine(doc, thick, col, shape.getFirstCtrlPtAt(1), shape.getPtAt(1),
              blackDash, whiteDash, hasDble, 1., doubleSep));

    // Plotting the dots.
    if(!arrow1.hasStyle() || isClosed)
      showPts.appendChild(LShapeSVGGenerator.getShowPointsDot(doc, rad, shape.getPtAt(0), col));

    if(!arrow2.hasStyle() || isClosed)
      showPts.appendChild(LShapeSVGGenerator.getShowPointsDot(doc, rad, shape.getPtAt(-1), col));

    for(i=1; i<size-1; i++) {
      showPts.appendChild(LShapeSVGGenerator.getShowPointsDot(doc, rad, shape.getPtAt(i), col));
      showPts.appendChild(LShapeSVGGenerator.getShowPointsDot(doc, rad, shape.getSecondCtrlPtAt(i), col));
    }

    for(i=0; i<size; i++)
      showPts.appendChild(LShapeSVGGenerator.getShowPointsDot(doc, rad, shape.getFirstCtrlPtAt(i), col));

    if(isClosed) {
      showPts.appendChild(LShapeSVGGenerator.getShowPointsDot(doc, rad, shape.getSecondCtrlPtAt(-1), col));
      showPts.appendChild(LShapeSVGGenerator.getShowPointsDot(doc, rad, shape.getSecondCtrlPtAt(0), col));
    }

    return showPts;
  }
View Full Code Here


                    final double minY, final double maxY, final int subGridDots, final double subGridWidth,
                    final double tlx, final double tly, final double brx, final double bry, final Color subGridColour) {
    final double dotStep = unit*IShape.PPC/(subGridDots*subGridDiv);
    final double nbX = (maxX-minX)*subGridDiv;
    final double nbY = (maxY-minY)*subGridDiv;
    final SVGElement subgridDots = new SVGGElement(document);
    SVGElement dot;

    subgridDots.setAttribute(SVGAttributes.SVG_FILL, CSSColors.INSTANCE.getColorName(subGridColour, true));
    subgridDots.setAttribute(prefix+LNamespace.XML_TYPE, LNamespace.XML_TYPE_GRID_SUB);
    subgridDots.setAttribute(prefix+LNamespace.XML_GRID_DOTS, String.valueOf(subGridDots));
    subgridDots.setAttribute(prefix+LNamespace.XML_GRID_SUB_DIV, String.valueOf(subGridDots));
    subgridDots.setAttribute(prefix+LNamespace.XML_GRID_WIDTH, String.valueOf(subGridWidth));

    for(double i=0, n=tlx; i<nbX; i++, n+=xSubStep)
      for(double j=0, m=tly; j<=nbY; j++, m+=ySubStep)
        for(double k=0; k<subGridDots; k++) {
          dot = new SVGCircleElement(document);
          dot.setAttribute(SVGAttributes.SVG_CX, String.valueOf(n+k*dotStep));
          dot.setAttribute(SVGAttributes.SVG_CY, String.valueOf(m));
          dot.setAttribute(SVGAttributes.SVG_R, String.valueOf(subGridWidth/2.));
          subgridDots.appendChild(dot);
        }

    for(double j=0, n=tly; j<nbY; j++, n+=ySubStep)
      for(double i=0, m=tlx; i<=nbX; i++, m+=xSubStep)
        for(double k=0; k<subGridDots; k++) {
          dot = new SVGCircleElement(document);
          dot.setAttribute(SVGAttributes.SVG_CX, String.valueOf(m));
          dot.setAttribute(SVGAttributes.SVG_CY, String.valueOf(n+k*dotStep));
          dot.setAttribute(SVGAttributes.SVG_R, String.valueOf(subGridWidth/2.));
          subgridDots.appendChild(dot);
        }

    dot = new SVGCircleElement(document);
    dot.setAttribute(SVGAttributes.SVG_CX, String.valueOf(brx));
    dot.setAttribute(SVGAttributes.SVG_CY, String.valueOf(bry));
View Full Code Here

                    final double tlx, final double tly, final double brx, final double bry, final Color subGridColour,
                    final double posX, final double posY, final double xStep, final double yStep) {
    double i;
    double j;
    double k;
    final SVGElement subgrids = new SVGGElement(document);
    SVGElement line;

    subgrids.setAttribute(SVGAttributes.SVG_STROKE_WIDTH, String.valueOf(subGridWidth));
    subgrids.setAttribute(SVGAttributes.SVG_STROKE, CSSColors.INSTANCE.getColorName(subGridColour, true));
    subgrids.setAttribute(SVGAttributes.SVG_STROKE_LINECAP, SVGAttributes.SVG_LINECAP_VALUE_ROUND);
    subgrids.setAttribute(prefix+LNamespace.XML_TYPE, LNamespace.XML_TYPE_GRID_SUB);
    subgrids.setAttribute(prefix+LNamespace.XML_GRID_DOTS, String.valueOf(subGridDots));
    subgrids.setAttribute(prefix+LNamespace.XML_GRID_SUB_DIV, String.valueOf(subGridDiv));

    for(k=minX, i=posX; k<maxX; i+=xStep, k++)
      for(j=0; j<=subGridDiv; j++) {
        line = new SVGLineElement(document);
        line.setAttribute(SVGAttributes.SVG_X1, String.valueOf(i+xSubStep*j));
        line.setAttribute(SVGAttributes.SVG_X2, String.valueOf(i+xSubStep*j));
        line.setAttribute(SVGAttributes.SVG_Y1, String.valueOf(bry));
        line.setAttribute(SVGAttributes.SVG_Y2, String.valueOf(tly));
        subgrids.appendChild(line);
      }

    for(k=minY, i=posY; k<maxY; i-=yStep, k++)
      for(j=0; j<=subGridDiv; j++) {
        line = new SVGLineElement(document);
        line.setAttribute(SVGAttributes.SVG_X1, String.valueOf(tlx));
        line.setAttribute(SVGAttributes.SVG_X2, String.valueOf(brx));
        line.setAttribute(SVGAttributes.SVG_Y1, String.valueOf(i-ySubStep*j));
        line.setAttribute(SVGAttributes.SVG_Y2, String.valueOf(i-ySubStep*j));
        subgrids.appendChild(line);
      }

    elt.appendChild(subgrids);
  }
 
View Full Code Here

    double n;
    double l;
    double j;
    final int gridDots = shape.getGridDots();
    final double dotStep = unit*IShape.PPC/gridDots;
    final SVGElement gridDotsElt = new SVGGElement(document);
    SVGElement dot;

    gridDotsElt.setAttribute(SVGAttributes.SVG_FILL, CSSColors.INSTANCE.getColorName(linesColour, true));
    gridDotsElt.setAttribute(prefix+LNamespace.XML_TYPE, LNamespace.XML_TYPE_GRID);
    gridDotsElt.setAttribute(prefix+LNamespace.XML_GRID_DOTS, String.valueOf(gridDots));
    gridDotsElt.setAttribute(prefix+LNamespace.XML_GRID_WIDTH, String.valueOf(gridWidth));

    for(k=minX, i=posX; k<=maxX; i+=xStep, k++)
      for(m=tly, n=minY; n<maxY; n++, m+=absStep)
        for(l=0, j=m; l<gridDots; l++, j+=dotStep) {
          dot = new SVGCircleElement(document);
          dot.setAttribute(SVGAttributes.SVG_CX, String.valueOf(i));
          dot.setAttribute(SVGAttributes.SVG_CY, String.valueOf(j));
          dot.setAttribute(SVGAttributes.SVG_R, String.valueOf(gridWidth/2.));
          gridDotsElt.appendChild(dot);
        }

    for(k=minY, i=posY; k<=maxY; i-=yStep, k++)
      for(m=tlx, n=minX; n<maxX; n++, m+=absStep)
        for(l=0, j=m; l<gridDots; l++, j+=dotStep) {
          dot = new SVGCircleElement(document);
          dot.setAttribute(SVGAttributes.SVG_CX, String.valueOf(j));
          dot.setAttribute(SVGAttributes.SVG_CY, String.valueOf(i));
          dot.setAttribute(SVGAttributes.SVG_R, String.valueOf(gridWidth/2.));
          gridDotsElt.appendChild(dot);
        }

    dot = new SVGCircleElement(document);
    dot.setAttribute(SVGAttributes.SVG_CX, String.valueOf(brx));
    dot.setAttribute(SVGAttributes.SVG_CY, String.valueOf(bry));
    dot.setAttribute(SVGAttributes.SVG_R, String.valueOf(gridWidth/2.));
    gridDotsElt.appendChild(dot);

    elt.appendChild(gridDotsElt);
  }
View Full Code Here

  private void createSVGGridDiv(final SVGDocument document, final SVGElement elt, final String prefix, final double minX, final double maxX,
                  final double minY, final double maxY, final double tlx, final double tly, final double brx, final double bry,
                  final double posX, final double posY, final double xStep, final double yStep, final double gridWidth, final Color linesColour) {
    double k;
    double i;
    final SVGElement grids = new SVGGElement(document);
    SVGElement line;

    grids.setAttribute(SVGAttributes.SVG_STROKE_WIDTH, String.valueOf(gridWidth));
    grids.setAttribute(SVGAttributes.SVG_STROKE, CSSColors.INSTANCE.getColorName(linesColour, true));
    grids.setAttribute(SVGAttributes.SVG_STROKE_LINECAP, SVGAttributes.SVG_LINECAP_VALUE_SQUARE);
    grids.setAttribute(prefix+LNamespace.XML_TYPE, LNamespace.XML_TYPE_GRID);

    for(k=minX, i=posX; k<=maxX; i+=xStep, k++) {
      line = new SVGLineElement(document);
      line.setAttribute(SVGAttributes.SVG_X1, String.valueOf(i));
      line.setAttribute(SVGAttributes.SVG_X2, String.valueOf(i));
      line.setAttribute(SVGAttributes.SVG_Y1, String.valueOf(bry));
      line.setAttribute(SVGAttributes.SVG_Y2, String.valueOf(tly));
      grids.appendChild(line);
    }

    for(k=minY, i=posY; k<=maxY; i-=yStep, k++) {
      line = new SVGLineElement(document);
      line.setAttribute(SVGAttributes.SVG_X1, String.valueOf(tlx));
      line.setAttribute(SVGAttributes.SVG_X2, String.valueOf(brx));
      line.setAttribute(SVGAttributes.SVG_Y1, String.valueOf(i));
      line.setAttribute(SVGAttributes.SVG_Y2, String.valueOf(i));
      grids.appendChild(line);
    }

    elt.appendChild(grids);
  }
View Full Code Here

    final float labelWidth     = fontMetrics.stringWidth(String.valueOf((int)maxX));
    final double xorigin = xStep*originX;
    final double yorigin = isXLabelSouth  ? yStep*originY+labelHeight : yStep*originY-2;
    final double width=gridWidth/2.;
    final double tmp = isXLabelSouth ? width : -width;
    final SVGElement texts = new SVGGElement(document);
    SVGElement text;
    String label;
    double i;
    double j;

    texts.setAttribute(SVGAttributes.SVG_FONT_SIZE, String.valueOf(shape.getLabelsSize()));
    texts.setAttribute(SVGAttributes.SVG_STROKE, CSSColors.INSTANCE.getColorName(gridLabelsColor, true));
    texts.setAttribute(prefix+LNamespace.XML_TYPE, LNamespace.XML_TYPE_TEXT);

    for(i=tlx + (isYLabelWest ? width+gridLabelsSize/4. : -width-labelWidth-gridLabelsSize/4.), j=minX; j<=maxX; i+=absStep, j++) {
      text = new SVGTextElement(document);
      text.setAttribute(SVGAttributes.SVG_X, String.valueOf((int)i));
      text.setAttribute(SVGAttributes.SVG_Y, String.valueOf((int)(yorigin+tmp)));
      text.setTextContent(String.valueOf((int)j));
      texts.appendChild(text);
    }

    if(isYLabelWest)
      for(i=tly + (isXLabelSouth ? -width-gridLabelsSize/4. : width+labelHeight), j=maxY ; j>=minY; i+=absStep, j--) {
        label = String.valueOf((int)j);
        text = new SVGTextElement(document);
        text.setAttribute(SVGAttributes.SVG_X, String.valueOf((int)(xorigin-fontMetrics.stringWidth(label)-gridLabelsSize/4.-width)));
        text.setAttribute(SVGAttributes.SVG_Y, String.valueOf((int)i));
        text.setTextContent(label);
        texts.appendChild(text);
      }
    else
      for(i=tly + (isXLabelSouth ? -width-gridLabelsSize/4. : width+labelHeight), j=maxY; j>=minY; i+=absStep, j--) {
        label = String.valueOf((int)j);
        text = new SVGTextElement(document);
        text.setAttribute(SVGAttributes.SVG_X, String.valueOf((int)(xorigin+gridLabelsSize/4.+width)));
        text.setAttribute(SVGAttributes.SVG_Y, String.valueOf((int)i));
        text.setTextContent(label);
        texts.appendChild(text);
      }

    elt.appendChild(texts);
  }
View Full Code Here

  public SVGElement toSVG(final SVGDocument doc) {
    if(doc==null)
      return null;

    final String prefix   = LNamespace.LATEXDRAW_NAMESPACE+':';
    final SVGElement root = new SVGGElement(doc);

    root.setAttribute(SVGAttributes.SVG_ID, getSVGID());
    root.setAttribute(prefix+LNamespace.XML_TYPE, LNamespace.XML_TYPE_GRID);
    root.setAttribute(prefix+LNamespace.XML_GRID_X_SOUTH, String.valueOf(shape.isXLabelSouth()));
    root.setAttribute(prefix+LNamespace.XML_GRID_Y_WEST, String.valueOf(shape.isYLabelWest()));
    root.setAttribute(prefix+LNamespace.XML_GRID_UNIT, String.valueOf(shape.getUnit()));
    root.setAttribute(prefix+LNamespace.XML_GRID_END, shape.getGridEndX() + " " + shape.getGridEndY());//$NON-NLS-1$
    root.setAttribute(prefix+LNamespace.XML_GRID_START, shape.getGridStartX() + " " + shape.getGridStartY());//$NON-NLS-1$
    root.setAttribute(prefix+LNamespace.XML_GRID_ORIGIN, shape.getOriginX() + " " + shape.getOriginY());//$NON-NLS-1$
    createSVGGrid(root, doc);
    setSVGRotationAttribute(root);

    return root;
  }
View Full Code Here

  @Override
  public SVGElement toSVG(final SVGDocument doc) {
    if(doc==null || doc.getFirstChild().getDefs()==null)
      return null;

    final SVGElement root = new SVGGElement(doc);
        SVGElement elt;
        root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE+':'+LNamespace.XML_TYPE, LNamespace.XML_TYPE_TRIANGLE);
    root.setAttribute(SVGAttributes.SVG_ID, getSVGID());
      final double gap     = getPositionGap()/2.;
      final IPoint pt1     = shape.getTopLeftPoint();
      final IPoint pt2     = shape.getBottomRightPoint();
    final IPoint p1     = ShapeFactory.createPoint((pt1.getX()+pt2.getX())/2., pt1.getY());
    final IPoint p2     = ShapeFactory.createPoint(pt2.getX(), pt2.getY());
    final IPoint p3     = ShapeFactory.createPoint(pt1.getX(), pt2.getY());
      final double p1x = p1.getX();
      final double p1y = p1.getY();
      final double p2x = p2.getX();
      final double p2y = p2.getY();
      final double p3x = p3.getX();
      double cornerGap1 = GLibUtilities.getCornerGap(ShapeFactory.createPoint(p1x, p2y), p1, p2, gap);
      double cornerGap2 = GLibUtilities.getCornerGap(shape.getGravityCentre(), p2, p3, gap);

      if(p2x>p3x)
        cornerGap2*=-1;

      if(p1y>p2y)
        cornerGap1*=-1;

    final String points = p1x + "," + (p1y - cornerGap1) + " " + //$NON-NLS-1$//$NON-NLS-2$
            (p2x - cornerGap2) + "," + (p2y + (p1y<p2y ? gap : -gap)) + " " + //$NON-NLS-1$//$NON-NLS-2$
            (p3x + cornerGap2) + "," + (p2y + (p1y<p2y ? gap : -gap));//$NON-NLS-1$
      final String ltdPoints = pt1.getX() + " " + pt1.getY() + " " + shape.getPtAt(1).getX() + " " + shape.getPtAt(1).getY() +//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
                " " + shape.getPtAt(2).getX() + " " + shape.getPtAt(2).getY() + " " + pt2.getX() + " " + pt2.getY();//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$

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

         shad.setAttribute(SVGAttributes.SVG_POINTS, points);
         setSVGShadowAttributes(shad, true);
         root.appendChild(shad);
    }

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

    elt = new SVGPolygonElement(doc);
    elt.setAttribute(SVGAttributes.SVG_POINTS, points);
    root.appendChild(elt);
    root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE+':'+LNamespace.XML_POINTS, ltdPoints);

    if(shape.hasDbleBord()){
      final SVGElement dblBord = new SVGPolygonElement(doc);

      dblBord.setAttribute(SVGAttributes.SVG_POINTS, points);
      setSVGDoubleBordersAttributes(dblBord);
      root.appendChild(dblBord);
    }

    setSVGAttributes(doc, elt, true);
    setSVGRotationAttribute(root);

View Full Code Here

    final double gap = getPositionGap();
    final IPoint tl  = shape.getTopLeftPoint();
    final IPoint br  = shape.getBottomRightPoint();
    SVGElement elt;
        final SVGElement root = new SVGGElement(document);
        final double width  = Math.max(1, br.getX()-tl.getX()+gap);
        final double x    = tl.getX()-gap/2.;
        final double y    = tl.getY()-gap/2.;

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

        if(shape.hasShadow()) {
          elt = new SVGRectElement(x, y, width, width, document);
          setSVGShadowAttributes(elt, true);
          root.appendChild(elt);
          setSVGRoundCorner(elt);
        }

        if(shape.hasShadow() && !shape.getLineStyle().getLatexToken().equals(PSTricksConstants.LINE_NONE_STYLE)) {
          // The background of the borders must be filled is there is a shadow.
          elt = new SVGRectElement(x, y, width, width, document);
          setSVGBorderBackground(elt, root);
          setSVGRoundCorner(elt);
        }

        elt = new SVGRectElement(x, y, width, width, document);
        root.appendChild(elt);
        setSVGAttributes(document, elt, true);
        setSVGRoundCorner(elt);

        if(shape.hasDbleBord()) {
          elt = new SVGRectElement(x, y, width, width, document);
          setSVGDoubleBordersAttributes(elt);
          setSVGRoundCorner(elt);
          root.appendChild(elt);
        }

        setSVGRotationAttribute(root);

    return root;
View Full Code Here

  @Override
  public SVGElement toSVG(final SVGDocument doc) {
    if(doc==null)
      return null;

        final SVGElement root     = new SVGGElement(doc);
    final SVGDefsElement defs   = doc.getFirstChild().getDefs();
    final StringBuilder points   = new StringBuilder();
    final List<IPoint> pts    = shape.getPoints();
    SVGPolyLineElement elt;

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

    for(final IPoint pt : pts)
      points.append(pt.getX()).append(',').append(pt.getY()).append(' ');

    final String pointsStr = points.toString();

    if(shape.hasShadow()) {
      final SVGPolyLineElement shad = new SVGPolyLineElement(doc);
      try { shad.setPoints(pointsStr); }catch(final ParseException ex) { BadaboomCollector.INSTANCE.add(ex); }
      setSVGShadowAttributes(shad, false);
      root.appendChild(shad);
      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 SVGPolyLineElement(doc);
        try { elt.setPoints(pointsStr); }catch(final ParseException ex) { BadaboomCollector.INSTANCE.add(ex); }
        setSVGBorderBackground(elt, root);
        }

    elt = new SVGPolyLineElement(doc);
    try { elt.setPoints(pointsStr); }catch(final ParseException ex) { BadaboomCollector.INSTANCE.add(ex); }
    root.appendChild(elt);

    if(shape.hasDbleBord()) {
      final SVGPolyLineElement dblBord = new SVGPolyLineElement(doc);
      try { dblBord.setPoints(pointsStr); }catch(final ParseException ex) { BadaboomCollector.INSTANCE.add(ex); }
      setSVGDoubleBordersAttributes(dblBord);
      root.appendChild(dblBord);
    }

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

TOP

Related Classes of net.sf.latexdraw.parsers.svg.SVGGElement

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.