All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.electric.Main Maven / Gradle / Ivy

There is a newer version: 9.02-e
Show newest version
/* -*- tab-width: 4 -*-
 *
 * Electric(tm) VLSI Design System
 *
 * File: Main.java
 *
 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
 *
 * Electric(tm) is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Electric(tm) 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Electric(tm); see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, Mass 02111-1307, USA.
 */
package com.sun.electric;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.prefs.Preferences;

import com.sun.electric.database.EditingPreferences;
import com.sun.electric.database.Environment;
import com.sun.electric.database.Snapshot;
import com.sun.electric.database.hierarchy.Cell;
import com.sun.electric.database.hierarchy.EDatabase;
import com.sun.electric.database.hierarchy.Library;
import com.sun.electric.database.id.IdManager;
import com.sun.electric.database.text.Pref;
import com.sun.electric.database.text.Setting;
import com.sun.electric.database.text.Version;
import com.sun.electric.database.variable.EditWindow_;
import com.sun.electric.database.variable.TextDescriptor;
import com.sun.electric.technology.Technology;
import com.sun.electric.tool.AbstractUserInterface;
import com.sun.electric.tool.Client;
import com.sun.electric.tool.Job;
import com.sun.electric.tool.JobException;
import com.sun.electric.tool.Tool;
import com.sun.electric.tool.UserInterfaceInitial;
import com.sun.electric.tool.io.FileType;
import com.sun.electric.tool.io.input.SimulationData;
import com.sun.electric.tool.lang.EvalJavaBsh;
import com.sun.electric.tool.user.ActivityLogger;
import com.sun.electric.tool.user.Clipboard;
import com.sun.electric.tool.user.ErrorLogger;
import com.sun.electric.tool.user.MessagesStream;
import com.sun.electric.tool.user.User;
import com.sun.electric.tool.user.UserInterfaceMain;
import com.sun.electric.tool.user.menus.FileMenu;
import com.sun.electric.tool.util.concurrent.runtime.taskParallel.SimpleWorker;
import com.sun.electric.tool.util.concurrent.runtime.taskParallel.ThreadPool;
import com.sun.electric.util.ElapseTimer;
import com.sun.electric.util.TextUtils;
import com.sun.electric.util.config.Configuration;

/**
 * This class initializes Electric and starts the system. How to run Electric:
 * 

*

java -jar electric.jar [electric-options] without plugins *

java -classpath electric.jardelim{list of plugins} com.sun.electric.Launcher [electric-options] * otherwise, where delim is OS-dependant separator *

And Electric options are: *

-mdi: multiple document interface mode *

-sdi: single document interface mode *

-NOMINMEM: ignore minimum memory provided for JVM *

-s script name: bean shell script to execute *

-version: version information *

-v: brief version information *

-debug: debug mode. Extra information is available *

-server: dump strace of snapshots *

-help: this message *

* See manual for more instructions. */ public final class Main { /** * Mode of Job manager */ private static enum Mode { /** Thread-safe full screen run. */ FULL_SCREEN_SAFE, /** JonG: "I think batch mode implies 'no GUI', and nothing more." */ BATCH, /** Server side. */ SERVER, /** Client side. */ CLIENT; } private static final Mode DEFAULT_MODE = Mode.FULL_SCREEN_SAFE; private Main() {} private static Mode runMode; /** JonG: "I think batch mode implies 'no GUI', and nothing more." */ public static boolean isBatch() { return runMode == Mode.BATCH; } /** * The main entry point of Electric. * @param args the arguments to the program. */ public static void main(String[] args) { // convert args to array list List argsList = new ArrayList(); for (int i=0; i{list of plugins} com.sun.electric.Launcher [electric-options]"); System.out.println("\t\twhere is OS-dependant separator (colon or semicolon)"); System.out.println("\nOptions:"); System.out.println("\t-mdi: multiple document interface mode"); System.out.println("\t-sdi: single document interface mode"); System.out.println("\t-NOMINMEM: ignore minimum memory provided for JVM"); System.out.println("\t-s