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.
This commit is contained in:
boccioli_m
2015-10-16 14:37:34 +02:00
parent 1edc492f93
commit 66f265336f
6 changed files with 295 additions and 167 deletions

View File

@@ -17,18 +17,11 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextDist" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextIst2" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabelDeviceName" pref="150" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextSta" min="-2" pref="100" max="-2" attributes="0"/>
@@ -37,6 +30,15 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextIst1" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextDist" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextIst2" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
@@ -64,9 +66,7 @@
<Component id="jTextRes" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -74,31 +74,27 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="jButton1" alignment="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextSta" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextIst1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextRef1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextDir" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextIst2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextRef2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextDist" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextRes" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextSta" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextIst1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextRef1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextDir" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabelDeviceName" alignment="3" min="-2" pref="22" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextIst2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextRef2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextDist" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextRes" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
@@ -113,7 +109,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextSta">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
@@ -123,7 +119,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextIst1">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
@@ -133,7 +129,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextIst2">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
@@ -143,7 +139,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextDir">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
@@ -153,7 +149,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextRef1">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
@@ -163,7 +159,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextRef2">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
@@ -173,7 +169,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextDist">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextDistActionPerformed"/>
@@ -181,7 +177,7 @@
</Component>
<Component class="javax.swing.JTextField" name="jTextRes">
<Properties>
<Property name="text" type="java.lang.String" value="jTextField1"/>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
@@ -189,9 +185,9 @@
<Property name="text" type="java.lang.String" value="Resolution:"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Component class="javax.swing.JLabel" name="jLabelDeviceName">
<Properties>
<Property name="text" type="java.lang.String" value="Stop"/>
<Property name="horizontalAlignment" type="int" value="4"/>
</Properties>
</Component>
</SubComponents>

View File

@@ -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))
);
}// </editor-fold>//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;

View File

@@ -174,6 +174,22 @@
</MenuItem>
</SubComponents>
</Container>
<Container class="javax.swing.JPopupMenu" name="jPopupMenuCustom">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItemCustomClose">
<Properties>
<Property name="text" type="java.lang.String" value="Close this custom panel"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItemCustomCloseActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Container>
</NonVisualComponents>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
@@ -457,7 +473,7 @@
<Container class="javax.swing.JPanel" name="jPanelCustom">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 100]"/>
<Dimension value="[300, 100]"/>
</Property>
</Properties>
<Constraints>
@@ -469,56 +485,88 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanelCustomFrame" pref="440" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabelCustomPanelName" max="32767" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jButtonX" min="-2" pref="18" max="-2" attributes="0"/>
</Group>
<Component id="jPanelCustomHeader" max="32767" attributes="0"/>
<Component id="jPanelCustomFrame" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jButtonX" max="32767" attributes="0"/>
<Component id="jLabelCustomPanelName" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanelCustomHeader" min="-2" pref="18" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanelCustomFrame" min="-2" pref="80" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="253" max="-2" attributes="0"/>
<EmptySpace min="253" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanelCustomHeader">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[88, 20]"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Component class="javax.swing.JButton" name="jButtonX">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="8" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons/x-darker-8px.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Close this custom panel"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[10, 10]"/>
</Property>
<Property name="rolloverIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons/x-darker-8px.png"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonXActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="East"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabelCustomPanelName">
<Properties>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1000, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 20]"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabelCustomPanelNameMouseClicked"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanelCustomFrame">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
</Container>
<Component class="javax.swing.JButton" name="jButtonX">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="8" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons/x-8px.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Close this custom panel"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[8, 8]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonXActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabelCustomPanelName">
</Component>
</SubComponents>
</Container>
</SubComponents>

View File

@@ -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
//<editor-fold defaultstate="collapsed" desc="Witget Variables declaration">
// 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
//</editor-fold>
@@ -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());

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -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