4import java.awt.event.*;
9import org.apache.batik.swing.JSVGCanvas;
10import org.apache.batik.swing.JSVGScrollPane;
51 svgfile=File.createTempFile(
"aud-svgviewer-",
".svg");
52 }
catch (IOException e) {
53 System.err.println(
"ERROR: "+e.getMessage());
67 frame.setVisible(
false);
72 final JPanel panel =
new JPanel(
new BorderLayout());
73 @SuppressWarnings(
"unused")
74 final JSVGScrollPane pane =
new JSVGScrollPane(
svgCanvas);
77 panel.add(
"South",
label);
92 public static void help() {
94 (
"Batik JSVGCanvas overview\n"+
95 "-------------------------\n"+
96 "Shift+Mouse Left\tpan\n"+
97 "Shift+Mouse Right\tzoom in/out (drag)\n"+
98 "Ctrl+Mouse Left\trectangle zoom\n"+
99 "Ctrl+Mouse Right\trotate [disabled!]\n"+
107 JFrame f=
new JFrame(caption!=
null ? caption :
"aud.util.SVGViewer");
118 parent().addWindowListener(
new WindowAdapter() {
119 public void windowClosing(WindowEvent e) {
126 public static void main(String[] args) {
127 if (args.length==0) {
128 System.err.println(
"usage: java aud.util.SVGViewer file.svg\n");
132 for (String arg : args) {
Simple SVG viewer based on Batik's SVGCanvas.
static void help()
print help (mouse/key bindings) to stdout
JFrame parent()
get parent widget
static SVGViewer displayWindow(File file, String caption)
create new SVGViewer (toplevel window) and display file
JComponent createComponents()
static void main(String[] args)
visualize given dot files (file names as command line arguments)
SVGViewer(JFrame parent, File svgfile)
create new instance
JLabel statusbar()
get status bar
void display()
display current svg file
void setExitOnClose()
exit application if viewer is closed
void display(File file)
display svg file