You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2006/11/20 06:25:32 UTC
svn commit: r477052 [2/8] - in /xmlgraphics/batik/trunk: ./
documentation-sources/ documentation-sources/classes/
documentation-sources/conf/ documentation-sources/content/
documentation-sources/content/demo/ documentation-sources/content/xdocs/
docume...
Added: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/dev/test.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/documentation-sources/content/xdocs/dev/test.xml?view=auto&rev=477052
==============================================================================
--- xmlgraphics/batik/trunk/documentation-sources/content/xdocs/dev/test.xml (added)
+++ xmlgraphics/batik/trunk/documentation-sources/content/xdocs/dev/test.xml Sun Nov 19 21:25:24 2006
@@ -0,0 +1,614 @@
+<?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: testInfrastructure.xml 215909 2005-07-12 02:05:44Z cam $ -->
+<!-- ========================================================================= -->
+
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>Test infrastructure</title>
+ </header>
+
+ <body>
+ <p>
+ This document describes the Batik test infrastructure whose goals
+ are to:
+ </p>
+ <ul>
+ <li>make it easy to detect regressions,</li>
+ <li>make it easy to run test suites, and</li>
+ <li>make it easy to write new tests and add them
+ to an existing test suite.</li>
+ </ul>
+ <p>
+ The intent for the test infrastructure is that it grows
+ along with Batik and keeps monitoring the health of
+ the code base.
+ </p>
+ <p>
+ While the test suites in the infrastructure will be
+ run every day by build/test machines, they are also
+ intended to help the commiters and developers get confident
+ that their code modifications did not introduce regressions.
+ </p>
+
+ <section id="infrastructure">
+ <title>The test infrastructure</title>
+
+ <section>
+ <title>High-level interfaces</title>
+ <p>
+ The following are the high level interfaces in the infrastructure.
+ </p>
+
+ <!-- <div class="figure"><img src="images/testHighLevel.jpg" alt="Batik Viewer"/></div> -->
+
+ <dl class="classes">
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/Test.html">Test</a></dt>
+ <dd>
+ <p>
+ A <code>Test</code> is performing whatever check is needed in its
+ <code>run</code> method, and each run produces a
+ <code>TestReport</code>.
+ </p>
+ </dd>
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/TestReport.html">TestReport</a></dt>
+ <dd>
+ <p>
+ A <code>TestReport</code> describes whether a <code>Test</code>
+ run passed or failed and provides a description of the failure in
+ terms of an error code (unique in the context of a given
+ <code>Test</code>) and a set of key/value pairs.
+ </p>
+ </dd>
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/TestSuite.html">TestSuite</a></dt>
+ <dd>
+ <p>
+ A <code>TestSuite</code> is a test aggregation which can run a set
+ of <code>Test</code> instances.
+ </p>
+ </dd>
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/TestReportProcessor.html">TestReportProcessor</a></dt>
+ <dd>
+ <p>
+ A <code>TestReportProcessor</code> is used to analyze a
+ <code>TestReport</code>. A specific implementation can choose to
+ create graphs, send an email or write an HTML file.
+ </p>
+ </dd>
+ </dl>
+ </section>
+
+ <section>
+ <title>Default implementations</title>
+
+ <p>
+ The test infrastructure comes with a number of default
+ implementations for the interfaces described above.
+ Specifically:
+ </p>
+
+ <dl class="classes">
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/AbstractTest.html">AbstractTest</a></dt>
+ <dd>
+ <p>
+ This implementation of the <code>Test</code> interface is
+ intended to make it easier to write a âsafeâ <code>Test</code>
+ implementation. See the <a href="#writingNewTests">Writing new
+ tests</a> section for a description of how to use that class.
+ </p>
+ </dd>
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/DefaultTestReport.html">DefaultTestReport</a></dt>
+ <dd>
+ <p>
+ This class provides a simple implementation of the
+ <code>TestReport</code> interface that most <code>Test</code>
+ implementations will be able to use. See the
+ <a href="#writingNewTests">Writing new tests</a> section for
+ more details.
+ </p>
+ </dd>
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/DefaultTestSuite.html">DefaultTestSuite</a></dt>
+ <dd>
+ <p>
+ This class provides an implementation of the
+ <code>TestSuite</code> interface and makes it
+ easy to aggregate <code>Test</code> instances.
+ </p>
+ </dd>
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/SimpleTestReportProcessor.html">SimpleTestReportProcessor</a></dt>
+ <dd>
+ <p>
+ This class is a sample <code>TestReportProcessor</code>
+ implementation that simply traces the content of a
+ <code>TestReport</code> to an output stream.
+ </p>
+ </dd>
+ <dt><a class="class" href="../javadoc/org/apache/batik/test/TestReportMailer.html">TestReportMailer</a></dt>
+ <dd>
+ <p>
+ This is another implementation of the
+ <code>TestReportProcessor</code> interface that emails a test
+ report to a list of destination e-mail addresses.
+ </p>
+ </dd>
+ </dl>
+ </section>
+
+ <section>
+ <title>XML implementations</title>
+
+ <p>
+ The test infrastructure is using XML-out (and XML-in
+ too, see the <a href="#runningATestSuite">Running a test suite</a>
+ section) as a favorite way to generate test reports. The
+ <a class="class" href="../javadoc/org/apache/batik/test/XMLTestReportProcessor.html">XMLTestReportProcessor</a>
+ implementation of the <code>TestReportProcessor</code> interface.
+ It outputs reports in XML in a configurable directory.
+ </p>
+ <p>
+ The <code>XMLTestReportProcessor</code> can notify an
+ <a class="class" href="../javadoc/org/apache/batik/test/XMLReportConsumer.html">XMLReportConsumer</a>
+ when it has created a new report. There is one implementation of
+ that interface that can run an XSL stylesheet on the
+ XML report (e.g., to generate an HTML report), called
+ <a class="class" href="../javadoc/org/apache/batik/test/XSLXMLReportConsumer.html">XSLXMLReportConsumer</a>.
+ This is used by the <code>regard</code> rule in the Batik build to produce an
+ HTML report for the default regression test suite.
+ </p>
+ </section>
+ </section>
+
+ <section id="managingATestSuite">
+ <title>Managing test suites</title>
+
+ <p>
+ The infrastructure is designed to make it easy to create, update
+ and modify test suites. This section describes how to describe a
+ set of tests to be run and how to actually run that test suite.
+ </p>
+
+ <section>
+ <title>Describing a test suite</title>
+ <p>
+ Test suites can be described in XML (XML-in refered to earlier
+ in this document). The general format for describing a test suite is:
+ </p>
+ <source><![CDATA[<testSuite id="testSuiteA" name="MyFavoriteTestSuite">
+ <!-- Set of tests to be run -->
+ <test id="t1" class="myFavoriteTestClassA"/>
+ <test id="t2" class="myFavoriteTestClassB"/>
+ <test id="t3" class="myFavoriteTestClassC"/>
+</testSuite>]]></source>
+
+ <p>
+ Note that tests can be grouped in <code>testGroup</code> elements,
+ which can have their own <code>id</code> and <code>class</code>
+ attributes. This is useful because it allows developers to run
+ specific tests or test groups by specifying their IDs. In addition,
+ because the class attribute is inherited by a <code>test</code> element
+ from its parent, <code>testGroup</code>s allow the developers to
+ group tests which use the same class and specify that class on the
+ group.
+ </p>
+
+ <p>
+ <code>Test</code> instances listed in a test suite can have arguments
+ passed to them, as defined by the test class. These arguments are
+ passed in using <code>arg</code> child elements.
+ </p>
+
+ <p>
+ The following example shows a test suite with two tests:
+ </p>
+
+ <source><![CDATA[<testSuite id="sampleTestSuite" name="SAMPLE TEST SUITE">
+
+ <!-- ========================================================================== -->
+ <!-- Validates that the SVGRenderingAccuracyTest class is operating as expected -->
+ <!-- ========================================================================== -->
+ <test id="renderingAccuracyTest" class="org.apache.batik.test.svg.SVGRenderingAccuracyTestValidator"/>
+
+ <!-- ========================================================================== -->
+ <!-- Rendering regression tests -->
+ <!-- ========================================================================== -->
+ <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
+ <arg class="java.net.URL"
+ value="file:samples/anne.svg"/>
+ <arg class="java.net.URL"
+ value="file:test-references/samples/solaris/anne.png"/>
+ <property name="VariationURL"
+ class="java.net.URL"
+ value="file:test-references/samples/variation/anne.png"/>
+ <property name="SaveVariation"
+ class="java.io.File"
+ value="test-references/samples/variation-candidate/anne.png"/>
+ </test>
+
+</testSuite>]]></source>
+ </section>
+
+ <section id="runningATestSuite">
+ <title>Running a test suite</title>
+
+ <p>
+ Yet another XML file describes which test to run and how to process
+ the generated test reports. The general syntax is something
+ like:
+ </p>
+ <source><![CDATA[<testRun id="regard" name="Test Run Name Here">
+
+ <!-- =================================== -->
+ <!-- Descriptions of processors that -->
+ <!-- will process the results of the -->
+ <!-- test suite -->
+ <!-- =================================== -->
+ <testReportProcessor class="myFavoriteReportProcessorA"/>
+ <testReportProcessor class="myFavoriteReportProcessorB"/>
+
+ <!-- =================================== -->
+ <!-- Set of test suite to run. They will -->
+ <!-- produce TestReports. -->
+ <!-- =================================== -->
+ <testSuite href="http://url.to.my.first.test.suite"/>
+ <testSuite href="http://url.to.my.second.test.suite"/>
+
+</testRun>]]></source>
+
+ <p>
+ <code>testRun</code> elements can be nested. In a nutshell, you can
+ specify a set of <code>TestReportProcessor</code>s which should
+ process the <code>TestReport</code> generated by the
+ <code>TestSuite</code> built from the list of <code>Test</code>
+ instances described in the files referenced by the
+ <code>testSuite</code> elements.
+ </p>
+ <p>
+ For example:
+ </p>
+ <source><![CDATA[<testRun name="Batik Standard Regression Test Run">
+
+ <testRun name="REGARD">
+ <testReportProcessor class="org.apache.batik.test.xml.XMLTestReportProcessor">
+ <arg class="org.apache.batik.test.xml.XSLXMLReportConsumer">
+ <!-- Stylesheet -->
+ <arg class="java.lang.String" value="file:test-resources/org/apache/batik/test/svg/HTMLReport.xsl"/>
+ <!-- Ouput Directory -->
+ <arg class="java.lang.String" value="test-reports/html"/>
+ <!-- Output file prefix -->
+ <arg class="java.lang.String" value="RegardResult"/>
+ <!-- Output file suffix -->
+ <arg class="java.lang.String" value=".html"/>
+ </arg>
+ </testReportProcessor>
+
+ <testSuite href="file:test-resources/org/apache/batik/test/samplesRendering.xml"/>
+ <testSuite href="file:test-resources/org/apache/batik/svggen/regsvggen.xml"/>
+ <testSuite href="file:test-resources/org/apache/batik/test/unitTesting.xml"/>
+ </testRun>
+
+</testRun>]]></source>
+
+ <p>
+ There is a rule in Batik's <code>build.xml</code> file to run a test
+ suite defined in an XML file as the one above. At the command line,
+ type the following, for Windows:
+ </p>
+ <source>build runtestsuite path/to/my/newly/created/testSuite.xml</source>
+ <p>
+ and for Unix:
+ </p>
+ <source>build.sh runtestsuite path/to/my/newly/created/testSuite.xml</source>
+ <p>
+ In addition, the <code>regard</code> rule runs a specific set of
+ tests by default, so that you do not need to pass any
+ <em>testRun</em> file argument.
+ </p>
+ <p>
+ <strong><code>regard</code> is the projectâs safeguard against
+ regressions</strong>.</p>
+ </section>
+ </section>
+
+ <section id="regard">
+ <title>regard: the Batik regression test suite</title>
+
+ <p>
+ The regard test suite contains all the regression tests for the Batik
+ project. The <code>regard</code> tool is a specific test suite
+ description, <code>regard.xml</code> (which you can find in the
+ <code>test-resources/org/apache/batik/test</code> directory). That
+ file contains a set of test suite files which sould be run.
+ </p>
+
+ <p>
+ The following describes how to use the regard tool and some of the
+ most important tests in the regard test suite.
+ </p>
+
+ <section>
+ <title>Running regard</title>
+
+ <p>
+ The regard tool lets you run either all the tests or any specific
+ test you want in the test suite. To run all the tests in the regard
+ test suite, type the following at the command line, for Windows:
+ </p>
+
+ <source>build regard</source>
+ <p>
+ and for Unix:
+ </p>
+ <source>build.sh regard</source>
+
+ <p>
+ To run a specific test in the test suite, type the qualified test ID
+ or any substring of that ID:
+ </p>
+
+ <source>build.sh regard <em>id-list</em></source>
+
+ <p>For example:</p>
+ <source>build.sh regard unitTesting.ts batikFX.svg</source>
+
+ <p>
+ will run all the tests with an ID containing
+ <code>unitTesting.ts</code> (i.e., all the test selection unit
+ testing, see
+ <code>test-resources/org/apache/batik/gvt/unitTesting.xml</code>)
+ and the accuracy rendering test on <code>batikFX.svg</code> (because
+ it is the only test with <code>batikFX.svg</code> in its ID).
+ </p>
+ </section>
+
+ <section>
+ <title>Rendering accuracy tests</title>
+
+ <p>
+ There is a <code>Test</code> implementation,
+ <a class="class" href="../javadoc/org/apache/batik/test/SVGRenderingAccuracyTest.html">SVGRenderingAccuracyTest</a>,
+ which checks that Batikâs rendering of an SVG document stays accurate.
+ It compares reference images with the rendering Batik produces and
+ reports any discrepency.
+ </p>
+
+ <p>
+ An <code>SVGRenderingAccuracyTest</code>âs constructor configuration
+ is made of:
+ </p>
+ <ul>
+ <li>the URL to the SVG it should render, and</li>
+ <li>the URL to a reference PNG file.</li>
+ </ul>
+
+ <p>
+ The default behavior for the test is to render the SVG into a PNG
+ file and compare with the reference image. If there is not
+ difference, the test passes. Otherwise, it fails.
+ </p>
+
+ <p>
+ In addition to this default behavior, the
+ <code>SVGRenderingAccuracyTest</code> can take an optional
+ configuration parameter, an image URL defined as an âacceptedâ
+ variation around the reference image. If such a variation image is
+ specified, then the test will pass if:
+ </p>
+ <ul>
+ <li>the rasterized SVG is equal to the reference image, or</li>
+ <li>
+ the difference between the rasterized SVG and the reference image
+ is exactly the same as the accepted variation image.
+ </li>
+ </ul>
+
+ <p>
+ Finally, to ease the process of creating âacceptedâ variation
+ images, <code>SVGRenderingAccuracyTest</code> can take an optional
+ file name (called <code>saveVariation</code>) describing where the
+ variation between the rasterized SVG and the reference image will be
+ stored in case the rasterized SVG is different from the reference
+ image and the difference is not equal to the variation image, if any
+ was defined. That way, it becomes possible to run a test, and if that
+ test fails, the developer can review the <code>saveVariation</code>
+ image and decide whether it is an acceptable variation or not and
+ use it in subsequent test run as the âacceptedâ variation image, which
+ will allow the test to pass if that exact same variation remains
+ constant.
+ </p>
+ </section>
+
+ <section>
+ <title>Day to day use of regard</title>
+
+ <section>
+ <title>Initial set up</title>
+ <p>
+ To set up the test environment the first time, you need to:
+ </p>
+ <ul>
+ <li>
+ check out the latest version of the code, including the
+ <code>test-</code>* directories (sources, resources and
+ references) and the <code>build.xml</code> file, and
+ </li>
+ <li>
+ run the regard test suite once:
+ <source>build regard</source>
+ </li>
+ </ul>
+ <p>
+ This will generate an HTML test report (<code>report.html</code>)
+ in the
+ <tt>test-reports/<em>yyyy</em>.<em>mm</em>.<em>dd</em>-<em>HHhMMmSSs</em>/html</tt>
+ directory. Depending on how much different text rendering is
+ between your work environment and the environment used to create
+ the reference images, you will get more or less test that will
+ fail, because of differences in the way text is rendered on various
+ platforms and because of fonts not being available on some
+ platforms. For example, a running the test on a Windows 2000
+ laptop against images generated on the Solaris platform caused 16
+ tests out of 71 to fail.
+ </p>
+ <p>
+ Review the HTML report to make sure that the differences are
+ really due to text variations. This will usually be the case and
+ you can make sure by clicking on the diff images contained in the
+ report to see them at full scale. You can you can then turn the
+ âcandidateâ variations generated by the test into âacceptedâ
+ variations by moving files from one directory to another:
+ </p>
+ <source>mv test-references/samples/candidate-variations/*.png test-references/samples/accepted-variations/*.png
+mv test-references/samples/tests/candidate-variations/*.png test-references/samples/tests/accepted-variations/*.png</source>
+ <p>You can now run the test again:</p>
+ <source>build regard</source>
+ <p>
+ Check the newly generated HTML report in the
+ <code>test-reports/html</code> directory: there should no
+ longer be any test failure.
+ </p>
+ </section>
+
+ <section>
+ <title>Daily usage</title>
+
+ <p>
+ Once the intial set up has been done, you can use regard by simply
+ updating your SVN copy, including the test-references. If no
+ change occurs, your test will keep passing with your reference
+ images. If a test fails (e.g., if someone checks in a new reference
+ image from a platform different than the one you are using, you
+ will have to check if it is because of system specific reasons or
+ if there is a bigger problem.
+ </p>
+ </section>
+ </section>
+
+ <section>
+ <title>SVG generator tests</title>
+
+ <p>
+ Regard contains over 100 tests for checking regressions on the SVG
+ generator. If you use <code>svggen</code> as an argument to regard,
+ all the SVG generator tests will be run (because
+ <code>regard.xml</code> points to
+ <code>test-resources/org/apache/batik/svggen/regsvggen.xml</code>,
+ which is a test suite description for the SVG generator and that
+ fileâs root <code>testSuite</code> element has the âsvggenâ ID).
+ </p>
+ </section>
+ </section>
+
+ <section id="writingNewTests">
+ <title>Writing new tests</title>
+
+ <p>
+ Writing a new test involves either configuring a new test or writing a
+ new <code>Test</code> class. In both cases, you will need to add an
+ entry to a test suiteâs XML description. This section uses two test
+ suites as an example: the âregardâ test suite to show how to configure
+ a new test and the âunitTestsâ test suite to show how to add a new
+ <code>Test</code> implementation.
+ </p>
+
+ <section>
+ <title>Adding a new test configuration</title>
+ <p>
+ Imagine that you add a cool new test case to the
+ <code>samples</code> directory, such as
+ <code>linking-viewBox.svg</code>. In order to check for regressions
+ on that file you can add the following entry:
+ </p>
+ <source><![CDATA[ <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
+ <arg class="java.net.URL"
+ value="file:samples/tests/linkingViewBox.svg"/>
+ <arg class="java.net.URL"
+ value="file:test-references/samples/tests/solaris/linkingViewBox.png"/>
+ <property name="VariationURL"
+ class="java.net.URL"
+ value="file:test-references/samples/tests/variation/linkingViewBox.png"/>
+ <property name="SaveVariation"
+ class="java.io.File"
+ value="test-references/samples/tests/variation-candidate/linkingViewBox.png"/>
+ </test>]]></source>
+ <p>
+ to the
+ <code>test-resources/org/apache/batik/test/samplesRendering.xml</code>
+ test suite description, the description of the regard test suite. If
+ you have access to the build machine where the reference images are
+ typically generated, you can check 0n the reference image in
+ <code>test-references/samples/tests</code>. Otherwise (and this is
+ OK), you can let the test fail the first time it is run on the
+ build/test machine and that will be a reminder for whoever is
+ responsible for that machine that a valid reference image should be
+ checked in.
+ </p>
+ </section>
+
+ <section>
+ <title>Writing a new test</title>
+
+ <p>
+ Imagine you want to validate some aspect of your code, and let's take
+ the bridge error handling as an example. You could create a new
+ class in the <code>test-sources</code> directory, in
+ <code>test-sources/org/apache/batik/bridge</code> in our example,
+ and let's call it <code>ErrorHandlingTest</code>. To simplify the
+ implementation of the <code>Test</code> interface, you can choose
+ to derive from the <code>AbstractTest</code> class and generate a
+ <code>DefaultTestReport</code>.
+ </p>
+
+ <p>
+ While writing the <code>Test</code> you may want to use your own XML
+ file with just your test, for example:
+ </p>
+ <source><![CDATA[ <testReportProcessor class="org.apache.batik.test.SimpleTestReportProcessor"/>
+
+ <test class="org.apache.batik.bridge.ErrorHandlingTest">
+ <!-- Expected error code -->
+ <arg class="java.lang.String" value="expected.error.code"/>
+ <!-- Input SVG that this test manipulates to generate error conditions -->
+ <arg class="java.net.URL" value="file:test-resources/org/apache/batik/bridge/ErrorHandlingBase.svg"/>
+ <!-- Id of the element to test -->
+ <arg class="java.lang.String value="rectangle6"/>
+ <!-- Attribute to test -->
+ <arg class="java.lang.String value="x"/>
+ <!-- Value to test on the attribute -->
+ <arg class="java.lang.String value="abcd"/>
+ </test>]]></source>
+ <p>
+ This is just an example and does not pretend to be the right way to go
+ about implementing or specifying this specific type of test. Once done
+ with tuning the test, one or multiple configurations for the test can
+ be added to the relevant test suiteâs XML description. In some cases,
+ it will be interesting to create a separate test suite.
+ </p>
+ </section>
+
+ </section>
+
+ </body>
+
+</document>
Propchange: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/dev/test.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/download.html
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/documentation-sources/content/xdocs/download.html?view=auto&rev=477052
==============================================================================
--- xmlgraphics/batik/trunk/documentation-sources/content/xdocs/download.html (added)
+++ xmlgraphics/batik/trunk/documentation-sources/content/xdocs/download.html Sun Nov 19 21:25:24 2006
@@ -0,0 +1,156 @@
+<?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.
+
+ $Id$
+-->
+
+<!--
+ This file was adapted from Forrest's download page.
+
+ Note: To understand how this template is used, see the documentation
+ at http://forrest.apache.org/howto/howto-asf-mirror.html
+-->
+
+<html>
+ <head>
+ <title>Download Batik</title>
+ </head>
+ <body>
+ <h1>Download Batik</h1>
+ <p>
+ There are several ways you can obtain Batik's binary or sources:
+ </p>
+ <ul>
+ <li><a href="#distributon">Download a distribution</a></li>
+ <li><a href="#snapshot">Download a snapshot</a></li>
+ <li><a href="#svn">Get the source from the Subversion repository</a></li>
+ <li><a href="#nightly">Download an unofficial nightly build</a></li>
+ </ul>
+
+ <h2>Download a distribution</h2>
+ <p>
+ Every Batik release provides three distributions: a binary distribution
+ (named <tt>batik-<em>version</em>.zip</tt>), a source distribution (named
+ <tt>batik-src-<em>version</em>,zip</tt>) and a documentation distribution
+ (named <tt>batik-docs-<em>version</em>.zip</tt>). These distributions
+ are provided as ZIP files on the Apache mirrors. Note that it is
+ good practice to <a href="install.html#verify">verify the integrity</a>
+ of the distribution files.
+ </p>
+ <p>
+ After downloading the distribution, consult the
+ <a href="install.html">installation notes</a> for details on how to
+ install.
+ </p>
+ <h3>
+ <a name="closest"></a>Current official release (closest mirror site
+ selected automatically)
+ </h3>
+ <p>
+ You are currently using <b>[preferred]</b>. If you encounter a
+ problem with this mirror, then please select another. If all
+ mirrors are failing, there are backup mirrors at the end of the list.
+ See <a href="http://www.apache.org/mirrors/">status</a> of mirrors.
+ </p>
+ <form action="[location]" method="get" id="SelectMirror">
+ Other mirrors: <select name="Preferred">
+ <!--[if-any http] [for http]-->
+ <option value="[http]">[http]</option>
+ <!--[end] [end]-->
+ <!--[if-any ftp] [for ftp]-->
+ <option value="[ftp]">[ftp]</option>
+ <!--[end] [end]-->
+ <!--[if-any backup] [for backup]-->
+ <option value="[backup]">[backup] (backup)</option>
+ <!--[end] [end]-->
+ </select>
+ <input type="submit" value="Change" />
+ </form>
+ <p>
+ The current release is Apache Batik 1.6 (see the
+ <a href="[preferred]/xml/batik/README.txt">release change log</a>).
+ </p>
+ <dl>
+ <dt>Binary distribution</dt>
+ <dd>
+ <a href="[preferred]/xml/batik/batik-1.6.zip">batik-1.6.zip</a>
+ [<a href="http://www.apache.org/dist/xml/batik/batik-1.6.zip.asc">PGP</a>]
+ [<a href="http://www.apache.org/dist/xml/batik/batik-1.6.zip.md5">MD5</a>]
+ </dd>
+ </dl>
+ <dl>
+ <dt>Source distribution</dt>
+ <dd>
+ <a href="[preferred]/xml/batik/batik-src-1.6.zip">batik-src-1.6.zip</a>
+ [<a href="http://www.apache.org/dist/xml/batik/batik-src-1.6.zip.asc">PGP</a>]
+ [<a href="http://www.apache.org/dist/xml/batik/batik-src-1.6.zip.md5">MD5</a>]
+ </dd>
+ </dl>
+ <dl>
+ <dt>Documentation distribution</dt>
+ <dd>
+ <a href="[preferred]/xml/batik/batik-docs-1.6.zip">batik-docs-1.6.zip</a>
+ [<a href="http://www.apache.org/dist/xml/batik/batik-docs-1.6.zip.asc">PGP</a>]
+ [<a href="http://www.apache.org/dist/xml/batik/batik-docs-1.6.zip.md5">MD5</a>]
+ </dd>
+ </dl>
+ <p>
+ Older releases are available from the
+ <a href="http://archive.apache.org/dist/xml/batik">Apache archives</a>.
+ However, we strongly recommend using the current release of Batik.
+ </p>
+
+ <h2><a name="snapshot"></a>Current development snapshot</h2>
+ <p>
+ Nightly snapshots of the source tree are available from the
+ <a href="http://svn.apache.org/builds/xml-batik">Apache build server</a>.
+ These snapshots represent the current state of development and may
+ or may not be as stable as releases. There are two distributions
+ provided: a complete copy of the Subversion repository trunk
+ (named <tt>batik-svn-<em>date</em>.zip</tt>), including Batik's
+ <a href="dev/test.html">regression testing utility</a> and reference
+ images; and a snapshot of the aforementioned source code without
+ any of the testing facilities (named
+ <tt>batik-src-<em>date</em>.zip</tt>).
+ </p>
+
+ <h2><a name="svn"></a>Subversion repository</h2>
+ <p>
+ To fetch the latest Subversion repository trunk, just run the following
+ command:
+ </p>
+ <pre class="code">svn checkout http://svn.apache.org/repos/asf/xmlgraphics/batik/trunk/</pre>
+ <p>
+ You can also browse the Subversion repository using ViewCVS at
+ <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/batik/">http://svn.apache.org/viewcvs.cgi/xmlgraphics/batik/</a>.
+ </p>
+
+ <h2><a name="nightly"></a>Unofficial nightly build</h2>
+ <p>
+ Unofficial nightly builds of the latest Subversion repository sources are
+ available for download from
+ <a href="http://arc.mcc.id.au/batik-nightly/">http://arc.mcc.id.au/batik-nightly/</a>.
+ On this page you can also find a
+ <a href="http://java.sun.com/products/javawebstart/">Java Web Start</a>able
+ version of <a href="tools/browser.html">Squiggle, the SVG browser</a>,
+ from the latest nightly build. Note that the builds on this page are
+ not supported.
+ </p>
+ </body>
+</html>
Propchange: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/download.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/faq.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/documentation-sources/content/xdocs/faq.xml?view=auto&rev=477052
==============================================================================
--- xmlgraphics/batik/trunk/documentation-sources/content/xdocs/faq.xml (added)
+++ xmlgraphics/batik/trunk/documentation-sources/content/xdocs/faq.xml Sun Nov 19 21:25:24 2006
@@ -0,0 +1,858 @@
+<?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 -->
+<!-- author cjolif@ilog.fr -->
+<!-- version $Id: faq.xml 388441 2006-03-24 07:50:03Z cam $ -->
+<!-- ====================================================================== -->
+
+<!DOCTYPE faqs PUBLIC "-//APACHE//DTD FAQ V2.0//EN" "http://forrest.apache.org/dtd/faq-v20.dtd">
+<faqs>
+ <title>Frequently Asked Questions</title>
+
+ <part id="part-general">
+ <title>General questions</title>
+
+ <faq id="what-is-batik">
+ <question>What is Batik?</question>
+ <answer>
+ <p>
+ Batik is a Java-based toolkit for applications or applets that want
+ to use images in the <a href="site:svg11">Scalable
+ Vector Graphics (SVG)</a> format for various purposes, such as
+ display, generation or manipulation.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="what-is-svg">
+ <question>What is SVG?</question>
+ <answer>
+ <p>
+ <a href="site:svg11">SVG</a> (Scalable Vector
+ Graphics) is an open-standard language for describing
+ two-dimensional (2D) graphics in XML. It is a Recommendation from the
+ <a href="http://www.w3.org/">W3C</a>. SVG lets you describe rich images
+ with features such as gradients, transparency, filter effects and animation.
+ </p>
+ <p>
+ SVG has three types of graphic objects: shapes (e.g., paths consisting
+ of straight lines and curves), images and text. Graphical objects can be grouped,
+ styled, transformed and composited (e.g., drawn with transparency). SVG has a
+ large set of static features which includes nested transformations, clipping
+ paths, masking and filter effects.
+ </p>
+ <p>
+ In addition, SVG images can be dynamic and interactive. A rich set of event
+ handlers such as for mouse movement and clicks can be assigned to any SVG
+ graphical object. These handlers can invoke scripts, which, in response to an
+ event, can dynamically modify the SVG graphic through the SVG Document Object Model
+ (DOM) API, allowing, for example scripts to change the color or location of graphical
+ elements.
+ </p>
+ <p>
+ SVG graphical elements can be animated through scripting. Alternatively,
+ animation sequences can be expressed directly in XML because SVG leverages the
+ <a href="site:smil">SMIL Animation</a>
+ specification for multimedia, another
+ <a href="http://www.w3.org/">W3C</a> specification.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="what-can-i-do">
+ <question>What can I do with Batik?</question>
+ <answer>
+ <p>
+ Batik contains several <a href="site:architecture">core modules</a>
+ which can be used independently or jointly to <strong>generate SVG
+ content</strong> (see the <a href="site:generator">SVG Generator</a>
+ and <a href="site:dom-api">SVG DOM</a> implementation documentation)
+ <strong>view SVG content</strong> (see the <a href="site:swing">JSVGCanvas</a>)
+ or <strong>convert to and from the SVG format</strong> (see the
+ <a href="site:transcoder">SVG Transcoder</a> page).
+ </p>
+
+ <p>
+ In addition, Batik contains
+ <a href="using/architecture.html#lowLevelComponents">low level
+ modules</a>, such as an object-oriented Graphic Vector Toolkit
+ (GVT), a set of low level parsers specific to the SVG syntax and a
+ set of <a href="site:extending">extensions</a> to the Java 2D API
+ (such as sophisticated fill types and filter effects).
+ </p>
+
+ <p>
+ Finally, Batik comes with <a href="site:tools">packaged applications</a> to help developers get
+ familiar with the code and be quickly able to use the various modules: Squiggle, an
+ <a href="site:browser">SVG browser</a> (in the
+ <code>org.apache.batik.apps.svgbrowser</code> package) an
+ <a href="site:rasterizer">SVG rasterizer</a> (in the
+ <code>org.apache.batik.apps.rasterizer</code> package), a
+ <a href="site:font-converter">Font converter</a> (in the
+ <code>org.apache.batik.apps.ttf2svg package</code>) and an
+ <a href="site:pretty-printer">SVG pretty printer</a> (in the
+ <code>org.apache.batik.apps.svgpp package</code>).</p>
+ <p>
+ Squiggle, the <a href="site:browser">SVG browser</a> can display SVG
+ documents and lets the user zoom, pan and rotate any SVG document,
+ view the SVG source, link between SVG documents, view a tree
+ representation of the SVG DOM and more. One important component of
+ the SVG viewer is the <code>org.apache.batik.swing.JSVGCanvas</code>
+ component, which can be plugged in to any Java application or applet
+ to provide SVG viewing capability.
+ </p>
+ <p>
+ The <a href="site:rasterizer">SVG rasterizer</a>
+ lets the user convert
+ SVG files to raster formats such as JPEG, PNG or TIFF . It
+ contains an extensible mechanism so that arbitrary raster
+ formats can be added. For example, the rasterizer lets you
+ create one SVG file with a special effect (e.g., shadows,
+ gradients, etc.), turn it into a PNG image, then modify the
+ SVG source (e.g., modify a piece of text or a color), and
+ generate another PNG image from it. This way, you can easily
+ generate a series of images sharing a common theme or look and
+ feel to post on a web site. (Note that the rasterizer can also
+ be used on a web server to do this conversion automatically).
+ </p>
+ <p>
+ The <a href="site:font-converter">SVG Font Converter</a>
+ lets the user easily create
+ an <a href="http://www.w3.org/TR/SVG11/fonts.html">SVG
+ Font</a> for a set of characters from a TrueType Font
+ file. That SVG Font definition can be embedded in a document
+ using the characters. This allows users to create SVG
+ documents that are self contained and do not rely on system
+ fonts, and guarantees that the SVG file will be displayed
+ exactly as it was authored on all platforms.
+ </p>
+
+ <p>
+ The <a href="site:pretty-printer">SVG Pretty Printer</a>
+ is a convenience tool to
+ pretty print an SVG document, which means that you can
+ reformat any existing SVG document to produce a nicely
+ formatted and highly legible version.
+ </p>
+ <p>
+ These applications show that Batik can be used client side
+ (the browser can be used on any client machine) and server
+ side (the rasterizer can be used to serve SVG images to client
+ machines that do not have SVG support).
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="why-at-apache">
+ <question>Why do we have such a project at Apache?</question>
+ <answer>
+ <p>
+ The <a href="http://xmlgraphics.apache.org/charter.html">mission
+ of the Apache XML Graphics Project</a> is to promote the use of
+ XML-based graphics by âproviding robust, full-featured,
+ commercial-quality, and freely available software packages for the
+ conversion of XML to graphical output and for related componentsâ.
+ Batik as an open source implementation of a key format for todayâs
+ and tomorrowâs web fits well in this mission.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="how-does-batik-relate">
+ <question>How does Batik relate to other Apache projects?</question>
+ <answer>
+ <p>
+ Batik is used in <a href="http://cocoon.apache.org/">Cocoon</a>
+ for server side rasterization of SVG images. In addition, the Batik is used in the
+ <a href="http://xmlgraphics.apache.org/fop/">FOP</a> project to convert
+ SVG images to PDF format.
+ </p>
+ </answer>
+
+ </faq>
+
+ <faq id="how-did-it-start">
+ <question>How did it start?</question>
+ <answer>
+ <p>
+ Batik started out because several teams doing SVG related projects decided to join
+ efforts with the idea that the whole will be greater than the sum of the parts. The
+ following companies or institutions are part of the team that contributed and/or
+ created the initial Batik project, during the fall of 2000:
+ </p>
+ <ul>
+ <li><a href="http://www.csiro.au/">CSIRO</a></li>
+ <li><a href="http://www.ilog.com/">ILOG</a></li>
+ <li><a href="http://koala.ilog.fr/">Koala Team</a></li>
+ <li><a href="http://www.kodak.com/">Eastman Kodak Company</a></li>
+ <li><a href="http://www.sun.com/">Sun Microsystems, Inc.</a></li>
+ </ul>
+ <p>
+ In addition, the Batik project is supported by <a href="http://www.ibm.com/">IBM</a>.
+ </p>
+ <p>
+ We encourage anyone to participate. As with all ASF projects, all efforts are
+ volunteer-based. We are looking for individuals to work with us on
+ fulfilling our goals for Batik in the spirit of collaborative open-source
+ software development.
+ </p>
+ </answer>
+
+ </faq>
+
+ <faq id="what-is-next">
+ <question>Where is Batik going? What is next?</question>
+ <answer>
+ <p>
+ The SVG implementation is not complete (see the current
+ <a href="site:status">status</a>), and there is more work to
+ do to achieve a fully functional viewer.
+ </p>
+
+ <p>
+ Batik 1.1 supports all static SVG features,
+ linking and a limited support for scripting, and the 1.5 release
+ completed support for scripting and dynamic documents.
+ With Batik 1.6 came many improvements to
+ the implementation of SVG DOM functions, bug fixes, performance
+ improvements, and the beginning of some SVG 1.2 support.
+ Declarative animation and further SVG 1.2 features
+ should be supported in the 2.0 release.
+ </p>
+ <p>
+ The type of applications (e.g., transcoding applications)
+ that can or will be added to Batik depends on contributions
+ and feedback.
+ </p>
+ </answer>
+
+ </faq>
+
+ <faq id="how-can-i-create-svg">
+ <question>How can I create and author SVG content?</question>
+ <answer>
+ <p>
+ Well, you can always use a plain text editor such as vi or
+ xemacs, but there are many graphic authoring packages that can
+ export SVG documents and that will let you author SVG content
+ visually.
+ </p>
+ <p>
+ You can get a list of tools exporting SVG from the <a
+ href="http://www.w3.org/Graphics/SVG/SVG-Implementations#edit">SVG
+ implementation</a> section of the SVG Home page on the W3C
+ web site. You can also imagine building a tool on top of
+ Batik: feel free to contribute!
+ </p>
+ <p>
+ Authoring is one way of creating SVG content, and graphic
+ authoring packages are useful for that purpose. However, there
+ are many types of graphics which can be generated, such as
+ stock quotes, statistical data, etc. For these types of
+ graphics, there are many ways to generate SVG content. For
+ example, if your data (say stock information) is contained in
+ an XML document, you could use XSLT to transform your XML data
+ into SVG. If your data comes from a database and you retrieve
+ that data in a servlet on a Web server (e.g., using JDBC), you
+ could use the Java binding for the DOM API to generate an SVG
+ document from the database data. You could also use Batikâs
+ SVG generator and use the Java 2D API to generate that
+ graphic.
+ </p>
+ <p>
+ The following URLs will be useful to learn more about each of
+ these solutions:
+ </p>
+ <ul>
+ <li><a href="http://xml.apache.org/xalan-j/index.html">Xalan for XSLT</a></li>
+ <li><a href="http://xml.apache.org/xerces-j/index.html">Xerces</a> and
+ <a href="http://java.sun.com/xml/download.html">Crimson</a> for the DOM API</li>
+ <li><a href="site:generator">SVG Generator</a></li>
+ </ul>
+ </answer>
+ </faq>
+
+ <faq id="what-other-svg-products-exist">
+ <question>What other SVG products are out there?</question>
+ <answer>
+ <p>
+ There are many companies supporting SVG and you will find a list of
+ available implementations on the
+ <a href="http://www.w3.org/Graphics/SVG/SVG-Implementations">W3Câs SVG
+ implementation page</a>.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="svg-spec">
+ <question>Where can I find the SVG specification?</question>
+ <answer>
+ <p>
+ The <a href="site:svg11">SVG specification</a> is
+ available from the <a href="http://www.w3.org/">W3C web site</a>.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="how-much-does-batik-implement">
+ <question>How much of SVG does Batik implement?</question>
+ <answer>
+ <p>
+ The <a href="site:status">status page</a> shows how much of the SVG
+ specification Batik implements by showing which of the tests in the
+ <a href="status.html#beSuiteStatus">SVG Basic Effectivity test
+ suite</a> Batik successfully passes.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="benefits-of-svg-being-xml">
+ <question>What are the benefits of SVG being an XML grammar?</question>
+ <answer>
+ <p>
+ Being an XML grammar means SVG can leverage work done around
+ XML, and SVG actually leverages other grammars such as
+ <a href="http://www.w3.org/TR/2001/REC-xlink-20010627/">XLink</a>,
+ for linking and
+ <a href="http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimationFramework">SMIL</a>
+ for the animation.
+ </p>
+ <p>
+ Beyond the use and mix with other XML syntaxes, being an XML grammar
+ lets SVG benefit from the plethora of XML tools that make it so easy
+ to manipulate, generate, search and edit XML files.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="what-is-in-a-name">
+ <question>Where does the name come from?</question>
+ <answer>
+ <p>
+ Batik is a highly evolved art tradition that developed in Java
+ (one of the islands comprising what is now called
+ Indonesia). Batik is generally thought of as the quintessentially
+ Indonesian textile. Motifs of flowers, twining plants, leaves,
+ buds, birds, butterflies, fish, insects and geometric forms are
+ rich in symbolic association and variety; there are about three
+ thousand recorded batik patterns.
+ </p>
+ <p>
+ We think that Batik gracefully evokes Java, graphics and
+ high-quality, terms that constitute the core of the toolkit.
+ </p>
+ <p>
+ <a href="http://www.expat.or.id/info/batik.html">This page</a>
+ shows examples of what Batik textures look like.
+ </p>
+ </answer>
+ </faq>
+ </part>
+
+ <part id="batik-help">
+ <title>Getting started with Apache Batik/SVG</title>
+
+ <faq id="system-requirements">
+ <question>What are the system requirements to run Batik?</question>
+ <answer>
+ <p>
+ Batik is written in the Java language and requires a version 1.3
+ implementation at this time.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="how-to-install">
+ <question>How do I install Batik?</question>
+ <answer>
+ <p>
+ You will need the <a href="http://java.sun.com/">JDK 1.3</a> to run
+ Batik.
+ </p>
+ <p>
+ To install Batik you need to <a href="site:download">download</a>
+ the binary or source distribution and unzip it on your computer.
+ </p>
+ <p>
+ You can have a look at the <a href="site:install">installation
+ instructions</a> for more information.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="how-can-i-see-demo">
+ <question>How can I see a demo?</question>
+ <answer>
+ <p>
+ You can see an online demonstration of Squiggle the SVG
+ browser on the <a href="site:demo">demo page</a>. Alternatively, you
+ can <a href="site:download">download</a> Batik or see
+ <a href="site:browser">screenshots</a> of the Batik SVG viewer,
+ images created from the <a href="site:rasterizer">rasterizer</a> and
+ an <a href="site:generator">example</a> of how to use the
+ <code>SVGGraphics2D</code> generator.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="what-scripting-languages-batik-supports">
+ <question>What scripting languages can I use in my SVG files?</question>
+ <answer>
+ <p>
+ A limited support of scripting in SVG files is provided with
+ the current version of Batik (script are executed but dynamic
+ update is not supported).
+ </p>
+ <p>
+ Batik can recognize the following scripting languages:
+ </p>
+ <ul>
+ <li>
+ ECMAScript thanks to the
+ <a href="http://www.mozilla.org/rhino/">Mozilla Rhino</a> JavaScript
+ engine included in the distribution,
+ </li>
+ <li>
+ Python for which you need to download the
+ <a href="http://www.jython.org">Jython</a> engine, and
+ </li>
+ <li>
+ Tcl for which you need to download the
+ <a href="http://dev.scriptics.com/software/java/">Jacl</a> engine.
+ </li>
+ </ul>
+ <p>
+ To get more information on how to install optional
+ scripting languages you can have a look at the
+ <a href="site:install">installation instructions</a>.
+ </p>
+ </answer>
+ </faq>
+ </part>
+
+ <part id="batik-error">
+ <title>Troubleshooting Apache Batik</title>
+
+ <faq id="NoSuchMethodException">
+ <question>
+ When I try to run Batik it results in a NoSuchMethodException. What
+ is the problem?
+ </question>
+ <answer>
+ <p>
+ There is certainly something wrong with your classpath. Clear your
+ <code>CLASSPATH</code> environment variable and be sure to remove
+ all the libraries which use the W3Câs DOM bindings from
+ <code>jre/lib/ext</code>before running any of the Batikâs
+ applications.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="display-does-not-update">
+ <question>
+ When I change the document in Java it doesnât update the
+ display, even if I call repaint?
+ </question>
+ <answer>
+ <p>
+ There are two common causes for this. The first is that the
+ <a class="class" href="javadoc/org/apache/batik/swing/JSVGCanvas.html">JSVGCanvas</a>
+ doesnât know itâs a dynamic document. Normally
+ Batik detects this by looking for script elements but when you
+ modify the document from Java it canât tell. So call
+ </p>
+ <source>myJSVGCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);</source>
+ <p>
+ before loading the document (with <code>setURI</code>,
+ <code>setDocument</code>, <code>setSVGDocument</code>, etc.).
+ </p>
+ <p>
+ The second common reason is that the changes arenât made in
+ the
+ <a class="class" href="javadoc/org/apache/batik/bridge/UpdateManager.html">UpdateManager</a>âs
+ thread. You can run code in the <code>UpdateManager</code>âs thread
+ with the following:
+ </p>
+ <source>UpdateManager um = JSVGCanvas.getUpdateManager();
+um.getUpdateRunnableQueue().invokeLater(Runnable);</source>
+ <p>
+ <strong>NOTE:</strong> The update manager only becomes
+ available after the first rendering completes. You can
+ be notified when this happens by registering a
+ <code>GVTTreeRendererListener</code>.
+ </p>
+ </answer>
+ </faq>
+ <faq id="must-mouseover-to-change">
+ <question>
+ When I change the document in Java it only updates if I
+ move the mouse over the canvas?
+ </question>
+ <answer>
+ <p>
+ The most common causes for this, is that the changes are not made in
+ the <code>UpdateManager</code>âs thread. See previous FAQ for
+ example code to run code in the Update Managerâs thread. Moving the
+ mouse works because it delivers the mouse move events in the update
+ thread, and after a runnable completes in the
+ <code>UpdateManager</code>âs thread it checks if the canvas needs
+ repainting.
+ </p>
+ </answer>
+ </faq>
+ <faq id="changes-are-not-rendered">
+ <question>
+ When I create new SVG elements or modify some SVG attributes through
+ the DOM API, from ECMAScript, nothing happens, the changes are not
+ rendered. Why not?
+ </question>
+ <answer>
+ <p>
+ A common problem is that script contain the wrong DOM calls
+ to create elements or modify attributes.
+ </p>
+ <p>
+ SVG elements need to be created in the SVG namespace. For example,
+ to create a <code>rect</code> element, you should use
+ </p>
+ <source>document.createElementNS(svgNS, "rect");</source>
+ <p>
+ (where <code>svgNS</code> is equal to
+ <code>"http://www.w3.org/2000/svg"</code>), which appropriately
+ creates the <code>rect</code> element in the SVG namespace. A call to
+ </p>
+ <source>document.createElement("rect")</source>
+ <p>
+ creates an element with the name <code>rect</code> but which does not
+ belong to the SVG namespace. As such, it is ignored by Batik.
+ </p>
+ <p>
+ Most SVG attributes belong to what is called the âper element type
+ partition namespaceâ (see the
+ <a href="http://www.w3.org/TR/REC-xml-names">Namespaces in XML</a>
+ specification). The appropriate way to set attributes on an SVG
+ element is a call to <code>setAttributeNS</code> with a namespace
+ value of <code>null</code>, for example:
+ </p>
+ <source>elt.setAttributeNS(null, "width", "40");</source>
+ <p>
+ In the Batik SVG DOM implementation, you can also use a call to
+ <code>setAttribute</code> and you can write
+ </p>
+ <source>elt.setAttribute("width", "40")</source>
+ <p>
+ However, it is important to know that some implementations make a
+ difference between <code>setAttribute(x, y)</code> and
+ <code>setAttributeNS(null, x, y)</code>, so it is goo practice
+ to use <code>setAttributeNS</code> which is the only guaranteed
+ interoperable way of setting attributes in a namespace aware DOM
+ implementation.
+ </p>
+ <p>
+ Finally, for attributes which belong to a specific namespace, like the
+ the <code>href</code> attribute on the <code>image</code> element,
+ you have to use the <code>setAttributeNS</code> method with the
+ XLink namespace. For example, assuming <code>img</code> references an
+ <code>image</code> DOM <code>Element</code>, you can modify the
+ href as follows:
+ </p>
+ <source>img.setAttributeNS(xlinkNS, "xlink:href", "myImage.jpg");</source>
+ <p>
+ where <code>xlinkNS</code> is equal to
+ <code>"http://www.w3.org/1999/xlink"</code>.
+ </p>
+ <p>
+ For more information on common authoring pitfalls, see Jonathan Wattâs
+ <a href="http://jwatt.org/svg/authoring/">SVG Authoring
+ Guidelines</a>.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="null-updatemanager">
+ <question>
+ When I get the UpdateManager from the canvas sometimes
+ it is null, why?
+ </question>
+ <answer>
+ <p>
+ The <code>JSVGCanvas</code> is highly asynchronous so when you call
+ <code>setURI</code>, <code>setDocument</code> or
+ <code>setSVGDocument</code> they return essentially immediately.
+ Behind the scenes, the canvas creates the rendering tree and does a
+ first rendering after dispatching the document <code>SVGLoad</code>
+ event. Only after this first rendering does the
+ <code>UpdateManger</code> become available.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="why-updatemanager">
+ <question>
+ Why do I have to go through the UpdateManager to
+ run my code? Canât you just synchronize the DOM?
+ </question>
+ <answer>
+ <p>
+ It would be possible to synchronize individual calls to
+ the DOM, however in general this is almost useless for the
+ way DOM works. For example creating a single rectangle
+ element takes approximately 6 individual DOM calls. So
+ higher level synchronization is needed.
+ </p>
+ <p>
+ The use of a
+ <a class="class" href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runnable.html">Runnable</a>
+ is a common way of accomplishing synchronization for a block of code.
+ This is essentially the approach that Swing takes (all Swing
+ modification should take place in the Swing thread). It was
+ considered to use the Swing event thread, but this would lock the
+ user interface while scripts were working.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="extension-tags-work-with-source-not-binary">
+ <question>
+ I can use the Batik extension tags with the source distribution
+ but not with the binary distribution. What am I missing?
+ </question>
+ <answer>
+ <p>
+ When running from the source distribution you automatically get the
+ service provider entries for the Batik extension elements
+ (such as <code>regularPolygon</code> and <code>star</code>).
+ We chose not to include these by default in the
+ binary distribution for the Batik applications.
+ </p>
+ <p>
+ There is a subdirectory called <code>extensions</code> that has jar
+ files that enable the extended elements from Batik.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="red-circles">
+ <question>
+ Why do I get red circles when I view the samples/extensions files?
+ </question>
+ <answer>
+ <p>
+ You are using the binary distribution. This distribution does not
+ include support for our example extensions (they are just examples
+ and other people can do more sophisticated things).
+ </p>
+ <p>
+ If you want to view these examples you need to use the extension
+ enabled versions of the applications in the <code>extensions</code>
+ subdirectory.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="dom-modifications-do-not-display">
+ <question>
+ I am modifying the DOM after displaying it in the JSVGCanvas,
+ but my changes arenât shown (even if I call repaint).
+ </question>
+ <answer>
+ <p>
+ For efficiency, if Batik loads a static document it doesnât
+ set up any dynamic support. Batik normally decides whether a
+ document is dynamic by checking if it contains any
+ <code>script</code> elements or event handler attributes. However,
+ if your Java application is modifying the DOM directly there may be
+ no script elements. In this case you need to tell Batik to set up
+ dynamic support regardless.
+ </p>
+ <p>
+ You can inform the <code>JSVGCanvas</code> that a document should
+ be handled dynamically by calling the <code>setDocumentState</code>
+ method, just before loading the document:
+ </p>
+ <source>JSVGCanvas myCanvas = ...;
+myCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
+myCanvas.setURI("myFile.svg");</source>
+ </answer>
+ </faq>
+
+ <faq id="batik-fails-with-fop-on-org.w3c.xxx">
+ <question>
+ I am trying to use Batik and FOP together but Batik does not work and
+ fails on the <code>org.w3c.</code>* packages. What is happening?
+ </question>
+ <answer>
+ <p>
+ Both FOP and Batik use the <code>org.w3c.</code>* packages.
+ Depending on the version of FOP and Batik, Batik has been using a
+ version of these packages which is more recent than the one in the
+ <code>xml-apis.jar</code> file FOP uses. However, if the
+ <code>xml-apis.jar</code> file that comes with the FOP distribution
+ is loaded before the Batik jar files, then the version coming with
+ FOP takes precedence (i.e., that is the version the Java Virtual
+ Machine loads). Because that version is incompatible with Batik, you
+ encounter this problem.
+ </p>
+ <p>
+ The solution is to either repackage the <code>xml-apis.jar</code> file
+ with the classes in the Batik distribution (you will need the Batik
+ source distribution to do that), or you will need to make sure the
+ Batik jars are loaded before FOPâs <code>xml-apis.jar</code>, for
+ example by putting Batikâs jar file before FOPâs in your classpath.
+ If you are copying your jar files to <code>.../jre/lib/ext</code>,
+ you can simply remove the FOP <code>xml-apis.jar</code> file from
+ that directory.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="how-to-checkout-latest-batik-via-svn">
+ <question>
+ How do I checkout the latest SVN version of Batik?
+ </question>
+ <answer>
+ <p>
+ You just have to follow the instructions on the
+ <a href="site:download">download page</a>.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="mac-os-x-messed-up-svg-files">
+ <question>
+ Iâm using Mac OS X, and some of the SVG files I view are messed up
+ (things appear clipped or out of place). What do I need to do to fix
+ this?
+ </question>
+ <answer>
+ <p>
+ As of Mac OS X release 10.1.1 there still appears to be
+ problems in the Apple implementation of the Java 2D APIs. The
+ true source of these problems and/or workarounds have yet to be
+ identified (although the problems appear to be closely tied to a
+ âgstack underflowâ error message from the Apple JVM). We are
+ interested in finding the source of these problems and
+ reasonable workarounds, so if you know what causes these errors
+ the Batik team would be very interested in hearing from you
+ (either directly or through the user/developer mailing lists).
+ </p>
+ <p>
+ Other things to be aware of on Mac OS X, due to fixes for
+ other problems with Java 2D under Mac OS X, you may find that
+ some filtering operations take significantly more memory than on
+ other platforms. This will be especially true for deeply nested
+ filter trees (where the result of one filtering operation is
+ filtered by another filtering operation).
+ </p>
+ <p>
+ Finally a few hints on avoiding problems under Mac OS X. The
+ bugs seems to be triggered by filters, and pure raster SVG documents
+ have not been found to cause problems. The use of the
+ <code>filterRes</code> attribute on the <code>filter</code> element
+ seems especially problematic. The bug isnât 100% reproducible, so
+ while some content exhibits the problem, if you play with the
+ document enough it will often âfixâ itself for a while, then later
+ it will go back to being broken (which indicates that the problem may
+ be some sort of race condition in the JVM).
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="mac-os-x-batik-demo-crash">
+ <question>
+ I cannot run the Batik demo on Mac OS X (10.1.1). The Batik splash
+ screen hangs. What is happening?
+ </question>
+ <answer>
+ <p>
+ The Batik <a href="site:demo">demo</a> uses Java Web Start. Java Web
+ Start (under the <code>Applications/Utilities</code> folder), lets
+ you start a Java application from a web browser. You can see the
+ debug traces by enabling the Java console for Java Web Start. If you
+ do, you will see that there is a
+ <code>java.lang.NoSuchMethodError</code> exception thrown.
+ </p>
+ <p>
+ This is happening because the Java Web Start jar file
+ (<code>javaws.jar</code> in <code>/Applications/Utilities/Java Web
+ Start/Content/MacOS</code>) contains an older version of the DOM
+ bindings.
+ </p>
+ <p>
+ One work around is to manually patch the <code>javaws.jar</code>
+ file to remove the DOM bindings so that they do not take precedence
+ over the Batik ones.
+ </p>
+ </answer>
+ </faq>
+ </part>
+
+ <part id="batik-dev">
+ <title>How do I contribute to Batik Development?</title>
+
+ <faq id="how-can-i-contribute">
+ <question>How can I contribute to Apache Batik development?</question>
+ <answer>
+ <p>
+ The Batik Project is an open volunteer project in the
+ spirit of the <a href="http://www.apache.org">Apache
+ Software Foundation</a> (ASF). This means that there are
+ many ways to contribute to the project, either with direct
+ participation (coding, documenting, answering questions,
+ proposing ideas, reporting bugs, suggesting bug-fixes, etc.)
+ or by resource donation (publicity, hardware, software,
+ conference presentations, speeches, etc.). Applications that
+ use the Batik modules, such as tools or extensions, are of special
+ interest to the project.
+ </p>
+ <p>
+ The process for contributing to Batik is the same as for other
+ Java projects at Apache. A formal description of that process
+ can be found on the <a href="http://jakarta.apache.org/guidelines/index.html">Jakarta</a>
+ web site. You can also view a list of
+ <a href="site:contributors">who has contributed to Batik</a>.
+ </p>
+ <p>
+ For direct participation, we suggest that you subscribe to the
+ <a href="site:mailing-lists">Batik mailing lists</a> and to
+ checkout the
+ <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/batik/">latest
+ code</a>.
+ </p>
+ </answer>
+ </faq>
+
+ <faq id="submit-patches">
+ <question>How do I submit patches or bug fixes?</question>
+ <answer>
+ <p>
+ You can submit bug fixes and patches to the
+ <a href="mailto:batik-dev@xmlgraphics.apache.org">Batik developers</a>
+ mailing list and you can enter bugs in
+ <a href="site:bugs">Bugzilla</a>.
+ </p>
+ </answer>
+ </faq>
+ </part>
+</faqs>
Propchange: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/faq.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/favicon.ico
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/documentation-sources/content/xdocs/favicon.ico?view=auto&rev=477052
==============================================================================
Binary file - no diff available.
Propchange: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/favicon.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/index.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/documentation-sources/content/xdocs/index.xml?view=auto&rev=477052
==============================================================================
--- xmlgraphics/batik/trunk/documentation-sources/content/xdocs/index.xml (added)
+++ xmlgraphics/batik/trunk/documentation-sources/content/xdocs/index.xml Sun Nov 19 21:25:24 2006
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ 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: index.xml 396260 2006-04-23 12:01:57Z deweese $ -->
+<!-- ========================================================================= -->
+
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
+<document>
+ <header>
+ <title>Batik SVG Toolkit</title>
+ </header>
+
+ <body>
+ <section id="overview">
+ <title>Overview</title>
+
+ <p>
+ Batik is a Java-based toolkit for applications or applets that want to
+ use images in the <a href="site:svg11">Scalable Vector
+ Graphics (SVG)</a> format for various purposes, such as display,
+ generation or manipulation.
+ </p>
+
+ <p>
+ The projectâs ambition is to give developers a set of
+ <a href="using/architecture.html#coreComponents">core modules</a> that can be
+ used together or individually to support specific SVG solutions.
+ Examples of <a href="site:modules">modules</a> are the
+ <a href="site:parsers">SVG Parser</a>, the
+ <a href="site:generator">SVG Generator</a> and the
+ <a href="site:dom-api">SVG DOM</a>. Another ambition for the Batik
+ project is to make it highly
+ <a href="site:extending">extensible</a>—for example, Batik
+ allows the developer to handle custom SVG elements. Even though the goal
+ of the project is to provide a set of core modules, one of the
+ deliverables is a full fledged <a href="site:browser">SVG
+ browser</a> implementation which validates the various modules and
+ their inter-operability.
+ </p>
+ </section>
+
+ <section id="uses">
+ <title>What Batik can be used for</title>
+ <p>
+ <img class="floating" src="images/batikUses.jpg" alt="Batik use cases"/>
+ With Batik, you can manipulate SVG documents anywhere Java is
+ available. You can also use the various
+ <a href="site:modules">Batik modules</a> to
+ <a href="site:generator">generate</a>,
+ <a href="site:dom-api">manipulate</a> and
+ <a href="site:transcoder">transcode</a> SVG images in your
+ applications or applets.
+ </p>
+ <p>
+ Batik makes it easy for Java based applications or applets to
+ deal with SVG content. For example, using Batikâs
+ <a href="site:generator">SVG generator module</a>,
+ a Java application or applet can very easily export its
+ graphics into the SVG format. Using Batikâs
+ <a href="site:swing">SVG viewing component</a>, an application or
+ applet can very easily integrate SVG viewing and interaction
+ capabilities. Another possibility is to use Batikâs modules to convert
+ SVG to various formats, such as raster images
+ (<abbr title="Joint Photographic Expert Group">JPEG</abbr>,
+ <abbr title="Portable Network Graphics">PNG</abbr> or
+ <abbr title="Tagged Image File Format">TIFF</abbr>) or
+ other vector formats (<abbr title="Windows Metafile">WMF</abbr> or
+ <abbr title="Portable Document Format">PDF</abbr>, the latter two due
+ to the transcoder provided by
+ <a href="http://xmlgraphics.apache.org/fop/">Apache Fop</a>).
+ </p>
+ <p>
+ The Batik toolkit includes the following:
+ </p>
+ <ul class="separated">
+ <li>
+ <p><strong>Modules</strong></p>
+ <ul>
+ <!--li>A <a href="site:css">CSS engine</a></li-->
+ <li>An <a href="site:dom-api">SVG DOM implementation</a></li>
+ <li>A set of <a href="site:parsers">SVG microsyntax parsers</a></li>
+ <li>A <a href="site:ecmascript">scripting module</a></li>
+ <li>A <a href="site:generator">generator</a> that creates an SVG document from Java2D calls</li>
+ <li>A <a href="site:swing">Swing SVG component</a></li>
+ <li>A <a href="site:transcoder">transcoder module</a></li>
+ </ul>
+ </li>
+ <li>
+ <p><strong>Tools and applications</strong></p>
+ <ul>
+ <li>Squiggle, an <a href="site:browser">SVG browser</a></li>
+ <li>An <a href="site:rasterizer">SVG rasterizer</a></li>
+ <li>A <a href="site:font-converter">
+ <abbr title="TrueType Font">TTF</abbr> to SVG converter</a></li>
+ <li>A <a href="site:pretty-printer">pretty printer</a> for SVG
+ source files</li>
+ </ul>
+ </li>
+ </ul>
+ <p>
+ See <a href="site:uses">examples of projects and products using
+ Batik</a> for real-life example of how Batik is already integrated in
+ projects and products.
+ </p>
+ </section>
+
+ <section id="spec">
+ <title>The SVG specification</title>
+ <p>
+ Scalable Vector Graphics, SVG, is a <a href="http://www.w3.org/">W3C</a>
+ Recommendation. It defines an XML grammar for rich 2D graphics
+ which includes features such as transparency, arbitrary geometry, filter
+ effects (shadows, lighting effects, etc.), scripting and animation.
+ </p>
+ <p>
+ The SVG specification states:
+ </p>
+ <p class="quote">
+ This specification defines the features and syntax for Scalable Vector
+ Graphics (SVG). SVG is a language for describing two-dimensional
+ graphics in XML [<a href="http://www.w3.org/TR/REC-xml">XML10</a>]. SVG
+ allows for three types of graphic objects: vector graphic shapes (e.g.,
+ paths consisting of straight lines and curves), images and text.
+ Graphical objects can be grouped, styled, transformed and composited
+ into previously rendered objects. The feature set includes nested
+ transformations, clipping paths, alpha masks, filter effects and
+ template objects.
+ </p>
+ <p>
+ SVG documents can be interactive and dynamic. Animations can be defined
+ and triggered either declaratively (i.e., by embedding SVG animation
+ elements in SVG content) or via scripting.
+ </p>
+ </section>
+
+ <section id="status">
+ <title>Implementation status</title>
+ <p>
+ The latest revision of Batik, release 1.6, is a conformant
+ <a href="http://www.w3.org/TR/SVG11/conform.html#ConformingSVGViewers">static
+ SVG implementation</a> and supports
+ <a href="http://www.w3.org/TR/SVG11/interact.html">interactivity</a>,
+ <a href="http://www.w3.org/TR/SVG11/linking.html">linking</a> and
+ <a href="http://www.w3.org/TR/SVG11/script.html">scripting</a> features
+ of the SVG specification. The Batik project does not currently support
+ declarative
+ <a href="http://www.w3.org/TR/SVG11/animate.html">animation</a>,
+ however <a href="site:animation">work is currently underway</a> to
+ add it.
+ </p>
+
+ <p>
+ See the <a href="site:status">status</a> page for a detailed description
+ of the set of SVG features Batik supports.
+ </p>
+ </section>
+
+ <section id="download">
+ <title>Download Batik</title>
+ <p>
+ You can get the Batik distribution, source and binary, from the
+ <a href="site:download">download page</a>.
+ </p>
+
+ <note>
+ All other libraries needed by Batik are included in the distribution.
+ As a consequence the Batik archive is quite big, but after you have
+ downloaded it, you will not need anything else.
+ </note>
+
+ <warning id="SecurityWarning" label="Security warning">
+ <p>
+ This is a warning that a script security issue was reported in
+ the Batik Squiggle browser. Squiggle uses the Rhino scripting
+ engine and some features of that engine can be leveraged by
+ malicious scripts to gain access to otherwise protected
+ resources (like the file system). This issue was fixed in the
+ 1.5.1 release of Batik. If you are using a version of Batik older than
+ 1.5.1, you should upgrade.
+ </p>
+ </warning>
+ </section>
+
+ </body>
+</document>
Propchange: xmlgraphics/batik/trunk/documentation-sources/content/xdocs/index.xml
------------------------------------------------------------------------------
svn:eol-style = native