public void actionPerformed(ActionEvent e) {
if (svgDocument == null) {
return;
}
final ParsedURL u
= new ParsedURL(((SVGOMDocument)svgDocument).getURLObject());
final JFrame fr = new JFrame(u.toString());
fr.setSize(resources.getInteger("ViewSource.width"),
resources.getInteger("ViewSource.height"));
final JTextArea ta = new JTextArea();
ta.setLineWrap(true);
ta.setFont(new Font("monospaced", Font.PLAIN, 12));
JScrollPane scroll = new JScrollPane();
scroll.getViewport().add(ta);
scroll.setVerticalScrollBarPolicy
(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
fr.getContentPane().add(scroll, BorderLayout.CENTER);
new Thread() {
public void run() {
char [] buffer = new char[4096];
try {
Document doc = new PlainDocument();
InputStream is
= u.openStream(MimeTypeConstants.MIME_TYPES_SVG);
Reader in = XMLUtilities.createXMLDocumentReader(is);
int len;
while ((len=in.read(buffer, 0, buffer.length)) != -1) {
doc.insertString(doc.getLength(),