Skip to content

Commit 01ddaba

Browse files
author
NilsFo
committed
Added support for 'magnification' XML arguments
1 parent 7d0daa3 commit 01ddaba

4 files changed

Lines changed: 29 additions & 9 deletions

File tree

Binary file not shown.

src/de/rub/bph/CellomicsPuzzleHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public void run() {
3535
helperGUI = new PuzzleHelperGUI();
3636
}
3737
});
38-
}
39-
40-
;
38+
};
4139

4240
}

src/de/rub/bph/ui/PuzzleHelperGUI.form

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</component>
6666
</children>
6767
</grid>
68-
<grid id="f29b" layout-manager="GridLayoutManager" row-count="9" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
68+
<grid id="f29b" layout-manager="GridLayoutManager" row-count="10" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
6969
<margin top="0" left="0" bottom="0" right="0"/>
7070
<constraints>
7171
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -83,7 +83,7 @@
8383
</component>
8484
<vspacer id="1fb0">
8585
<constraints>
86-
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
86+
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
8787
</constraints>
8888
</vspacer>
8989
<component id="bb32b" class="javax.swing.JLabel">
@@ -140,7 +140,7 @@
140140
</component>
141141
<component id="ac11e" class="javax.swing.JCheckBox" binding="flipRowCB">
142142
<constraints>
143-
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
143+
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
144144
</constraints>
145145
<properties>
146146
<text value="Flip row images along the y axis"/>
@@ -162,20 +162,34 @@
162162
</component>
163163
<component id="9f5cc" class="javax.swing.JButton" binding="autoReadImageSizesButton" default-binding="true">
164164
<constraints>
165-
<grid row="8" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
165+
<grid row="9" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
166166
</constraints>
167167
<properties>
168168
<text value="Auto read image sizes"/>
169169
</properties>
170170
</component>
171171
<component id="47c0b" class="javax.swing.JCheckBox" binding="flipFinalImageCB">
172172
<constraints>
173-
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
173+
<grid row="7" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
174174
</constraints>
175175
<properties>
176176
<text value="Flip final image along the y axis"/>
177177
</properties>
178178
</component>
179+
<component id="594c2" class="javax.swing.JLabel">
180+
<constraints>
181+
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
182+
</constraints>
183+
<properties>
184+
<text value="Magnification:"/>
185+
</properties>
186+
</component>
187+
<component id="e2b79" class="javax.swing.JSpinner" binding="magnificationSP">
188+
<constraints>
189+
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
190+
</constraints>
191+
<properties/>
192+
</component>
179193
</children>
180194
</grid>
181195
<grid id="c5429" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">

src/de/rub/bph/ui/PuzzleHelperGUI.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package de.rub.bph.ui;
22

33
import de.rub.bph.CellomicsPuzzleHelper;
4-
import de.rub.bph.data.PuzzleDirection;
54
import de.rub.bph.ui.component.WellPreviewPanel;
65
import ij.ImagePlus;
76
import ij.io.Opener;
@@ -23,6 +22,8 @@
2322
import java.util.regex.Matcher;
2423
import java.util.regex.Pattern;
2524

25+
import de.rub.bph.data.PuzzleDirection;
26+
2627

2728
/**
2829
* Created by nilfoe on 12/03/2018.
@@ -37,6 +38,8 @@ public class PuzzleHelperGUI extends JFrame {
3738
public static final String INSTRUCTION_PFLIPROW = "pfliprow";
3839
public static final String INSTRUCTION_PFLIPRESULT = "pflipresult";
3940
public static final String INSTRUCTION_VERSION = "version";
41+
public static final String INSTRUCTION_MAGNIFICATION = "immagni";
42+
4043
private FileNameExtensionFilter exportFileFilter, imageFileFilter;
4144

4245
private JButton button1;
@@ -55,6 +58,7 @@ public class PuzzleHelperGUI extends JFrame {
5558
private JButton autoReadImageSizesButton;
5659
private JCheckBox flipFinalImageCB;
5760
private JButton importBT;
61+
private JSpinner magnificationSP;
5862

5963
private JCheckBoxMenuItem autoUpdateCB;
6064

@@ -63,6 +67,7 @@ public PuzzleHelperGUI() {
6367
exportFileFilter = new FileNameExtensionFilter("XML", "xml");
6468
imageFileFilter = new FileNameExtensionFilter("Image files", "tiff", "tif", "png", "bmp");
6569

70+
magnificationSP.setModel(new SpinnerNumberModel(10, 1, Integer.MAX_VALUE, 1));
6671
pWidthSP.setModel(new SpinnerNumberModel(10, 1, Integer.MAX_VALUE, 1));
6772
pHeightSP.setModel(new SpinnerNumberModel(10, 1, Integer.MAX_VALUE, 1));
6873
imWidthSP.setModel(new SpinnerNumberModel(1000, 1, Integer.MAX_VALUE, 1));
@@ -232,6 +237,7 @@ private void exportFile() throws IOException {
232237
map.put(INSTRUCTION_PDIR, String.valueOf(directionCB.getSelectedItem()));
233238
map.put(INSTRUCTION_PFLIPROW, String.valueOf(flipRowCB.isSelected()));
234239
map.put(INSTRUCTION_PFLIPRESULT, String.valueOf(flipFinalImageCB.isSelected()));
240+
map.put(INSTRUCTION_MAGNIFICATION, String.valueOf(magnificationSP.getValue()));
235241
map.put(INSTRUCTION_VERSION, CellomicsPuzzleHelper.VERSION);
236242

237243
FileOutputStream fout = new FileOutputStream(f);
@@ -287,6 +293,7 @@ private void actionImportFile() throws IOException {
287293
XMLArgumentList.add(INSTRUCTION_PFLIPROW);
288294
XMLArgumentList.add(INSTRUCTION_PFLIPRESULT);
289295
XMLArgumentList.add(INSTRUCTION_VERSION);
296+
XMLArgumentList.add(INSTRUCTION_MAGNIFICATION);
290297
HashMap<String, String> xmlMap = new HashMap<>();
291298

292299
BufferedReader br = new BufferedReader(new FileReader(f));
@@ -322,6 +329,7 @@ private void actionImportFile() throws IOException {
322329
imWidthSP.setValue(Integer.valueOf(xmlMap.get(INSTRUCTION_IMWIDTH)));
323330
imHeightSP.setValue(Integer.valueOf(xmlMap.get(INSTRUCTION_IMHEIGHT)));
324331
pWidthSP.setValue(Integer.valueOf(xmlMap.get(INSTRUCTION_PWIDTH)));
332+
magnificationSP.setValue(Integer.valueOf(xmlMap.get(INSTRUCTION_MAGNIFICATION)));
325333
pHeightSP.setValue(Integer.valueOf(xmlMap.get(INSTRUCTION_PHEIGHT)));
326334
flipFinalImageCB.setSelected(Boolean.valueOf(xmlMap.get(INSTRUCTION_PFLIPRESULT)));
327335
flipRowCB.setSelected(Boolean.valueOf(xmlMap.get(INSTRUCTION_PFLIPROW)));

0 commit comments

Comments
 (0)