7 package org.libcsdbg.jtracer;
13 import java.awt.Insets;
14 import java.awt.Dimension;
15 import java.awt.BorderLayout;
17 import javax.swing.event.HyperlinkEvent;
18 import javax.swing.event.HyperlinkListener;
19 import javax.swing.WindowConstants;
20 import javax.swing.JDialog;
21 import javax.swing.JFrame;
22 import javax.swing.JEditorPane;
30 public class AboutDialog extends JDialog implements HyperlinkListener
44 Registry conf = Registry.getCurrent();
45 setTitle(
"About " + (String) conf.
get(
"generic",
"name"));
48 File page = conf.getResource(
"var/about.html");
49 JEditorPane viewer =
new JEditorPane(page.toURI().toURL());
51 viewer.putClientProperty(JEditorPane.W3C_LENGTH_UNITS,
true);
52 viewer.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES,
true);
53 viewer.setEditable(
false);
54 viewer.setFocusable(
false);
55 viewer.setMargin(
new Insets(0, 0, 0, 0));
57 viewer.setPreferredSize(
new Dimension(334, 380));
59 viewer.setPreferredSize(
new Dimension(334, 400));
61 viewer.addHyperlinkListener(
this);
62 add(viewer, BorderLayout.CENTER);
72 setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
85 if (event.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
88 URL url = event.getURL();
89 String proto = url.getProtocol();
90 Registry conf = Registry.getCurrent();
92 if (proto.equals(
"file"))
95 else if (proto.equals(
"mailto"))
98 else if (proto.equals(
"http"))
102 catch (Throwable t) {
Object get(String section, String key)
Get an entry.
void mail(URL url)
Open a URL on the registered mail composer.
A dialog that shows an HTML page with project information (version, short description, license, copyright e.t.c) and links to various online project resources.
static final long serialVersionUID
Class version.
void hyperlinkUpdate(HyperlinkEvent event)
Handler for hyperlink events.