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 0000000..63516d9 Binary files /dev/null and b/plugins/icons/x-darker-8px.png differ diff --git a/script/tests/tests.properties b/script/tests/tests.properties index 6fa6d63..4e82b05 100644 --- a/script/tests/tests.properties +++ b/script/tests/tests.properties @@ -1,5 +1,5 @@ #TestingList for pshell: configuration properties -#Fri Oct 16 08:06:48 CEST 2015 +#Fri Oct 16 14:35:50 CEST 2015 customPanel=Kollimators showEnabledTestsOnly=true -listFilter=parallelizeOneTest +listFilter=CollimatorTests