Debian Codegraph @

documentation-sources/content/xdocs/using/architecture.xml

raw
1 <?xml version="1.0"?>
2
3 <!--
4
5 Licensed to the Apache Software Foundation (ASF) under one or more
6 contributor license agreements. See the NOTICE file distributed with
7 this work for additional information regarding copyright ownership.
8 The ASF licenses this file to You under the Apache License, Version 2.0
9 (the "License"); you may not use this file except in compliance with
10 the License. You may obtain a copy of the License at
11
12 http://www.apache.org/licenses/LICENSE-2.0
13
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19
20 -->
21
22 <!-- ========================================================================= -->
23 <!-- author [email protected] -->
24 <!-- version $Id$ -->
25 <!-- ========================================================================= -->
26
27 <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
28 <document>
29 <header>
30 <title>Architecture overview</title>
31 </header>
32
33 <body>
34 <p>This document briefly describes the Batik architecture and the role of each of
35 its modules. For detailed module design, you can refer to the
36 Batik UML diagrams <a href="http://opensource.objectsbydesign.com/batik/index.html">Object by Design</a>
37 or <a href="http://www.yworks.com/products/yDoc/showcase/batik-1.5/">yWorks</a>.</p>
38 <p>The Batik modules are of one of three types:
39 application modules, core modules and low level modules.
40 The following figure illustrates these three module types.</p>
41 <div class="figure"><img src="images/HighLevelArchitecture.png" alt="Batik Architecture" />
42 </div>
43 <p><a href="#applicationComponents">Application modules</a> illustrate how to use
44 the core modules and let users evaluate the Batik software by experimenting
45 with its features.</p>
46 <p>The <a href="#coreComponents">Core modules</a> are the heart of Batik and the primary deliverables for the
47 projects. These are the modules developers use to manipulate, generate, create,
48 convert, render and view SVG content.</p>
49 <p>Finally, the <a href="#lowLevelComponents">Low level modules</a> are used internally by the core modules to
50 accomplish their work. These modules are not typically used by developers directly.</p>
51
52 <section id="applicationComponents">
53 <title>Application modules</title>
54 <p>As mentioned earlier, the application modules illustrate the functionality that Batik
55 offers. </p>
56 <p>For example, the <a href="site:browser">SVG browser</a> is built using several
57 Batik core modules (such as the <code>JSVGCanvas</code> GUI component and the <code>ImageTranscoder</code>s)
58 and illustrates how Batik lets you not only view, zoom, pan and rotate SVG documents, but also search them
59 and convert them to other formats (such as JPEG, TIFF or PNG).</p>
60 <p>The <a href="site:pretty-printer">SVG pretty printer</a> is another example that shows how Batik
61 lets you manipulate and transform SVG content, here for the purposed of tidying up potentially
62 disorganized SVG files.</p>
63 <p>The <a href="site:font-converter">SVG font converter</a> illustrates how Batik can help you embed
64 SVG font definitions in an SVG file by providing an application that converts ranges of
65 characters from a TrueType Font format to the SVG font format.</p>
66 <p>Finally, the <a href="site:rasterizer">SVG rasterizer</a> shows how to leverage the
67 <a href="site:transcoder">transcoder API</a> to convert to and from SVG content.</p>
68 <p>
69 Note that even though the application modules are meant to be useful and fun to use, they
70 are not the primary deliverables of the Batik project. Instead, they are illustrations of how the
71 Batik core modules might be used and combined.</p>
72 </section>
73
74 <section id="coreComponents">
75 <title>Core modules</title>
76 <p>The Batik core modules are the heart of the Batik architecture. They can be used individually
77 or in combination for various purposes, and the <a href="#applicationComponents">application modules</a>
78 offer some usage examples.
79 </p>
80 <ul>
81 <li>The <a href="site:generator">SVG generator</a> is a module containing
82 <code><a href="../javadoc/org/apache/batik/svggen/SVGGraphics2D.html">SVGGraphics2D</a></code>
83 class, that lets all Java applications or applets easily convert their
84 graphics to the SVG format, as easily as they draw to a screen or a printer,
85 by leveraging the Java 2D API’s extensible design.</li>
86 <li><a href="site:dom-api">SVG DOM</a> an implementation of the SVG DOM API defined
87 in the SVG recommendation. It lets the programmer manipulate SVG documents in a Java program.</li>
88 <li>The <a href="site:swing">Swing components</a> module includes, primarily, the
89 <code><a href="../javadoc/org/apache/batik/swing/JSVGCanvas.html">JSVGCanvas</a></code>
90 class, a UI component that can display SVG content and let the user
91 interact with that content (zoom, pan, rotate, select text, etc.).</li>
92 <li>The <strong>Bridge</strong> module is rarely used directly. It is responsible for creating
93 and maintaining an appropriate object corresponding to an SVG element. The bridge converts an
94 SVG document into the internal representation Batik uses for graphics (GVT, the
95 Graphic Vector Toolkit).</li>
96 <li>The <a href="site:transcoder">transcoder</a> is a module that provides a generic API for
97 transcoding an input to an output. This module transcodes an input stream or a document
98 into a particular ouput format, used for converting SVG documents to other types.</li>
99 </ul>
100 </section>
101
102 <section id="lowLevelComponents">
103 <title>Low level modules</title>
104 <p>The low level modules are not expected to be used directly by developers using the Batik
105 API. Rather, they support the operation of the core modules. The low level modules
106 include:</p>
107 <ul>
108 <li>The <strong>Graphic Vector Toolkit</strong> (GVT) module, which represents a view of the DOM tree
109 that is more suitable for for rendering and event handling purposes. This module describes
110 DOM tree in terms of a tree of Java graphics objects.</li>
111 <li>The <strong>Renderer</strong> module is responsible for rendering a GVT tree and any
112 related task. For example, a raster based renderer may perform
113 some caching (the default renderer in Batik does that). However, a renderer could perform
114 any task deemed necessary and does not have to be raster based.</li>
115 <li>The <a href="site:parsers">SVG parser</a> module contains parser classes for complex
116 SVG attributes such as the <code>transform</code> or <code>color</code> attributes. Higher level modules
117 rely on the SVG parser module.</li>
118 </ul>
119 </section>
120 </body>
121 </document>