From 66f265336fa8092f2b7a0d6c01886e156982e361 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Fri, 16 Oct 2015 14:37:34 +0200 Subject: [PATCH] Added: animate custom panel: - immediately, the test list concerns only one device - while test running, if more devices are concerned in the test list. Stil missing: caget from custom panel. --- plugins/Kollimators.form | 96 +++++++++++------------ plugins/Kollimators.java | 112 +++++++++++++-------------- plugins/TestingList.form | 114 +++++++++++++++++++-------- plugins/TestingList.java | 136 ++++++++++++++++++++++++++------- plugins/icons/x-darker-8px.png | Bin 0 -> 2900 bytes script/tests/tests.properties | 4 +- 6 files changed, 295 insertions(+), 167 deletions(-) create mode 100644 plugins/icons/x-darker-8px.png diff --git a/plugins/Kollimators.form b/plugins/Kollimators.form index edc52ef..489b048 100644 --- a/plugins/Kollimators.form +++ b/plugins/Kollimators.form @@ -17,18 +17,11 @@ - - - - - - - - - - - - + + + + + @@ -37,6 +30,15 @@ + + + + + + + + + @@ -64,9 +66,7 @@ - - - + @@ -74,31 +74,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -113,7 +109,7 @@ - + @@ -123,7 +119,7 @@ - + @@ -133,7 +129,7 @@ - + @@ -143,7 +139,7 @@ - + @@ -153,7 +149,7 @@ - + @@ -163,7 +159,7 @@ - + @@ -173,7 +169,7 @@ - + @@ -181,7 +177,7 @@ - + @@ -189,9 +185,9 @@ - + - + diff --git a/plugins/Kollimators.java b/plugins/Kollimators.java index 49a56e6..805f9e4 100644 --- a/plugins/Kollimators.java +++ b/plugins/Kollimators.java @@ -42,70 +42,72 @@ public class Kollimators extends javax.swing.JPanel { jTextDist = new javax.swing.JTextField(); jTextRes = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); - jButton1 = new javax.swing.JButton(); + jLabelDeviceName = new javax.swing.JLabel(); jLabel1.setText("STA:"); - jTextSta.setText("jTextField1"); + jTextSta.setEditable(false); jLabel2.setText("IST1:"); - jTextIst1.setText("jTextField1"); + jTextIst1.setEditable(false); jLabel3.setText("IST2:"); - jTextIst2.setText("jTextField1"); + jTextIst2.setEditable(false); jLabel4.setText("Direction:"); - jTextDir.setText("jTextField1"); + jTextDir.setEditable(false); jLabel5.setText("REF1:"); - jTextRef1.setText("jTextField1"); + jTextRef1.setEditable(false); jLabel6.setText("REF2:"); - jTextRef2.setText("jTextField1"); + jTextRef2.setEditable(false); jLabel7.setText("DIST:"); - jTextDist.setText("jTextField1"); + jTextDist.setEditable(false); jTextDist.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextDistActionPerformed(evt); } }); - jTextRes.setText("jTextField1"); + jTextRes.setEditable(false); jLabel8.setText("Resolution:"); - jButton1.setText("Stop"); + jLabelDeviceName.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jTextDist, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jTextIst2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabelDeviceName, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextSta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jTextIst1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(jTextIst1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextDist, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextIst2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() @@ -126,36 +128,32 @@ public class Kollimators extends javax.swing.JPanel { .addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextRes, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jButton1) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(0, 0, 0)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, 0) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(jTextSta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel2) - .addComponent(jTextIst1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel5) - .addComponent(jTextRef1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel4) - .addComponent(jTextDir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(jTextIst2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel6) - .addComponent(jTextRef2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel7) - .addComponent(jTextDist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel8) - .addComponent(jTextRes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jTextSta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(jTextIst1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5) + .addComponent(jTextRef1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4) + .addComponent(jTextDir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabelDeviceName, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jTextIst2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6) + .addComponent(jTextRef2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7) + .addComponent(jTextDist, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8) + .addComponent(jTextRes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -170,18 +168,19 @@ public class Kollimators extends javax.swing.JPanel { * @param deviceName */ public void animate(String deviceName){ - this.jTextDir.setText(deviceName+"?"); - this.jTextDist.setText(deviceName+"?"); - this.jTextIst1.setText(deviceName+":IST1:1"); - this.jTextIst2.setText(deviceName+":IST2:1"); - this.jTextRef1.setText(deviceName+":REF1:1"); - this.jTextRef2.setText(deviceName+":REF2:1"); - this.jTextRes.setText(deviceName+"?"); - this.jTextSta.setText(deviceName+":STA:2"); + this.jLabelDeviceName.setText(deviceName); + this.jTextDir.setToolTipText(deviceName+"?"); + this.jTextDist.setToolTipText(deviceName+"?"); + this.jTextIst1.setToolTipText(deviceName+":IST1:1"); + this.jTextIst2.setToolTipText(deviceName+":IST2:1"); + this.jTextRef1.setToolTipText(deviceName+":REF1:1"); + this.jTextRef2.setToolTipText(deviceName+":REF2:1"); + this.jTextRes.setToolTipText(deviceName+"?"); + this.jTextSta.setToolTipText(deviceName+":STA:2"); + } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; @@ -190,6 +189,7 @@ public class Kollimators extends javax.swing.JPanel { private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabelDeviceName; private javax.swing.JTextField jTextDir; private javax.swing.JTextField jTextDist; private javax.swing.JTextField jTextIst1; diff --git a/plugins/TestingList.form b/plugins/TestingList.form index 0dc3a81..b78419e 100644 --- a/plugins/TestingList.form +++ b/plugins/TestingList.form @@ -174,6 +174,22 @@ + + + + + + + + + + + + + + + + @@ -457,7 +473,7 @@ - + @@ -469,56 +485,88 @@ - - + - - - - - - + + + - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 1d1c5cf..86c1076 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -448,7 +448,7 @@ public class TestingList extends Panel { * * @return custom panel as component */ - private Component getCustomPanel(){ + public Component getCustomPanel(){ Component customPanel = null; if(this.jPanelCustomFrame.getComponentCount() >0){ Component components[] = this.jPanelCustomFrame.getComponents(); @@ -457,6 +457,23 @@ public class TestingList extends Panel { } return customPanel; } + + + /** + * add custom panel if specified. + * Custom panels are java classes. To add a new custom panel MyNewPanel: + * - create a panel and save it as MyNewPanel.java + * - add MyNewPanel.java file in the pshell plugins folder + * - on pshell, open Plugins and enable MyNewPanel.java + * - restart pshell + * To show the new panel, open the menu Advanced/Load Custom Panel + * + * @param panel the panel to add as component + */ + public void loadCustomPanel(Component panel){ + if(panel != null) + loadCustomPanel(panel.getClass().getName() ); + } /** * add custom panel if specified. @@ -467,6 +484,7 @@ public class TestingList extends Panel { * - restart pshell * To show the new panel, open the menu Advanced/Load Custom Panel * + * @param sPanelClassName the panel to add as class name */ private void loadCustomPanel(String sPanelClassName){ closeCustomPanel(); @@ -482,10 +500,10 @@ public class TestingList extends Panel { if(jTable1.getValueAt(row, COL.STARTSEQUENCE.ordinal())==null) continue; String sStartSequence = String.valueOf(jTable1.getValueAt(row, COL.STARTSEQUENCE.ordinal())); if(sStartSequence.equals(StartSequence.TOGETHER.toString())){ - SwingUtils.OptionResult ret = SwingUtils.showOption(this, "checkDataFields()", - "A custom panel " + - " is active. Tests can only run in sequence (one after the other). \nDo you want to set tests in sequence?", - OptionType.YesNoCancel); + SwingUtils.OptionResult ret = SwingUtils.showOption(this, "Modify Start mode", + "A custom panel is active. Tests can only run in sequence (Start mode: 'After previous'). "+ + "\nDo you want to set all tests Start mode to 'After previous'?", + OptionType.YesNo); if(ret == SwingUtils.OptionResult.Yes){ changeSequenceToAfter = true ; } else { @@ -615,6 +633,8 @@ public class TestingList extends Panel { jSeparator4 = new javax.swing.JPopupMenu.Separator(); jCheckBoxMenuShowSelectedTests1 = new javax.swing.JCheckBoxMenuItem(); jMenuItemReload1 = new javax.swing.JMenuItem(); + jPopupMenuCustom = new javax.swing.JPopupMenu(); + jMenuItemCustomClose = new javax.swing.JMenuItem(); jPanel1 = new javax.swing.JPanel(); jPanelTopCommands = new javax.swing.JPanel(); jPanelButtons = new javax.swing.JPanel(); @@ -629,9 +649,10 @@ public class TestingList extends Panel { jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jPanelCustom = new javax.swing.JPanel(); - jPanelCustomFrame = new javax.swing.JPanel(); + jPanelCustomHeader = new javax.swing.JPanel(); jButtonX = new javax.swing.JButton(); jLabelCustomPanelName = new javax.swing.JLabel(); + jPanelCustomFrame = new javax.swing.JPanel(); jCheckBoxMenuShowSelectedTests.setSelected(true); jCheckBoxMenuShowSelectedTests.setText("Show enabled tests only"); @@ -773,6 +794,14 @@ public class TestingList extends Panel { }); jPopupMenuTable.add(jMenuItemReload1); + jMenuItemCustomClose.setText("Close this custom panel"); + jMenuItemCustomClose.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemCustomCloseActionPerformed(evt); + } + }); + jPopupMenuCustom.add(jMenuItemCustomClose); + setLayout(new java.awt.BorderLayout()); jPanel1.setMinimumSize(new java.awt.Dimension(100, 200)); @@ -919,42 +948,50 @@ public class TestingList extends Panel { add(jScrollPane2, java.awt.BorderLayout.CENTER); - jPanelCustom.setPreferredSize(new java.awt.Dimension(400, 100)); + jPanelCustom.setPreferredSize(new java.awt.Dimension(300, 100)); + + jPanelCustomHeader.setPreferredSize(new java.awt.Dimension(88, 20)); + jPanelCustomHeader.setLayout(new java.awt.BorderLayout()); jButtonX.setFont(new java.awt.Font("Tahoma", 0, 8)); // NOI18N - jButtonX.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/x-8px.png"))); // NOI18N + jButtonX.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/x-darker-8px.png"))); // NOI18N jButtonX.setToolTipText("Close this custom panel"); - jButtonX.setPreferredSize(new java.awt.Dimension(8, 8)); + jButtonX.setPreferredSize(new java.awt.Dimension(10, 10)); + jButtonX.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/x-darker-8px.png"))); // NOI18N jButtonX.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonXActionPerformed(evt); } }); + jPanelCustomHeader.add(jButtonX, java.awt.BorderLayout.EAST); + + jLabelCustomPanelName.setMaximumSize(new java.awt.Dimension(1000, 20)); + jLabelCustomPanelName.setMinimumSize(new java.awt.Dimension(100, 20)); + jLabelCustomPanelName.setPreferredSize(new java.awt.Dimension(200, 20)); + jLabelCustomPanelName.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jLabelCustomPanelNameMouseClicked(evt); + } + }); + jPanelCustomHeader.add(jLabelCustomPanelName, java.awt.BorderLayout.CENTER); javax.swing.GroupLayout jPanelCustomLayout = new javax.swing.GroupLayout(jPanelCustom); jPanelCustom.setLayout(jPanelCustomLayout); jPanelCustomLayout.setHorizontalGroup( jPanelCustomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanelCustomLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanelCustomFrame, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)) - .addGroup(jPanelCustomLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabelCustomPanelName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jButtonX, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelCustomLayout.createSequentialGroup() + .addGroup(jPanelCustomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanelCustomHeader, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanelCustomFrame, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) ); jPanelCustomLayout.setVerticalGroup( jPanelCustomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanelCustomLayout.createSequentialGroup() - .addGroup(jPanelCustomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jButtonX, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelCustomLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(jLabelCustomPanelName) - .addGap(0, 0, 0))) + .addComponent(jPanelCustomHeader, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanelCustomFrame, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(253, 253, 253)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); add(jPanelCustom, java.awt.BorderLayout.SOUTH); @@ -1244,10 +1281,22 @@ public class TestingList extends Panel { }//GEN-LAST:event_jMenuLoadCustomPanelMenuSelected private void jButtonXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonXActionPerformed - // TODO add your handling code here: + closeCustomPanel(); }//GEN-LAST:event_jButtonXActionPerformed + private void jLabelCustomPanelNameMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCustomPanelNameMouseClicked + + if(evt.getButton() == java.awt.event.MouseEvent.BUTTON3){ + //right mouse click + jPopupMenuCustom.show(jLabelCustomPanelName, evt.getX(), evt.getY()); + } + }//GEN-LAST:event_jLabelCustomPanelNameMouseClicked + + private void jMenuItemCustomCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCustomCloseActionPerformed + this.closeCustomPanel(); + }//GEN-LAST:event_jMenuItemCustomCloseActionPerformed + // // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButtonMoveDown; @@ -1262,6 +1311,7 @@ public class TestingList extends Panel { private javax.swing.JCheckBoxMenuItem jCheckBoxMenuShowSelectedTests1; private javax.swing.JLabel jLabelCustomPanelName; private javax.swing.JMenu jMenuAdvanced; + private javax.swing.JMenuItem jMenuItemCustomClose; private javax.swing.JMenuItem jMenuItemDeselectSelection; private javax.swing.JMenuItem jMenuItemEditScript; private javax.swing.JMenuItem jMenuItemNewDevice; @@ -1280,9 +1330,11 @@ public class TestingList extends Panel { private javax.swing.JPanel jPanelButtons; private javax.swing.JPanel jPanelCustom; private javax.swing.JPanel jPanelCustomFrame; + private javax.swing.JPanel jPanelCustomHeader; private javax.swing.JPanel jPanelSelection; private javax.swing.JPanel jPanelTopCommands; private javax.swing.JPopupMenu jPopupMenuConfigs; + private javax.swing.JPopupMenu jPopupMenuCustom; private javax.swing.JPopupMenu jPopupMenuOptions; private javax.swing.JPopupMenu jPopupMenuTable; private javax.swing.JScrollPane jScrollPane2; @@ -1291,7 +1343,7 @@ public class TestingList extends Panel { private javax.swing.JPopupMenu.Separator jSeparator3; private javax.swing.JPopupMenu.Separator jSeparator4; private javax.swing.JPopupMenu.Separator jSeparator5; - private javax.swing.JSeparator jSeparator6; + private javax.swing.JPopupMenu.Separator jSeparator6; private javax.swing.JTable jTable1; // End of variables declaration//GEN-END:variables // @@ -1533,6 +1585,35 @@ public class TestingList extends Panel { System.out.println("animateCustomPanel(): "+String.valueOf(ex)); } } + + + /** + * Starts animating the custom panel, if present, and only if the whole list of selected tests contains one only device name + * + * Note: the custom panel must have the public method "animate(String deviceName)" + */ + public void animateCustomPanel(){ + //scan the table to see if only one device name is present + String sDeviceName = ""; + String sRowDeviceName = ""; + boolean bRowTestEnabled = false; + for (int row = 0; row < jTable1.getRowCount(); row++) { + sRowDeviceName = String.valueOf(jTable1.getValueAt(row, COL.DEVICENAME.ordinal())); + bRowTestEnabled = (boolean) jTable1.getValueAt(row, COL.CHECK.ordinal()); + if(bRowTestEnabled){ + if(sDeviceName == ""){ + sDeviceName = sRowDeviceName; + } else if(sDeviceName != sRowDeviceName){ + //there are at least two devices. Cannot animate the custom panel + return; + } + } + } + //if only one device name is present in the table, then animate the custom panel with the device + if(sDeviceName != ""){ + animateCustomPanel(sDeviceName); + } + } /** * put the test result in table @@ -1784,6 +1865,7 @@ public class TestingList extends Panel { public void run() { // code in the other thread, can reference "var" variable + loadCustomPanel(getCustomPanel()); executeTest(0); } @@ -2478,6 +2560,8 @@ public class TestingList extends Panel { loadTests(); //store current file in the properties saveProperties("listFilter", file.getName()); + //try to animate the custom panel, if the tests list concerns only one device + animateCustomPanel(); } catch (Exception ex) { ex.printStackTrace(); SwingUtils.showMessage(this, "loadListFilter()", ex.toString()); diff --git a/plugins/icons/x-darker-8px.png b/plugins/icons/x-darker-8px.png new file mode 100644 index 0000000000000000000000000000000000000000..63516d9de0add0c413060e2c62bfd8457bfb3d33 GIT binary patch literal 2900 zcmV-a3#;^rP)f6Xi@@54ZTQ_E-Enz5K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