Commit 9e5d4e97 authored by Andrey Filippov's avatar Andrey Filippov

added x3d model versions

parent 47feee12
...@@ -128,6 +128,7 @@ public class EyesisCorrectionParameters { ...@@ -128,6 +128,7 @@ public class EyesisCorrectionParameters {
public String x3dModelVersion="v01";
public String x3dDirectory=""; public String x3dDirectory="";
public void setProperties(String prefix,Properties properties){ public void setProperties(String prefix,Properties properties){
...@@ -219,6 +220,8 @@ public class EyesisCorrectionParameters { ...@@ -219,6 +220,8 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"x3dDirectory", this.x3dDirectory); properties.setProperty(prefix+"x3dDirectory", this.x3dDirectory);
properties.setProperty(prefix+"use_x3d_subdirs", this.use_x3d_subdirs+""); properties.setProperty(prefix+"use_x3d_subdirs", this.use_x3d_subdirs+"");
properties.setProperty(prefix+"x3dModelVersion", this.x3dModelVersion);
properties.setProperty(prefix+"clt_batch_apply_man", this.clt_batch_apply_man+""); properties.setProperty(prefix+"clt_batch_apply_man", this.clt_batch_apply_man+"");
properties.setProperty(prefix+"clt_batch_extrinsic", this.clt_batch_extrinsic+""); properties.setProperty(prefix+"clt_batch_extrinsic", this.clt_batch_extrinsic+"");
properties.setProperty(prefix+"clt_batch_poly", this.clt_batch_poly+""); properties.setProperty(prefix+"clt_batch_poly", this.clt_batch_poly+"");
...@@ -323,6 +326,8 @@ public class EyesisCorrectionParameters { ...@@ -323,6 +326,8 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"use_x3d_subdirs")!= null) this.use_x3d_subdirs=Boolean.parseBoolean(properties.getProperty(prefix+"use_x3d_subdirs")); if (properties.getProperty(prefix+"use_x3d_subdirs")!= null) this.use_x3d_subdirs=Boolean.parseBoolean(properties.getProperty(prefix+"use_x3d_subdirs"));
if (properties.getProperty(prefix+"x3dModelVersion")!= null) this.x3dModelVersion=properties.getProperty(prefix+"x3dModelVersion");
if (properties.getProperty(prefix+"clt_batch_apply_man")!= null) this.clt_batch_apply_man=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_apply_man")); if (properties.getProperty(prefix+"clt_batch_apply_man")!= null) this.clt_batch_apply_man=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_apply_man"));
if (properties.getProperty(prefix+"clt_batch_extrinsic")!= null) this.clt_batch_extrinsic=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_extrinsic")); if (properties.getProperty(prefix+"clt_batch_extrinsic")!= null) this.clt_batch_extrinsic=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_extrinsic"));
if (properties.getProperty(prefix+"clt_batch_poly")!= null) this.clt_batch_poly=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_poly")); if (properties.getProperty(prefix+"clt_batch_poly")!= null) this.clt_batch_poly=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_poly"));
...@@ -401,6 +406,7 @@ public class EyesisCorrectionParameters { ...@@ -401,6 +406,7 @@ public class EyesisCorrectionParameters {
gd.addStringField ("Aberration kernels for CLT directory", this.cltKernelDirectory, 60); gd.addStringField ("Aberration kernels for CLT directory", this.cltKernelDirectory, 60);
gd.addCheckbox ("Select aberration kernels for CLT directory", false); gd.addCheckbox ("Select aberration kernels for CLT directory", false);
gd.addStringField ("x3d model version", this.x3dModelVersion, 20); // 10a
gd.addStringField ("x3d output directory", this.x3dDirectory, 60); gd.addStringField ("x3d output directory", this.x3dDirectory, 60);
gd.addCheckbox ("Select x3d output directory", false); gd.addCheckbox ("Select x3d output directory", false);
gd.addCheckbox ("Use individual subdirectory for each 3d model (timestamp as name)", this.use_x3d_subdirs); gd.addCheckbox ("Use individual subdirectory for each 3d model (timestamp as name)", this.use_x3d_subdirs);
...@@ -488,6 +494,7 @@ public class EyesisCorrectionParameters { ...@@ -488,6 +494,7 @@ public class EyesisCorrectionParameters {
this.smoothKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSmoothKernelDirectory(false, true); this.smoothKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSmoothKernelDirectory(false, true);
this.dctKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectDCTKernelDirectory(false, true); this.dctKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectDCTKernelDirectory(false, true);
this.cltKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectCLTKernelDirectory(false, true); this.cltKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectCLTKernelDirectory(false, true);
this.x3dModelVersion= gd.getNextString(); // 10a
this.x3dDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectX3dDirectory(false, true); this.x3dDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectX3dDirectory(false, true);
this.use_x3d_subdirs= gd.getNextBoolean(); this.use_x3d_subdirs= gd.getNextBoolean();
this.equirectangularDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectEquirectangularDirectory(false, false); this.equirectangularDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectEquirectangularDirectory(false, false);
...@@ -533,11 +540,13 @@ public class EyesisCorrectionParameters { ...@@ -533,11 +540,13 @@ public class EyesisCorrectionParameters {
gd.addStringField ("Aberration kernels for CLT directory", this.cltKernelDirectory, 60); // 6 gd.addStringField ("Aberration kernels for CLT directory", this.cltKernelDirectory, 60); // 6
gd.addCheckbox ("Select aberration kernels for CLT directory", false); // 7 gd.addCheckbox ("Select aberration kernels for CLT directory", false); // 7
gd.addStringField ("x3d model version", this.x3dModelVersion, 60); // 10a
gd.addStringField ("x3d output directory", this.x3dDirectory, 60); // 8 gd.addStringField ("x3d output directory", this.x3dDirectory, 60); // 8
gd.addCheckbox ("Select x3d output directory", false); // 9 gd.addCheckbox ("Select x3d output (top model) directory", false); // 9
gd.addCheckbox ("Use individual subdirectory for each 3d model (timestamp as name)", this.use_x3d_subdirs); //10 gd.addCheckbox ("Use individual subdirectory for each 3d model (timestamp as name)", this.use_x3d_subdirs); //10
gd.addStringField ("Results directory", this.resultsDirectory, 60); // 11 gd.addStringField ("Results directory", this.resultsDirectory, 60); // 11
gd.addCheckbox ("Select results directory", false); // 12 gd.addCheckbox ("Select results directory", false); // 12
...@@ -581,6 +590,7 @@ public class EyesisCorrectionParameters { ...@@ -581,6 +590,7 @@ public class EyesisCorrectionParameters {
this.sourceDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSourceDirectory(false, false); // 3 this.sourceDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSourceDirectory(false, false); // 3
this.sensorDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSensorDirectory(false, false); // 5 this.sensorDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSensorDirectory(false, false); // 5
this.cltKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectCLTKernelDirectory(false, true); // 7 this.cltKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectCLTKernelDirectory(false, true); // 7
this.x3dModelVersion= gd.getNextString(); // 10a
this.x3dDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectX3dDirectory(false, true); // 9 this.x3dDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectX3dDirectory(false, true); // 9
this.use_x3d_subdirs= gd.getNextBoolean(); // 10 this.use_x3d_subdirs= gd.getNextBoolean(); // 10
this.resultsDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectResultsDirectory(false, true); // 12 this.resultsDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectResultsDirectory(false, true); // 12
...@@ -1148,7 +1158,7 @@ public class EyesisCorrectionParameters { ...@@ -1148,7 +1158,7 @@ public class EyesisCorrectionParameters {
} }
// select qualified (by 'name' - quad timestamp) x3d subdirectory // select qualified (by 'name' - quad timestamp) x3d subdirectory
public String selectX3dDirectory(String name, boolean smart, boolean newAllowed) { public String selectX3dDirectory(String name, String version, boolean smart, boolean newAllowed) {
String dir= CalibrationFileManagement.selectDirectory( String dir= CalibrationFileManagement.selectDirectory(
smart, smart,
...@@ -1159,14 +1169,18 @@ public class EyesisCorrectionParameters { ...@@ -1159,14 +1169,18 @@ public class EyesisCorrectionParameters {
this.x3dDirectory); //this.sourceDirectory); this.x3dDirectory); //this.sourceDirectory);
if (dir!=null) { if (dir!=null) {
this.x3dDirectory=dir; this.x3dDirectory=dir;
if (this.use_x3d_subdirs &&(name != null) && !name.equals("")) { if (this.use_x3d_subdirs && (name != null) && !name.equals("")) {
dir= CalibrationFileManagement.selectDirectory( name = this.x3dDirectory + Prefs.getFileSeparator()+name;
smart, if ((version != null) && !version.equals("")) {
newAllowed, // save name = name + Prefs.getFileSeparator()+version;
"x3d output sub-directory", // title }
"Select x3d output sub-directory", // button dir= CalibrationFileManagement.selectDirectory(
null, // filter smart,
this.x3dDirectory + Prefs.getFileSeparator()+name); //this.sourceDirectory); newAllowed, // save
"x3d output sub-directory", // title
"Select x3d output sub-directory", // button
null, // filter
name); //this.x3dDirectory + Prefs.getFileSeparator()+name); //this.sourceDirectory);
} }
} }
return dir; return dir;
......
...@@ -27,12 +27,19 @@ ...@@ -27,12 +27,19 @@
import java.awt.Button; import java.awt.Button;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Frame; import java.awt.Frame;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.Label;
import java.awt.MouseInfo;
import java.awt.Panel; import java.awt.Panel;
import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
...@@ -394,10 +401,10 @@ private Panel panel1, ...@@ -394,10 +401,10 @@ private Panel panel1,
panel6 = new Panel(); panel6 = new Panel();
panel6.setLayout(new GridLayout(1, 0, 5, 5)); panel6.setLayout(new GridLayout(1, 0, 5, 5));
addButton("Save",panel6); addButton("Save", panel6,color_process); //, "Save configuration");
addButton("Restore",panel6,color_restore); addButton("Restore", panel6,color_restore); // , "Restore configuration");
addButton("Stop",panel6,color_stop); addButton("Stop", panel6,color_stop);
addButton("Abort",panel6,color_stop); addButton("Abort", panel6,color_stop);
add(panel6); add(panel6);
...@@ -666,18 +673,62 @@ private Panel panel1, ...@@ -666,18 +673,62 @@ private Panel panel1,
} }
} }
public class AwtToolTip extends MouseAdapter{
private String toolTipText= "...";
private Component component = null;
private Dialog dialog;
public AwtToolTip(String toolTipText, Component component){
this.toolTipText= toolTipText;
this.component= component;
dialog = new Dialog(new Frame());
dialog.add(new Label(toolTipText));
dialog.setLocationRelativeTo(component);
dialog.pack();
}
@Override
public void mouseEntered(MouseEvent mouseEvent){
Point location = MouseInfo.getPointerInfo().getLocation();
int x = (int) location.getX();
int y = (int) location.getY();
dialog.setLocation(x,y);
dialog.setVisible(true);
}
@Override
public void mouseExited(MouseEvent mouseEvent){
dialog.setVisible(false);
}
}
void addButton(String label, Panel panel,Color color, String toolTip) {
Button b = new Button(label);
b.setBackground(color);
b.addActionListener(this);
b.addKeyListener(IJ.getInstance());
b.addMouseListener(new AwtToolTip(toolTip, b));
panel.add(b);
}
void addButton(String label, Panel panel,Color color) { void addButton(String label, Panel panel,Color color) {
Button b = new Button(label); Button b = new Button(label);
b.setBackground(color); b.setBackground(color);
b.addActionListener(this); b.addActionListener(this);
b.addKeyListener(IJ.getInstance()); b.addKeyListener(IJ.getInstance());
// b.addMouseListener(new AwtToolTip(label, b));
panel.add(b); panel.add(b);
} }
void addButton(String label, Panel panel) { void addButton(String label, Panel panel) {
Button b = new Button(label); Button b = new Button(label);
b.addActionListener(this); b.addActionListener(this);
b.addKeyListener(IJ.getInstance()); b.addKeyListener(IJ.getInstance());
// b.addMouseListener(new AwtToolTip(label, b));
panel.add(b); panel.add(b);
} }
@Override @Override
......
This diff is collapsed.
...@@ -4069,6 +4069,7 @@ public class QuadCLT { ...@@ -4069,6 +4069,7 @@ public class QuadCLT {
// Save as individual JPEG images in the model directory // Save as individual JPEG images in the model directory
String x3d_path= correctionsParameters.selectX3dDirectory( String x3d_path= correctionsParameters.selectX3dDirectory(
name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion,
true, // smart, true, // smart,
true); //newAllowed, // save true); //newAllowed, // save
for (int sub_img = 0; sub_img < 4; sub_img++){ for (int sub_img = 0; sub_img < 4; sub_img++){
...@@ -7039,6 +7040,7 @@ public class QuadCLT { ...@@ -7039,6 +7040,7 @@ public class QuadCLT {
} }
String x3d_path= correctionsParameters.selectX3dDirectory( // for x3d and obj String x3d_path= correctionsParameters.selectX3dDirectory( // for x3d and obj
this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion,
true, // smart, true, // smart,
true); //newAllowed, // save true); //newAllowed, // save
...@@ -7559,6 +7561,7 @@ public class QuadCLT { ...@@ -7559,6 +7561,7 @@ public class QuadCLT {
String path= correctionsParameters.selectX3dDirectory( String path= correctionsParameters.selectX3dDirectory(
//TODO: Which one to use - name or this.image_name ? //TODO: Which one to use - name or this.image_name ?
this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion,
// name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false // name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
true, // smart, true, // smart,
true); //newAllowed, // save true); //newAllowed, // save
...@@ -7707,6 +7710,7 @@ public class QuadCLT { ...@@ -7707,6 +7710,7 @@ public class QuadCLT {
String path= correctionsParameters.selectX3dDirectory( String path= correctionsParameters.selectX3dDirectory(
//TODO: Which one to use - name or this.image_name ? //TODO: Which one to use - name or this.image_name ?
this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion,
// name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false // name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
true, // smart, true, // smart,
true); //newAllowed, // save true); //newAllowed, // save
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment