Bug 133711 - add svg support
add svg support
Status: NEW
Product: platform
Classification: Unclassified
Component: Graph
6.x
All All
: P3 (vote)
: 6.x
Assigned To: Kris Richards
issues@platform
http://wiki.netbeans.org/GraphLibrary...
: API_REVIEW_FAST
Depends on:
Blocks: 134005
  Show dependency treegraph
 
Reported: 2008-04-22 20:41 UTC by Kris Richards
Modified: 2008-07-11 10:21 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Visual Library SVG Support Plugin (29.11 KB, application/x-compressed)
2008-07-07 17:52 UTC, Kris Richards
Details
Visual Library SVG Support Plugin JavaDoc (56.63 KB, application/x-compressed)
2008-07-07 17:53 UTC, Kris Richards
Details
Batik 1.7.0 Library Wrapper Module (1.38 MB, application/x-compressed)
2008-07-07 17:55 UTC, Kris Richards
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kris Richards 2008-04-22 20:41:15 UTC
Add logic that allows users to export a scene to SVG format. This will require use of the "batik" library.
Comment 1 Kris Richards 2008-05-13 18:51:43 UTC
reassigning issue to myself in preparation for committing feature code.
Comment 2 Kris Richards 2008-06-13 14:19:41 UTC
The following are comments made on an email thread concerning this issue
----------------------

Minor comments - my experience with API review is that it's best to go find and ask some engineers to be your reviewers. Also perhaps full review is 
probably more suitable for planned Kris' change, but that may be just my feeling. (Dafe Simonek)

----------------------
I do not like the idea of including yet another library for an extra feature 
in the graph library. The library is otherwise standalone. I'd rather see you 
create new module that has dependency on the visual library and batik 
libraries and provides the additional API for SVG support. That is the 
lowlevel advice.

The higher level one is to have standard review. Then it is possible to argue 
in IZ and during a conf call about the best solution. (Jaroslav Tulach)

----------------------
I am adding an "export to SVG" feature to the Visual Library. The code that was submitted by the community makes use of two jars fromthe Batik library. I 
need to link with these jar files.

Then you need a library wrapper module to hold them, and you need to add a dependency on this to whatever module implements the export feature. Be 
sure to read

http://wiki.netbeans.org/DevFaqExternalLibrariesUpdated

regarding the source tree conventions for the new JARs, and get an open-source review before including the new library wrapper module in the standard 
build.

--------------------
Anyway the bigger problem is that the issue is silent about the need to add 
dependencies on new libraries. That information immediately changed the 
situation and attracted my attention. We do not want NetBeans Platform to 
have strong dependencies on too many external libraries. Enough troubles with 
javahelp.

I would suggest to turn this review into standard one. Let Kris update the 
material with info about the libraries, possible find a way to make 
them "voluntary", let him find four reviewers to check that and call a conf 
call to get some conclusion.(Jaroslav Tulach)

------------------------
>We do not want NetBeans Platform to have strong dependencies on too many external libraries.
Yes. With NB Platform going into the JDK (as well as in some of the Java licensees distros), this needs to be the focus.

>I would suggest to turn this review into standard one
Please.
(Arseniy)

Comment 3 Kris Richards 2008-06-13 14:20:36 UTC
I will reopen this SVG api-review issue. Change it to a standard review. Add my patch/diffs. Contact reviewers directly and setup a conf call.
Comment 4 yoshtec 2008-06-21 10:40:00 UTC
Exporting to SVG is really simple with batik:
<code>
    DOMImplementation dom = SVGDOMImplementation.getDOMImplementation();
    SVGDocument doc = (SVGDocument) dom.createDocument(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", null);
    SVGGraphics2D generator = new SVGGraphics2D(doc);

    try {
        // some scene from the Visual Library
        scene.paint(generator);
        FileWriter file = new FileWriter("out.svg");
        PrintWriter writer = new PrintWriter(file);

        generator.stream(writer);
    } catch (Exception e) {
        e.printStackTrace();
    }
</code>

Works like a charm. Tried that yesterday after completing the Visual Database Explorer tutorial.
Comment 5 Kris Richards 2008-07-07 17:52:56 UTC
Created attachment 64011 [details]
Visual Library SVG Support Plugin
Comment 6 Kris Richards 2008-07-07 17:53:59 UTC
Created attachment 64012 [details]
Visual Library SVG Support Plugin JavaDoc
Comment 7 Kris Richards 2008-07-07 17:55:13 UTC
Created attachment 64013 [details]
Batik 1.7.0 Library Wrapper Module
Comment 8 Jaroslav Tulach 2008-07-11 10:21:16 UTC
Y01 Add private constructor to SVGExporter
Y02 The tests might test a bit more than just return value == false.
Y03 Do not duplicate DOM W3C classes and their implementation. Can't Batik work with regular DOM parsers? Can you just 
add a dependency on libs.xerces instead of carying yet another XML parser with batik?
Y04 Which clusters this shall be added into?


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo