/*
* Copyright (C) 2014 Shashank Tulsyan
*
* 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 neembuu.release1.ui;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import neembuu.release1.api.ui.MainComponent;
/**
*
* @author Shashank Tulsyan
*/
public class InstallPermissionAndProgress extends javax.swing.JPanel {
private final JDialog jd;
/**
* Creates new form InstallPermissionAndProgress
*/
public InstallPermissionAndProgress(JDialog jd1) {
this.jd = jd1;
initComponents();
initTints();
}
private void initTints(){
okButton.setBackground(Colors.PROGRESS_BAR_FILL_BUFFER);
exitButton.setBackground(Colors.BUTTON_TINT);
knowMoreButton.setBackground(Colors.BUTTON_TINT);
}
public static void showMessage(MainComponent m){
JFrame jf = null;
try{
jf = m.getJFrame();
}catch(NullPointerException npe){
}
JDialog jd = new JDialog(jf, "Need Permission", true);
jd.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
jd.setSize(500, 405);
jd.setResizable(false);
InstallPermissionAndProgress x = new InstallPermissionAndProgress(jd);
jd.getContentPane().add(x);
jd.setVisible(true);
}
/**
* 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() {
okButton = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
exitButton = new javax.swing.JButton();
knowMoreButton = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
setBackground(new java.awt.Color(255, 255, 255));
okButton.setFont(Fonts.MyriadPro.deriveFont(14f));
okButton.setText(org.openide.util.NbBundle.getMessage(InstallPermissionAndProgress.class, "InstallPermissionAndProgress.okButton.text")); // NOI18N
okButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
okButtonActionPerformed(evt);
}
});
jLabel1.setFont(new java.awt.Font("Futura-Light", 0, 18)); // NOI18N
jLabel1.setText(org.openide.util.NbBundle.getMessage(InstallPermissionAndProgress.class, "InstallPermissionAndProgress.jLabel1.text")); // NOI18N
jLabel2.setFont(new java.awt.Font("Futura-Light", 0, 16)); // NOI18N
jLabel2.setText(org.openide.util.NbBundle.getMessage(InstallPermissionAndProgress.class, "InstallPermissionAndProgress.jLabel2.text")); // NOI18N
exitButton.setFont(Fonts.MyriadPro.deriveFont(14f));
exitButton.setText(org.openide.util.NbBundle.getMessage(InstallPermissionAndProgress.class, "InstallPermissionAndProgress.exitButton.text")); // NOI18N
exitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitButtonActionPerformed(evt);
}
});
knowMoreButton.setFont(Fonts.MyriadPro.deriveFont(14f));
knowMoreButton.setText(org.openide.util.NbBundle.getMessage(InstallPermissionAndProgress.class, "InstallPermissionAndProgress.knowMoreButton.text")); // NOI18N
knowMoreButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
knowMoreButtonActionPerformed(evt);
}
});
jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/neembuu/release1/ui/images/uac_sample.jpg"))); // NOI18N
jLabel3.setText(org.openide.util.NbBundle.getMessage(InstallPermissionAndProgress.class, "InstallPermissionAndProgress.jLabel3.text")); // NOI18N
jLabel4.setFont(new java.awt.Font("Futura-Light", 0, 18)); // NOI18N
jLabel4.setText(org.openide.util.NbBundle.getMessage(InstallPermissionAndProgress.class, "InstallPermissionAndProgress.jLabel4.text")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(45, 45, 45)
.addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(46, 46, 46)
.addComponent(knowMoreButton, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(exitButton))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4))
.addComponent(jLabel3))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3)
.addGap(10, 10, 10)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(okButton)
.addComponent(exitButton)
.addComponent(knowMoreButton))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void knowMoreButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_knowMoreButtonActionPerformed
// TODO add your handling code here:
try{
java.awt.Desktop.getDesktop().browse(new java.net.URL("http://neembuu.com/help/Why%20Install%20Pismo.html").toURI());
}catch(Exception a){
JOptionPane.showMessageDialog(null,"http://neembuu.com/help/Why%20Install%20Pismo.html","Please visit the page to know more",JOptionPane.INFORMATION_MESSAGE);
}
}//GEN-LAST:event_knowMoreButtonActionPerformed
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
// TODO add your handling code here:
jd.setVisible(false);
}//GEN-LAST:event_okButtonActionPerformed
private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed
System.exit(-1);
}//GEN-LAST:event_exitButtonActionPerformed
public static void main(String[] args) {
InitLookAndFeel.init();
showMessage(null);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton exitButton;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JButton knowMoreButton;
private javax.swing.JButton okButton;
// End of variables declaration//GEN-END:variables
}