From: Florian L. <fle...@us...> - 2005-09-27 15:52:38
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5972/src/net/sf/magicmap/client/gui/dialogs Added Files: AboutDialog.java Log Message: komplett überarbeiteter AboutDialog --- NEW FILE: AboutDialog.java --- package net.sf.magicmap.client.gui.dialogs; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; 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; private JTextField text; public static void showDialog(Frame owner){ 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); this.setResizable(false); RelativeLayout layout = new RelativeLayout(); RelativePanelBuilder builder = new RelativePanelBuilder(layout); // OK JButton ok = builder.addButton(GUIUtils.i18n("ok"), "okbutton", "OK", this); builder.setTop("okbutton",this.getHeight()-60); builder.setLeft("okbutton",this.getWidth()-83); builder.setHeight("okbutton",27 - (this.getHeight()-60)); builder.setWidth("okbutton",75 - (this.getWidth()-83)); JEditorPane aboutText = null; try { aboutText = new JEditorPane(this.getClass().getClassLoader().getResource("aboutText.html")); aboutText.setEditable(false); aboutText.setOpaque(false); builder.add(aboutText,"abouttext"); builder.setTop("abouttext",0); builder.setLeft("abouttext",0); builder.setHeight("abouttext",430); builder.setWidth("abouttext",400); } catch (IOException e) { e.printStackTrace(); } JLabel magicMapImage = builder.addLabel("","magicmapimage",58,0); builder.setWidth("magicmapimage",284); builder.setHeight("magicmapimage",222); magicMapImage.setIcon(new ImageIcon(this.getClass().getClassLoader().getResource("MagicMapLogo.gif"))); mainPanel = builder.getPanel(); setContentPane(mainPanel); getRootPane().setDefaultButton(ok); } /** */ public void actionPerformed(ActionEvent e){ if ("OK".equals(e.getActionCommand())){ this.setVisible(false); } } } |