Author: tfmorris
Date: 2010-10-27 09:14:49-0700
New Revision: 18818
Modified:
trunk/src/argouml-app/src/org/argouml/application/Main.java
Log:
Remove embedded tabs. No code changes.
Modified: trunk/src/argouml-app/src/org/argouml/application/Main.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/application/Main.java?view=diff&pathrev=18818&r1=18817&r2=18818
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/application/Main.java (original)
+++ trunk/src/argouml-app/src/org/argouml/application/Main.java 2010-10-27 09:14:49-0700
@@ -145,12 +145,12 @@
private static List<String> commands;
private static String projectName = null;
-
+
private static String theTheme;
// Andreas: this is just temporary for the uml2 pre-alpha versions.
private static boolean showUml2warning = true;
-
+
/**
* The main entry point of ArgoUML.
* @param args command line parameters
@@ -163,13 +163,13 @@
st.mark("begin");
initPreinitialize();
-
+
st.mark("arguments");
parseCommandLine(args);
// Register our last chance exception handler
AwtExceptionHandler.registerExceptionHandler();
-
+
// Get the splash screen up as early as possible
st.mark("create splash");
SplashScreen splash = null;
@@ -200,7 +200,7 @@
new ActionExit().doCommand(null);
return;
}
-
+
if (reloadRecent && projectName == null) {
projectName = getMostRecentProject();
}
@@ -257,13 +257,13 @@
ArgoFrame.getFrame().setCursor(
Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
- // Andreas: just temporary: a warning dialog for uml2...
- if( showUml2warning && Model.getFacade().getUmlVersion().startsWith("2")) {
- JOptionPane.showMessageDialog( ArgoFrame.getFrame()
- , "You are running an experimental version not meant for productive work!"
- , "UML2 pre-alpha warning"
- , JOptionPane.WARNING_MESSAGE);
- }
+ // Andreas: just temporary: a warning dialog for uml2...
+ if( showUml2warning && Model.getFacade().getUmlVersion().startsWith("2")) {
+ JOptionPane.showMessageDialog( ArgoFrame.getFrame()
+ , "You are running an experimental version not meant for productive work!"
+ , "UML2 pre-alpha warning"
+ , JOptionPane.WARNING_MESSAGE);
+ }
//ToolTipManager.sharedInstance().setInitialDelay(500);
@@ -300,8 +300,8 @@
org.argouml.util.Tools.logVersionInfo();
setSystemProperties();
}
-
-
+
+
private static void initTranslator() {
// Set the i18n locale
Translator.init(Configuration.getString(Argo.KEY_LOCALE));
@@ -329,12 +329,11 @@
System.setProperty("apple.laf.useScreenMenuBar", "true");
/* FIX: set the application name for Mac OS X */
- System.setProperty(
- "com.apple.mrj.application.apple.menu.about.name",
+ System.setProperty("com.apple.mrj.application.apple.menu.about.name",
"ArgoUML");
}
-
-
+
+
/**
* Parse command line args. The assumption is that all options precede the
* name of a project file to load. Sets static fields that can be referenced
@@ -348,7 +347,7 @@
Argo.KEY_RELOAD_RECENT_PROJECT, false);
commands = new ArrayList<String>();
theTheme = null;
-
+
for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("-")) {
String themeName = LookAndFeelMgr.getInstance()
@@ -394,12 +393,11 @@
PrintManager.getInstance().print();
// nothing else to do (?)
System.exit(0);
- } else if (args[i].equalsIgnoreCase("-nouml2warning")) { // Andreas: just temporary for the
- showUml2warning = false; // uml2 pre-alpha versions!
+ } else if (args[i].equalsIgnoreCase("-nouml2warning")) { // Andreas: just temporary for the
+ showUml2warning = false; // uml2 pre-alpha versions!
} else {
- System.err
- .println("Ignoring unknown/incomplete option '"
- + args[i] + "'");
+ System.err.println("Ignoring unknown/incomplete option '"
+ + args[i] + "'");
}
} else {
if (projectName == null) {
@@ -459,7 +457,7 @@
return pb;
}
-
+
/**
* Initialize the UML model repository.
*/
@@ -482,7 +480,7 @@
if (splash != null) {
splash.updateProgress(40);
}
-
+
st.mark("open project");
Designer.disableCritiquing();
Designer.clearCritiquing();
@@ -507,8 +505,7 @@
} else {
if (splash != null) {
splash.showStatus(
- Translator.localize(
- "statusmsg.bar.defaultproject"));
+ Translator.localize("statusmsg.bar.defaultproject"));
}
}
@@ -524,7 +521,7 @@
Designer.enableCritiquing();
}
-
+
private static String getMostRecentProject() {
// If no project was entered on the command line,
// try to reload the most recent project if that option is true
@@ -572,7 +569,7 @@
File projectFile = new File(theProjectName);
if (!projectFile.exists()) {
System.err.println("Project file '" + projectFile
- + "' does not exist.");
+ + "' does not exist.");
/* this will cause an empty project to be created */
} else {
try {
@@ -604,9 +601,9 @@
* Why are these gone? */
System.err.println("");
System.err.println("You can also set java settings which influence "
- + "the behaviour of ArgoUML:");
+ + "the behaviour of ArgoUML:");
System.err.println(" -Xms250M -Xmx500M [makes ArgoUML reserve "
- + "more memory for large projects]");
+ + "more memory for large projects]");
System.err.println("\n\n");
}
@@ -623,11 +620,11 @@
// check if we are using a supported java version
if (!JavaRuntimeUtility.isJreSupported()) {
- System.err.println("You are using Java "
+ System.err.println("You are using Java "
+ JavaRuntimeUtility.getJreVersion()
+ ", Please use Java 5 (aka 1.5) or later"
+ " with ArgoUML");
- System.exit(0);
+ System.exit(0);
}
}
@@ -642,7 +639,7 @@
System.err.println("ERROR: unable to get localhost information.");
e.printStackTrace(System.err);
System.err.println("On Unix systems this usually indicates that"
- + "your /etc/hosts file is incorrectly setup.");
+ + "your /etc/hosts file is incorrectly setup.");
System.err.println("Stopping execution of ArgoUML.");
System.exit(0);
}
@@ -673,7 +670,7 @@
// ArgoFrame.getInstance().setVisible(true);
performCommandsInternal(list);
}
-
+
/**
* Perform a list of commands that were given on the command line.
*
@@ -684,68 +681,68 @@
*/
private static void performCommandsInternal(List<String> list) {
for (String commandString : list) {
- int pos = commandString.indexOf('=');
+ int pos = commandString.indexOf('=');
+
+ String commandName;
+ String commandArgument;
+
+ if (pos == -1) {
+ commandName = commandString;
+ commandArgument = null;
+ } else {
+ commandName = commandString.substring(0, pos);
+ commandArgument = commandString.substring(pos + 1);
+ }
+
+ // Perform one command.
+ Class c;
+ try {
+ c = Class.forName(commandName);
+ } catch (ClassNotFoundException e) {
+ System.out.println("Cannot find the command: " + commandName);
+ continue;
+ }
+
+ // Now create a new object.
+ Object o = null;
+ try {
+ o = c.newInstance();
+ } catch (InstantiationException e) {
+ System.out.println(commandName
+ + " could not be instantiated - skipping"
+ + " (InstantiationException)");
+ continue;
+ } catch (IllegalAccessException e) {
+ System.out.println(commandName
+ + " could not be instantiated - skipping"
+ + " (IllegalAccessException)");
+ continue;
+ }
- String commandName;
- String commandArgument;
- if (pos == -1) {
- commandName = commandString;
- commandArgument = null;
- } else {
- commandName = commandString.substring(0, pos);
- commandArgument = commandString.substring(pos + 1);
- }
-
- // Perform one command.
- Class c;
- try {
- c = Class.forName(commandName);
- } catch (ClassNotFoundException e) {
- System.out.println("Cannot find the command: " + commandName);
- continue;
- }
-
- // Now create a new object.
- Object o = null;
- try {
- o = c.newInstance();
- } catch (InstantiationException e) {
- System.out.println(commandName
- + " could not be instantiated - skipping"
- + " (InstantiationException)");
- continue;
- } catch (IllegalAccessException e) {
- System.out.println(commandName
- + " could not be instantiated - skipping"
- + " (IllegalAccessException)");
- continue;
- }
-
-
- if (o == null || !(o instanceof CommandLineInterface)) {
- System.out.println(commandName
- + " is not a command - skipping.");
- continue;
- }
-
- CommandLineInterface clio = (CommandLineInterface) o;
-
- System.out.println("Performing command "
- + commandName + "( "
- + (commandArgument == null
- ? "" : commandArgument) + " )");
- boolean result = clio.doCommand(commandArgument);
- if (!result) {
- System.out.println("There was an error executing "
- + "the command "
- + commandName + "( "
- + (commandArgument == null
- ? "" : commandArgument) + " )");
- System.out.println("Aborting the rest of the commands.");
- return;
- }
- }
+ if (o == null || !(o instanceof CommandLineInterface)) {
+ System.out.println(commandName
+ + " is not a command - skipping.");
+ continue;
+ }
+
+ CommandLineInterface clio = (CommandLineInterface) o;
+
+ System.out.println("Performing command "
+ + commandName + "( "
+ + (commandArgument == null
+ ? "" : commandArgument) + " )");
+ boolean result = clio.doCommand(commandArgument);
+ if (!result) {
+ System.out.println("There was an error executing "
+ + "the command "
+ + commandName + "( "
+ + (commandArgument == null
+ ? "" : commandArgument) + " )");
+ System.out.println("Aborting the rest of the commands.");
+ return;
+ }
+ }
}
/**
@@ -760,7 +757,7 @@
argoDir.mkdir();
}
}
-
+
/**
* Install our security handlers,
* and do basic initialization of log4j.
@@ -774,7 +771,7 @@
* Refer to {@link java.awt.EventDispatchThread} for details.
*/
static {
-
+
/*
* Install the trap to "eat" SecurityExceptions.
*
@@ -782,8 +779,8 @@
* http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4714232
*/
System.setProperty(
- "sun.awt.exception.handler",
- ArgoAwtExceptionHandler.class.getName());
+ "sun.awt.exception.handler",
+ ArgoAwtExceptionHandler.class.getName());
/*
* The string <code>log4j.configuration</code> is the
@@ -801,39 +798,37 @@
// deployment.user.logdir & deployment.user.tmp
if (System.getProperty("log4j.configuration") == null) {
Properties props = new Properties();
- InputStream stream = null;
+ InputStream stream = null;
try {
- stream =
- Thread.currentThread().getContextClassLoader()
- .getResourceAsStream(
- DEFAULT_LOGGING_CONFIGURATION);
-
- if (stream != null) {
- props.load(stream);
- }
+ stream = Thread.currentThread().getContextClassLoader()
+ .getResourceAsStream(DEFAULT_LOGGING_CONFIGURATION);
+
+ if (stream != null) {
+ props.load(stream);
+ }
} catch (IOException io) {
io.printStackTrace();
System.exit(-1);
}
- PropertyConfigurator.configure(props);
+ PropertyConfigurator.configure(props);
- if (stream == null) {
- BasicConfigurator.configure();
- Logger.getRootLogger().getLoggerRepository().setThreshold(
+ if (stream == null) {
+ BasicConfigurator.configure();
+ Logger.getRootLogger().getLoggerRepository().setThreshold(
Level.ERROR); // default level is DEBUG
Logger.getRootLogger().error(
"Failed to find valid log4j properties"
- + "in log4j.configuration"
- + "using default logging configuration");
- }
+ + "in log4j.configuration"
+ + "using default logging configuration");
+ }
}
// initLogging();
LOG = Logger.getLogger(Main.class);
}
-
+
/**
* Create and display a splash screen.
* @return the splash screen
@@ -856,7 +851,7 @@
}
return splash;
}
-
+
/**
* Do a part of the initialization that is very much GUI-stuff.
*
@@ -865,15 +860,15 @@
private static ProjectBrowser initializeGUI(SplashScreen splash) {
// make the projectbrowser
JPanel todoPane = new ToDoPane();
- ProjectBrowser pb = ProjectBrowser.makeInstance(splash, true, todoPane);
+ ProjectBrowser pb = ProjectBrowser.makeInstance(splash, true, todoPane);
- JOptionPane.setRootFrame(pb);
+ JOptionPane.setRootFrame(pb);
pb.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// Set the screen layout to what the user left it before, or
// to reasonable defaults.
Rectangle scrSize = GraphicsEnvironment.getLocalGraphicsEnvironment()
- .getMaximumWindowBounds();
+ .getMaximumWindowBounds();
int configFrameWidth =
Configuration.getInteger(Argo.KEY_SCREEN_WIDTH, scrSize.width);
@@ -881,14 +876,14 @@
if (w == 0) {
w = 600;
}
-
+
int configFrameHeight =
Configuration.getInteger(Argo.KEY_SCREEN_HEIGHT, scrSize.height);
int h = Math.min(configFrameHeight, scrSize.height);
if (h == 0) {
h = 400;
}
-
+
int x = Configuration.getInteger(Argo.KEY_SCREEN_LEFT_X, 0);
int y = Configuration.getInteger(Argo.KEY_SCREEN_TOP_Y, 0);
pb.setLocation(x, y);
@@ -896,13 +891,13 @@
pb.setExtendedState(Configuration.getBoolean(
Argo.KEY_SCREEN_MAXIMIZED, false)
? Frame.MAXIMIZED_BOTH : Frame.NORMAL);
-
+
UIManager.put("Button.focusInputMap", new UIDefaults.LazyInputMap(
new Object[] {
- "ENTER", "pressed",
- "released ENTER", "released",
- "SPACE", "pressed",
- "released SPACE", "released"
+ "ENTER", "pressed",
+ "released ENTER", "released",
+ "SPACE", "pressed",
+ "released SPACE", "released"
})
);
return pb;
@@ -948,7 +943,7 @@
public PostLoad(List<Runnable> actions) {
postLoadActions = actions;
}
-
+
/*
* @see java.lang.Runnable#run()
*/
@@ -978,11 +973,11 @@
*/
private static final Logger LOG = Logger.getLogger(LoadModules.class);
-
+
private static final String[] OPTIONAL_INTERNAL_MODULES = {
"org.argouml.dev.DeveloperModule",
};
-
+
/**
* Load internal modules which should be found on the standard
* classpath.
@@ -1002,7 +997,7 @@
* @see java.lang.Runnable#run()
*/
public void run() {
- huntForInternalModules();
+ huntForInternalModules();
LOG.info("Module loading done");
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2676196
To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.