Package net.sf.latexdraw.parsers.svg

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


   * @since 2.0.0
   */
  protected LCircleSVGGenerator(final SVGGElement elt, final boolean withTransformation) {
    this(ShapeFactory.createCircle());

    final SVGElement elt2 = getLaTeXDrawElement(elt, null);

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

    setSVGLatexdrawParameters(elt);
View Full Code Here


    final IPoint br = shape.getBottomRightPoint();
    final double tlx = tl.getX();
    final double tly = tl.getY();
    final double brx = br.getX();
    final double bry = br.getY();
    SVGElement elt;
        final SVGElement shad;
        final SVGElement dblBord;
        final SVGElement root = new SVGGElement(doc);
        root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE+':'+LNamespace.XML_TYPE, LNamespace.XML_TYPE_CIRCLE);
        root.setAttribute(SVGAttributes.SVG_ID, getSVGID());
        final double gap = getPositionGap();

        if(shape.hasShadow()) {
          shad = new SVGCircleElement((brx+tlx)/2., (bry+tly)/2., (brx-tlx+gap)/2., doc);
          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 SVGCircleElement((brx+tlx)/2., (bry+tly)/2., (brx-tlx+gap)/2., doc);
          setSVGBorderBackground(elt, root);
        }

        elt = new SVGCircleElement((brx+tlx)/2., (bry+tly)/2., (brx-tlx+gap)/2., doc);// FIXME Should use prototype design pattern to reduce re-creation.
        root.appendChild(elt);

        if(shape.hasDbleBord()) {
          dblBord = new SVGCircleElement((brx+tlx)/2., (bry+tly)/2., (brx-tlx+gap)/2., doc);
          setSVGDoubleBordersAttributes(dblBord);
          root.appendChild(dblBord);
        }

        setSVGAttributes(doc, elt, true);
        setSVGRotationAttribute(root);
View Full Code Here

      // Creation of the SVG document.
      final List<IShape> shapes;
      final SVGDocument doc     = new SVGDocument();
      final SVGSVGElement root   = doc.getFirstChild();
      final SVGGElement g     = new SVGGElement(doc);
      SVGElement elt;

      if(onlySelection)
        shapes  = drawing.getSelection().getShapes();
      else shapes = drawing.getShapes();
View Full Code Here

      final Instrument[] instruments   = ui.getInstruments();
      final double incr        = 100./(drawing.size() + instruments.length + ui.getPresentations().size());
      final SVGDocument doc       = toSVG(drawing, incr);
      final SVGMetadataElement meta  = new SVGMetadataElement(doc);
      final SVGSVGElement root     = doc.getFirstChild();
      final SVGElement metaLTD    = (SVGElement)doc.createElement(LNamespace.LATEXDRAW_NAMESPACE+':'+SVGElements.SVG_METADATA);

      // Creation of the SVG meta data tag.
      meta.appendChild(metaLTD);
      root.appendChild(meta);
View Full Code Here

TOP

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

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.