Package org.apache.batik.dom.svg

Examples of org.apache.batik.dom.svg.SVGOMDocument


                                      true);
        evtTarget.removeEventListener("DOMCharacterDataModified",
                                      domCharacterDataModifiedListener,
                                      true);

        SVGOMDocument svgDocument = (SVGOMDocument)document;
        CSSEngine cssEngine = svgDocument.getCSSEngine();
        cssEngine.removeCSSEngineListener(cssPropertiesChangedListener);

        focusManager.dispose();
    }
View Full Code Here


                            button = new JRadioButtonMenuItem(title);

                            button.addActionListener
                                (new java.awt.event.ActionListener() {
                                    public void actionPerformed(ActionEvent e) {
                                        SVGOMDocument doc;
                                        doc = (SVGOMDocument)svgCanvas.getSVGDocument();
                                        doc.clearViewCSS();
                                        alternateStyleSheet = title;
                                        svgCanvas.setSVGDocument(doc);
                                    }
                                });
View Full Code Here

                        // nothing more to do at this point.
                    }

                    if (st != null) {
                        if (svgDocument != null) {
                            SVGOMDocument doc = (SVGOMDocument)svgDocument;
                            ParsedURL docPURL
                                = new ParsedURL(svgDocument.getURL());
                            ParsedURL purl = new ParsedURL(docPURL, st);
                            String fi = svgCanvas.getFragmentIdentifier();
                            fi = (fi == null) ? "" : fi;
View Full Code Here

    /**
     * Initializes the given document.
     */
    protected void initializeDocument(Document document) {
        SVGOMDocument doc = (SVGOMDocument)document;
        CSSEngine eng = doc.getCSSEngine();
        if (eng == null) {
            SVGDOMImplementation impl;
            impl = (SVGDOMImplementation)doc.getImplementation();
            eng = impl.createCSSEngine(doc, this);
            doc.setCSSEngine(eng);
            eng.setMedia(userAgent.getMedia());
            String uri = userAgent.getUserStyleSheetURI();
            if (uri != null) {
                try {
                    URL url = new URL(uri);
View Full Code Here

                                   domCharacterDataModifiedListener,
                                   true);

        focusManager = new FocusManager(document);

        SVGOMDocument svgDocument = (SVGOMDocument)document;
        CSSEngine cssEngine = svgDocument.getCSSEngine();
        cssPropertiesChangedListener = new CSSPropertiesChangedListener();
        cssEngine.addCSSEngineListener(cssPropertiesChangedListener);
    }
View Full Code Here

                                      true);
        evtTarget.removeEventListener("DOMCharacterDataModified",
                                      domCharacterDataModifiedListener,
                                      true);

        SVGOMDocument svgDocument = (SVGOMDocument)document;
        CSSEngine cssEngine = svgDocument.getCSSEngine();
        cssEngine.removeCSSEngineListener(cssPropertiesChangedListener);
        cssEngine.dispose();
        if (focusManager != null) {
            focusManager.dispose();
        }
View Full Code Here

                            button = new JRadioButtonMenuItem(title);

                            button.addActionListener
                                (new java.awt.event.ActionListener() {
                                    public void actionPerformed(ActionEvent e) {
                                        SVGOMDocument doc;
                                        doc = (SVGOMDocument)svgCanvas.getSVGDocument();
                                        doc.clearViewCSS();
                                        alternateStyleSheet = title;
                                        svgCanvas.setSVGDocument(doc);
                                    }
                                });
View Full Code Here

        Filter           img = reg.readURL(purl, extractColorSpace(e, ctx));
        Object           obj = img.getProperty
            (SVGBrokenLinkProvider.SVG_BROKEN_LINK_DOCUMENT_PROPERTY);
        if ((obj != null) && (obj instanceof SVGDocument)) {
            // Ok so we are dealing with a broken link.
            SVGOMDocument doc = (SVGOMDocument)obj;
            ctx.initializeDocument(doc);
            return createSVGImageNode(ctx, e, doc);
        }
        node.setImage(img);
        Rectangle2D imgBounds = img.getBounds2D();
View Full Code Here

    {
      final BaseScope scope = (BaseScope) thisObj;
      final String parser = "org.apache.xerces.parsers.SAXParser";//XMLResourceDescriptor.getXMLParserClassName();
      final SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
      final String uri = "file:" + scope.basePath + "/" + file;
      final SVGOMDocument doc = (SVGOMDocument) f.createDocument(uri);

      // Initialize the CSS Engine for the document
      final SVGDOMImplementation impl = (SVGDOMImplementation) SVGDOMImplementation.getDOMImplementation();
      final UserAgent userAgent = new UserAgentAdapter();
      final BridgeContext ctx = new BridgeContext(userAgent, new DocumentLoader(userAgent));
      doc.setCSSEngine(impl.createCSSEngine(doc, ctx));

      return Context.javaToJS(doc, scope);
    }
    catch (Exception e)
    {
View Full Code Here

   
    String enddate = DateFormat.getDateInstance(DateFormat.SHORT).format(new Date(currenttime.getTime() + (this.validityms)));
      String hardtokensnwithoutprefix = hardtokensn.substring(this.hardtokensnprefix.length());
      String copyoftokensnwithoutprefix = copyoftokensn.substring(this.hardtokensnprefix.length());

      final SVGOMDocument clone = (SVGOMDocument)svgdoc.cloneNode(true);
      // Get Text rows
      process( "text", userdata, dnfields, pincodes, pukcodes,
          hardtokensn, hardtokensnwithoutprefix,
        copyoftokensn, copyoftokensnwithoutprefix,
        startdate, enddate, clone);
      process( "svg:text", userdata, dnfields, pincodes, pukcodes,
          hardtokensn, hardtokensnwithoutprefix,
        copyoftokensn, copyoftokensnwithoutprefix,
        startdate, enddate, clone);
                      
      // Add Image
      /**
      if(userdata.hasimage()){
        addImage(userdata);      
      }
       */
    insertImage(userdata, clone); // special dravel for demo

      PrintTranscoder t = new PrintTranscoder();
    TranscoderInput input = new TranscoderInput(clone);
    TranscoderOutput output = new TranscoderOutput(new ByteArrayOutputStream());
    t.transcode(input, output);
    {
      final String aDoNot = clone.getRootElement().getAttribute("doNotScaleToPage");
      t.addTranscodingHint( PrintTranscoder.KEY_SCALE_TO_PAGE,
                            new Boolean(aDoNot==null||aDoNot.trim().length()<=0) );
    }
      return t;
    }
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.svg.SVGOMDocument

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.