//
// Main.java
//

/*
ImageJ software for multidimensional image processing and analysis.

Copyright (c) 2010, ImageJDev.org.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the names of the ImageJDev.org developers nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

package imagej;

import imagej.ui.UIService;

/**
 * Launches ImageJ.
 * 
 * @author Curtis Rueden
 */
public final class Main {

	private Main() {
		// prevent instantiation of utility class
	}

	public static void main(String[] args) {
		manageSettings();
		final ImageJ context = ImageJ.createContext();
		context.getService(UIService.class).processArgs(args);
	}

	private static void manageSettings() {
		// TODO
		// if (settings don't exist on disk) {
		//   someone.initSettingsToDefault();  // who should own this code?
		//   maybe write to disk or let persistence mechanism auto save on exit
		//   also optionsSynchronizer.update() after IJ1 initialized
		// }
	}

}

@@ -1862,28 +1862,8 @@
 ) %7B%0A
-%09%09manageSettings();%0A
 %09%09fi
@@ -1972,315 +1972,6 @@
 %09%7D%0A%0A
-%09private static void manageSettings() %7B%0A%09%09// TODO%0A%09%09// if (settings don't exist on disk) %7B%0A%09%09//   someone.initSettingsToDefault();  // who should own this code?%0A%09%09//   maybe write to disk or let persistence mechanism auto save on exit%0A%09%09//   also optionsSynchronizer.update() after IJ1 initialized%0A%09%09// %7D%0A%09%7D%0A%0A
 %7D%0A

remove manageSettings() stub code. This was in place to set IJ1 options values from IJ2 after everything was loaded. Now the LegacyService sets IJ1 settings after ij.ImageJ is initialized