/* * Moonlight|3D * Copyright (C) 2005 The Moonlight|3D team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Created on Jan 5, 2005 */ package eu.moonlight3d.hdrviewer; import eu.moonlight3d.framework.VersionInformation; import eu.moonlight3d.framework.exceptions.ExceptionHelper; import eu.moonlight3d.framework.scripts.Interpreter; /** * This is the batch application main class for Moonlight * HDR Viewer. This class is used when Moonlight HDR Viewer * is started in batch mode. This main class will take a * script as command line argument and will try to execute * it. Unlike HDRViewer, no attempt is made to open files * given on the command line as images. * * @author gregor */ public class HDRBatch { /** * The main entry point for Moonlight|3D in batch mode * * @param args command line arguments */ public static void main(String[] args) { try { eu.moonlight3d.framework.State state=eu.moonlight3d.framework.State.getInstance(); state.setBatchMode(true); state.setVersionInformation(new VersionInformation("Moonlight HDR Viewer Batch",0,1,1)); state.setApplicationShortName("mlhdrviewer"); state.start(args); if(state.getCommandLineArguments().length>0) { String script=state.getCommandLineArguments()[0]; try { state.logger().info("running script " + script); Interpreter interpreter=state.getScriptManager().createInterpreterForFile(script); interpreter.runFile(script); } catch(Exception e) { System.err.print(ExceptionHelper.getFullText(e)); } } else { state.logger().warning("no script given on command line: exiting without any actions performed"); } state.shutdown(); } catch(Exception e) { System.err.print(ExceptionHelper.getFullText(e)); } } }