Closedown

This commit is contained in:
boccioli_m
2017-10-13 11:30:48 +02:00
parent 3dc213865f
commit 923e80b41b
3 changed files with 17 additions and 53 deletions

View File

@@ -4,25 +4,15 @@
import ch.psi.utils.swing.SwingUtils;
import java.awt.Desktop;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.table.DefaultTableModel;
@@ -66,7 +56,7 @@ public class TestingListDetails extends javax.swing.JPanel {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabelDeviceName = new javax.swing.JLabel();
txtDeviceName = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
txtDeviceDescription = new javax.swing.JTextField();
@@ -93,9 +83,9 @@ public class TestingListDetails extends javax.swing.JPanel {
jLabel10 = new javax.swing.JLabel();
jButtonOk1 = new javax.swing.JButton();
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel1.setText("Device name");
jLabel1.setVisible(false);
jLabelDeviceName.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabelDeviceName.setText("Device name");
jLabelDeviceName.setVisible(false);
txtDeviceName.setEditable(false);
txtDeviceName.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
@@ -256,7 +246,7 @@ public class TestingListDetails extends javax.swing.JPanel {
.addComponent(jLabel8)
.addComponent(jLabel6)
.addComponent(jLabel9)
.addComponent(jLabel1)
.addComponent(jLabelDeviceName)
.addComponent(jLabel10))
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING))
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING))
@@ -315,7 +305,7 @@ public class TestingListDetails extends javax.swing.JPanel {
.addComponent(jScrollPaneRes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabelDeviceName)
.addComponent(txtDeviceName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
@@ -412,33 +402,6 @@ public class TestingListDetails extends javax.swing.JPanel {
}
}
/**
* Build a map with optional parameters to be passed to the testing script.
* The map is like this: parameters \_ name | \_ value | \_ description \_
* name | \_ value | \_ description ... the name 'name' is the mapping key.
* 'value' and 'description' are constant mapping keys of a nested map.
*
* @param parametersString string containing the parameters. Syntax:
* name:value:description[;name:value:description;...]
*/
private HashMap buildParametersMap(String parametersString) {
HashMap mParameters = new HashMap(); // contains name and attributes
HashMap mParameterAttributes = new HashMap(); //contians value and description
String[] dsParameterAttributes = null;
String[] dsParameters = parametersString.split(PARAM_SEPARATOR);
for (String sParameter : dsParameters) {
dsParameterAttributes = sParameter.split(VALUE_SEPARATOR);
if (dsParameterAttributes.length > 2) {
mParameterAttributes = new HashMap();
mParameterAttributes.put("value", (Object) dsParameterAttributes[1]);
mParameterAttributes.put("description", dsParameterAttributes[2]);
//add parameter name and attributes (value + description)
mParameters.put(dsParameterAttributes[0], mParameterAttributes);
}
}
return mParameters;
}
private HashMap getParametersFromTable(){
HashMap mParameters = new HashMap(); // contains name and attributes
HashMap mParameterAttributes = new HashMap(); //contians value and description
@@ -517,8 +480,8 @@ public class TestingListDetails extends javax.swing.JPanel {
private void jButtonMoreTestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMoreTestActionPerformed
if(this.jButtonMoreTest.getText()=="More"){
this.txtDeviceName.setVisible(true);
this.jLabel1.setVisible(true);
//this.txtDeviceName.setVisible(true);
//this.jLabelDeviceName.setVisible(true);
this.jLabel2.setVisible(true);
this.txtDeviceDescription.setVisible(true);
this.jButtonMoreTest.setText("Less");
@@ -527,8 +490,8 @@ public class TestingListDetails extends javax.swing.JPanel {
this.txtTestSuite.setVisible(true);
this.jLabel8.setVisible(true);
}else{
this.txtDeviceName.setVisible(false);
this.jLabel1.setVisible(false);
//this.txtDeviceName.setVisible(false);
//this.jLabelDeviceName.setVisible(false);
this.jLabel2.setVisible(false);
this.txtDeviceDescription.setVisible(false);
this.jScrollPaneTestDesc.setVisible(false);
@@ -551,7 +514,6 @@ public class TestingListDetails extends javax.swing.JPanel {
private javax.swing.JButton jButtonOk;
private javax.swing.JButton jButtonOk1;
private javax.swing.JEditorPane jEditorPaneHelp;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel4;
@@ -560,6 +522,7 @@ public class TestingListDetails extends javax.swing.JPanel {
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JLabel jLabelDeviceName;
private javax.swing.JScrollPane jScrollPaneHtml;
private javax.swing.JScrollPane jScrollPaneParam;
private javax.swing.JScrollPane jScrollPaneRes;