/* * Copyright (C) 2013 Vinu K.N * * 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 org.domainmath.gui.about; import java.awt.Cursor; import java.awt.Desktop; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; public class AboutDlg extends javax.swing.JDialog { /** Creates new form AboutDlg */ public AboutDlg(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); } /** 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() { jPanel1 = new javax.swing.JPanel(); headLabel = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); authorLabel = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/domainmath/gui/about/resources/about_en"); // NOI18N setTitle(bundle.getString("Dialog.title")); // NOI18N setUndecorated(true); setResizable(false); jPanel1.setBackground(new java.awt.Color(0, 153, 0)); jPanel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jPanel1MouseClicked(evt); } }); headLabel.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N headLabel.setForeground(new java.awt.Color(255, 255, 255)); headLabel.setText(bundle.getString("headLabel.text")); // NOI18N headLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { headLabelMouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { headLabelMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { headLabelMouseExited(evt); } }); jLabel2.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("All rights reserved under GNU General Public License version 3"); jLabel2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel2MouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { jLabel2MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jLabel2MouseExited(evt); } }); authorLabel.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N authorLabel.setForeground(new java.awt.Color(255, 255, 255)); authorLabel.setText(" © Vinu K.N"); jLabel1.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Thanks to (alphabetic order): "); jScrollPane1.setBorder(null); jTextArea1.setEditable(false); jTextArea1.setBackground(new java.awt.Color(0, 153, 0)); jTextArea1.setColumns(20); jTextArea1.setFont(new java.awt.Font("Segoe UI", 0, 14)); // NOI18N jTextArea1.setForeground(new java.awt.Color(255, 255, 255)); jTextArea1.setRows(5); jTextArea1.setText("Amitay Drummer\nYufei Yuan\n"); jTextArea1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextArea1MouseClicked(evt); } }); jScrollPane1.setViewportView(jTextArea1); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(28, 28, 28) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 385, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(authorLabel) .addComponent(headLabel) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(12, 12, 12) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(0, 0, Short.MAX_VALUE))) .addGap(37, 37, 37)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(30, 30, 30) .addComponent(headLabel) .addGap(18, 18, 18) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(authorLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addGap(43, 43, 43)) ); getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); pack(); }// </editor-fold>//GEN-END:initComponents private void headLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_headLabelMouseClicked setPath("https://sites.google.com/site/domainmathide/") ; }//GEN-LAST:event_headLabelMouseClicked private void headLabelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_headLabelMouseEntered this.setCursor(new Cursor(Cursor.HAND_CURSOR)); }//GEN-LAST:event_headLabelMouseEntered private void headLabelMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_headLabelMouseExited this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }//GEN-LAST:event_headLabelMouseExited private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseClicked setPath("http://www.gnu.org/licenses/") ; }//GEN-LAST:event_jLabel2MouseClicked private void jLabel2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseEntered this.setCursor(new Cursor(Cursor.HAND_CURSOR)); }//GEN-LAST:event_jLabel2MouseEntered private void jLabel2MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseExited this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }//GEN-LAST:event_jLabel2MouseExited private void jPanel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseClicked this.dispose(); }//GEN-LAST:event_jPanel1MouseClicked private void jTextArea1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextArea1MouseClicked this.dispose(); }//GEN-LAST:event_jTextArea1MouseClicked public void setPath(String path) { try { URI uri = new URI(path); Desktop desktop=Desktop.getDesktop(); desktop.browse(uri); } catch (URISyntaxException | IOException ex) { } } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(AboutDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(AboutDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(AboutDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(AboutDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { AboutDlg dialog = new AboutDlg(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel authorLabel; private javax.swing.JLabel headLabel; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration//GEN-END:variables }