<?xml version="1.0"?>
<!DOCTYPE document SYSTEM "./dtd/document-v10.dtd">

<!--

   Copyright 2001-2003  The Apache Software Foundation 

   Licensed 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$ -->
<!-- ========================================================================= -->

<document>
    <header>
        <title>Batik - Architecture Overview</title>
        <subtitle>Batik's modules explained</subtitle>
        <authors>
            <person name="Vincent Hardy" email="vincent.hardy@eng.sun.com"/>
        </authors>
    </header>

    <body>
        <s1 title="Introduction">
            <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 <link href="http://opensource.objectsbydesign.com/batik/index.html">Object by Design</link>
            or <link href="http://www.yworks.com/products/yDoc/showcase/batik-1.5/">yWorks</link>.</p>
            <p>The Batik modules are of one of three types:</p>
            <ul>
                <li><link href="#applicationComponents">Application Modules</link></li>
                <li><link href="#coreComponents">Core Modules</link></li>
                <li><link href="#lowLevelComponents">Low Level Modules</link></li>
            </ul>
            <p>The following figure illustrates these three module types. </p>
            <figure src="images/HighLevelArchitecture.png" alt="Batik Architecture" />
            <p><link href="#applicationComponents">Application Modules</link> illustrate how to use
            the Core Modules and let users evaluate the Batik software by experimenting
            with its features.</p>
            <p>The <link href="#coreComponents">Core Modules</link> 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 <link href="lowLevelComponents">Low Level Modules</link> are used internally by the Core Modules to 
            accomplish their work. These modules are not typically used by developers directly.</p> 
        </s1>

        <anchor id="applicationComponents" />
        <s1 title="Application Modules">
            <p>As mentioned earlier, the Application Modules illustrate the functionality that Batik
            offers. </p>
            <p>For example, the <link href="svgviewer.html">SVG Browser</link> 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 <link href="svgpp">SVG Pretty Printer</link> 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 <link href="ttf2svg">SVG Font Converter</link> 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 True Type Font format to the SVG Font format.</p>
            <p>Finally, the <link href="svgrasterizer.html">SVG Rasterizer</link> shows how to leverage the     
            <link href="rasterizerTutorial.html">Transcoder API</link> to convert to and from SVG content</p> 
            <p>
            Note that even though the Application Modules are meant to be usefull 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>
        </s1>

        <anchor id="coreComponents" />
        <s1 title="Core Modules">
            <p>The Batik core modules are the heart of the Batik architecture. They can be used individually
            or in combinations for various purposes, and the <link href="#applicationComponents">Application Modules</link>
            offer some usage examples.
            </p>
            <ul>
                <li><link href="svggen.html"><code>SVG Generator</code></link> is a modules which contains
                <link href="svggen.html#whatIsIt">SVGCanvas2D</link> that lets all Java technology 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><link href="domapi.html"><code>SVG DOM</code></link> 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><link href="svgcanvas.html"><code>JSVGCanvas</code></link> is a UI component that can display
                SVG content and let the user interact with that content (zoom, pan, rotate, text selection, etc...)</li>
                <li><strong>Bridge</strong>. This module is rarely used directly. It is responsible for creating 
                and maintaining an appropriate object corresponding to an Element. The Bridge converts an
                SVG document into the internal representation Batik uses for graphics (GVT, the 
                Graphic Vector Toolkit)</li>
                <li><link href="rasterizerTutorial.html">Transcoder</link> is a module that provide a generic API for 
                transcoding an input to an output. This module transcodes an input stream or a document 
                into a particular ouput format. </li>
            </ul>
        </s1>

        <anchor id="lowLevelComponents" />
        <s1 title="Low Level Modules">
            <p>The Low Level Modules are not expected to be used directly by developers using the Batik
            API. Rather, they are supporting 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 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 it deems necessary and does not have to be raster based.</li>
                <li>The <strong>SVG Parser</strong> module contains 'Micro Parsers'. These are parsers for complex 
                SVG attributes such as <code>transform</code> or <code>color</code> attributes. Higher level modules 
                rely on the SVG Parser module.</li>
            </ul>
        </s1>
    </body>
</document>