//---------------------------------------------------------------------------
// Copyright © 2009-2009 Eamonn Duffy. All Rights Reserved.
//---------------------------------------------------------------------------
//
// $RCSfile: $
//
// $Revision: $
//
// Created: Eamonn A. Duffy, Oct/Nov-2009.
//
// Purpose: Web Service Consumer to help test Web Site timings.
//
//---------------------------------------------------------------------------
package webserviceconsumer;
import com.eamonnduffy.webservices.Development;
import com.eamonnduffy.webservices.DevelopmentSoap;
import java.awt.Component;
import java.awt.Cursor;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import java.util.UUID;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Holder;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.SOAPFaultException;
// Web Service WSDL links.
/*
http://Beta.Eadent.com/WebServices/Development.asmx?WSDL
http://www.Eadent.com/WebServices/Development.asmx?WSDL
http://www.EamonnDuffy.com/WebServices/Tools.asmx?WSDL
http://www.Dubhthaigh.info/WebServices/Example001.asmx?WSDL
http://www.ForForums.info/WebServices/Example001.asmx?WSDL
http://www.ZEamonn.info/WebServices/Example001.asmx?WSDL
*/
// Class for Look And Feel ComboBox items.
// TODO: This was originally a nested class *BUT* the private attributes were accessible directly from the outside class.
// TODO: Why does Java allow this?
class LookAndFeelItem
{
// The following final Attributes will be assigned in the Constructor.
private final String m_DisplayText;
private final String m_ReferenceText;
public LookAndFeelItem(String DisplayText, String ReferenceText)
{
m_DisplayText = DisplayText;
m_ReferenceText = ReferenceText;
}
@Override
public String toString()
{
return m_DisplayText;
}
public String GetReferenceText()
{
return m_ReferenceText;
}
}
/**
* The application's main frame.
*/
public class WebServiceConsumerView extends FrameView
{
// Attributes.
private SimpleDateFormat m_FormattedSimpleDateFormat = new SimpleDateFormat("E yyyy-MM-dd HH:mm:ss z");
private SimpleDateFormat m_CsvSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private DateFormat m_DateFormat = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.ENGLISH);
private TimeZone m_DefaultTimeZone = TimeZone.getDefault();
private TimeZone m_MstTimeZone = TimeZone.getTimeZone("MST");
private boolean m_bAutomaticMode = false;
private Timer m_AutomaticTimer = null;
private long m_AutomaticInterval = 0;
private long m_AutomaticLastReference = 0;
private boolean m_bAutomaticWriteFiles = false;
private boolean m_bAutomaticEadent = false;
private boolean m_bAutomaticEamonnDuffy = false;
private boolean m_bAutomaticDubhthaigh = false;
private boolean m_bAutomaticForForums = false;
private boolean m_bAutomaticZEamonn = false;
private FileWriter m_FormattedFileWriter = null;
private BufferedWriter m_FormattedBufferedWriter = null;
private FileWriter m_CsvFileWriter = null;
private BufferedWriter m_CsvBufferedWriter = null;
private boolean m_bIsWindows = false; // For special Unix-To-Dos conversion of Exception messages that contain hard-coded line-feeds only.
private boolean m_bFirstTimeOpenOutputFiles = true; // Some Information is displayed the first time.
private boolean m_bAllowLookAndFeelAction = false;
// Some experimental diagnostic helper data.
private long m_MainThreadId = -1;
private long m_AutomaticTimerThreadId = -1;
public WebServiceConsumerView(SingleFrameApplication app)
{
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName)) {
if (!busyIconTimer.isRunning()) {
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
} else if ("message".equals(propertyName)) {
String text = (String)(evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
} else if ("progress".equals(propertyName)) {
int value = (Integer)(evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
// Set the DateFormat to be MST. SimpleDateFormat is used for UK Date and Time.
m_DateFormat.setTimeZone(m_MstTimeZone);
// Make the Seconds Left Text Box Right Justified.
//TextSecondsLeft.setHorizontalAlignment(JTextField.RIGHT);
if (GetSystemProperty("os.name").toLowerCase().startsWith(("windows")))
m_bIsWindows = true;
else
m_bIsWindows = false;
System.out.printf("Initial Look And Feel : %s\n", UIManager.getLookAndFeel().getClass().getName());
LookAndFeelItem Item = null;
Item = new LookAndFeelItem("System Default", UIManager.getSystemLookAndFeelClassName());
ComboBoxLookAndFeel.addItem(Item);
/*
Item = new LookAndFeelItem("Java Default", "javax.swing.plaf.metal.MetalLookAndFeel");
ComboBoxLookAndFeel.addItem(Item);
*/
Item = new LookAndFeelItem("Cross Platform", UIManager.getCrossPlatformLookAndFeelClassName());
ComboBoxLookAndFeel.addItem(Item);
/*
Item = new LookAndFeelItem("Metal", "javax.swing.plaf.metal.MetalLookAndFeel");
ComboBoxLookAndFeel.addItem(Item);
Item = new LookAndFeelItem("Nimbus", "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
ComboBoxLookAndFeel.addItem(Item);
Item = new LookAndFeelItem("Motif", "com.sun.java.swing.plaf.motif.MotifLookAndFeel");
ComboBoxLookAndFeel.addItem(Item);
if (m_bIsWindows)
{
Item = new LookAndFeelItem("Windows", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
ComboBoxLookAndFeel.addItem(Item);
Item = new LookAndFeelItem("Windows Classic", "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
ComboBoxLookAndFeel.addItem(Item);
}
Item = new LookAndFeelItem("GTK+", "com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
ComboBoxLookAndFeel.addItem(Item);
*/
UIManager.LookAndFeelInfo[] Infos = UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo Info : Infos)
{
Item = new LookAndFeelItem(Info.getName(), Info.getClassName());
ComboBoxLookAndFeel.addItem(Item);
}
m_bAllowLookAndFeelAction = true;
ComboBoxLookAndFeel.setSelectedIndex(0);
// Some experimental diagnostics.
m_MainThreadId = Thread.currentThread().getId();
}
// Return a string representin the specified System Property.
private String GetSystemProperty(String Key)
{
String Result = null;
try
{
Result = System.getProperty(Key);
}
catch (Exception Exception)
{
Result = String.format("[EXCEPTION: %s]", Exception.getMessage());
}
if (Result == null)
Result = "[ERROR: UNKNOWN]";
return Result;
}
@Action
public void showAboutBox()
{
if (aboutBox == null)
{
JFrame mainFrame = WebServiceConsumerApp.getApplication().getMainFrame();
aboutBox = new WebServiceConsumerAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
WebServiceConsumerApp.getApplication().show(aboutBox);
}
/** 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")
// //GEN-BEGIN:initComponents
private void initComponents() {
mainPanel = new javax.swing.JPanel();
TabbedPane = new javax.swing.JTabbedPane();
PanelManual = new javax.swing.JPanel();
ButtonPseudoPingEadent = new javax.swing.JButton();
ButtonPseudoPingDubhthaigh = new javax.swing.JButton();
ButtonPseudoPingZEamonn = new javax.swing.JButton();
ButtonPseudoPingEamonnDuffy = new javax.swing.JButton();
ButtonPseudoPingForForums = new javax.swing.JButton();
ButtonPseudoPingAll = new javax.swing.JButton();
PanelAutomatic = new javax.swing.JPanel();
CheckBoxEadent = new javax.swing.JCheckBox();
CheckBoxEamonnDuffy = new javax.swing.JCheckBox();
CheckBoxDubhthaigh = new javax.swing.JCheckBox();
CheckBoxForForums = new javax.swing.JCheckBox();
CheckBoxZEamonn = new javax.swing.JCheckBox();
jLabel3 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
TextSecondsLeft = new javax.swing.JTextField();
TextHours = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
TextSeconds = new javax.swing.JTextField();
ButtonAutomaticEnd = new javax.swing.JButton();
TextMinutes = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
ButtonAutomaticBegin = new javax.swing.JButton();
CheckBoxAll = new javax.swing.JCheckBox();
CheckBoxWriteFiles = new javax.swing.JCheckBox();
jLabel6 = new javax.swing.JLabel();
ComboBoxLookAndFeel = new javax.swing.JComboBox();
menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
mainPanel.setName("mainPanel"); // NOI18N
TabbedPane.setName("TabbedPane"); // NOI18N
PanelManual.setName("PanelManual"); // NOI18N
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(webserviceconsumer.WebServiceConsumerApp.class).getContext().getResourceMap(WebServiceConsumerView.class);
ButtonPseudoPingEadent.setText(resourceMap.getString("ButtonPseudoPingEadent.text")); // NOI18N
ButtonPseudoPingEadent.setName("ButtonPseudoPingEadent"); // NOI18N
ButtonPseudoPingEadent.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonPseudoPingEadentActionPerformed(evt);
}
});
ButtonPseudoPingDubhthaigh.setText(resourceMap.getString("ButtonPseudoPingDubhthaigh.text")); // NOI18N
ButtonPseudoPingDubhthaigh.setName("ButtonPseudoPingDubhthaigh"); // NOI18N
ButtonPseudoPingDubhthaigh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonPseudoPingDubhthaighActionPerformed(evt);
}
});
ButtonPseudoPingZEamonn.setText(resourceMap.getString("ButtonPseudoPingZEamonn.text")); // NOI18N
ButtonPseudoPingZEamonn.setName("ButtonPseudoPingZEamonn"); // NOI18N
ButtonPseudoPingZEamonn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonPseudoPingZEamonnActionPerformed(evt);
}
});
ButtonPseudoPingEamonnDuffy.setText(resourceMap.getString("ButtonPseudoPingEamonnDuffy.text")); // NOI18N
ButtonPseudoPingEamonnDuffy.setName("ButtonPseudoPingEamonnDuffy"); // NOI18N
ButtonPseudoPingEamonnDuffy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonPseudoPingEamonnDuffyActionPerformed(evt);
}
});
ButtonPseudoPingForForums.setText(resourceMap.getString("ButtonPseudoPingForForums.text")); // NOI18N
ButtonPseudoPingForForums.setName("ButtonPseudoPingForForums"); // NOI18N
ButtonPseudoPingForForums.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonPseudoPingForForumsActionPerformed(evt);
}
});
ButtonPseudoPingAll.setText(resourceMap.getString("ButtonPseudoPingAll.text")); // NOI18N
ButtonPseudoPingAll.setName("ButtonPseudoPingAll"); // NOI18N
ButtonPseudoPingAll.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonPseudoPingAllActionPerformed(evt);
}
});
javax.swing.GroupLayout PanelManualLayout = new javax.swing.GroupLayout(PanelManual);
PanelManual.setLayout(PanelManualLayout);
PanelManualLayout.setHorizontalGroup(
PanelManualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelManualLayout.createSequentialGroup()
.addContainerGap()
.addGroup(PanelManualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(ButtonPseudoPingAll, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
.addComponent(ButtonPseudoPingZEamonn, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
.addComponent(ButtonPseudoPingDubhthaigh, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
.addComponent(ButtonPseudoPingEadent, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
.addComponent(ButtonPseudoPingEamonnDuffy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(ButtonPseudoPingForForums, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))
.addGap(404, 404, 404))
);
PanelManualLayout.setVerticalGroup(
PanelManualLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelManualLayout.createSequentialGroup()
.addContainerGap()
.addComponent(ButtonPseudoPingEadent)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ButtonPseudoPingEamonnDuffy)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ButtonPseudoPingDubhthaigh)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ButtonPseudoPingForForums)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ButtonPseudoPingZEamonn)
.addGap(18, 18, 18)
.addComponent(ButtonPseudoPingAll)
.addContainerGap(34, Short.MAX_VALUE))
);
TabbedPane.addTab(resourceMap.getString("PanelManual.TabConstraints.tabTitle"), PanelManual); // NOI18N
PanelAutomatic.setName("PanelAutomatic"); // NOI18N
CheckBoxEadent.setSelected(true);
CheckBoxEadent.setText(resourceMap.getString("CheckBoxEadent.text")); // NOI18N
CheckBoxEadent.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
CheckBoxEadent.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
CheckBoxEadent.setName("CheckBoxEadent"); // NOI18N
CheckBoxEamonnDuffy.setSelected(true);
CheckBoxEamonnDuffy.setText(resourceMap.getString("CheckBoxEamonnDuffy.text")); // NOI18N
CheckBoxEamonnDuffy.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
CheckBoxEamonnDuffy.setName("CheckBoxEamonnDuffy"); // NOI18N
CheckBoxDubhthaigh.setSelected(true);
CheckBoxDubhthaigh.setText(resourceMap.getString("CheckBoxDubhthaigh.text")); // NOI18N
CheckBoxDubhthaigh.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
CheckBoxDubhthaigh.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
CheckBoxDubhthaigh.setName("CheckBoxDubhthaigh"); // NOI18N
CheckBoxForForums.setSelected(true);
CheckBoxForForums.setText(resourceMap.getString("CheckBoxForForums.text")); // NOI18N
CheckBoxForForums.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
CheckBoxForForums.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
CheckBoxForForums.setName("CheckBoxForForums"); // NOI18N
CheckBoxZEamonn.setSelected(true);
CheckBoxZEamonn.setText(resourceMap.getString("CheckBoxZEamonn.text")); // NOI18N
CheckBoxZEamonn.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
CheckBoxZEamonn.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
CheckBoxZEamonn.setName("CheckBoxZEamonn"); // NOI18N
jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
jLabel3.setName("jLabel3"); // NOI18N
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
jLabel1.setName("jLabel1"); // NOI18N
TextSecondsLeft.setEditable(false);
TextSecondsLeft.setHorizontalAlignment(javax.swing.JTextField.CENTER);
TextSecondsLeft.setName("TextSecondsLeft"); // NOI18N
TextHours.setName("TextHours"); // NOI18N
jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
jLabel5.setName("jLabel5"); // NOI18N
jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
jLabel2.setName("jLabel2"); // NOI18N
TextSeconds.setName("TextSeconds"); // NOI18N
ButtonAutomaticEnd.setText(resourceMap.getString("ButtonAutomaticEnd.text")); // NOI18N
ButtonAutomaticEnd.setEnabled(false);
ButtonAutomaticEnd.setName("ButtonAutomaticEnd"); // NOI18N
ButtonAutomaticEnd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonAutomaticEndActionPerformed(evt);
}
});
TextMinutes.setName("TextMinutes"); // NOI18N
jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
jLabel4.setName("jLabel4"); // NOI18N
ButtonAutomaticBegin.setText(resourceMap.getString("ButtonAutomaticBegin.text")); // NOI18N
ButtonAutomaticBegin.setName("ButtonAutomaticBegin"); // NOI18N
ButtonAutomaticBegin.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ButtonAutomaticBeginActionPerformed(evt);
}
});
CheckBoxAll.setSelected(true);
CheckBoxAll.setText(resourceMap.getString("CheckBoxAll.text")); // NOI18N
CheckBoxAll.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
CheckBoxAll.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
CheckBoxAll.setName("CheckBoxAll"); // NOI18N
CheckBoxAll.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CheckBoxAllActionPerformed(evt);
}
});
javax.swing.GroupLayout PanelAutomaticLayout = new javax.swing.GroupLayout(PanelAutomatic);
PanelAutomatic.setLayout(PanelAutomaticLayout);
PanelAutomaticLayout.setHorizontalGroup(
PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addContainerGap()
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(CheckBoxZEamonn)
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(CheckBoxEamonnDuffy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(CheckBoxEadent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(CheckBoxDubhthaigh, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(CheckBoxForForums, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(CheckBoxAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGap(33, 33, 33)
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addComponent(ButtonAutomaticBegin)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ButtonAutomaticEnd))
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addComponent(TextHours, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(TextMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3))
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(TextSeconds, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4))
.addComponent(jLabel5)
.addComponent(TextSecondsLeft, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE))
.addGap(228, 228, 228))
);
PanelAutomaticLayout.setVerticalGroup(
PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addContainerGap()
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addComponent(CheckBoxAll)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(CheckBoxEadent)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(CheckBoxEamonnDuffy)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(CheckBoxDubhthaigh)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(CheckBoxForForums)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(CheckBoxZEamonn))
.addGroup(PanelAutomaticLayout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(TextHours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(TextMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(TextSeconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(18, 18, 18)
.addGroup(PanelAutomaticLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ButtonAutomaticBegin)
.addComponent(ButtonAutomaticEnd))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(TextSecondsLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(96, Short.MAX_VALUE))
);
TabbedPane.addTab(resourceMap.getString("PanelAutomatic.TabConstraints.tabTitle"), PanelAutomatic); // NOI18N
CheckBoxWriteFiles.setSelected(true);
CheckBoxWriteFiles.setText(resourceMap.getString("CheckBoxWriteFiles.text")); // NOI18N
CheckBoxWriteFiles.setName("CheckBoxWriteFiles"); // NOI18N
jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
jLabel6.setName("jLabel6"); // NOI18N
ComboBoxLookAndFeel.setName("ComboBoxLookAndFeel"); // NOI18N
ComboBoxLookAndFeel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ComboBoxLookAndFeelActionPerformed(evt);
}
});
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(TabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 517, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(CheckBoxWriteFiles)
.addGap(40, 40, 40)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(ComboBoxLookAndFeel, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap(13, Short.MAX_VALUE))
);
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(TabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(CheckBoxWriteFiles)
.addComponent(jLabel6)
.addComponent(ComboBoxLookAndFeel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(15, Short.MAX_VALUE))
);
menuBar.setName("menuBar"); // NOI18N
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(webserviceconsumer.WebServiceConsumerApp.class).getContext().getActionMap(WebServiceConsumerView.class, this);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
helpMenu.setName("helpMenu"); // NOI18N
aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem.setName("aboutMenuItem"); // NOI18N
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
statusPanel.setName("statusPanel"); // NOI18N
statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
statusMessageLabel.setName("statusMessageLabel"); // NOI18N
statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
progressBar.setName("progressBar"); // NOI18N
javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
statusPanel.setLayout(statusPanelLayout);
statusPanelLayout.setHorizontalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 540, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 370, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel)
.addContainerGap())
);
statusPanelLayout.setVerticalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(statusPanelLayout.createSequentialGroup()
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3))
);
setComponent(mainPanel);
setMenuBar(menuBar);
setStatusBar(statusPanel);
}// //GEN-END:initComponents
// Wait Cursor related methods.
// TODO: Find a way to add these generically to any relevant UI class.
// As of 2-Nov-2009, courtesy of: http://www.coderanch.com/t/337216/Swing-AWT-SWT-JFace/java/wait-cursor
/** Sets cursor for specified component to Wait cursor */
public static void startWaitCursor(JComponent component)
{
Component c = component.getRootPane().getGlassPane();
c.setCursor( Cursor.getPredefinedCursor(
Cursor.WAIT_CURSOR ) );
c.setVisible(true);
}
/** Sets cursor for specified component to normal cursor */
public static void stopWaitCursor(JComponent component)
{
Component c = component.getRootPane().getGlassPane();
c.setCursor(Cursor.getPredefinedCursor(
Cursor.DEFAULT_CURSOR ) );
c.setVisible(false);
}
// My helper methods.
private void BeginWaitCursor()
{
try
{
startWaitCursor(getRootPane());
}
catch (Exception Exception)
{
ErrorOutputLine(String.format("BeginWaitCursor Exception = %s", Exception.getMessage()));
}
}
private void EndWaitCursor()
{
try
{
stopWaitCursor(getRootPane());
}
catch (Exception Exception)
{
ErrorOutputLine(String.format("EndWaitCursor Exception = %s", Exception.getMessage()));
}
}
// Return a Date/Time formatted accordingly.
private String Format(Date DateAndTime)
{
String Result = m_FormattedSimpleDateFormat.format(DateAndTime);
Result += " [" + m_DateFormat.format(DateAndTime) + "]";
return Result;
}
// Attempt to parse the specified Value String into an int, using the specified value if the parsing fails.
private static int Parse(String ValueString, int ValueIfFails)
{
int Value = ValueIfFails;
if (ValueString != null)
{
try
{
Value = Integer.parseInt(ValueString);
}
catch (Exception Exception)
{
Value = ValueIfFails;
}
}
return Value;
}
// Return a new GUID.
private String NewGuid()
{
return UUID.randomUUID().toString();
}
// Attempt to set the Seconds Left Before Next Pseudo-Ping text.
// This method was introduced as part of a number of measures to try and track down the following Exception:
/*
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: cannot open system clipboard
at sun.awt.windows.WClipboard.openClipboard(Native Method)
at sun.awt.datatransfer.SunClipboard.getClipboardFormatsOpenClose(Unknown Source)
at sun.awt.datatransfer.SunClipboard.isDataFlavorAvailable(Unknown Source)
at org.jdesktop.application.TextActions.updateTextActions(TextActions.java:132)
at org.jdesktop.application.TextActions.access$400(TextActions.java:47)
at org.jdesktop.application.TextActions$TextComponentCaretListener.caretUpdate(TextActions.java:115)
at javax.swing.text.JTextComponent.fireCaretUpdate(Unknown Source)
at javax.swing.text.JTextComponent$MutableCaretEvent.fire(Unknown Source)
at javax.swing.text.JTextComponent$MutableCaretEvent.stateChanged(Unknown Source)
at javax.swing.text.DefaultCaret.fireStateChanged(Unknown Source)
at javax.swing.text.DefaultCaret.changeCaretPosition(Unknown Source)
at javax.swing.text.DefaultCaret.handleSetDot(Unknown Source)
at javax.swing.text.DefaultCaret.setDot(Unknown Source)
at javax.swing.text.DefaultCaret$Handler.removeUpdate(Unknown Source)
at javax.swing.text.AbstractDocument.fireRemoveUpdate(Unknown Source)
at javax.swing.text.AbstractDocument.handleRemove(Unknown Source)
at javax.swing.text.AbstractDocument.remove(Unknown Source)
at javax.swing.text.AbstractDocument.replace(Unknown Source)
at javax.swing.text.JTextComponent.setText(Unknown Source)
at webserviceconsumer.WebServiceConsumerView$10.actionPerformed(WebServiceConsumerView.java:1159)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
*/
private void SetSecondsLeft(String Text)
{
try
{
TextSecondsLeft.setText(Text);
}
catch (Exception Exception)
{
ErrorOutputLine(String.format("TextSecondsLeft.setText(\"%s\") Exception = %s", Text, Exception.getMessage()));
}
}
// Open the Output Files if the specified conditional flag is true.
private void OpenOutputFiles(boolean bConditional)
{
if (bConditional)
{
if (m_FormattedFileWriter == null) // This should be the case.
{
try
{
m_FormattedFileWriter = new FileWriter("PseudoPingOutput.txt", true);
m_FormattedBufferedWriter = new BufferedWriter(m_FormattedFileWriter);
}
catch (Exception Exception)
{
System.err.printf("Formatted Output File Open Exception = %s\n", Exception.getMessage());
}
}
if (m_CsvFileWriter == null) // This should be the case.
{
try
{
m_CsvFileWriter = new FileWriter("PseudoPingData.csv", true);
m_CsvBufferedWriter = new BufferedWriter(m_CsvFileWriter);
File TestSize = new File("PseudoPingData.csv");
if (TestSize.length() <= 0)
{
m_CsvBufferedWriter.write("Reference,Domain,ProviderAddress,HttpUserAgent,ConsumerAddress,BeginTime,MethodDuration,EndTime,Status");
m_CsvBufferedWriter.newLine();
}
}
catch (Exception Exception)
{
ErrorOutputLine(String.format("CSV Output File Open Exception = %s", Exception.getMessage()));
ErrorOutputLine();
}
}
}
if (m_bFirstTimeOpenOutputFiles) // Display some Properties the First Time only.
{
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine(String.format("Java Version = %s", GetSystemProperty("java.version")));
OutputLine(String.format("Java Vendor = %s", GetSystemProperty("java.vendor")));
OutputLine(String.format("O/S Name = %s", GetSystemProperty("os.name")));
OutputLine(String.format("O/S Architecture = %s", GetSystemProperty("os.arch")));
OutputLine(String.format("O/S Version = %s", GetSystemProperty("os.version")));
OutputLine(String.format("File Separator = \"%s\"", GetSystemProperty("file.separator")));
OutputLine(String.format("Path Separator = \"%s\"", GetSystemProperty("path.separator")));
String LineSeparator = GetSystemProperty("line.separator");
//OutputLine(String.format("Line Separator Length = %d", LineSeparator.length()));
//LineSeparator = LineSeparator.replace("\r", "");
//LineSeparator = LineSeparator.replace("\n", "");
OutputLine(String.format("Line Separator = %s", GetBreakdown(LineSeparator)));
OutputLine(String.format("Is Windows = %s", m_bIsWindows));
OutputLine();
OutputLine("Installed Look And Feels:");
UIManager.LookAndFeelInfo[] Infos = UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo Info : Infos)
{
OutputLine(String.format(" %s = %s", Info.getName(), Info.getClassName()));
}
OutputLine();
m_bFirstTimeOpenOutputFiles = false;
}
}
// Return a String as broken down into component parts.
private String GetBreakdown(String Text)
{
String Result = null;
try
{
StringBuffer Working = new StringBuffer();
for (int CharAsInt : Text.toCharArray())
{
Working.append(String.format("0x%04X ", CharAsInt));
if (CharAsInt == '\r')
Working.append("[] ");
else if (CharAsInt == '\n')
Working.append("[] ");
}
Result = Working.toString();
}
catch (Exception Exception)
{
Result = String.format("Get Breakdown Exception = %s", Exception.getMessage());
}
return Result;
}
// Close the Output Files if they are open.
private void CloseOutputFiles()
{
if (m_CsvFileWriter != null)
{
try
{
if (m_CsvBufferedWriter != null)
m_CsvBufferedWriter.close();
}
catch (Exception Exception)
{
System.err.printf("CSV Output File Stream Close BufferedWriter Exception = %s\n", Exception.getMessage());
}
try
{
m_CsvFileWriter.close(); // May not be necessary in light of the above BufferedWriter close.
}
catch (Exception Exception)
{
System.err.printf("CSV Output File Stream Close FileWriter Exception = %s\n", Exception.getMessage());
}
m_CsvBufferedWriter = null;
m_CsvFileWriter = null;
}
if (m_FormattedFileWriter != null)
{
try
{
if (m_FormattedBufferedWriter != null)
m_FormattedBufferedWriter.close();
}
catch (Exception Exception)
{
System.err.printf("Formatted Output File Stream Close BufferedWriter Exception = %s\n", Exception.getMessage());
}
try
{
m_FormattedFileWriter.close(); // May not be necessary in light of the above BufferedWriter close.
}
catch (Exception Exception)
{
System.err.printf("Formatted Output File Stream Close FileWriter Exception = %s\n", Exception.getMessage());
}
m_FormattedBufferedWriter = null;
m_FormattedFileWriter = null;
}
}
// Write the specified Text and a New Line to the Output Stream and the Output File, if it is open.
private void OutputLine(String Text)
{
System.out.println(Text);
if (m_FormattedBufferedWriter != null)
{
try
{
m_FormattedBufferedWriter.write(Text);
m_FormattedBufferedWriter.newLine();
}
catch (Exception Exception)
{
}
}
}
private void OutputLine()
{
OutputLine("");
}
// Write the specified Text and a New Line to the Error Output Stream and the Output File, if it is open.
private void ErrorOutputLine(String Text)
{
System.err.println(Text);
if (m_FormattedBufferedWriter != null)
{
try
{
if (m_bIsWindows) // For Windows:
Text = Text.replace("\n", "\r\n"); // Some Exception Text has hard-coded line-feeds only, which can
// cause warnings when a text file is opened (e.g. in Visual Studio).
m_FormattedBufferedWriter.write(Text);
m_FormattedBufferedWriter.newLine();
}
catch (Exception Exception)
{
}
}
}
private void ErrorOutputLine()
{
ErrorOutputLine("");
}
// Write a line to the CSV Output File.
private void OutputCsv(String Reference, String Domain, String ProviderAddress, String HttpUserAgent, String ConsumerAddress,
Date BeginTime, long MethodDuration, Date EndTime, String Status)
{
try
{
if (m_CsvBufferedWriter != null)
{
if (m_bIsWindows) // For Windows:
Status = Status.replace("\n", "\r\n"); // Some Exception Text has hard-coded line-feeds only, which can
// cause warnings when a text file is opened (e.g. in Visual Studio).
String Text = String.format("%s,%s,%s,%s,%s,%s,%d,%s,%s",
Reference, Domain, ProviderAddress, HttpUserAgent, ConsumerAddress,
m_CsvSimpleDateFormat.format(BeginTime), MethodDuration, m_CsvSimpleDateFormat.format(EndTime),
Status);
m_CsvBufferedWriter.write(Text);
m_CsvBufferedWriter.newLine();
}
}
catch (Exception Exception)
{
//System.err.printf("OutputCsv Exception = %s\n", Exception.getMessage());
}
}
// Beta.Eadent.com/WebServices/Development.asmx helper method.
// 2-Nov-2009: Provider: .NET 1.1 code on a .NET 2.0+ site.
private void EadentDevelopment()
{
String Status = "Ok";
Date BeginTime = new Date();
String Reference = NewGuid();
String Domain = "Beta.Eadent.com";
Development Development = new Development();
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine(String.format("Reference: %s", Reference));
OutputLine();
OutputLine(String.format("Domain : %s", Domain));
OutputLine("Provider: http://Beta.Eadent.com/WebServices/Development.asmx. .NET 1.1 code, .NET 2.0+ site setting.");
OutputLine("Consumer: NetBeans Java.");
OutputLine();
OutputLine("Development Begin:");
OutputLine(String.format(" Date/Time = %s", Format(BeginTime)));
OutputLine(String.format(" Service Name = %s", Development.getServiceName().toString()));
OutputLine(String.format(" WSDL Location = %s", Development.getWSDLDocumentLocation().toString()));
DevelopmentSoap DevelopmentSoap = null;
try
{
DevelopmentSoap = Development.getDevelopmentSoap();
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
String EndPointAddress = (String)(((BindingProvider)DevelopmentSoap).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
OutputLine(String.format(" EndPoint Address = %s", EndPointAddress));
if (DevelopmentSoap != null)
{
Holder ConsumerHolder = new Holder();
Holder UserAgentHolder = new Holder();
Holder ProviderHolder = new Holder();
long BeforeMethod = 0;
long AfterMethod = 0;
long MethodDuration = 0;
OutputLine("PseudoPing:");
BeforeMethod = System.currentTimeMillis();
try
{
DevelopmentSoap.pseudoPing(ConsumerHolder, UserAgentHolder, ProviderHolder);
}
catch (SOAPFaultException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" SOAPFaultException: %s", Status));
}
catch (WebServiceException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" WebServiceException: %s", Status));
}
catch (NullPointerException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" NullPointerException: %s", Status));
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
AfterMethod = System.currentTimeMillis();
MethodDuration = AfterMethod - BeforeMethod;
OutputLine(String.format(" Provider Address = %s", ProviderHolder.value));
OutputLine(String.format(" HTTP User Agent = %s", UserAgentHolder.value));
OutputLine(String.format(" Consumer Address = %s", ConsumerHolder.value));
OutputLine(String.format(" Before Method = %d ms.", BeforeMethod));
OutputLine(String.format(" After Method = %d ms.", AfterMethod));
OutputLine(String.format(" Method Duration = %d ms.", MethodDuration));
Date EndTime = new Date();
OutputLine("Development End:");
OutputLine(String.format(" Date/Time = %s", Format(EndTime)));
OutputLine();
OutputCsv(Reference, Domain, ProviderHolder.value, UserAgentHolder.value, ConsumerHolder.value, BeginTime, MethodDuration, EndTime, Status);
}
}
// www.EamonnDuffy.com/WebServices/Tools.asmx, PseudoPing(...), helper method.
// ?-???-20??: Provider: .NET 2.0+ code on a .NET 2.0+ site.
private void EamonnDuffyPseudoPing()
{
System.err.printf("TODO: Un-comment EamonnDuffyPseudoPing() after moving www.EamonnDuffy.com\n");
/*
String Status = "Ok";
Date BeginTime = new Date();
String Reference = NewGuid();
String Domain = "www.EamonnDuffy.com";
Tools Tools = new Tools();
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine(String.format("Reference: %s", Reference));
OutputLine();
OutputLine(String.format("Domain : %s", Domain));
OutputLine("Provider: http://www.EamonnDuffy.com/WebServices/Tools.asmx. .NET 2.0+ code, .NET 2.0+ site setting.");
OutputLine("Consumer: NetBeans Java.");
OutputLine();
OutputLine("Tools Begin:");
OutputLine(String.format(" Date/Time = %s", Format(BeginTime)));
OutputLine(String.format(" Service Name = %s", Tools.getServiceName().toString()));
OutputLine(String.format(" WSDL Location = %s", Tools.getWSDLDocumentLocation().toString()));
ToolsSoap ToolsSoap = null;
try
{
ToolsSoap = Tools.getToolsSoap();
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
String EndPointAddress = (String)(((BindingProvider)ToolsSoap).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
OutputLine(String.format(" EndPoint Address = %s", EndPointAddress));
if (ToolsSoap != null)
{
Holder ConsumerHolder = new Holder();
Holder UserAgentHolder = new Holder();
Holder ProviderHolder = new Holder();
long BeforeMethod = 0;
long AfterMethod = 0;
long MethodDuration = 0;
OutputLine("PseudoPing:");
BeforeMethod = System.currentTimeMillis();
try
{
ToolsSoap.pseudoPing(ConsumerHolder, UserAgentHolder, ProviderHolder);
}
catch (SOAPFaultException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" SOAPFaultException: %s", Status));
}
catch (WebServiceException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" WebServiceException: %s", Status));
}
catch (NullPointerException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" NullPointerException: %s", Status));
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
AfterMethod = System.currentTimeMillis();
MethodDuration = AfterMethod - BeforeMethod;
OutputLine(String.format(" Provider Address = %s", ProviderHolder.value));
OutputLine(String.format(" HTTP User Agent = %s", UserAgentHolder.value));
OutputLine(String.format(" Consumer Address = %s", ConsumerHolder.value));
OutputLine(String.format(" Before Method = %d ms.", BeforeMethod));
OutputLine(String.format(" After Method = %d ms.", AfterMethod));
OutputLine(String.format(" Method Duration = %d ms.", MethodDuration));
Date EndTime = new Date();
OutputLine("Tools End:");
OutputLine(String.format(" Date/Time = %s", Format(EndTime)));
OutputLine();
OutputCsv(Reference, Domain, ProviderHolder.value, UserAgentHolder.value, ConsumerHolder.value, BeginTime, MethodDuration, EndTime, Status);
}
*/
}
// www.Dubhthaigh.info/WebServices/Example001.asmx helper method.
// 4-Nov-2009: Provider: .NET 2.0+ code on a .NET 2.0+ site.
private void DubhthaighExample001()
{
String Status = "Ok";
Date BeginTime = new Date();
String Reference = NewGuid();
String Domain = "www.Dubhthaigh.info";
info.dubhthaigh.webservices.example001.Example001 Example001 = new info.dubhthaigh.webservices.example001.Example001();
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine(String.format("Reference: %s", Reference));
OutputLine();
OutputLine(String.format("Domain : %s", Domain));
OutputLine("Provider: http://www.Dubhthaigh.info/WebServices/Example001.asmx. .NET 2.0+ code, .NET 2.0+ site setting.");
OutputLine("Consumer: NetBeans Java.");
OutputLine();
OutputLine("Example001 Begin:");
OutputLine(String.format(" Date/Time = %s", Format(BeginTime)));
OutputLine(String.format(" Service Name = %s", Example001.getServiceName().toString()));
OutputLine(String.format(" WSDL Location = %s", Example001.getWSDLDocumentLocation().toString()));
info.dubhthaigh.webservices.example001.Example001Soap Example001Soap = null;
try
{
Example001Soap = Example001.getExample001Soap();
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
String EndPointAddress = (String)(((BindingProvider)Example001Soap).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
OutputLine(String.format(" EndPoint Address = %s", EndPointAddress));
if (Example001Soap != null)
{
Holder ConsumerHolder = new Holder();
Holder UserAgentHolder = new Holder();
Holder ProviderHolder = new Holder();
long BeforeMethod = 0;
long AfterMethod = 0;
long MethodDuration = 0;
OutputLine("PseudoPing:");
BeforeMethod = System.currentTimeMillis();
try
{
Example001Soap.pseudoPing(ConsumerHolder, UserAgentHolder, ProviderHolder);
}
catch (SOAPFaultException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" SOAPFaultException: %s", Status));
}
catch (WebServiceException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" WebServiceException: %s", Status));
}
catch (NullPointerException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" NullPointerException: %s", Status));
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
AfterMethod = System.currentTimeMillis();
MethodDuration = AfterMethod - BeforeMethod;
OutputLine(String.format(" Provider Address = %s", ProviderHolder.value));
OutputLine(String.format(" HTTP User Agent = %s", UserAgentHolder.value));
OutputLine(String.format(" Consumer Address = %s", ConsumerHolder.value));
OutputLine(String.format(" Before Method = %d ms.", BeforeMethod));
OutputLine(String.format(" After Method = %d ms.", AfterMethod));
OutputLine(String.format(" Method Duration = %d ms.", MethodDuration));
Date EndTime = new Date();
OutputLine("Example001 End:");
OutputLine(String.format(" Date/Time = %s", Format(EndTime)));
OutputLine();
OutputCsv(Reference, Domain, ProviderHolder.value, UserAgentHolder.value, ConsumerHolder.value, BeginTime, MethodDuration, EndTime, Status);
}
}
// www.ForForums.info/WebServices/Example001.asmx helper method.
// 2-Nov-2009: Provider: .NET 2.0+ code on a .NET 2.0+ site.
private void ForForumsExample001()
{
String Status = "Ok";
Date BeginTime = new Date();
String Reference = NewGuid();
String Domain = "www.ForForums.info";
info.forforums.webservices.example001.Example001 Example001 = new info.forforums.webservices.example001.Example001();
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine(String.format("Reference: %s", Reference));
OutputLine();
OutputLine(String.format("Domain : %s", Domain));
OutputLine("Provider: http://www.ForForums.info/WebServices/Example001.asmx. .NET 2.0+ code, .NET 2.0+ site setting.");
OutputLine("Consumer: NetBeans Java.");
OutputLine();
OutputLine("Example001 Begin:");
OutputLine(String.format(" Date/Time = %s", Format(BeginTime)));
OutputLine(String.format(" Service Name = %s", Example001.getServiceName().toString()));
OutputLine(String.format(" WSDL Location = %s", Example001.getWSDLDocumentLocation().toString()));
info.forforums.webservices.example001.Example001Soap Example001Soap = null;
try
{
Example001Soap = Example001.getExample001Soap();
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
String EndPointAddress = (String)(((BindingProvider)Example001Soap).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
OutputLine(String.format(" EndPoint Address = %s", EndPointAddress));
if (Example001Soap != null)
{
Holder ConsumerHolder = new Holder();
Holder UserAgentHolder = new Holder();
Holder ProviderHolder = new Holder();
long BeforeMethod = 0;
long AfterMethod = 0;
long MethodDuration = 0;
OutputLine("PseudoPing:");
BeforeMethod = System.currentTimeMillis();
try
{
Example001Soap.pseudoPing(ConsumerHolder, UserAgentHolder, ProviderHolder);
}
catch (SOAPFaultException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" SOAPFaultException: %s", Status));
}
catch (WebServiceException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" WebServiceException: %s", Status));
}
catch (NullPointerException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" NullPointerException: %s", Status));
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
AfterMethod = System.currentTimeMillis();
MethodDuration = AfterMethod - BeforeMethod;
OutputLine(String.format(" Provider Address = %s", ProviderHolder.value));
OutputLine(String.format(" HTTP User Agent = %s", UserAgentHolder.value));
OutputLine(String.format(" Consumer Address = %s", ConsumerHolder.value));
OutputLine(String.format(" Before Method = %d ms.", BeforeMethod));
OutputLine(String.format(" After Method = %d ms.", AfterMethod));
OutputLine(String.format(" Method Duration = %d ms.", MethodDuration));
Date EndTime = new Date();
OutputLine("Example001 End:");
OutputLine(String.format(" Date/Time = %s", Format(EndTime)));
OutputLine();
OutputCsv(Reference, Domain, ProviderHolder.value, UserAgentHolder.value, ConsumerHolder.value, BeginTime, MethodDuration, EndTime, Status);
}
}
// www.ZEamonn.info/WebServices/Example001.asmx helper method.
// 2-Nov-2009: Provider: .NET 1.1 code on a .NET 1.1 site.
private void ZEamonnExample001()
{
String Status = "Ok";
Date BeginTime = new Date();
String Reference = NewGuid();
String Domain = "www.ZEamonn.info";
info.zeamonn.webservices.example001.Example001 Example001 = new info.zeamonn.webservices.example001.Example001();
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine(String.format("Reference: %s", Reference));
OutputLine();
OutputLine(String.format("Domain : %s", Domain));
OutputLine("Provider: http://www.ZEamonn.info/WebServices/Example001.asmx. .NET 1.1 code, .NET 1.1 site setting.");
OutputLine("Consumer: NetBeans Java.");
OutputLine();
OutputLine("Example001 Begin:");
OutputLine(String.format(" Date/Time = %s", Format(BeginTime)));
OutputLine(String.format(" Service Name = %s", Example001.getServiceName().toString()));
OutputLine(String.format(" WSDL Location = %s", Example001.getWSDLDocumentLocation().toString()));
info.zeamonn.webservices.example001.Example001Soap Example001Soap = null;
try
{
Example001Soap = Example001.getExample001Soap();
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
String EndPointAddress = (String)(((BindingProvider)Example001Soap).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY));
OutputLine(String.format(" EndPoint Address = %s", EndPointAddress));
if (Example001Soap != null)
{
Holder ConsumerHolder = new Holder();
Holder UserAgentHolder = new Holder();
Holder ProviderHolder = new Holder();
long BeforeMethod = 0;
long AfterMethod = 0;
long MethodDuration = 0;
OutputLine("PseudoPing:");
BeforeMethod = System.currentTimeMillis();
try
{
Example001Soap.pseudoPing(ConsumerHolder, UserAgentHolder, ProviderHolder);
}
catch (SOAPFaultException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" SOAPFaultException: %s", Status));
}
catch (WebServiceException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" WebServiceException: %s", Status));
}
catch (NullPointerException Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" NullPointerException: %s", Status));
}
catch (Exception Exception)
{
Status = Exception.getMessage();
ErrorOutputLine(String.format(" Exception: %s", Status));
}
AfterMethod = System.currentTimeMillis();
MethodDuration = AfterMethod - BeforeMethod;
OutputLine(String.format(" Provider Address = %s", ProviderHolder.value));
OutputLine(String.format(" HTTP User Agent = %s", UserAgentHolder.value));
OutputLine(String.format(" Consumer Address = %s", ConsumerHolder.value));
OutputLine(String.format(" Before Method = %d ms.", BeforeMethod));
OutputLine(String.format(" After Method = %d ms.", AfterMethod));
OutputLine(String.format(" Method Duration = %d ms.", MethodDuration));
Date EndTime = new Date();
OutputLine("Example001 End:");
OutputLine(String.format(" Date/Time = %s", Format(EndTime)));
OutputLine();
OutputCsv(Reference, Domain, ProviderHolder.value, UserAgentHolder.value, ConsumerHolder.value, BeginTime, MethodDuration, EndTime, Status);
}
}
// Pseudo-Ping All.
private void PseudoPingAll()
{
OpenOutputFiles(CheckBoxWriteFiles.isSelected());
BeginWaitCursor();
EadentDevelopment();
EamonnDuffyPseudoPing();
DubhthaighExample001();
ForForumsExample001();
ZEamonnExample001();
EndWaitCursor();
CloseOutputFiles();
}
// Automatic Psuedo-Ping Selected.
private void AutomaticPseudoPingSelected()
{
OpenOutputFiles(m_bAutomaticWriteFiles);
BeginWaitCursor();
if (m_bAutomaticEadent)
EadentDevelopment();
// System.err.printf("Eadent Pseudo-Ping.\n");
if (m_bAutomaticEamonnDuffy)
EamonnDuffyPseudoPing();
if (m_bAutomaticDubhthaigh)
DubhthaighExample001();
// System.err.printf("Dubhthaigh Pseudo-Ping.\n");
if (m_bAutomaticForForums)
ForForumsExample001();
// System.err.printf("ForForums Pseudo-Ping.\n");
if (m_bAutomaticZEamonn)
ZEamonnExample001();
// System.err.printf("ZEamonn Pseudo-Ping.\n");
EndWaitCursor();
CloseOutputFiles();
}
private void ButtonPseudoPingEadentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonPseudoPingEadentActionPerformed
OpenOutputFiles(CheckBoxWriteFiles.isSelected());
BeginWaitCursor();
EadentDevelopment();
EndWaitCursor();
CloseOutputFiles();
}//GEN-LAST:event_ButtonPseudoPingEadentActionPerformed
private void ButtonPseudoPingDubhthaighActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonPseudoPingDubhthaighActionPerformed
OpenOutputFiles(CheckBoxWriteFiles.isSelected());
BeginWaitCursor();
DubhthaighExample001();
EndWaitCursor();
CloseOutputFiles();
}//GEN-LAST:event_ButtonPseudoPingDubhthaighActionPerformed
private void ButtonPseudoPingZEamonnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonPseudoPingZEamonnActionPerformed
OpenOutputFiles(CheckBoxWriteFiles.isSelected());
BeginWaitCursor();
ZEamonnExample001();
EndWaitCursor();
CloseOutputFiles();
}//GEN-LAST:event_ButtonPseudoPingZEamonnActionPerformed
private void ButtonPseudoPingEamonnDuffyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonPseudoPingEamonnDuffyActionPerformed
OpenOutputFiles(CheckBoxWriteFiles.isSelected());
BeginWaitCursor();
EamonnDuffyPseudoPing();
EndWaitCursor();
CloseOutputFiles();
}//GEN-LAST:event_ButtonPseudoPingEamonnDuffyActionPerformed
private void ButtonPseudoPingForForumsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonPseudoPingForForumsActionPerformed
OpenOutputFiles(CheckBoxWriteFiles.isSelected());
BeginWaitCursor();
ForForumsExample001();
EndWaitCursor();
CloseOutputFiles();
}//GEN-LAST:event_ButtonPseudoPingForForumsActionPerformed
private void ButtonPseudoPingAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonPseudoPingAllActionPerformed
PseudoPingAll();
}//GEN-LAST:event_ButtonPseudoPingAllActionPerformed
private void ButtonAutomaticBeginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonAutomaticBeginActionPerformed
m_bAutomaticWriteFiles = CheckBoxWriteFiles.isSelected();
m_bAutomaticEadent = CheckBoxEadent.isSelected();
m_bAutomaticEamonnDuffy = CheckBoxEamonnDuffy.isSelected();
m_bAutomaticDubhthaigh = CheckBoxDubhthaigh.isSelected();
m_bAutomaticForForums = CheckBoxForForums.isSelected();
m_bAutomaticZEamonn = CheckBoxZEamonn.isSelected();
boolean bAtLeastOne = false;
bAtLeastOne |= m_bAutomaticEadent;
bAtLeastOne |= m_bAutomaticEamonnDuffy;
bAtLeastOne |= m_bAutomaticDubhthaigh;
bAtLeastOne |= m_bAutomaticForForums;
bAtLeastOne |= m_bAutomaticZEamonn;
int Hours = Parse(TextHours.getText(), 0);
int Minutes = Parse(TextMinutes.getText(), 0);
int Seconds = Parse(TextSeconds.getText(), 0);
m_AutomaticInterval = ((Hours * 60 * 60) + (Minutes * 60) + Seconds) * 1000;
if (bAtLeastOne && (m_AutomaticInterval > 0))
{
OpenOutputFiles(m_bAutomaticWriteFiles);
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine("Automatic Pseudo-Ping Selected: Begin.");
OutputLine(String.format(" Date/Time = %s", Format(new Date())));
OutputLine(String.format(" Every %d Hour(s), %d Minute(s), %d Second(s). [Interval = %d ms]", Hours, Minutes, Seconds, m_AutomaticInterval));
OutputLine();
long CurrentThreadId = Thread.currentThread().getId();
if (CurrentThreadId != m_MainThreadId)
{
ErrorOutputLine(String.format("NOTE: Main Thread Id = %d, Current Thread Id = %d.", m_MainThreadId, CurrentThreadId));
ErrorOutputLine();
}
CloseOutputFiles();
CheckBoxWriteFiles.setEnabled(false);
ButtonPseudoPingEadent.setEnabled(false);
ButtonPseudoPingEamonnDuffy.setEnabled(false);
ButtonPseudoPingDubhthaigh.setEnabled(false);
ButtonPseudoPingForForums.setEnabled(false);
ButtonPseudoPingZEamonn.setEnabled(false);
ButtonPseudoPingAll.setEnabled(false);
CheckBoxAll.setEnabled(false);
CheckBoxEadent.setEnabled(false);
CheckBoxEamonnDuffy.setEnabled(false);
CheckBoxDubhthaigh.setEnabled(false);
CheckBoxForForums.setEnabled(false);
CheckBoxZEamonn.setEnabled(false);
TextHours.setEnabled(false);
TextMinutes.setEnabled(false);
TextSeconds.setEnabled(false);
ButtonAutomaticBegin.setEnabled(false);
ButtonAutomaticEnd.setEnabled(true);
m_AutomaticLastReference = System.currentTimeMillis();
SetSecondsLeft(Long.toString(m_AutomaticInterval / 1000));
AutomaticPseudoPingSelected();
m_bAutomaticMode = true;
m_AutomaticTimer = new Timer(100, new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
try
{
if (m_bAutomaticMode)
{
long CurrentThreadId = Thread.currentThread().getId();
if (CurrentThreadId != m_AutomaticTimerThreadId)
{
if (CurrentThreadId != m_MainThreadId)
{
OpenOutputFiles(CheckBoxWriteFiles.isSelected());
ErrorOutputLine(String.format("NOTE: Main Thread Id = %d, Current Automatic Timer Thread Id = %d.", m_MainThreadId, CurrentThreadId));
CloseOutputFiles();
}
}
m_AutomaticTimerThreadId = CurrentThreadId;
long CurrentReference = System.currentTimeMillis();
long DeltaReference = CurrentReference - m_AutomaticLastReference;
// TODO: Revisit what to do when wraparound occurs.
if (DeltaReference < 0)
m_AutomaticLastReference = CurrentReference;
else
{
long MsLeft = m_AutomaticInterval - DeltaReference;
if (MsLeft < 0)
MsLeft = 0;
SetSecondsLeft(Long.toString(MsLeft / 1000));
if (MsLeft <= 0)
{
m_AutomaticLastReference = CurrentReference;
AutomaticPseudoPingSelected();
SetSecondsLeft(Long.toString(m_AutomaticInterval / 1000));
}
}
}
}
catch (Exception Exception)
{
ErrorOutputLine(String.format("Automatic Timer Method Exception = %s", Exception.getMessage()));
}
}
});
m_AutomaticTimer.start();
}
}//GEN-LAST:event_ButtonAutomaticBeginActionPerformed
private void ButtonAutomaticEndActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonAutomaticEndActionPerformed
m_bAutomaticMode = false;
if (m_AutomaticTimer != null)
{
m_AutomaticTimer.stop();
m_AutomaticTimer = null;
}
SetSecondsLeft("");
CheckBoxWriteFiles.setEnabled(true);
ButtonPseudoPingEadent.setEnabled(true);
ButtonPseudoPingEamonnDuffy.setEnabled(true);
ButtonPseudoPingDubhthaigh.setEnabled(true);
ButtonPseudoPingForForums.setEnabled(true);
ButtonPseudoPingZEamonn.setEnabled(true);
ButtonPseudoPingAll.setEnabled(true);
CheckBoxAll.setEnabled(true);
CheckBoxEadent.setEnabled(true);
CheckBoxEamonnDuffy.setEnabled(true);
CheckBoxDubhthaigh.setEnabled(true);
CheckBoxForForums.setEnabled(true);
CheckBoxZEamonn.setEnabled(true);
TextHours.setEnabled(true);
TextMinutes.setEnabled(true);
TextSeconds.setEnabled(true);
ButtonAutomaticBegin.setEnabled(true);
ButtonAutomaticEnd.setEnabled(false);
OpenOutputFiles(m_bAutomaticWriteFiles);
OutputLine("--------------------------------------------------------------------------");
OutputLine();
OutputLine("Automatic Pseudo-Ping Selected: End.");
OutputLine(String.format(" Date/Time = %s", Format(new Date())));
OutputLine();
CloseOutputFiles();
}//GEN-LAST:event_ButtonAutomaticEndActionPerformed
private void CheckBoxAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CheckBoxAllActionPerformed
boolean bSelected = false;
if (CheckBoxAll.isSelected())
{
bSelected = true;
}
else
{
bSelected = false;
}
CheckBoxEadent.setSelected(bSelected);
CheckBoxEamonnDuffy.setSelected(bSelected);
CheckBoxDubhthaigh.setSelected(bSelected);
CheckBoxForForums.setSelected(bSelected);
CheckBoxZEamonn.setSelected(bSelected);
}//GEN-LAST:event_CheckBoxAllActionPerformed
private void ComboBoxLookAndFeelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComboBoxLookAndFeelActionPerformed
if (m_bAllowLookAndFeelAction)
{
Runnable Defer = new Runnable()
{
public void run()
{
try
{
LookAndFeelItem Item = (LookAndFeelItem)ComboBoxLookAndFeel.getSelectedItem();
System.out.printf("Setting Look And Feel to: %s\n", Item.GetReferenceText());
UIManager.setLookAndFeel(Item.GetReferenceText());
JFrame Frame = getFrame();
SwingUtilities.updateComponentTreeUI(Frame);
Frame.pack();
if (aboutBox != null)
aboutBox = null;
}
catch (Exception Exception)
{
System.err.printf("Setting Look And Feel Exception = %s\n", Exception.getMessage());
}
}
};
SwingUtilities.invokeLater(Defer);
}
}//GEN-LAST:event_ComboBoxLookAndFeelActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton ButtonAutomaticBegin;
private javax.swing.JButton ButtonAutomaticEnd;
private javax.swing.JButton ButtonPseudoPingAll;
private javax.swing.JButton ButtonPseudoPingDubhthaigh;
private javax.swing.JButton ButtonPseudoPingEadent;
private javax.swing.JButton ButtonPseudoPingEamonnDuffy;
private javax.swing.JButton ButtonPseudoPingForForums;
private javax.swing.JButton ButtonPseudoPingZEamonn;
private javax.swing.JCheckBox CheckBoxAll;
private javax.swing.JCheckBox CheckBoxDubhthaigh;
private javax.swing.JCheckBox CheckBoxEadent;
private javax.swing.JCheckBox CheckBoxEamonnDuffy;
private javax.swing.JCheckBox CheckBoxForForums;
private javax.swing.JCheckBox CheckBoxWriteFiles;
private javax.swing.JCheckBox CheckBoxZEamonn;
private javax.swing.JComboBox ComboBoxLookAndFeel;
private javax.swing.JPanel PanelAutomatic;
private javax.swing.JPanel PanelManual;
private javax.swing.JTabbedPane TabbedPane;
private javax.swing.JTextField TextHours;
private javax.swing.JTextField TextMinutes;
private javax.swing.JTextField TextSeconds;
private javax.swing.JTextField TextSecondsLeft;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel mainPanel;
private javax.swing.JMenuBar menuBar;
private javax.swing.JProgressBar progressBar;
private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel;
// End of variables declaration//GEN-END:variables
private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
private JDialog aboutBox;
}
//---------------------------------------------------------------------------
// End Of $RCSfile: $
//---------------------------------------------------------------------------