diff --git a/NanoJ-Fluidics.jar b/NanoJ-Fluidics.jar index cecb1e8..9a0aa76 100644 Binary files a/NanoJ-Fluidics.jar and b/NanoJ-Fluidics.jar differ diff --git a/NanoJ-Fluidics_IJ.jar b/NanoJ-Fluidics_IJ.jar index ba74b4d..bceee6b 100644 Binary files a/NanoJ-Fluidics_IJ.jar and b/NanoJ-Fluidics_IJ.jar differ diff --git a/NanoJ-Fluidics_MM.jar b/NanoJ-Fluidics_MM.jar index 9e952d6..b17bed6 100644 Binary files a/NanoJ-Fluidics_MM.jar and b/NanoJ-Fluidics_MM.jar differ diff --git a/PackagedBinaries/NanoJ-Fluidics.zip b/PackagedBinaries/NanoJ-Fluidics.zip index 9821b1e..2b973b5 100644 Binary files a/PackagedBinaries/NanoJ-Fluidics.zip and b/PackagedBinaries/NanoJ-Fluidics.zip differ diff --git a/PackagedBinaries/NanoJ-Fluidics_IJ.zip b/PackagedBinaries/NanoJ-Fluidics_IJ.zip index 38386b0..b1ccaef 100644 Binary files a/PackagedBinaries/NanoJ-Fluidics_IJ.zip and b/PackagedBinaries/NanoJ-Fluidics_IJ.zip differ diff --git a/PackagedBinaries/NanoJ-Fluidics_MM.zip b/PackagedBinaries/NanoJ-Fluidics_MM.zip index 1a996f8..b57c433 100644 Binary files a/PackagedBinaries/NanoJ-Fluidics_MM.zip and b/PackagedBinaries/NanoJ-Fluidics_MM.zip differ diff --git a/src/nanoj/pumpControl/java/sequentialProtocol/Step.java b/src/nanoj/pumpControl/java/sequentialProtocol/Step.java index 330b344..631df31 100644 --- a/src/nanoj/pumpControl/java/sequentialProtocol/Step.java +++ b/src/nanoj/pumpControl/java/sequentialProtocol/Step.java @@ -68,6 +68,7 @@ public String toString() { private FlowRateSlider rateSlider; private JTextField volume; private JComboBox volumeUnitsList; + private JLabel peristalticLabel = new JLabel("secs."); private JComboBox action = new JComboBox(Pump.Action.values()); private int number; @@ -110,7 +111,6 @@ public Step(int num) { this.time = new JTextField(Integer.toString(time), 2); Listener listener = new Listener(); this.time.addActionListener(listener); - this.time.addFocusListener(listener); step.add(this.time); timeUnitsList = new JComboBox(TimeUnit.values()); @@ -146,6 +146,7 @@ public Step(int num) { volumeUnitsList = new JComboBox(VolumeUnit.values()); volumeUnitsList.setSelectedIndex(volumeUnit.ordinal()); step.add(volumeUnitsList); + step.add(peristalticLabel); this.action.setSelectedItem(action); step.add(this.action); @@ -280,19 +281,22 @@ public void actionPerformed(ActionEvent e) { } } - class Listener implements ActionListener, FocusListener { + class Listener implements ActionListener { void updateSyringeInformation() { Syringe syringe = Syringe.values()[syringeList.getSelectedIndex()]; if (syringe.equals(Syringe.PERISTALTIC)) { - volume.setText(time.getText()); volumeUnitsList.setSelectedIndex(VolumeUnit.UL.ordinal()); + volumeUnitsList.setEnabled(false); - volume.setEnabled(false); + volumeUnitsList.setVisible(false); + peristalticLabel.setVisible(true); + } else { volumeUnitsList.setEnabled(true); - volume.setEnabled(true); + volumeUnitsList.setVisible(true); + peristalticLabel.setVisible(true); } if (pumpManager.anyPumpsConnected()) { @@ -301,24 +305,6 @@ void updateSyringeInformation() { } } - public void updateTime() { - float duration; - - try { - duration = Float.parseFloat(time.getText()); - } catch (Exception e1) { - duration = 1; - } - - if (duration < 0 ) { - time.setText("0"); - } - else time.setText("" + Math.round(duration)); - - if (Syringe.values()[syringeList.getSelectedIndex()].equals(Syringe.PERISTALTIC)) - volume.setText(time.getText()); - } - @Override public void actionPerformed(ActionEvent e) { @@ -327,17 +313,20 @@ public void actionPerformed(ActionEvent e) { } if (e.getSource().equals(time)) { - updateTime(); + float duration; + + try { + duration = Float.parseFloat(time.getText()); + } catch (Exception e1) { + duration = 1; + } + + if (duration < 0 ) { + time.setText("0"); + } + else time.setText("" + Math.round(duration)); } } - - @Override - public void focusGained(FocusEvent e) { } - - @Override - public void focusLost(FocusEvent e) { - updateTime(); - } } // Methods