Commit da48d22b authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

fixing headless run

parent 1b78d16a
Loading
Loading
Loading
Loading
+179 −179
Original line number Original line Diff line number Diff line
@@ -573,7 +573,7 @@ public class EyesisCorrectionParameters {
			String [] sensorFiles=null;
			String [] sensorFiles=null;
// try reading all matching files
// try reading all matching files
			File dir= new File (this.sensorDirectory);
			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;
			File [] fileList=null;
			if (dir.exists()) {
			if (dir.exists()) {
				fileList=dir.listFiles(sensorFilter);
				fileList=dir.listFiles(sensorFilter);
+658 −749

File changed.

Preview size limit exceeded, changes collapsed.

+77 −87
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ import ij.process.*;
import ij.gui.*;
import ij.gui.*;
import ij.plugin.frame.*;
import ij.plugin.frame.*;
import ij.text.*;
import ij.text.*;
import ij.plugin.PlugIn;


import java.awt.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.*;
@@ -50,9 +51,8 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXException;





/* This plugin opens images in Elphel JP4/JP46 format (opens as JPEG, reads MakerNote and converts). */
/* 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 panel1;
	Panel confpanel;
	Panel confpanel;
	Frame instance;
	Frame instance;
	PlugInFrame plugInFrame;


	String arg;
	String arg;


@@ -75,44 +76,33 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
        public boolean demux=true;
        public boolean demux=true;
	public String imageTitle="cameraImage";
	public String imageTitle="cameraImage";
	private int ExifOffset=0x0c;
	private int ExifOffset=0x0c;
	private Boolean headless=GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance();


	public JP46_Reader_camera() {
	public void run(String arg) {
		super("JP46 Reader Camera");
		if (IJ.versionLessThan("1.39t")) return;
		if (instance!=null) {
			instance.toFront();
			return;
	}
	}
		instance = this;
		addKeyListener(IJ.getInstance());


		panel1 = new Panel();
	public JP46_Reader_camera(Boolean showGui) {

		if (showGui) initGui();
		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() {
		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 (IJ.versionLessThan("1.39t")) return;
		if (instance!=null) {
		if (instance!=null) {
			instance.toFront();
			instance.toFront();
			return;
			return;
		}
		}
		instance = this;

		addKeyListener(IJ.getInstance());
		plugInFrame=new PlugInFrame("JP46 Reader Camera");
		instance = (Frame)plugInFrame;

		plugInFrame.addKeyListener(IJ.getInstance());


		panel1 = new Panel();
		panel1 = new Panel();


@@ -124,10 +114,10 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
		addButton("Show image properties",panel1);
		addButton("Show image properties",panel1);
		addButton("Decode image info to properties",panel1);
		addButton("Decode image info to properties",panel1);
		addButton("Split Bayer",panel1);
		addButton("Split Bayer",panel1);
		add(panel1);
		plugInFrame.add(panel1);
		pack();
		plugInFrame.pack();
		GUI.center(this);
		GUI.center(plugInFrame);
		setVisible(showGUI);
		plugInFrame.setVisible(true);
	}
	}


	void addButton(String label, Panel panel) {
	void addButton(String label, Panel panel) {