-
大小: 12.39MB文件類型: .zip金幣: 1下載: 0 次發布日期: 2023-07-10
- 語言: Java
- 標簽: batik??highcharts??
資源簡介
通過Batik,你可以在JAVA可以使用的地方操作SVG文檔,您還可以在你的應用程序使用Batik模塊來生成 , 處理和轉碼SVG圖像。Batik很容易讓基于Java的應用程序或小程序來處理SVG內容。
代碼片段和文件信息
/*
???Licensed?to?the?Apache?Software?Foundation?(ASF)?under?one?or?more
???contributor?license?agreements.??See?the?NOTICE?file?distributed?with
???this?work?for?additional?information?regarding?copyright?ownership.
???The?ASF?licenses?this?file?to?You?under?the?Apache?License?Version?2.0
???(the?“License“);?you?may?not?use?this?file?except?in?compliance?with
???the?License.??You?may?obtain?a?copy?of?the?License?at
???????http://www.apache.org/licenses/LICENSE-2.0
???Unless?required?by?applicable?law?or?agreed?to?in?writing?software
???distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
???WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
???See?the?License?for?the?specific?language?governing?permissions?and
???limitations?under?the?License.
?*/
import?java.io.IOException;
import?java.net.URL;
import?javax.swing.Japplet;?
import?org.apache.batik.dom.svg.SAXSVGDocumentFactory;
import?org.apache.batik.swing.JSVGCanvas;
import?org.apache.batik.util.xmlResourceDescriptor;
import?org.w3c.dom.Document;
import?org.w3c.dom.Element;
import?org.w3c.dom.Node;
/**
?*?A?applet?demonstrating?the?JSVGCanvas.
?*
?*?@version?$Id$
?*/
public?class?appletDemo?extends?Japplet?{
????protected?JSVGCanvas?canvas;
????protected?Document?doc;
????protected?Element?svg;
????public?void?init()?{
????????//?Create?a?new?JSVGCanvas.
????????canvas?=?new?JSVGCanvas();
????????getContentPane().add(canvas);
????????try?{
????????????//?Parse?the?barChart.svg?file?into?a?Document.
????????????String?parser?=?xmlResourceDescriptor.getxmlParserClassName();
????????????SAXSVGDocumentFactory?f?=?new?SAXSVGDocumentFactory(parser);
????????????URL?url?=?new?URL(getCodebase()?“barChart.svg“);
????????????doc?=?f.createDocument(url.toString());
????????????svg?=?doc.getDocumentElement();
????????????//?Change?the?document?viewBox.
????????????svg.setAttributeNS(null?“viewBox“?“40?95?370?265“);
????????????//?Make?the?text?look?nice.
????????????svg.setAttributeNS(null?“text-rendering“?“geometricPrecision“);
????????????//?Remove?the?xml-stylesheet?PI.
????????????for?(Node?n?=?svg.getPreviousSibling();
????????????????????n?!=?null;
????????????????????n?=?n.getPreviousSibling())?{
????????????????if?(n.getNodeType()?==?Node.PROCESSING_INSTRUCTION_NODE)?{
????????????????????doc.removeChild(n);
????????????????????break;
????????????????}
????????????}
????????????//?Remove?the?Batik?sample?mark?‘use‘?element.
????????????for?(Node?n?=?svg.getLastChild();
????????????????????n?!=?null;
????????????????????n?=?n.getPreviousSibling())?{
????????????????if?(n.getNodeType()?==?Node.ELEMENT_NODE
????????????????????????&&?n.getLocalName().equals(“use“))?{
????????????????????svg.removeChild(n);
????????????????????break;
????????????????}
????????????}
????????}?catch?(Exception?ex)?{
????????}
????}
????public?void?start()?{
????????//?Display?the?document.
????????canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
????????canv
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2008-01-06?11:07??batik-1.7\
?????文件???????62675??2008-01-01?10:20??batik-1.7\CHANGES
?????文件???????11357??2006-11-16?12:27??batik-1.7\LICENSE
?????文件?????????684??2007-12-26?22:27??batik-1.7\NOTICE
?????文件????????2862??2007-01-18?22:18??batik-1.7\README
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\demo\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\dev\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\images\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\skin\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\skin\css\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\skin\images\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\skin\sc
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\skin\translations\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\tools\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\tools\images\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\using\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\using\images\
?????目錄???????????0??2008-01-06?11:04??batik-1.7\docs\using\sc
?????目錄???????????0??2008-01-06?11:07??batik-1.7\extensions\
?????文件???????56270??2008-01-06?11:07??batik-1.7\batik-rasterizer.jar
?????文件???????15216??2008-01-06?11:07??batik-1.7\batik-slideshow.jar
?????文件??????553673??2008-01-06?11:07??batik-1.7\batik-squiggle.jar
?????文件???????18152??2008-01-06?11:07??batik-1.7\batik-svgpp.jar
?????文件????????6080??2008-01-06?11:07??batik-1.7\batik-ttf2svg.jar
?????文件????????5238??2008-01-06?11:07??batik-1.7\batik.jar
?????文件????????1871??2008-01-06?11:04??batik-1.7\docs\.htaccess
?????文件??????????31??2008-01-06?11:04??batik-1.7\docs\broken-li
?????文件???????25821??2008-01-06?11:04??batik-1.7\docs\contributors.html
?????文件???????11294??2008-01-06?11:04??batik-1.7\docs\demo.html
?????文件????????1924??2008-01-06?11:04??batik-1.7\docs\demo\ap
............此處省略693個文件信息
評論
共有 條評論