/* * The MIT License * * Copyright 2013 Andreas Giemza. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package de.andreasgiemza.jgeagle.panels; import java.awt.Desktop; import java.io.IOException; import java.net.URI; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Andreas Giemza */ public class AboutPanel extends javax.swing.JPanel { private String mailto; /** * Creates new form AboutPanel */ public AboutPanel() { initComponents(); } private void openWebsite(String site) { try { Desktop.getDesktop().browse(URI.create(site)); } catch (IOException ex) { Logger.getLogger(AboutPanel.class.getName()).log(Level.SEVERE, null, ex); } } /** * 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() { jgeagleLabel = new javax.swing.JLabel(); copyrightLabel = new javax.swing.JLabel(); emailLabel = new javax.swing.JLabel(); emailClickableLabel = new javax.swing.JLabel(); websiteLabel = new javax.swing.JLabel(); websiteClickableLabel = new javax.swing.JLabel(); githubLabel = new javax.swing.JLabel(); githubClickableLabel = new javax.swing.JLabel(); jgeagleLabel.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jgeagleLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jgeagleLabel.setText("JGeagle"); copyrightLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); copyrightLabel.setText("Copyright 2013 Andreas Giemza."); emailLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); emailLabel.setText("Email"); emailClickableLabel.setText("<html><a href=\"mailto:andreas@giemza.net\">andreas@giemza.net</a></html>"); emailClickableLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); emailClickableLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { emailClickableLabelMouseClicked(evt); } }); websiteLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); websiteLabel.setText("Website"); websiteClickableLabel.setText("<html><a href=\"http://www.andreasgiemza.de/jgeagle/\">http://www.andreasgiemza.de/jgeagle/</a></html>"); websiteClickableLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); websiteClickableLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { websiteClickableLabelMouseClicked(evt); } }); githubLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); githubLabel.setText("GitHub"); githubClickableLabel.setText("<html><a href=\"https://github.com/hurik/JGeagle\">https://github.com/hurik/JGeagle</a></html>"); githubClickableLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); githubClickableLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { githubClickableLabelMouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jgeagleLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(copyrightLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(websiteLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(githubLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(emailLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(emailClickableLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(websiteClickableLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(githubClickableLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jgeagleLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(copyrightLabel) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(emailLabel) .addComponent(emailClickableLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(websiteLabel) .addComponent(websiteClickableLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(githubLabel) .addComponent(githubClickableLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents private void emailClickableLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_emailClickableLabelMouseClicked try { Desktop.getDesktop().mail(URI.create("andreas@giemza.net")); } catch (IOException ex) { Logger.getLogger(AboutPanel.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_emailClickableLabelMouseClicked private void websiteClickableLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_websiteClickableLabelMouseClicked openWebsite("http://www.andreasgiemza.de/jgeagle/"); }//GEN-LAST:event_websiteClickableLabelMouseClicked private void githubClickableLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_githubClickableLabelMouseClicked openWebsite("https://github.com/hurik/JGeagle"); }//GEN-LAST:event_githubClickableLabelMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel copyrightLabel; private javax.swing.JLabel emailClickableLabel; private javax.swing.JLabel emailLabel; private javax.swing.JLabel githubClickableLabel; private javax.swing.JLabel githubLabel; private javax.swing.JLabel jgeagleLabel; private javax.swing.JLabel websiteClickableLabel; private javax.swing.JLabel websiteLabel; // End of variables declaration//GEN-END:variables }