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

added x3d model versions

parent 47feee12
......@@ -128,6 +128,7 @@ public class EyesisCorrectionParameters {
public String x3dModelVersion="v01";
public String x3dDirectory="";
public void setProperties(String prefix,Properties properties){
......@@ -219,6 +220,8 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"x3dDirectory", this.x3dDirectory);
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_extrinsic", this.clt_batch_extrinsic+"");
properties.setProperty(prefix+"clt_batch_poly", this.clt_batch_poly+"");
......@@ -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+"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_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"));
......@@ -401,6 +406,7 @@ public class EyesisCorrectionParameters {
gd.addStringField ("Aberration kernels for CLT directory", this.cltKernelDirectory, 60);
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.addCheckbox ("Select x3d output directory", false);
gd.addCheckbox ("Use individual subdirectory for each 3d model (timestamp as name)", this.use_x3d_subdirs);
......@@ -488,6 +494,7 @@ public class EyesisCorrectionParameters {
this.smoothKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSmoothKernelDirectory(false, true);
this.dctKernelDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectDCTKernelDirectory(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.use_x3d_subdirs= gd.getNextBoolean();
this.equirectangularDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectEquirectangularDirectory(false, false);
......@@ -533,11 +540,13 @@ public class EyesisCorrectionParameters {
gd.addStringField ("Aberration kernels for CLT directory", this.cltKernelDirectory, 60); // 6
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.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.addStringField ("Results directory", this.resultsDirectory, 60); // 11
gd.addCheckbox ("Select results directory", false); // 12
......@@ -581,6 +590,7 @@ public class EyesisCorrectionParameters {
this.sourceDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSourceDirectory(false, false); // 3
this.sensorDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectSensorDirectory(false, false); // 5
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.use_x3d_subdirs= gd.getNextBoolean(); // 10
this.resultsDirectory= gd.getNextString(); if (gd.getNextBoolean()) selectResultsDirectory(false, true); // 12
......@@ -1148,7 +1158,7 @@ public class EyesisCorrectionParameters {
}
// 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(
smart,
......@@ -1159,14 +1169,18 @@ public class EyesisCorrectionParameters {
this.x3dDirectory); //this.sourceDirectory);
if (dir!=null) {
this.x3dDirectory=dir;
if (this.use_x3d_subdirs &&(name != null) && !name.equals("")) {
dir= CalibrationFileManagement.selectDirectory(
smart,
newAllowed, // save
"x3d output sub-directory", // title
"Select x3d output sub-directory", // button
null, // filter
this.x3dDirectory + Prefs.getFileSeparator()+name); //this.sourceDirectory);
if (this.use_x3d_subdirs && (name != null) && !name.equals("")) {
name = this.x3dDirectory + Prefs.getFileSeparator()+name;
if ((version != null) && !version.equals("")) {
name = name + Prefs.getFileSeparator()+version;
}
dir= CalibrationFileManagement.selectDirectory(
smart,
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;
......
......@@ -27,12 +27,19 @@
import java.awt.Button;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.MouseInfo;
import java.awt.Panel;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileInputStream;
......@@ -394,10 +401,10 @@ private Panel panel1,
panel6 = new Panel();
panel6.setLayout(new GridLayout(1, 0, 5, 5));
addButton("Save",panel6);
addButton("Restore",panel6,color_restore);
addButton("Stop",panel6,color_stop);
addButton("Abort",panel6,color_stop);
addButton("Save", panel6,color_process); //, "Save configuration");
addButton("Restore", panel6,color_restore); // , "Restore configuration");
addButton("Stop", panel6,color_stop);
addButton("Abort", panel6,color_stop);
add(panel6);
......@@ -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) {
Button b = new Button(label);
b.setBackground(color);
b.addActionListener(this);
b.addKeyListener(IJ.getInstance());
// b.addMouseListener(new AwtToolTip(label, b));
panel.add(b);
}
void addButton(String label, Panel panel) {
Button b = new Button(label);
b.addActionListener(this);
b.addKeyListener(IJ.getInstance());
// b.addMouseListener(new AwtToolTip(label, b));
panel.add(b);
}
@Override
......
This diff is collapsed.
......@@ -4069,6 +4069,7 @@ public class QuadCLT {
// Save as individual JPEG images in the model directory
String x3d_path= correctionsParameters.selectX3dDirectory(
name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion,
true, // smart,
true); //newAllowed, // save
for (int sub_img = 0; sub_img < 4; sub_img++){
......@@ -7039,6 +7040,7 @@ public class QuadCLT {
}
String x3d_path= correctionsParameters.selectX3dDirectory( // for x3d and obj
this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion,
true, // smart,
true); //newAllowed, // save
......@@ -7559,6 +7561,7 @@ public class QuadCLT {
String path= correctionsParameters.selectX3dDirectory(
//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
correctionsParameters.x3dModelVersion,
// name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
true, // smart,
true); //newAllowed, // save
......@@ -7707,6 +7710,7 @@ public class QuadCLT {
String path= correctionsParameters.selectX3dDirectory(
//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
correctionsParameters.x3dModelVersion,
// name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
true, // smart,
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