Debian Codegraph @

documentation-sources/content/xdocs/tools/browser.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>Squiggle, the SVG Browser</title>
31 </header>
32
33 <body>
34 <p>
35 This page describes the main features of Squiggle, the SVG browser that
36 comes with Batik.
37 </p>
38
39 <section id="downloading">
40 <title>Downloading the browser</title>
41
42 <p>
43 Refer to the <a href="site:download">download page</a> to find out
44 how to download Batik. Refer to the
45 <a href="site:install">installation page</a> for
46 instructions on how to install the Batik download on your system.
47 </p>
48 </section>
49
50 <section id="starting">
51 <title>Starting the browser</title>
52 <p>
53 The method for starting the browser depends on the distribution of Batik
54 that you chose to download. The following describes how to start the
55 browser for each distribution (binary and source).
56 </p>
57
58 <section id="starting-binary">
59 <title>Starting the browser for the binary distribution</title>
60
61 <p>
62 If you downloaded the <a href="../install.html#distributions">binary
63 distribution</a> of Batik, you should have a file called
64 <code>batik-1.6.zip</code> (or similar), which, when expanded,
65 created a <code>batik-squiggle.jar</code> file. To start the browser,
66 type the following on the command line:
67 </p>
68 <source>cd <em>installation-directory</em>
69 java -jar batik-squiggle.jar</source>
70 <p>You can pass options on the command line:</p>
71 <source>java -jar batik-squiggle.jar <em>[</em><strong>-font-size</strong> <em>font-size] [URIs]</em></source>
72 <p>where:</p>
73 <dl class="options">
74 <dt><strong>-font-size</strong> <em>font-size</em></dt>
75 <dd>
76 <p>specifies the font size to use in windows and menus, and</p>
77 </dd>
78 <dt><em>[URIs]</em></dt>
79 <dd>
80 <p>specifies the URIs for the SVG documents the browser should open
81 when it starts.</p>
82 </dd>
83 </dl>
84 <p>For example:</p>
85 <source>java -jar batik-squiggle.jar -font-size 10</source>
86 <p>starts the browser with a small widget text font size, and:</p>
87 <source>java -jar batik-squiggle.jar -font-size 10 samples/batikLogo.svg</source>
88 <p>starts the browser with the <code>batikLogo.svg</code> file open and
89 uses a small widget text font size.</p>
90 <p>
91 If you are using Mac OS X, and you have generated the Squiggle
92 application bundle, you can use its icon to start the browser.
93 This is the preferred way to start the browser under Mac OS X,
94 as it ensures better integration with the operating system
95 (a nicer looking menu and dock icon).
96 </p>
97 </section>
98
99 <section id="starting-source">
100 <title>Starting the browser for the source distribution</title>
101
102 <p>
103 If you downloaded the <a href="../install.html#distributions">source
104 distribution</a> of Batik, you should have a zip file
105 called <code>batik-src-1.6.zip</code> (or similar) that expanded into
106 a directory called <code>xml-batik</code> or
107 <code>batik-<em>version</em></code>. In that directory, you can find
108 build scripts for the platform you are running on. For example, there
109 is a <code>build.bat</code> script for users of the Windows platform
110 and there is a <code>build.sh</code> script for UNIX users.
111 </p>
112 <p>
113 To start the browser you should:
114 </p>
115 <ul>
116 <li>
117 Make sure that your <code>JAVA_HOME</code> environment variable is
118 set to your JDK installation directory
119 </li>
120 <li>
121 Open a command line window and change to the <code>xml-batik</code>
122 or <code>batik-<em>version</em></code> directory where the Batik
123 distribution was expanded
124 </li>
125 <li>
126 <p>
127 For Windows, type the following at the command prompt:
128 </p>
129 <source>build squiggle</source>
130 <p>
131 and for Unix and Mac OS X:
132 </p>
133 <source>./build.sh squiggle</source>
134 <p>This will start the browser.</p>
135 </li>
136 </ul>
137 <p>You can pass options to the browser as follows, for Windows:</p>
138 <source>build squiggle <em>[</em><strong>-font-size</strong> <em>font-size] [URIs]</em></source>
139 <p>and for Unix:</p>
140 <source>./build.sh squiggle <em>[</em><strong>-font-size</strong> <em>font-size] [URIs]</em></source>
141 <p>
142 Refer to <a href="#starting-binary">“Starting the browser for the
143 binary distribution”</a> for an explanation of these options.
144 </p>
145 <p>
146 Note that the number of files that can be opened on Windows from the
147 command line is limited because batch files take at most 9
148 parameters.
149 </p>
150 </section>
151
152 <section id="screenshot">
153 <title>Squiggle screenshot</title>
154 <p>
155 The following image shows the result of starting the browser, from the
156 binary or source distribution, with the <code>-font-size 10
157 samples/batikFX.svg</code> options.
158 </p>
159
160 <div class="figure"><img src="images/svgviewerDefaultRegular.png"
161 alt="Screenshot of Squiggle showing the batikFX.svg sample"/>
162 </div>
163
164 </section>
165 </section>
166
167 <section id="viewing">
168 <title>Viewing SVG documents</title>
169 <p>
170 The browser has several features to view and browse SVG documents:
171 </p>
172 <ul>
173 <li><a href="#localFile">Opening a local SVG file</a></li>
174 <li><a href="#urlFile">Opening an SVG file from the web</a></li>
175 <li><a href="#locationBar">Using the location text field to view an SVG file</a></li>
176 <li><a href="#browsing">Browsing SVG files</a></li>
177 <li><a href="#viewingMultiple">Viewing multiple SVG files</a></li>
178 </ul>
179
180 <section id="localFile">
181 <title>Opening a local SVG file</title>
182 <p>
183 In situations where you want to open SVG files locally on the machine
184 where you are running Squiggle, you can use <strong>File&#x2192;Open
185 File</strong> menu item to open that file, or use the
186 <strong>Ctrl-F</strong> key accelerator. Doing so brings up a file
187 chooser that lets you select the file you want to view.
188 </p>
189
190 <div class="figure"><img src="images/svgviewerFileOpen.png"
191 alt="Screenshot of Squiggle showing the 'File&#x2192;Open' menu and file chooser"/>
192 </div>
193 </section>
194
195 <section id="urlFile">
196 <title>Opening an SVG file from the web</title>
197 <p>
198 There are many situations where the SVG content you want to view is
199 not local to the machine where Squiggle is running. In that case, you
200 can use the <strong>File&#x2192;Open Location</strong> menu item, or
201 use the <strong>Ctrl-A</strong> key accelerator to open that page.
202 Doing so brings up a dialog box where you can type in the URL for the
203 file you want to view.
204 </p>
205
206 <div class="figure"><img src="images/svgviewerOpenPage.png"
207 alt="Screenshot of Squiggle showing the 'File&#x2192;Open Location' menu and window"/>
208 </div>
209 </section>
210
211 <section id="locationBar">
212 <title>Using the location bar text field to view an SVG file</title>
213 <p>
214 When you know the URL of the document you want to view,
215 you can enter it directly in the location bar text field
216 at the top of Squiggle, the same way you can enter a URL
217 in an HTML browser.
218 </p>
219
220 <div class="figure"><img src="images/svgviewerLocationBar.png"
221 alt="Screenshot of Squiggle showing the location bar"/>
222 </div>
223 </section>
224
225 <section id="browsing">
226 <title>Browsing SVG files</title>
227 <p>
228 As with HTML content, it is common to navigate back and forth between
229 SVG files (remember that SVG files contain hyperlinks, just like HTML
230 does) and, as described later in this document, it is possible to
231 <a href="#zoomInOut">zoom</a> into SVG documents,
232 <a href="#panning">pan</a> and <a href="#rotating">rotate</a>.
233 </p>
234
235 <div class="figure"><img src="images/svgviewerBrowsing.png"
236 alt="Screnshot of Squiggle showing the 'Go' menu"/>
237 </div>
238
239 <p>
240 Squiggle offers multiple features to help you browse SVG files:
241 </p>
242 <dl>
243 <dt>Navigating between files</dt>
244 <dd>
245 <p>
246 The <strong>Go&#x2192;Back</strong> menu item (or the
247 <strong>Ctrl-left arrow</strong> keyboard accelerator) and the
248 <strong>Go&#x2192;Forward</strong> menu item (or the
249 <strong>Ctrl-right arrow</strong> keyboard accelerator) let you
250 move to the previous and next visited SVG documents.
251 </p>
252 </dd>
253 <dt>History</dt>
254 <dd>
255 <p>
256 The <strong>Go</strong> menu also contains a list of previously
257 viewed SVG documents, which gives you a way to randomly access any
258 document you have already visited.
259 </p>
260 </dd>
261 <dt>Navigating between views</dt>
262 <dd>
263 <p>
264 The <strong>View&#x2192;Previous Transform</strong> menu item
265 (<strong>Ctrl-K</strong>) and the <strong>View&#x2192;Next
266 Transform</strong> menu item (<strong>Ctrl-L</strong>) let you go
267 to the previous or next view of the document. This is useful when,
268 for example, you <a href="#panning">pan</a> or
269 <a href="#rotating">rotate</a> the document and want to go back to
270 the previous view you had of the document (i.e., before you panned
271 or rotated it).
272 </p>
273 </dd>
274 </dl>
275 </section>
276
277 <section id="viewingMultiple">
278 <title>Viewing multiple SVG files</title>
279
280 <div class="figure"><img src="images/svgviewerMultipleFiles.png"
281 alt="Screenshot of Squiggle with two windows open"/>
282 </div>
283
284 <p>
285 Squiggle can display multiple files simultaneously in different
286 windows. To view a new file in a separate window, simply select the
287 <strong>File&#x2192;New Window</strong> menu item or use the
288 <strong>Ctrl-N</strong> keyboard accelerator.
289 </p>
290 </section>
291
292 <section id="reloading">
293 <title>Reloading an SVG document</title>
294
295 <p>
296 When working on an SVG document, you may want the browser to reprocess
297 a document that you have modified. The <strong>File&#x2192;Reload
298 Document</strong> menu item or the <strong>Ctrl-R</strong> keyboard
299 accelerator will cause the document to be reprocessed by the browser.
300 </p>
301 </section>
302 </section>
303
304 <section id="exportAndPrint">
305 <title>Exporting and printing SVG documents</title>
306 <p>
307 The <strong>File&#x2192;Print</strong> menu item or
308 <strong>Ctrl-P</strong> will print the currently displayed SVG document.
309 </p>
310 <p>
311 The <strong>File&#x2192;Export As</strong> menu item offers the option
312 to export the currently displayed SVG document to various raster
313 formats. Currently, the browser supports the
314 <abbr title="Portable Network Graphics">PNG</abbr>,
315 <abbr title="Joint Photographic Expert Group">JPEG</abbr> and
316 <abbr title="Tagged Image File Format">TIFF</abbr> formats.
317 </p>
318 </section>
319
320 <section id="inspecting">
321 <title>Inspecting the SVG source</title>
322
323 <p>
324 The browser offers two ways to inspect the source of an SVG document:
325 <a href="#viewingSource">viewing the plain source</a> or
326 <a href="#viewingTree">viewing the document tree</a>. Both are explained
327 below.
328 </p>
329
330 <section id="viewingSource">
331 <title>Viewing the source</title>
332 <div class="figure"><img src="images/svgviewerViewSource.png"
333 alt="Screenshot of Squiggle showing the 'View&#x2192;View Source' menu item and the source window"/>
334 </div>
335
336 <p>
337 When the browser displays an SVG file, you can select the
338 <strong>View&#x2192;View Source...</strong> menu item or use the
339 <strong>Ctrl-U</strong> keyboard accelerator to view the source code.
340 </p>
341 </section>
342
343 <section id="viewingTree">
344 <title>Viewing the document tree</title>
345 <div class="figure"><img src="images/svgviewerViewTree.png"
346 alt="Screenshot of Squiggle showing the 'View&#x2192;DOM Viewer...' menu item and the DOM viewer window"/>
347 </div>
348
349 <p>
350 When the browser displays an SVG file, you can select the
351 <strong>View&#x2192;DOM Viewer...</strong> menu item or use the
352 <strong>Ctrl-D</strong> keyboard accelerator to open a window that
353 shows the SVG document in the form of a tree. The window lets you
354 navigate the tree, select individual elements, such as a path
355 elements, and view the attributes and CSS values that apply to these
356 elements. While the View Source window shows the SVG source as it
357 was when it was loaded, the DOM Viewer window reflects the current
358 state of the document, including any modifications that have occurred
359 due to script.
360 </p>
361 </section>
362 </section>
363
364 <section id="configuring">
365 <title>Configuring Squiggle</title>
366
367 <p>
368 The <strong>Edit&#x2192;Preferences</strong> menu item or
369 <strong>Ctrl-G</strong> brings up the dialog box shown in the following
370 figure.
371 </p>
372
373 <div class="figure"><img src="images/svgviewerPreferences.png"
374 alt="Screenshot of Squiggle with the Preferences window open"/>
375 </div>
376
377 <p>
378 This dialog contains several types of options, which can be selected
379 with the left-hand side list. For each type of option, a panel lets you
380 configure various browser parameters:
381 </p>
382 <dl>
383 <dt>General panel</dt>
384 <dd>
385 <p>
386 This panel lets you choose some optional behavior:
387 </p>
388 <dl>
389 <dt>Enable double buffering</dt>
390 <dd>
391 When on, the browser uses additional memory resources
392 which improves the quality of effects such as zooming and panning.
393 </dd>
394 <dt>Show Rendering</dt>
395 <dd>
396 When on, the browser will update the canvas while processing an
397 SVG document. This turns on progressive rendering.
398 </dd>
399 <dt>Automatically resize window to document size</dt>
400 <dd>
401 When on, the browser window is resized to fit any newly loaded
402 document.
403 </dd>
404 <dt>Animation rate limiting</dt>
405 <dd>
406 This set of radio buttons determines how often animation
407 updates are performed. This can be set as a maximum percentage
408 of CPU time to use, a maximum number of frames per second, or
409 to perform as many updates as possible (unlimited).
410 </dd>
411 <dt>Print debugging information to console</dt>
412 <dd>
413 When on, some debug messages will be printed to the standard
414 output. This is will likely interest only developers.
415 </dd>
416 <dt>Use a validating XML parser</dt>
417 <dd>
418 When on, the XML parser used to load documents will be in
419 validating mode. This means that the document will be validated
420 against the DTD when it is loaded, and external DTD subsets
421 will be fetched.
422 </dd>
423 </dl>
424 </dd>
425
426 <dt>Security panel</dt>
427 <dd>
428 <p>
429 This panel has options relating to the script and resource
430 access in documents.
431 </p>
432 </dd>
433
434 <dt>Language panel</dt>
435 <dd>
436 <p>
437 This is the panel shown in the above figure. That panel lets you
438 select your languages. The user language can be used in SVG documents
439 to choose between alternate contents. For example, open the
440 <code>samples/moonPhases.svg</code> example. Then, change the user
441 language to French and <a href="#reloading">reload</a> the document
442 (<strong>Ctrl-R</strong>). You will see that the text is now
443 displayed in French. You can do the same with Japanese and the text
444 will be shown in Japanese.
445 </p>
446 </dd>
447
448 <dt>Stylesheet panel</dt>
449 <dd>
450 This panel lets you specify a user stylesheet which can override some
451 of the default settings in viewed SVG documents. This might be useful
452 if you want, for example, to override the font size used in text
453 elements.
454 </dd>
455
456 <dt>Network panel</dt>
457 <dd>
458 <p>
459 This panel lets you configure the proxy server to use if you are
460 working from behind a firewall.
461 </p>
462 </dd>
463 </dl>
464 </section>
465
466 <section id="zooming">
467 <title>Navigating SVG documents: zooming, panning, rotating, transform and thumbnail</title>
468
469 <p>
470 The Batik browser offers multiple way to navigate SVG documents:
471 </p>
472 <ul>
473 <li><a href="#zoomInOut">Zooming in and out</a></li>
474 <li><a href="#panning">Panning</a></li>
475 <li><a href="#rotating">Rotating</a></li>
476 <li><a href="#transform">Arbitrary transforms</a></li>
477 <li><a href="#thumbnail">Thumbnail</a></li>
478 </ul>
479
480 <section id="zoomInOut">
481 <title>Zooming in and out</title>
482 <p>
483 There are several methods to zoom in or out an SVG document:
484 </p>
485 <ul>
486 <li>
487 You can select the <strong>View&#x2192;Zoom In</strong> or
488 <strong>View&#x2192;Zoom Out</strong> menu item.
489 </li>
490 <li>
491 You can <strong>click</strong> on the <strong>Zoom In/Out</strong>
492 tool bar buttons (the ones that show a magnifying glass with
493 <strong>+/-</strong> signs).
494 </li>
495 <li>
496 You can use the <strong>Ctrl+I</strong> and <strong>Ctrl+O</strong>
497 keyboard accelerators.
498 </li>
499 <li>
500 If the mouse is over the document in the display area, you can press
501 the <strong>Ctrl key</strong> then <strong>click the left mouse
502 button and drag</strong> to select the area of interest in the
503 document. This can only be used to zoom into a document.
504 </li>
505 <li>
506 If the mouse is over the document in the display area, you can press
507 the <strong>Shift key</strong> then <strong>click the right mouse
508 button and drag</strong> it. This is called the <em>real time</em>
509 zoom and can be used both for zooming in and out.
510 </li>
511 </ul>
512
513 <div class="figure"><img src="images/svgviewerZoomin.png"
514 alt="Screenshot of Squiggle showing the Zoom In and Zoom Out menu items and tool bar buttons"/>
515 </div>
516 <div class="figure"><img src="images/svgviewerAOI.png"
517 alt="Screenshot of Squiggle zooming to an area of interest"/>
518 </div>
519 </section>
520
521 <anchor id="panning" />
522 <section id="panning">
523 <title>Panning a document</title>
524 <p>
525 Some documents are too big to fit into the browser, especially when
526 you <a href="#zoomInOut">zoom</a> in with a large zoom factor. In
527 these circumstances, it is useful to be able to move around the
528 document and pan to view different parts of the documents. Again,
529 there are multiple ways to do this:
530 </p>
531
532 <ul>
533 <li>
534 With the mouse cursor over the SVG document, <strong>press the Shift
535 key</strong> and then <strong>click and drag the left mouse
536 button</strong> to a new location. When you release the mouse, the
537 document will be translated to the new mouse location.
538 </li>
539 <li>
540 If you have the <a href="#thumbnail">thumbnail</a> open, you can
541 select the marker showing the current area of interest and move it
542 to the desired location.
543 </li>
544 </ul>
545 <div class="figure"><img src="images/svgviewerPan.png"
546 alt="Screenshot of Squiggle illustrating the panning gesture"/>
547 </div>
548 </section>
549
550 <section id="rotating">
551 <title>Rotating a document</title>
552 <p>
553 It is sometimes useful to be able to rotate a document (maps for
554 example). You can do this in the Batik browser by first pressing the
555 <strong>Ctrl key</strong> and then <strong>clicking and dragging
556 the right mouse button</strong> to a new location. The browser will
557 dynamically rotate the image as you move your cursor. When you are
558 satisfied with that angle, you can release the mouse button and the
559 document will be displayed with that new angle.
560 </p>
561 </section>
562
563 <section id="transform">
564 <title>Using the Transform dialog</title>
565 <p>
566 While the mouse and keyboard interactions give interactive way to
567 navigate an SVG document, it is sometimes desirable to be able to
568 define precisely the amount of <a href="#zoomInOut">zoom</a>,
569 <a href="#panning">pan</a> or <a href="#rotating">rotation</a>
570 desired. The Transform dialog, available through the
571 <strong>View&#x2192;Transform</strong> menu (<strong>Ctrl-E</strong>)
572 offers that feature.
573 </p>
574 </section>
575
576 <section id="thumbnail">
577 <title>Thumbnail</title>
578 <p>
579 Panning in the document window can be difficult after you have zoomed
580 into a document because you cannot see the whole document. Panning on
581 large documents (or with a large zoom factor) is made easy by the
582 thumbnail that you can bring up through the
583 <strong>View&#x2192;Thumbnail</strong> menu item or
584 the <strong>Ctrl-Y</strong> keyboard accelerator. The thumbnail shows
585 a rectangular marker that represents the “Area of Interest”, i.e.,
586 the region currently displayed in the window (the visible portion of
587 the document). You can <strong>drag out a rectangular marker with the
588 left mouse button pushed down</strong> to select a new area of
589 interest which will then be shown in the main window.
590 </p>
591
592 <div class="figure"><img src="images/svgviewerThumbnail.png"
593 alt="Screenshot of Squiggle showing the Thumbnail window"/>
594 </div>
595 </section>
596 </section>
597
598 </body>
599 </document>