From 54935745e0fabfe6b642f2e01bf951641c7661e6 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 14 Aug 2008 02:39:30 +0000 Subject: Client: Spruced up About Box Also added a link to the project site to the Help menu and added the ability to display an error message in the Status Bar if java.awt.Desktop is for some reason unsupported. Closes #30 --- client/trunk/master.jnlp | 24 +++++++++ .../fourisland/instadisc/InstaDiscAboutBox.form | 56 +++++++++------------ .../fourisland/instadisc/InstaDiscAboutBox.java | 42 ++++++++-------- .../com/fourisland/instadisc/InstaDiscView.form | 9 ++++ .../com/fourisland/instadisc/InstaDiscView.java | 36 ++++++++++++- .../resources/InstaDiscAboutBox.properties | 3 +- .../instadisc/resources/InstaDiscView.properties | 1 + .../instadisc/resources/instaDiscIconBig.png | Bin 0 -> 729 bytes 8 files changed, 115 insertions(+), 56 deletions(-) create mode 100644 client/trunk/master.jnlp create mode 100644 client/trunk/src/com/fourisland/instadisc/resources/instaDiscIconBig.png (limited to 'client') diff --git a/client/trunk/master.jnlp b/client/trunk/master.jnlp new file mode 100644 index 0000000..e9f8a88 --- /dev/null +++ b/client/trunk/master.jnlp @@ -0,0 +1,24 @@ + + + + ${APPLICATION.TITLE} + ${APPLICATION.VENDOR} + ${APPLICATION.DESC} + ${APPLICATION.DESC.SHORT} + + + + + + + + + + + + + + + + + diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.form b/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.form index 46e8a4d..21f10e7 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.form +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.form @@ -25,40 +25,43 @@ - - - - + + + + + - - - - - - - - - + + + + + + + + + + + + + + - - - + - - + - + @@ -73,9 +76,9 @@ - - + + @@ -96,6 +99,7 @@ + @@ -189,15 +193,5 @@ - - - - - - - - - - diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.java index 1b8a978..7d0e3bf 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscAboutBox.java @@ -35,7 +35,6 @@ public class InstaDiscAboutBox extends javax.swing.JDialog { javax.swing.JLabel homepageLabel = new javax.swing.JLabel(); javax.swing.JLabel appHomepageLabel = new javax.swing.JLabel(); javax.swing.JLabel appDescLabel = new javax.swing.JLabel(); - javax.swing.JLabel imageLabel = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.fourisland.instadisc.InstaDiscApp.class).getContext().getResourceMap(InstaDiscAboutBox.class); @@ -49,6 +48,7 @@ public class InstaDiscAboutBox extends javax.swing.JDialog { closeButton.setName("closeButton"); // NOI18N appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+4)); + appTitleLabel.setIcon(resourceMap.getIcon("appTitleLabel.icon")); // NOI18N appTitleLabel.setText(resourceMap.getString("Application.title")); // NOI18N appTitleLabel.setName("appTitleLabel"); // NOI18N @@ -76,35 +76,33 @@ public class InstaDiscAboutBox extends javax.swing.JDialog { appDescLabel.setText(resourceMap.getString("appDescLabel.text")); // NOI18N appDescLabel.setName("appDescLabel"); // NOI18N - imageLabel.setIcon(resourceMap.getIcon("imageLabel.icon")); // NOI18N - imageLabel.setName("imageLabel"); // NOI18N - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(imageLabel) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(versionLabel) - .addComponent(vendorLabel) - .addComponent(homepageLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(appTitleLabel) + .addGroup(layout.createSequentialGroup() + .addGap(12, 12, 12) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(appVersionLabel) - .addComponent(appVendorLabel) - .addComponent(appHomepageLabel))) - .addComponent(appTitleLabel, javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(appDescLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE) - .addComponent(closeButton)) + .addComponent(appDescLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(versionLabel) + .addComponent(vendorLabel) + .addComponent(homepageLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(appHomepageLabel) + .addComponent(appVendorLabel) + .addComponent(appVersionLabel))))) + .addComponent(closeButton, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(appTitleLabel) @@ -122,9 +120,9 @@ public class InstaDiscAboutBox extends javax.swing.JDialog { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(homepageLabel) .addComponent(appHomepageLabel)) - .addGap(19, 19, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(closeButton) - .addContainerGap()) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form index 1be0305..5050377 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form @@ -148,6 +148,15 @@ + + + + + + + + + diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java index 24d18ee..198ce2b 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java @@ -151,6 +151,7 @@ public class InstaDiscView extends FrameView { jMenuItem4 = new javax.swing.JMenuItem(); jMenuItem5 = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); + jMenuItem6 = new javax.swing.JMenuItem(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); statusPanel = new javax.swing.JPanel(); javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator(); @@ -256,6 +257,15 @@ public class InstaDiscView extends FrameView { helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N + jMenuItem6.setText(resourceMap.getString("jMenuItem6.text")); // NOI18N + jMenuItem6.setName("jMenuItem6"); // NOI18N + jMenuItem6.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem6ActionPerformed(evt); + } + }); + helpMenu.add(jMenuItem6); + aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N aboutMenuItem.setName("aboutMenuItem"); // NOI18N helpMenu.add(aboutMenuItem); @@ -308,7 +318,12 @@ public class InstaDiscView extends FrameView { Item item = (Item) jList1.getSelectedValue(); try { - java.awt.Desktop.getDesktop().browse(new URI(item.getURL())); + if (java.awt.Desktop.isDesktopSupported()) + { + java.awt.Desktop.getDesktop().browse(new URI(item.getURL())); + } else { + statusMessageLabel.setText("Error: Desktop not supported"); + } } catch (IOException ex) { Logger.getLogger(InstaDiscView.class.getName()).log(Level.SEVERE, null, ex); } catch (URISyntaxException ex) { @@ -346,6 +361,24 @@ public class InstaDiscView extends FrameView { jList1.repaint(); }//GEN-LAST:event_jList1ComponentShown + private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed + try + {//GEN-LAST:event_jMenuItem6ActionPerformed + if (java.awt.Desktop.isDesktopSupported()) + { + java.awt.Desktop.getDesktop().browse(new URI("http://fourisland.com/projects/instadisc/")); + } else { + statusMessageLabel.setText("Error: Desktop not supported"); + } + } catch (IOException ex) + { + Logger.getLogger(InstaDiscView.class.getName()).log(Level.SEVERE, null, ex); + } catch (URISyntaxException ex) + { + Logger.getLogger(InstaDiscView.class.getName()).log(Level.SEVERE, null, ex); + } + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JList jList1; private javax.swing.JMenu jMenu1; @@ -354,6 +387,7 @@ public class InstaDiscView extends FrameView { private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; + private javax.swing.JMenuItem jMenuItem6; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JSeparator jSeparator1; private javax.swing.JPanel mainPanel; diff --git a/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscAboutBox.properties b/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscAboutBox.properties index b76ddd5..02c5bc3 100644 --- a/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscAboutBox.properties +++ b/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscAboutBox.properties @@ -9,6 +9,5 @@ versionLabel.text=Product Version\: vendorLabel.text=Vendor\: homepageLabel.text=Homepage\: - #NOI18N -imageLabel.icon=about.png +appTitleLabel.icon=instaDiscIconBig.png diff --git a/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties b/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties index 4bef63f..6908fcb 100644 --- a/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties +++ b/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties @@ -36,3 +36,4 @@ jMenu1.text=Tools jMenuItem3.text=Manage Filters jMenuItem4.text=Request Retained Items jMenuItem5.text=Advanced Settings +jMenuItem6.text=InstaDisc Website diff --git a/client/trunk/src/com/fourisland/instadisc/resources/instaDiscIconBig.png b/client/trunk/src/com/fourisland/instadisc/resources/instaDiscIconBig.png new file mode 100644 index 0000000..6772466 Binary files /dev/null and b/client/trunk/src/com/fourisland/instadisc/resources/instaDiscIconBig.png differ -- cgit 1.4.1