/* * Get Organized - Organize your schedule, course assignments, and grades * Copyright © 2012 Alex Laird * getorganized@alexlaird.com * alexlaird.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package adl.go.gui; import adl.go.gui.ColoredComponent.GradientStyle; import java.awt.Color; import java.awt.Cursor; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.ResourceBundle; /** * The About dialog. * * @author Alex Laird */ public class AboutDialog extends EscapeDialog { /** * Construct the About dialog. * * @param viewPanel A reference to the view panel. */ public AboutDialog(ViewPanel viewPanel) { super (viewPanel.mainFrame); setMainPanel (viewPanel); initComponents (); } /** * Initialize the About dialog. */ public void init() { setTitle (viewPanel.domain.language.getString ("about")); aboutJPanel.setBackground (viewPanel.domain.utility.currentTheme.colorSingleWindowBackground1); aboutCloseButton.setFont (viewPanel.domain.utility.currentTheme.fontPlain12); hyperlinkLabel1.setFont (viewPanel.domain.utility.currentTheme.fontPlain12); aboutCloseButton.setBackground (viewPanel.domain.utility.currentTheme.colorButtonBackground); dedicatedLabel.setFont (viewPanel.domain.utility.currentTheme.fontPlain11); hyperlinkLabel2.setFont (viewPanel.domain.utility.currentTheme.fontPlain12); aboutLicense.setFont (viewPanel.domain.utility.currentTheme.fontPlain12); versionLabel.setFont (viewPanel.domain.utility.currentTheme.fontPlain12); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings ("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { aboutJPanel = new adl.go.gui.ColoredJPanel(GradientStyle.VERTICAL_GRADIENT_DOWN, Color.WHITE); closeButtonPanel = new javax.swing.JPanel(); aboutCloseButton = new javax.swing.JButton(); dedicatedLabel = new javax.swing.JLabel(); hyperlinkLabel1 = new javax.swing.JLabel(); aboutLicense = new javax.swing.JLabel(); aboutLabel = new javax.swing.JLabel(); versionLabel = new javax.swing.JLabel(); hyperlinkLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setResizable(false); closeButtonPanel.setOpaque(false); aboutCloseButton.setText(viewPanel.domain.language.getString ("close")); aboutCloseButton.setToolTipText(viewPanel.domain.language.getString ("closeToolTip")); aboutCloseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { aboutCloseButtonActionPerformed(evt); } }); closeButtonPanel.add(aboutCloseButton); dedicatedLabel.setText("<html>" + viewPanel.domain.language.getString ("specialThanks") + "</html>"); dedicatedLabel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); hyperlinkLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/adl/go/images/go.png"))); // NOI18N hyperlinkLabel1.setText("<html><a href=\"http://alexlaird.com/projects/get-organized\">alexlaird.com/projects/get-organized</a></html>"); hyperlinkLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { hyperlinkLabel1MouseReleased(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { hyperlinkLabel1aboutPanelMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { hyperlinkLabel1aboutPanelMouseExited(evt); } }); aboutLicense.setText("<html>" + viewPanel.domain.language.getString ("license") + "</html>"); aboutLabel.setFont(new java.awt.Font("Verdana", 1, 14)); // NOI18N aboutLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); aboutLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/adl/go/images/logo.png"))); // NOI18N versionLabel.setText("<html><b>" + viewPanel.domain.language.getString ("version") + ":</b> " + Domain.VERSION + "</html>"); hyperlinkLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); hyperlinkLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/adl/go/images/helium.png"))); // NOI18N hyperlinkLabel2.setText("<html><a href=\"http://www.heliumedu.com\">Get Organized has been replaced with Helium. Switch today!</a></html>"); hyperlinkLabel2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(java.awt.event.MouseEvent evt) { hyperlinkLabel2MouseReleased(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { hyperlinkLabel2MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { hyperlinkLabel2MouseExited(evt); } }); javax.swing.GroupLayout aboutJPanelLayout = new javax.swing.GroupLayout(aboutJPanel); aboutJPanel.setLayout(aboutJPanelLayout); aboutJPanelLayout.setHorizontalGroup( aboutJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, aboutJPanelLayout.createSequentialGroup() .addGroup(aboutJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, aboutJPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(aboutLicense, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, aboutJPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(aboutLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, aboutJPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(aboutJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(dedicatedLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE) .addComponent(closeButtonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, aboutJPanelLayout.createSequentialGroup() .addGap(10, 10, 10) .addGroup(aboutJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(aboutJPanelLayout.createSequentialGroup() .addComponent(versionLabel) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(aboutJPanelLayout.createSequentialGroup() .addComponent(hyperlinkLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(hyperlinkLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE))))) .addContainerGap()) ); aboutJPanelLayout.setVerticalGroup( aboutJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(aboutJPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(aboutLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(versionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(aboutLicense, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(13, 13, 13) .addGroup(aboutJPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(hyperlinkLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE) .addComponent(hyperlinkLabel1)) .addGap(13, 13, 13) .addComponent(dedicatedLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(closeButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(aboutJPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(aboutJPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 461, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void aboutCloseButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_aboutCloseButtonActionPerformed {//GEN-HEADEREND:event_aboutCloseButtonActionPerformed dispose (); viewPanel.requestFocus (); }//GEN-LAST:event_aboutCloseButtonActionPerformed private void hyperlinkLabel1MouseReleased(java.awt.event.MouseEvent evt)//GEN-FIRST:event_hyperlinkLabel1MouseReleased {//GEN-HEADEREND:event_hyperlinkLabel1MouseReleased if (Domain.desktop != null) { try { Domain.desktop.browse (new URI ("http://alexlaird.com/projects/get-organized")); } catch (IOException ex) { Domain.LOGGER.add (ex); } catch (URISyntaxException ex) { Domain.LOGGER.add (ex); } } }//GEN-LAST:event_hyperlinkLabel1MouseReleased private void hyperlinkLabel1aboutPanelMouseExited(java.awt.event.MouseEvent evt)//GEN-FIRST:event_hyperlinkLabel1aboutPanelMouseExited {//GEN-HEADEREND:event_hyperlinkLabel1aboutPanelMouseExited setCursor (Cursor.getDefaultCursor ()); }//GEN-LAST:event_hyperlinkLabel1aboutPanelMouseExited private void hyperlinkLabel1aboutPanelMouseEntered(java.awt.event.MouseEvent evt)//GEN-FIRST:event_hyperlinkLabel1aboutPanelMouseEntered {//GEN-HEADEREND:event_hyperlinkLabel1aboutPanelMouseEntered setCursor (Cursor.getPredefinedCursor (Cursor.HAND_CURSOR)); }//GEN-LAST:event_hyperlinkLabel1aboutPanelMouseEntered private void hyperlinkLabel2MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_hyperlinkLabel2MouseReleased if (Domain.desktop != null) { try { Domain.desktop.browse (new URI ("http://www.heliumedu.com")); } catch (IOException ex) { Domain.LOGGER.add (ex); } catch (URISyntaxException ex) { Domain.LOGGER.add (ex); } } }//GEN-LAST:event_hyperlinkLabel2MouseReleased private void hyperlinkLabel2MouseEntered(java.awt.event.MouseEvent evt)//GEN-FIRST:event_hyperlinkLabel2MouseEntered {//GEN-HEADEREND:event_hyperlinkLabel2MouseEntered setCursor (Cursor.getPredefinedCursor (Cursor.HAND_CURSOR)); }//GEN-LAST:event_hyperlinkLabel2MouseEntered private void hyperlinkLabel2MouseExited(java.awt.event.MouseEvent evt)//GEN-FIRST:event_hyperlinkLabel2MouseExited {//GEN-HEADEREND:event_hyperlinkLabel2MouseExited setCursor (Cursor.getDefaultCursor()); }//GEN-LAST:event_hyperlinkLabel2MouseExited // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton aboutCloseButton; protected adl.go.gui.ColoredJPanel aboutJPanel; private javax.swing.JLabel aboutLabel; private javax.swing.JLabel aboutLicense; private javax.swing.JPanel closeButtonPanel; private javax.swing.JLabel dedicatedLabel; private javax.swing.JLabel hyperlinkLabel1; private javax.swing.JLabel hyperlinkLabel2; private javax.swing.JLabel versionLabel; // End of variables declaration//GEN-END:variables /** * Launch the About dialog. */ protected void goViewAbout() { pack (); setLocationRelativeTo (viewPanel); setVisible (true); } /** * Apply the language for this dialog. * * @param language The language resource to be applied. */ public void applyLanguage(ResourceBundle language) { } }