diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-29 20:30:46 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-29 20:30:46 +0000 |
| commit | df1dbe48b99a5c86345a58d6da5727cb39547727 (patch) | |
| tree | 6f3a83225f47592e94b1a1ba9953707f348ad21f /sources/utils/VSAbout.java | |
| parent | a4d12944746dcb4f9d1140dfd52c7d58b930c17d (diff) | |
new package documented.
Diffstat (limited to 'sources/utils/VSAbout.java')
| -rw-r--r-- | sources/utils/VSAbout.java | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/sources/utils/VSAbout.java b/sources/utils/VSAbout.java index 5aca9a3..7580b6c 100644 --- a/sources/utils/VSAbout.java +++ b/sources/utils/VSAbout.java @@ -11,27 +11,30 @@ import javax.swing.*; import prefs.*; import utils.*; -// TODO: Auto-generated Javadoc /** - * The Class VSAbout. + * The Class VSAbout. This class is only for the about window which shows up + * if selected in the GUI. + * + * @author Paul C. Buetow */ -public class VSAbout extends VSFrame implements ActionListener { +public class VSAbout extends VSFrame { + /** The serial version uid */ private static final long serialVersionUID = 1L; /** The prefs. */ private VSPrefs prefs; /** - * Instantiates a new lang.process.removeabout. + * Instantiates a new VSAbout object. * * @param prefs the prefs - * @param relativeTo the relative to + * @param relativeTo the component to open the about window relative to */ public VSAbout(VSPrefs prefs, Component relativeTo) { super(prefs.getString("lang.name") + " - " + prefs.getString("lang.about"), relativeTo); - this.prefs = prefs; + disposeWithParent(); setContentPane(createContentPane()); setSize(350, 250); @@ -39,7 +42,6 @@ public class VSAbout extends VSFrame implements ActionListener { setVisible(true); } - /** * Creates the content pane. * @@ -48,8 +50,9 @@ public class VSAbout extends VSFrame implements ActionListener { public Container createContentPane() { Container contentPane = getContentPane(); - VSInfoArea infoArea = new VSInfoArea(prefs.getString("lang.about.info!")); - JPanel buttonPane = createButtonPane(); + VSInfoArea infoArea = new VSInfoArea( + prefs.getString("lang.about.info!")); + JPanel buttonPane = createButtonPanel(); JScrollPane scrollPane = new JScrollPane(infoArea); contentPane.add(scrollPane, BorderLayout.CENTER); @@ -59,31 +62,26 @@ public class VSAbout extends VSFrame implements ActionListener { } /** - * Creates the button pane. + * Creates the button panel. * - * @return the j panel + * @return the panel */ - public JPanel createButtonPane() { + public JPanel createButtonPanel() { JPanel buttonPane = new JPanel(); buttonPane.setBackground(Color.WHITE); JButton closeButton = new JButton( prefs.getString("lang.close")); closeButton.setMnemonic(prefs.getInteger("keyevent.close")); - closeButton.addActionListener(this); + closeButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String actionCommand = e.getActionCommand(); + if (actionCommand.equals(prefs.getString("lang.close"))) + dispose(); + } + }); buttonPane.add(closeButton); return buttonPane; } - - - /* (non-Javadoc) - * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) - */ - public void actionPerformed(ActionEvent e) { - String actionCommand = e.getActionCommand(); - - if (actionCommand.equals(prefs.getString("lang.close"))) - dispose(); - } } |
