Fix panel update if invalid values
This commit is contained in:
27
pom.xml
27
pom.xml
@@ -11,10 +11,21 @@
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>artifactory</id>
|
||||
<name>artifactory</name>
|
||||
<url>https://artifacts.psi.ch/artifactory/releases/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>artifactory_libs</id>
|
||||
<name>artifactory_libs</name>
|
||||
<url>https://artifacts.psi.ch/artifactory/libs-snapshots-local/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jcenter</id>
|
||||
<name>jcenter</name>
|
||||
<url>https://jcenter.bintray.com/</url>
|
||||
<id>central</id>
|
||||
<name>Default Repository</name>
|
||||
<layout>default</layout>
|
||||
<url>https://repo.maven.apache.org/maven2/</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
@@ -22,25 +33,19 @@
|
||||
<name>freehep</name>
|
||||
<url>http://java.freehep.org/maven2/</url>
|
||||
</repository>
|
||||
|
||||
|
||||
<repository>
|
||||
<id>imagej</id>
|
||||
<name>imagej</name>
|
||||
<url>http://maven.imagej.net/content/repositories/public</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>bintray-hltools</id>
|
||||
<name>bintray</name>
|
||||
<url>https://dl.bintray.com/paulscherrerinstitute/hltools</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<name>Scienta</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>pshell</artifactId>
|
||||
<version>1.16.0</version>
|
||||
<version>1.19.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
|
||||
@@ -486,6 +486,7 @@
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.passEnergy" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboPassActionPerformed"/>
|
||||
@@ -502,6 +503,7 @@
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="2000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.lowEnergy" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -516,6 +518,7 @@
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="2000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.centerEnergy" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -530,6 +533,7 @@
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="2000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.highEnergy" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -637,6 +641,7 @@
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.stepTime" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -651,6 +656,7 @@
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.stepSize" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -665,6 +671,7 @@
|
||||
<Property name="decimals" type="int" value="0"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.slices" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -679,6 +686,7 @@
|
||||
<Property name="decimals" type="int" value="0"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.iterations" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
|
||||
@@ -198,8 +198,9 @@ public final class ScientaPanel extends DevicePanel {
|
||||
dd.elementSet = getDevice().getElementSet();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.elementSet = null;
|
||||
} try{
|
||||
dd.acquisitionMode = getDevice().getAcquisitionMode();
|
||||
}
|
||||
try{
|
||||
dd.acquisitionMode = getDevice().getAcquisitionMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.acquisitionMode = null;
|
||||
}
|
||||
@@ -532,6 +533,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
|
||||
comboPass.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2", "5", "10", "20", "50", "100", "200" }));
|
||||
comboPass.setToolTipText("");
|
||||
comboPass.setName("scienta.passEnergy"); // NOI18N
|
||||
comboPass.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
comboPassActionPerformed(evt);
|
||||
@@ -544,6 +546,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
valueLow.setDecimals(2);
|
||||
valueLow.setMaxValue(2000.0);
|
||||
valueLow.setMinValue(0.0);
|
||||
valueLow.setName("scienta.lowEnergy"); // NOI18N
|
||||
valueLow.setShowButtons(false);
|
||||
|
||||
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
@@ -552,6 +555,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
valueCenter.setDecimals(2);
|
||||
valueCenter.setMaxValue(2000.0);
|
||||
valueCenter.setMinValue(0.0);
|
||||
valueCenter.setName("scienta.centerEnergy"); // NOI18N
|
||||
valueCenter.setShowButtons(false);
|
||||
|
||||
jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
@@ -560,6 +564,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
valueHigh.setDecimals(2);
|
||||
valueHigh.setMaxValue(2000.0);
|
||||
valueHigh.setMinValue(0.0);
|
||||
valueHigh.setName("scienta.highEnergy"); // NOI18N
|
||||
valueHigh.setShowButtons(false);
|
||||
|
||||
jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
@@ -631,6 +636,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
valueTime.setDecimals(2);
|
||||
valueTime.setMaxValue(1000.0);
|
||||
valueTime.setMinValue(0.0);
|
||||
valueTime.setName("scienta.stepTime"); // NOI18N
|
||||
valueTime.setShowButtons(false);
|
||||
|
||||
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
@@ -639,6 +645,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
valueSize.setDecimals(2);
|
||||
valueSize.setMaxValue(1000.0);
|
||||
valueSize.setMinValue(0.0);
|
||||
valueSize.setName("scienta.stepSize"); // NOI18N
|
||||
valueSize.setShowButtons(false);
|
||||
|
||||
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
@@ -647,6 +654,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
valueSlices.setDecimals(0);
|
||||
valueSlices.setMaxValue(1000.0);
|
||||
valueSlices.setMinValue(0.0);
|
||||
valueSlices.setName("scienta.slices"); // NOI18N
|
||||
valueSlices.setShowButtons(false);
|
||||
|
||||
jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
@@ -655,6 +663,7 @@ public final class ScientaPanel extends DevicePanel {
|
||||
valueIterations.setDecimals(0);
|
||||
valueIterations.setMaxValue(1000.0);
|
||||
valueIterations.setMinValue(0.0);
|
||||
valueIterations.setName("scienta.iterations"); // NOI18N
|
||||
valueIterations.setShowButtons(false);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
|
||||
97
src/main/java/ScientaParametersDialog.form
Normal file
97
src/main/java/ScientaParametersDialog.form
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="size" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[489, 236]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="parametersPanel" alignment="1" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonCancel" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
|
||||
<Component id="buttonOk" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textName" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="parametersPanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="ScientaParametersPanel" name="parametersPanel">
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonOk">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Ok"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonOkActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonCancel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Cancel"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCancelActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Name:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textName">
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
179
src/main/java/ScientaParametersDialog.java
Normal file
179
src/main/java/ScientaParametersDialog.java
Normal file
@@ -0,0 +1,179 @@
|
||||
import ch.psi.pshell.core.Context;
|
||||
import ch.psi.utils.swing.StandardDialog;
|
||||
import java.awt.Window;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ScientaParametersDialog extends StandardDialog {
|
||||
|
||||
public ScientaParametersDialog(Window parent, boolean modal) {
|
||||
super(parent,"Region Parameters", modal);
|
||||
initComponents();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onOpened() {
|
||||
setLocationRelativeTo(this.getParent());
|
||||
}
|
||||
|
||||
public ScientaParametersDialog(Window parent, boolean modal, Map pars) {
|
||||
this(parent, modal);
|
||||
if (pars ==null ){
|
||||
showDeviceData();
|
||||
} else {
|
||||
setValues((Map)pars);
|
||||
}
|
||||
}
|
||||
|
||||
public void setValues(Map<String,Object> values){
|
||||
Object name = values.get("name");
|
||||
textName.setText((name==null) ? "" : name.toString().trim());
|
||||
parametersPanel.setValues(values);
|
||||
}
|
||||
|
||||
public Map<String,Object> getValues(){
|
||||
Map<String,Object> ret = parametersPanel.getValues();
|
||||
ret.put("name", textName.getText().trim());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void showDeviceData(){
|
||||
parametersPanel.setDevice(Context.getInstance().getDevicePool().getByName("scienta", Scienta.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
parametersPanel = new ScientaParametersPanel();
|
||||
buttonOk = new javax.swing.JButton();
|
||||
buttonCancel = new javax.swing.JButton();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
textName = new javax.swing.JTextField();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setSize(new java.awt.Dimension(489, 236));
|
||||
|
||||
buttonOk.setText("Ok");
|
||||
buttonOk.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonOkActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonCancel.setText("Cancel");
|
||||
buttonCancel.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonCancelActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel1.setText("Name:");
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(parametersPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonCancel)
|
||||
.addGap(37, 37, 37)
|
||||
.addComponent(buttonOk)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textName)))
|
||||
.addGap(10, 10, 10))
|
||||
);
|
||||
|
||||
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonCancel, buttonOk});
|
||||
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(textName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(parametersPanel, 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(buttonOk)
|
||||
.addComponent(buttonCancel))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCancelActionPerformed
|
||||
cancel();
|
||||
}//GEN-LAST:event_buttonCancelActionPerformed
|
||||
|
||||
private void buttonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOkActionPerformed
|
||||
accept();
|
||||
}//GEN-LAST:event_buttonOkActionPerformed
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String args[]) {
|
||||
/* Set the Nimbus look and feel */
|
||||
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
||||
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
||||
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
||||
*/
|
||||
try {
|
||||
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
||||
if ("Nimbus".equals(info.getName())) {
|
||||
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException ex) {
|
||||
java.util.logging.Logger.getLogger(ScientaParametersDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (InstantiationException ex) {
|
||||
java.util.logging.Logger.getLogger(ScientaParametersDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (IllegalAccessException ex) {
|
||||
java.util.logging.Logger.getLogger(ScientaParametersDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||
java.util.logging.Logger.getLogger(ScientaParametersDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
/* Create and display the dialog */
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
ScientaParametersDialog dialog = new ScientaParametersDialog(new javax.swing.JFrame(), true);
|
||||
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(java.awt.event.WindowEvent e) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
dialog.setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonCancel;
|
||||
private javax.swing.JButton buttonOk;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private ScientaParametersPanel parametersPanel;
|
||||
private javax.swing.JTextField textName;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
509
src/main/java/ScientaParametersPanel.form
Normal file
509
src/main/java/ScientaParametersPanel.form
Normal file
@@ -0,0 +1,509 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Component class="javax.swing.JToggleButton" name="jToggleButton1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="jToggleButton1"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</NonVisualComponents>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="root" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="root" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="root">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="jPanel4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="jPanel4" linkSize="6" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jPanel1" linkSize="6" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jPanel2" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Modes"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel5" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="comboLens" linkSize="10" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboAcquisition" linkSize="10" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboElement" linkSize="10" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboDetector" linkSize="10" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboEnergy" linkSize="10" min="-2" max="-2" 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" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboLens" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboAcquisition" 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="comboEnergy" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboDetector" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboElement" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="17" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Lens:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboLens">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="scienta.lensMode" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Acquisition:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboAcquisition">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="scienta.acquisitionMode" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Energy:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboEnergy">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="scienta.energyMode" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Detector:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboDetector">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="scienta.detectorMode" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Element:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboElement">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="Item 1"/>
|
||||
<StringItem index="1" value="Item 2"/>
|
||||
<StringItem index="2" value="Item 3"/>
|
||||
<StringItem index="3" value="Item 4"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="scienta.elementSet" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel4">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Energy"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel14" linkSize="8" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel13" linkSize="8" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel12" linkSize="8" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel11" linkSize="8" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="valueHigh" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueCenter" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboPass" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueLow" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="jLabel11" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboPass" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="jLabel12" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueLow" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="jLabel13" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueCenter" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="jLabel14" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueHigh" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="43" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel11">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Pass:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboPass">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="7">
|
||||
<StringItem index="0" value="2"/>
|
||||
<StringItem index="1" value="5"/>
|
||||
<StringItem index="2" value="10"/>
|
||||
<StringItem index="3" value="20"/>
|
||||
<StringItem index="4" value="50"/>
|
||||
<StringItem index="5" value="100"/>
|
||||
<StringItem index="6" value="200"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.passEnergy" noResource="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel12">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Low:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.ValueSelection" name="valueLow">
|
||||
<Properties>
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="2000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.lowEnergy" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel13">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Center:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.ValueSelection" name="valueCenter">
|
||||
<Properties>
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="2000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.centerEnergy" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel14">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="High:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.ValueSelection" name="valueHigh">
|
||||
<Properties>
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="2000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.highEnergy" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Step"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel9" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="valueSize" linkSize="11" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueTime" linkSize="11" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel10" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="valueSlices" linkSize="11" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel17" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="valueIterations" linkSize="11" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueSlices" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueTime" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel9" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueSize" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel17" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="valueIterations" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel8">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Time:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.ValueSelection" name="valueTime">
|
||||
<Properties>
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.stepTime" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Size:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.ValueSelection" name="valueSize">
|
||||
<Properties>
|
||||
<Property name="decimals" type="int" value="2"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.stepSize" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel10">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Slices:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.ValueSelection" name="valueSlices">
|
||||
<Properties>
|
||||
<Property name="decimals" type="int" value="0"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.slices" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel17">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Iter:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.ValueSelection" name="valueIterations">
|
||||
<Properties>
|
||||
<Property name="decimals" type="int" value="0"/>
|
||||
<Property name="maxValue" type="double" value="1000.0"/>
|
||||
<Property name="minValue" type="double" value="0.0"/>
|
||||
<Property name="name" type="java.lang.String" value="scienta.iterations" noResource="true"/>
|
||||
<Property name="showButtons" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
586
src/main/java/ScientaParametersPanel.java
Normal file
586
src/main/java/ScientaParametersPanel.java
Normal file
@@ -0,0 +1,586 @@
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceBase.DeviceInvalidParameterException;
|
||||
import ch.psi.pshell.plot.LinePlotSeries;
|
||||
import ch.psi.pshell.swing.DevicePanel;
|
||||
import ch.psi.pshell.swing.ValueSelection;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.awt.Component;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JComboBox;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public final class ScientaParametersPanel extends DevicePanel {
|
||||
|
||||
LinePlotSeries spectrumSeries;
|
||||
|
||||
public ScientaParametersPanel() {
|
||||
initComponents();
|
||||
spectrumSeries = new LinePlotSeries("intensity");
|
||||
SwingUtils.setEnumCombo(comboLens, Scienta.LensMode.class);
|
||||
SwingUtils.setEnumCombo(comboElement, Scienta.ElementSet.class);
|
||||
SwingUtils.setEnumCombo(comboAcquisition, Scienta.AcquisitionMode.class);
|
||||
SwingUtils.setEnumCombo(comboEnergy, Scienta.EnergyMode.class);
|
||||
SwingUtils.setEnumCombo(comboDetector, Scienta.DetectorMode.class);
|
||||
|
||||
DefaultComboBoxModel model = new DefaultComboBoxModel();
|
||||
for (Integer energy : Scienta.PASS_ENERGY_VALUES) {
|
||||
model.addElement(energy);
|
||||
}
|
||||
comboPass.setModel(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Scienta getDevice() {
|
||||
return (Scienta) super.getDevice();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDevice(Device device) {
|
||||
|
||||
super.setDevice(device);
|
||||
if (device != null) {
|
||||
startBackgroundUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class DeviceData {
|
||||
|
||||
double[] spectrum;
|
||||
Scienta.LensMode lensMode;
|
||||
Scienta.ElementSet elementSet;
|
||||
Scienta.AcquisitionMode acquisitionMode;
|
||||
Scienta.EnergyMode energyMode;
|
||||
Scienta.DetectorMode detectorMode;
|
||||
Integer pass;
|
||||
double low;
|
||||
double center;
|
||||
double high;
|
||||
double width;
|
||||
//int frames;
|
||||
double time;
|
||||
double size;
|
||||
int slices;
|
||||
int iterations;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DeviceData doBackgroundUpdate() throws IOException, InterruptedException {
|
||||
DeviceData dd = new DeviceData();
|
||||
//read-once
|
||||
|
||||
dd.spectrum = getDevice().getSpectrum().getValue();
|
||||
|
||||
try{
|
||||
dd.lensMode = getDevice().getLensMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.lensMode = null;
|
||||
}
|
||||
try{
|
||||
dd.elementSet = getDevice().getElementSet();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.elementSet = null;
|
||||
}
|
||||
try{
|
||||
dd.acquisitionMode = getDevice().getAcquisitionMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.acquisitionMode = null;
|
||||
}
|
||||
try{
|
||||
dd.energyMode = getDevice().getEnergyMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.energyMode = null;
|
||||
}
|
||||
try{
|
||||
dd.detectorMode = getDevice().getDetectorMode();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.detectorMode = null;
|
||||
}
|
||||
try{
|
||||
dd.pass = getDevice().getPassEnergy();
|
||||
} catch (DeviceInvalidParameterException ex){
|
||||
dd.pass = null;
|
||||
}
|
||||
dd.low = getDevice().getLowEnergy().getValue();
|
||||
dd.center = getDevice().getCenterEnergy().getValue();
|
||||
dd.high = getDevice().getHighEnergy().getValue();
|
||||
dd.width = getDevice().getEnergyWidth().getValue();
|
||||
//dd.frames = getDevice().getFrames().getValue();
|
||||
dd.time = getDevice().getStepTime().getValue();
|
||||
dd.size = getDevice().getStepSize().getValue();
|
||||
dd.slices = getDevice().getSlices().getValue();
|
||||
|
||||
dd.iterations = getDevice().getIterations();
|
||||
return dd;
|
||||
}
|
||||
|
||||
void updateValueField(ValueSelection field, double value) {
|
||||
try {
|
||||
field.setValue(value);
|
||||
} catch (Exception ex) {
|
||||
getLogger().log(Level.FINE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
void updateComboField(JComboBox field, Object value) {
|
||||
try {
|
||||
if (field.getSelectedItem() != value) {
|
||||
field.setSelectedItem(value);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
getLogger().log(Level.FINE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBackgroundUpdateFinished(Object data) {
|
||||
DeviceData dd = (DeviceData) data;
|
||||
updateValueField(valueLow, dd.low);
|
||||
updateValueField(valueCenter, dd.center);
|
||||
updateValueField(valueHigh, dd.high);
|
||||
updateValueField(valueTime, dd.time);
|
||||
updateValueField(valueSize, dd.size);
|
||||
updateValueField(valueSlices, dd.slices);
|
||||
updateValueField(valueIterations, dd.iterations);
|
||||
updateComboField(comboLens, dd.lensMode);
|
||||
updateComboField(comboAcquisition, dd.acquisitionMode);
|
||||
updateComboField(comboDetector, dd.detectorMode);
|
||||
updateComboField(comboEnergy, dd.energyMode);
|
||||
updateComboField(comboElement, dd.elementSet);
|
||||
updateComboField(comboPass, dd.pass);
|
||||
}
|
||||
|
||||
public void setValues(Map<String,Object> values){
|
||||
for (String name:values.keySet()){
|
||||
try{
|
||||
Component child = SwingUtils.getComponentByName(root, name);
|
||||
if (child!=null){
|
||||
Object value = values.get(name);
|
||||
//if (value!=null){
|
||||
if (child instanceof JComboBox){
|
||||
if (value instanceof String){
|
||||
if (((String)value).isBlank()){
|
||||
continue;
|
||||
}
|
||||
Class comboClass = ((JComboBox)child).getModel().getElementAt(0).getClass();
|
||||
if (comboClass.isEnum()){
|
||||
value = Enum.valueOf(comboClass, (String)value);
|
||||
}
|
||||
}
|
||||
((JComboBox)child).setSelectedItem(value);
|
||||
} else if (child instanceof ValueSelection){
|
||||
if (value!=null){
|
||||
((ValueSelection)child).setValue((Double)value);
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
} catch (Exception ex){
|
||||
getLogger().log(Level.WARNING, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String,Object> getValues(){
|
||||
HashMap<String, Object> ret = new HashMap();
|
||||
for (Component child : SwingUtils.getComponentsByType(root, JComboBox.class)){
|
||||
if ((child.getName()!=null) && (!child.getName().isBlank())){
|
||||
ret.put(child.getName(), ((JComboBox)child).getSelectedItem());
|
||||
}
|
||||
}
|
||||
for (Component child : SwingUtils.getComponentsByType(root, ValueSelection.class)){
|
||||
if ((child.getName()!=null) && (!child.getName().isBlank())){
|
||||
ret.put(child.getName(), ((ValueSelection)child).getValue());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form. WARNING: Do NOT
|
||||
* modify this code. The content of this method is always regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jToggleButton1 = new javax.swing.JToggleButton();
|
||||
root = new javax.swing.JPanel();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
comboLens = new javax.swing.JComboBox();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
comboAcquisition = new javax.swing.JComboBox();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
comboEnergy = new javax.swing.JComboBox();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
comboDetector = new javax.swing.JComboBox();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
comboElement = new javax.swing.JComboBox();
|
||||
jPanel4 = new javax.swing.JPanel();
|
||||
jLabel11 = new javax.swing.JLabel();
|
||||
comboPass = new javax.swing.JComboBox();
|
||||
jLabel12 = new javax.swing.JLabel();
|
||||
valueLow = new ch.psi.pshell.swing.ValueSelection();
|
||||
jLabel13 = new javax.swing.JLabel();
|
||||
valueCenter = new ch.psi.pshell.swing.ValueSelection();
|
||||
jLabel14 = new javax.swing.JLabel();
|
||||
valueHigh = new ch.psi.pshell.swing.ValueSelection();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jLabel8 = new javax.swing.JLabel();
|
||||
valueTime = new ch.psi.pshell.swing.ValueSelection();
|
||||
jLabel9 = new javax.swing.JLabel();
|
||||
valueSize = new ch.psi.pshell.swing.ValueSelection();
|
||||
jLabel10 = new javax.swing.JLabel();
|
||||
valueSlices = new ch.psi.pshell.swing.ValueSelection();
|
||||
jLabel17 = new javax.swing.JLabel();
|
||||
valueIterations = new ch.psi.pshell.swing.ValueSelection();
|
||||
|
||||
jToggleButton1.setText("jToggleButton1");
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Modes"));
|
||||
|
||||
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel1.setText("Lens:");
|
||||
|
||||
comboLens.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
comboLens.setName("scienta.lensMode"); // NOI18N
|
||||
|
||||
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel2.setText("Acquisition:");
|
||||
|
||||
comboAcquisition.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
comboAcquisition.setName("scienta.acquisitionMode"); // NOI18N
|
||||
|
||||
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel3.setText("Energy:");
|
||||
|
||||
comboEnergy.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
comboEnergy.setName("scienta.energyMode"); // NOI18N
|
||||
|
||||
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel4.setText("Detector:");
|
||||
|
||||
comboDetector.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
comboDetector.setName("scienta.detectorMode"); // NOI18N
|
||||
|
||||
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel5.setText("Element:");
|
||||
|
||||
comboElement.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
comboElement.setName("scienta.elementSet"); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jLabel1))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(comboLens, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboAcquisition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboElement, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboDetector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3, jLabel4, jLabel5});
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboAcquisition, comboDetector, comboElement, comboEnergy, comboLens});
|
||||
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(comboLens, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(comboAcquisition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(comboEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(comboDetector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(comboElement, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(17, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Energy"));
|
||||
|
||||
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel11.setText("Pass:");
|
||||
|
||||
comboPass.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2", "5", "10", "20", "50", "100", "200" }));
|
||||
comboPass.setToolTipText("");
|
||||
comboPass.setName("scienta.passEnergy"); // NOI18N
|
||||
|
||||
jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel12.setText("Low:");
|
||||
|
||||
valueLow.setDecimals(2);
|
||||
valueLow.setMaxValue(2000.0);
|
||||
valueLow.setMinValue(0.0);
|
||||
valueLow.setName("scienta.lowEnergy"); // NOI18N
|
||||
valueLow.setShowButtons(false);
|
||||
|
||||
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel13.setText("Center:");
|
||||
|
||||
valueCenter.setDecimals(2);
|
||||
valueCenter.setMaxValue(2000.0);
|
||||
valueCenter.setMinValue(0.0);
|
||||
valueCenter.setName("scienta.centerEnergy"); // NOI18N
|
||||
valueCenter.setShowButtons(false);
|
||||
|
||||
jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel14.setText("High:");
|
||||
|
||||
valueHigh.setDecimals(2);
|
||||
valueHigh.setMaxValue(2000.0);
|
||||
valueHigh.setMinValue(0.0);
|
||||
valueHigh.setName("scienta.highEnergy"); // NOI18N
|
||||
valueHigh.setShowButtons(false);
|
||||
|
||||
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
|
||||
jPanel4.setLayout(jPanel4Layout);
|
||||
jPanel4Layout.setHorizontalGroup(
|
||||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel14)
|
||||
.addComponent(jLabel13)
|
||||
.addComponent(jLabel12)
|
||||
.addComponent(jLabel11))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(valueHigh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(valueCenter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(valueLow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {comboPass, valueCenter, valueHigh, valueLow});
|
||||
|
||||
jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel11, jLabel12, jLabel13, jLabel14});
|
||||
|
||||
jPanel4Layout.setVerticalGroup(
|
||||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(jLabel11)
|
||||
.addComponent(comboPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(jLabel12)
|
||||
.addComponent(valueLow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(jLabel13)
|
||||
.addComponent(valueCenter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(jLabel14)
|
||||
.addComponent(valueHigh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(43, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Step"));
|
||||
|
||||
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel8.setText("Time:");
|
||||
|
||||
valueTime.setDecimals(2);
|
||||
valueTime.setMaxValue(1000.0);
|
||||
valueTime.setMinValue(0.0);
|
||||
valueTime.setName("scienta.stepTime"); // NOI18N
|
||||
valueTime.setShowButtons(false);
|
||||
|
||||
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel9.setText("Size:");
|
||||
|
||||
valueSize.setDecimals(2);
|
||||
valueSize.setMaxValue(1000.0);
|
||||
valueSize.setMinValue(0.0);
|
||||
valueSize.setName("scienta.stepSize"); // NOI18N
|
||||
valueSize.setShowButtons(false);
|
||||
|
||||
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel10.setText("Slices:");
|
||||
|
||||
valueSlices.setDecimals(0);
|
||||
valueSlices.setMaxValue(1000.0);
|
||||
valueSlices.setMinValue(0.0);
|
||||
valueSlices.setName("scienta.slices"); // NOI18N
|
||||
valueSlices.setShowButtons(false);
|
||||
|
||||
jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel17.setText("Iter:");
|
||||
|
||||
valueIterations.setDecimals(0);
|
||||
valueIterations.setMaxValue(1000.0);
|
||||
valueIterations.setMinValue(0.0);
|
||||
valueIterations.setName("scienta.iterations"); // NOI18N
|
||||
valueIterations.setShowButtons(false);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel9)
|
||||
.addComponent(jLabel8))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(valueSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(valueTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel10)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(valueSlices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel17)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(valueIterations, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel17, jLabel8, jLabel9});
|
||||
|
||||
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {valueIterations, valueSize, valueSlices, valueTime});
|
||||
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel10)
|
||||
.addComponent(valueSlices, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel8)
|
||||
.addComponent(valueTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel9)
|
||||
.addComponent(valueSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel17)
|
||||
.addComponent(valueIterations, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout rootLayout = new javax.swing.GroupLayout(root);
|
||||
root.setLayout(rootLayout);
|
||||
rootLayout.setHorizontalGroup(
|
||||
rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(rootLayout.createSequentialGroup()
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
rootLayout.setVerticalGroup(
|
||||
rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(rootLayout.createSequentialGroup()
|
||||
.addGap(0, 0, 0)
|
||||
.addGroup(rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
rootLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jPanel1, jPanel4});
|
||||
|
||||
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)
|
||||
.addComponent(root, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(root, 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
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JComboBox comboAcquisition;
|
||||
private javax.swing.JComboBox comboDetector;
|
||||
private javax.swing.JComboBox comboElement;
|
||||
private javax.swing.JComboBox comboEnergy;
|
||||
private javax.swing.JComboBox comboLens;
|
||||
private javax.swing.JComboBox comboPass;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel12;
|
||||
private javax.swing.JLabel jLabel13;
|
||||
private javax.swing.JLabel jLabel14;
|
||||
private javax.swing.JLabel jLabel17;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
private javax.swing.JLabel jLabel5;
|
||||
private javax.swing.JLabel jLabel8;
|
||||
private javax.swing.JLabel jLabel9;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel4;
|
||||
private javax.swing.JToggleButton jToggleButton1;
|
||||
private javax.swing.JPanel root;
|
||||
private ch.psi.pshell.swing.ValueSelection valueCenter;
|
||||
private ch.psi.pshell.swing.ValueSelection valueHigh;
|
||||
private ch.psi.pshell.swing.ValueSelection valueIterations;
|
||||
private ch.psi.pshell.swing.ValueSelection valueLow;
|
||||
private ch.psi.pshell.swing.ValueSelection valueSize;
|
||||
private ch.psi.pshell.swing.ValueSelection valueSlices;
|
||||
private ch.psi.pshell.swing.ValueSelection valueTime;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
Reference in New Issue
Block a user