Button Refresh

This commit is contained in:
boccioli_m
2015-12-02 10:05:54 +01:00
parent d287e41579
commit 85da938186
2 changed files with 15 additions and 14 deletions

View File

@@ -23,7 +23,7 @@
<Component id="jLabelDeviceName" pref="100" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<Component id="jButtonReconnect" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
@@ -103,7 +103,7 @@
<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"/>
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButtonReconnect" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
@@ -197,12 +197,12 @@
<Property name="horizontalTextPosition" type="int" value="2"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Component class="javax.swing.JButton" name="jButtonReconnect">
<Properties>
<Property name="text" type="java.lang.String" value="Reconnect"/>
<Property name="text" type="java.lang.String" value="Refresh"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonReconnectActionPerformed"/>
</Events>
</Component>
</SubComponents>

View File

@@ -70,6 +70,7 @@ public class Kollimators extends javax.swing.JPanel {
public void animate(String deviceName) {
g_deviceName = deviceName;
jLabelDeviceName.setText(deviceName);
connect(deviceName+":STA2:1", jTextSta);
connect(deviceName+":IST1:1", jTextDist);
connect(deviceName+":IST1:1", jTextIst1);
@@ -123,7 +124,7 @@ public class Kollimators extends javax.swing.JPanel {
jTextRes = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jLabelDeviceName = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButtonReconnect = new javax.swing.JButton();
jLabel1.setText("STA:");
@@ -160,10 +161,10 @@ public class Kollimators extends javax.swing.JPanel {
jLabelDeviceName.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabelDeviceName.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
jButton1.setText("Reconnect");
jButton1.addActionListener(new java.awt.event.ActionListener() {
jButtonReconnect.setText("Refresh");
jButtonReconnect.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
jButtonReconnectActionPerformed(evt);
}
});
@@ -177,7 +178,7 @@ public class Kollimators extends javax.swing.JPanel {
.addGap(3, 3, 3)
.addComponent(jLabelDeviceName, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jButton1)
.addComponent(jButtonReconnect)
.addGap(0, 0, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -243,15 +244,15 @@ public class Kollimators extends javax.swing.JPanel {
.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)
.addComponent(jButton1))
.addComponent(jButtonReconnect))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
private void jButtonReconnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReconnectActionPerformed
// TODO add your handling code here:
animate();
}//GEN-LAST:event_jButton1ActionPerformed
}//GEN-LAST:event_jButtonReconnectActionPerformed
/**
@@ -293,7 +294,7 @@ public class Kollimators extends javax.swing.JPanel {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButtonReconnect;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;