From: Florian L. <fle...@us...> - 2005-09-28 10:33:23
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30462/src/net/sf/magicmap/client/gui/dialogs Modified Files: AboutDialog.java Log Message: homepagelink ist nun klickable Index: AboutDialog.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/AboutDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AboutDialog.java 27 Sep 2005 15:52:30 -0000 1.1 --- AboutDialog.java 28 Sep 2005 10:33:07 -0000 1.2 *************** *** 8,32 **** import javax.swing.ImageIcon; import javax.swing.JButton; - import javax.swing.JCheckBox; - import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JEditorPane; import javax.swing.JLabel; - import javax.swing.JOptionPane; import javax.swing.JPanel; - import javax.swing.JPasswordField; - import javax.swing.JTextArea; import javax.swing.JTextField; - import com.brunchboy.util.swing.relativelayout.RelativeLayout; - - import net.sf.magicmap.client.gui.utils.GUIConstants; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.utils.RelativePanelBuilder; - import net.sf.magicmap.client.meta.ServerConnectionInfo; - import net.sf.magicmap.client.utils.Settings; - import net.sf.magicmap.client.utils.Version; ! public class AboutDialog extends JDialog implements ActionListener { private JPanel mainPanel; --- 8,26 ---- import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JEditorPane; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; + import javax.swing.event.HyperlinkEvent; + import javax.swing.event.HyperlinkListener; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.utils.RelativePanelBuilder; ! import com.Ostermiller.util.Browser; ! import com.brunchboy.util.swing.relativelayout.RelativeLayout; ! ! public class AboutDialog extends JDialog implements ActionListener, HyperlinkListener { private JPanel mainPanel; *************** *** 36,44 **** AboutDialog d = new AboutDialog(owner); GUIUtils.locateOnScreen(d); d.setModal(true); d.setVisible(true); } ! public AboutDialog(Frame owner) { super(owner, GUIUtils.filterMnemonic(GUIUtils.i18n("about"))); setSize(406, 430); --- 30,39 ---- AboutDialog d = new AboutDialog(owner); GUIUtils.locateOnScreen(d); + Browser.init(); d.setModal(true); d.setVisible(true); } ! private AboutDialog(Frame owner) { super(owner, GUIUtils.filterMnemonic(GUIUtils.i18n("about"))); setSize(406, 430); *************** *** 62,65 **** --- 57,61 ---- aboutText.setEditable(false); aboutText.setOpaque(false); + aboutText.addHyperlinkListener(this); builder.add(aboutText,"abouttext"); builder.setTop("abouttext",0); *************** *** 68,71 **** --- 64,68 ---- builder.setWidth("abouttext",400); } catch (IOException e) { + //TODO e.printStackTrace(); } *************** *** 89,91 **** --- 86,99 ---- } } + + public void hyperlinkUpdate(HyperlinkEvent e) { + if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())){ + try { + Browser.displayURL(e.getURL().toExternalForm()); + } catch (IOException e1) { + //TODO + e1.printStackTrace(); + } + } + } } \ No newline at end of file |