blob: 725a156f384422e1173097b33384743dbb63bd95 [file] [log] [blame]
<?xml version="1.0"?>
<!--
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.
-->
<!-- ========================================================================= -->
<!-- author vincent.hardy@eng.sun.com -->
<!-- version $Id: architecture.xml 201374 2004-08-18 07:17:26Z vhardy $ -->
<!-- ========================================================================= -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Architecture overview</title>
</header>
<body>
<p>This document briefly describes the Batik architecture and the role of each of
its modules. For detailed module design, you can refer to the
Batik UML diagrams <a href="http://opensource.objectsbydesign.com/batik/index.html">Object by Design</a>
or <a href="http://www.yworks.com/products/yDoc/showcase/batik-1.5/">yWorks</a>.</p>
<p>The Batik modules are of one of three types:
application modules, core modules and low level modules.
The following figure illustrates these three module types.</p>
<div class="figure"><img src="images/HighLevelArchitecture.png" alt="Batik Architecture" />
</div>
<p><a href="#applicationComponents">Application modules</a> illustrate how to use
the core modules and let users evaluate the Batik software by experimenting
with its features.</p>
<p>The <a href="#coreComponents">Core modules</a> are the heart of Batik and the primary deliverables for the
projects. These are the modules developers use to manipulate, generate, create,
convert, render and view SVG content.</p>
<p>Finally, the <a href="#lowLevelComponents">Low level modules</a> are used internally by the core modules to
accomplish their work. These modules are not typically used by developers directly.</p>
<section id="applicationComponents">
<title>Application modules</title>
<p>As mentioned earlier, the application modules illustrate the functionality that Batik
offers. </p>
<p>For example, the <a href="site:browser">SVG browser</a> is built using several
Batik core modules (such as the <code>JSVGCanvas</code> GUI component and the <code>ImageTranscoder</code>s)
and illustrates how Batik lets you not only view, zoom, pan and rotate SVG documents, but also search them
and convert them to other formats (such as JPEG, TIFF or PNG).</p>
<p>The <a href="site:pretty-printer">SVG pretty printer</a> is another example that shows how Batik
lets you manipulate and transform SVG content, here for the purposed of tidying up potentially
disorganized SVG files.</p>
<p>The <a href="site:font-converter">SVG font converter</a> illustrates how Batik can help you embed
SVG font definitions in an SVG file by providing an application that converts ranges of
characters from a TrueType Font format to the SVG font format.</p>
<p>Finally, the <a href="site:rasterizer">SVG rasterizer</a> shows how to leverage the
<a href="site:transcoder">transcoder API</a> to convert to and from SVG content.</p>
<p>
Note that even though the application modules are meant to be useful and fun to use, they
are not the primary deliverables of the Batik project. Instead, they are illustrations of how the
Batik core modules might be used and combined.</p>
</section>
<section id="coreComponents">
<title>Core modules</title>
<p>The Batik core modules are the heart of the Batik architecture. They can be used individually
or in combination for various purposes, and the <a href="#applicationComponents">application modules</a>
offer some usage examples.
</p>
<ul>
<li>The <a href="site:generator">SVG generator</a> is a module containing
<code><a href="../javadoc/org/apache/batik/svggen/SVGGraphics2D.html">SVGGraphics2D</a></code>
class, that lets all Java applications or applets easily convert their
graphics to the SVG format, as easily as they draw to a screen or a printer,
by leveraging the Java 2D API’s extensible design.</li>
<li><a href="site:dom-api">SVG DOM</a> an implementation of the SVG DOM API defined
in the SVG recommendation. It lets the programmer manipulate SVG documents in a Java program.</li>
<li>The <a href="site:swing">Swing components</a> module includes, primarily, the
<code><a href="../javadoc/org/apache/batik/swing/JSVGCanvas.html">JSVGCanvas</a></code>
class, a UI component that can display SVG content and let the user
interact with that content (zoom, pan, rotate, select text, etc.).</li>
<li>The <strong>Bridge</strong> module is rarely used directly. It is responsible for creating
and maintaining an appropriate object corresponding to an SVG element. The bridge converts an
SVG document into the internal representation Batik uses for graphics (GVT, the
Graphic Vector Toolkit).</li>
<li>The <a href="site:transcoder">transcoder</a> is a module that provides a generic API for
transcoding an input to an output. This module transcodes an input stream or a document
into a particular ouput format, used for converting SVG documents to other types.</li>
</ul>
</section>
<section id="lowLevelComponents">
<title>Low level modules</title>
<p>The low level modules are not expected to be used directly by developers using the Batik
API. Rather, they support the operation of the core modules. The low level modules
include:</p>
<ul>
<li>The <strong>Graphic Vector Toolkit</strong> (GVT) module, which represents a view of the DOM tree
that is more suitable for for rendering and event handling purposes. This module describes
DOM tree in terms of a tree of Java graphics objects.</li>
<li>The <strong>Renderer</strong> module is responsible for rendering a GVT tree and any
related task. For example, a raster based renderer may perform
some caching (the default renderer in Batik does that). However, a renderer could perform
any task deemed necessary and does not have to be raster based.</li>
<li>The <a href="site:parsers">SVG parser</a> module contains parser classes for complex
SVG attributes such as the <code>transform</code> or <code>color</code> attributes. Higher level modules
rely on the SVG parser module.</li>
</ul>
</section>
</body>
</document>