/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.dlect.ui; import javax.swing.Icon; /** * * @author lee */ public abstract class AboutDialog extends javax.swing.JDialog { /** * Creates new form AboutDialog */ public AboutDialog() { initComponents(); // TODO(Later) scale icon. } @Override public void setVisible(boolean b) { this.setLocationRelativeTo(this.getOwner()); super.setVisible(b); } /** * 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() { java.awt.GridBagConstraints gridBagConstraints; logoLabel = new javax.swing.JLabel(); productLabel = new javax.swing.JLabel(); versionLabel = new javax.swing.JLabel(); descriptionLabel = new javax.swing.JTextPane(); jButton1 = new javax.swing.JButton(); setTitle("About " + getProductName()); setLocationByPlatform(true); setMinimumSize(new java.awt.Dimension(420, 225)); setResizable(false); getContentPane().setLayout(new java.awt.GridBagLayout()); logoLabel.setIcon(getApplicationIcon()); logoLabel.setToolTipText(""); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridheight = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weighty = 1.0; getContentPane().add(logoLabel, gridBagConstraints); productLabel.setFont(productLabel.getFont().deriveFont(productLabel.getFont().getStyle() | java.awt.Font.BOLD, productLabel.getFont().getSize()+9)); productLabel.setText(getProductName()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0); getContentPane().add(productLabel, gridBagConstraints); versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getSize()-1f)); versionLabel.setForeground(new java.awt.Color(51, 51, 51)); versionLabel.setText("Version " + getApplicationVersion()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0); getContentPane().add(versionLabel, gridBagConstraints); descriptionLabel.setEditable(false); descriptionLabel.setBackground(getBackground()); descriptionLabel.setContentType("text/html"); // NOI18N descriptionLabel.setText(getDescription()); descriptionLabel.setDragEnabled(false); descriptionLabel.setFocusCycleRoot(false); descriptionLabel.setFocusTraversalKeysEnabled(false); descriptionLabel.setFocusable(false); descriptionLabel.setOpaque(false); descriptionLabel.setRequestFocusEnabled(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0); getContentPane().add(descriptionLabel, gridBagConstraints); jButton1.setText("Close"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST; gridBagConstraints.insets = new java.awt.Insets(6, 26, 0, 0); getContentPane().add(jButton1, gridBagConstraints); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed this.setVisible(false); }//GEN-LAST:event_jButton1ActionPerformed public abstract String getProductName(); public abstract String getApplicationVersion(); public abstract Icon getApplicationIcon(); public abstract String getDescription(); // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextPane descriptionLabel; private javax.swing.JButton jButton1; private javax.swing.JLabel logoLabel; private javax.swing.JLabel productLabel; private javax.swing.JLabel versionLabel; // End of variables declaration//GEN-END:variables }