Commit da48d22b authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fixing headless run

parent 1b78d16a
......@@ -573,7 +573,7 @@ public class EyesisCorrectionParameters {
String [] sensorFiles=null;
// try reading all matching files
File dir= new File (this.sensorDirectory);
// if (debugLevel>1) System.out.println("selectSensorFiles, dir="+this.sensorDirectory);
if (debugLevel>1) System.out.println("selectSensorFiles, dir="+this.sensorDirectory);
File [] fileList=null;
if (dir.exists()) {
fileList=dir.listFiles(sensorFilter);
......
This diff is collapsed.
......@@ -30,6 +30,7 @@ import ij.process.*;
import ij.gui.*;
import ij.plugin.frame.*;
import ij.text.*;
import ij.plugin.PlugIn;
import java.awt.*;
import java.awt.event.*;
......@@ -50,9 +51,8 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/* This plugin opens images in Elphel JP4/JP46 format (opens as JPEG, reads MakerNote and converts). */
public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
public class JP46_Reader_camera implements PlugIn,ActionListener {
/**
*
......@@ -61,6 +61,7 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
Panel panel1;
Panel confpanel;
Frame instance;
PlugInFrame plugInFrame;
String arg;
......@@ -75,44 +76,33 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
public boolean demux=true;
public String imageTitle="cameraImage";
private int ExifOffset=0x0c;
private Boolean headless=GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance();
public JP46_Reader_camera() {
super("JP46 Reader Camera");
if (IJ.versionLessThan("1.39t")) return;
if (instance!=null) {
instance.toFront();
return;
public void run(String arg) {
}
instance = this;
addKeyListener(IJ.getInstance());
panel1 = new Panel();
panel1.setLayout(new GridLayout(6, 1, 50, 5));
addButton("Open JP4/JP46...",panel1);
addButton("Open JP4/JP46 from camera",panel1);
addButton("Configure...",panel1);
addButton("Show image properties",panel1);
addButton("Decode image info to properties",panel1);
addButton("Split Bayer",panel1);
public JP46_Reader_camera(Boolean showGui) {
if (showGui) initGui();
}
public JP46_Reader_camera() {
initGui();
}
add(panel1);
public void initGui() {
//super("JP46 Reader Camera");
if (headless) return;
pack();
GUI.center(this);
setVisible(true);
}
public JP46_Reader_camera(boolean showGUI) {
super("JP46 Reader Camera");
if (IJ.versionLessThan("1.39t")) return;
if (instance!=null) {
instance.toFront();
return;
}
instance = this;
addKeyListener(IJ.getInstance());
plugInFrame=new PlugInFrame("JP46 Reader Camera");
instance = (Frame)plugInFrame;
plugInFrame.addKeyListener(IJ.getInstance());
panel1 = new Panel();
......@@ -124,10 +114,10 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
addButton("Show image properties",panel1);
addButton("Decode image info to properties",panel1);
addButton("Split Bayer",panel1);
add(panel1);
pack();
GUI.center(this);
setVisible(showGUI);
plugInFrame.add(panel1);
plugInFrame.pack();
GUI.center(plugInFrame);
plugInFrame.setVisible(true);
}
void addButton(String label, Panel panel) {
......
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