/***************************************************
*
* cismet GmbH, Saarbruecken, Germany
*
* ... and it just works.
*
****************************************************/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package de.cismet.commons.gui.protocol.test;
import javax.swing.UIManager;
import de.cismet.commons.gui.protocol.ProtocolHandler;
import de.cismet.commons.gui.protocol.impl.CommentProtocolStepImpl;
import de.cismet.tools.gui.log4jquickconfig.Log4JQuickConfig;
/**
* DOCUMENT ME!
*
* @author jruiz
* @version $Revision$, $Date$
*/
public class ProtocolPanelTester extends javax.swing.JFrame {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JSplitPane jSplitPane1;
private de.cismet.commons.gui.protocol.ProtocolPanel protocolPanel1;
// End of variables declaration//GEN-END:variables
//~ Constructors -----------------------------------------------------------
/**
* Creates new form PanelTester.
*/
public ProtocolPanelTester() {
initComponents();
ProtocolHandler.getInstance().setRecordEnabled(true);
}
//~ Methods ----------------------------------------------------------------
/**
* 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() {
jButton2 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jButton4 = new javax.swing.JButton();
jSplitPane1 = new javax.swing.JSplitPane();
protocolPanel1 = new de.cismet.commons.gui.protocol.ProtocolPanel();
jPanel1 = new javax.swing.JPanel();
org.openide.awt.Mnemonics.setLocalizedText(
jButton2,
org.openide.util.NbBundle.getMessage(ProtocolPanelTester.class, "ProtocolPanelTester.jButton2.text")); // NOI18N
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle(org.openide.util.NbBundle.getMessage(ProtocolPanelTester.class, "ProtocolPanelTester.title")); // NOI18N
jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
org.openide.awt.Mnemonics.setLocalizedText(
jButton4,
org.openide.util.NbBundle.getMessage(ProtocolPanelTester.class, "ProtocolPanelTester.jButton4.text")); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jPanel2.add(jButton4);
getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);
protocolPanel1.setMinimumSize(new java.awt.Dimension(300, 33));
protocolPanel1.setPreferredSize(new java.awt.Dimension(300, 348));
jSplitPane1.setRightComponent(protocolPanel1);
jPanel1.setPreferredSize(new java.awt.Dimension(800, 600));
final javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(
0,
475,
Short.MAX_VALUE));
jSplitPane1.setLeftComponent(jPanel1);
getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
pack();
} // </editor-fold>//GEN-END:initComponents
/**
* DOCUMENT ME!
*
* @param evt DOCUMENT ME!
*/
private void jButton4ActionPerformed(final java.awt.event.ActionEvent evt) { //GEN-FIRST:event_jButton4ActionPerformed
ProtocolHandler.getInstance()
.recordStep(new CommentProtocolStepImpl(
" // Variables declaration - do not modify \n"
+ " private javax.swing.JButton jButton1;\n"
+ " private javax.swing.JPanel jPanel1;\n"
+ " private javax.swing.JPanel jPanel2;\n"
+ " private javax.swing.JPanel jPanel3;\n"
+ " private javax.swing.JScrollPane jScrollPane1;\n"
+ " private javax.swing.JTextField jTextField1;\n"
+ " private javax.swing.JPanel panSteps;\n"
+ " // End of variables declaration "));
ProtocolHandler.getInstance()
.recordStep(new CommentProtocolStepImpl(
" final JFrame frame = new JFrame(\"test\");\n"
+ " frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n"
+ " frame.setContentPane(new ProtocolPanel());\n"
+ " frame.setExtendedState( frame.getExtendedState()|JFrame.MAXIMIZED_BOTH );\n"
+ " frame.setVisible(true);"));
} //GEN-LAST:event_jButton4ActionPerformed
/**
* DOCUMENT ME!
*
* @param args the command line arguments
*/
public static void main(final 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 (final 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(ProtocolPanelTester.class.getName())
.log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(ProtocolPanelTester.class.getName())
.log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(ProtocolPanelTester.class.getName())
.log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(ProtocolPanelTester.class.getName())
.log(java.util.logging.Level.SEVERE, null, ex);
}
try {
//</editor-fold>
//</editor-fold>
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
} catch (final Exception ex) {
}
Log4JQuickConfig.configure4LumbermillOnLocalhost();
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new ProtocolPanelTester().setVisible(true);
}
});
}
}