11package de .rub .bph .ui ;
22
33import de .rub .bph .CellomicsPuzzleHelper ;
4- import de .rub .bph .data .PuzzleDirection ;
54import de .rub .bph .ui .component .WellPreviewPanel ;
65import ij .ImagePlus ;
76import ij .io .Opener ;
2322import java .util .regex .Matcher ;
2423import 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