svn commit: r13942 - branches/work_issue4925_mvw: . META-INF org/argouml/application org/argouml/application/api org/argouml/application/events org/argouml/kernel org/argouml/persistence org/argouml/profile org/argouml/profile/init org/argouml/profile/internal org/argouml/ui org/argouml/ui/cmd org/argouml/ui/explorer org/argouml/uml/diagram/ui org/argouml/uml/reveng/java org/argouml/uml/ui org/argouml/uml/ui/model_management org/argouml/util

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-12-18 02:51:05-0800
New Revision: 13942

Added:
   branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEvent.java   (contents, props changed)
   branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEventListener.java   (contents, props changed)
   branches/work_issue4925_mvw/org/argouml/persistence/ProjectFileView.java   (contents, props changed)
   branches/work_issue4925_mvw/org/argouml/profile/init/
   branches/work_issue4925_mvw/org/argouml/profile/init/InitProfileSubsystem.java   (contents, props changed)
   branches/work_issue4925_mvw/org/argouml/ui/AbstractArgoJPanel.java   (contents, props changed)
   branches/work_issue4925_mvw/org/argouml/util/ArgoFrame.java   (contents, props changed)
Removed:
   branches/work_issue4925_mvw/org/argouml/profile/internal/InitProfileSubsystem.java
   branches/work_issue4925_mvw/org/argouml/ui/ArgoFrame.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ProjectFileView.java
Modified:
   branches/work_issue4925_mvw/META-INF/MANIFEST.MF
   branches/work_issue4925_mvw/default.properties
   branches/work_issue4925_mvw/org/argouml/application/Main.java
   branches/work_issue4925_mvw/org/argouml/application/SubsystemUtility.java
   branches/work_issue4925_mvw/org/argouml/application/api/AbstractArgoJPanel.java
   branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventPump.java
   branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventTypes.java
   branches/work_issue4925_mvw/org/argouml/application/events/ArgoNotationEvent.java
   branches/work_issue4925_mvw/org/argouml/kernel/ProfileConfiguration.java
   branches/work_issue4925_mvw/org/argouml/kernel/ProjectSettings.java
   branches/work_issue4925_mvw/org/argouml/profile/StreamModelLoader.java
   branches/work_issue4925_mvw/org/argouml/ui/ActionExportXMI.java
   branches/work_issue4925_mvw/org/argouml/ui/ActionImportXMI.java
   branches/work_issue4925_mvw/org/argouml/ui/LoadSwingWorker.java
   branches/work_issue4925_mvw/org/argouml/ui/ProgressMonitorWindow.java
   branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java
   branches/work_issue4925_mvw/org/argouml/ui/ProjectSettingsTabProfile.java
   branches/work_issue4925_mvw/org/argouml/ui/SaveSwingWorker.java
   branches/work_issue4925_mvw/org/argouml/ui/SettingsTabProfile.java
   branches/work_issue4925_mvw/org/argouml/ui/StylePanelFig.java
   branches/work_issue4925_mvw/org/argouml/ui/SwingWorker.java
   branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionAboutArgoUML.java
   branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionShowXMLDump.java
   branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionSystemInfo.java
   branches/work_issue4925_mvw/org/argouml/ui/explorer/ActionExportProfileXMI.java
   branches/work_issue4925_mvw/org/argouml/ui/explorer/ExplorerEventAdaptor.java
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/SettingsTabDiagramAppearance.java
   branches/work_issue4925_mvw/org/argouml/uml/reveng/java/java.g
   branches/work_issue4925_mvw/org/argouml/uml/ui/AbstractActionAddModelElement2.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ActionDeleteModelElements.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ActionImportFromSources.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ActionOpenProject.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ActionRevertToSaved.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveAllGraphics.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveGraphics.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSetSourcePath.java
   branches/work_issue4925_mvw/org/argouml/uml/ui/model_management/PropPanelPackage.java

Log:
Update the branch to latest revision.

Modified: branches/work_issue4925_mvw/META-INF/MANIFEST.MF
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/META-INF/MANIFEST.MF?view=diff&rev=13942&p1=branches/work_issue4925_mvw/META-INF/MANIFEST.MF&p2=branches/work_issue4925_mvw/META-INF/MANIFEST.MF&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/META-INF/MANIFEST.MF	(original)
+++ branches/work_issue4925_mvw/META-INF/MANIFEST.MF	2007-12-18 02:51:05-0800
@@ -36,7 +36,7 @@
  org.argouml.pattern.cognitive.critics,
  org.argouml.persistence,
  org.argouml.profile,
- org.argouml.profile.internal,
+ org.argouml.profile.init,
  org.argouml.swingext,
  org.argouml.taskmgmt,
  org.argouml.ui,

Modified: branches/work_issue4925_mvw/default.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/default.properties?view=diff&rev=13942&p1=branches/work_issue4925_mvw/default.properties&p2=branches/work_issue4925_mvw/default.properties&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/default.properties	(original)
+++ branches/work_issue4925_mvw/default.properties	2007-12-18 02:51:05-0800
@@ -11,7 +11,7 @@
 #
 # Argo version
 #
-argo.core.version=PRE-0.25.4
+argo.core.version=PRE-0.25.5
 #
 # Compilation properties
 #

Modified: branches/work_issue4925_mvw/org/argouml/application/Main.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/Main.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/application/Main.java&p2=branches/work_issue4925_mvw/org/argouml/application/Main.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/application/Main.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/application/Main.java	2007-12-18 02:51:05-0800
@@ -36,7 +36,6 @@
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 
@@ -69,8 +68,7 @@
 import org.argouml.notation.providers.uml.InitNotationUml;
 import org.argouml.notation.ui.InitNotationUI;
 import org.argouml.persistence.PersistenceManager;
-import org.argouml.profile.internal.InitProfileSubsystem;
-import org.argouml.ui.ArgoFrame;
+import org.argouml.profile.init.InitProfileSubsystem;
 import org.argouml.ui.LookAndFeelMgr;
 import org.argouml.ui.ProjectBrowser;
 import org.argouml.ui.SplashScreen;
@@ -79,6 +77,7 @@
 import org.argouml.ui.cmd.PrintManager;
 import org.argouml.uml.diagram.ui.InitDiagramAppearanceUI;
 import org.argouml.uml.reveng.java.JavaImport;
+import org.argouml.util.ArgoFrame;
 import org.argouml.util.logging.SimpleTimer;
 import org.tigris.gef.util.Util;
 
@@ -114,6 +113,21 @@
 
     private static List<Runnable> postLoadActions = new ArrayList<Runnable>();
 
+    private static boolean doSplash = true;
+
+    private static boolean reloadRecent = false;
+
+    private static boolean batch = false;
+
+    private static List<String> commands;
+
+    private static String projectName = null;
+    
+    private static String theTheme;
+    
+    private static boolean preInitialized = false;
+    private static boolean initialized = false;
+    
     /**
      * The main entry point of ArgoUML.
      * @param args command line parameters
@@ -125,267 +139,63 @@
             SimpleTimer st = new SimpleTimer();
             st.mark("begin");
 
-            checkJVMVersion();
-            checkHostsFile();
-
-            // Force the configuration to load
-            Configuration.load();
-
-            // Synchronize the startup directory
-            String directory = Argo.getDirectory();
-            org.tigris.gef.base.Globals.setLastDirectory(directory);
-
-            // Initialise the version of this application
-            initVersion();
-
-            // Set the i18n locale
-            Translator.init(Configuration.getString(Argo.KEY_LOCALE));
-
-            // create an anonymous class as a kind of adaptor for the cognitive
-            // System to provide proper translation/i18n.
-            org.argouml.cognitive.Translator.setTranslator(
-                    new AbstractCognitiveTranslator() {
-                        public String i18nlocalize(String key) {
-                            return Translator.localize(key);
-                        }
-
-                        public String i18nmessageFormat(String key,
-                                Object[] iArgs) {
-                            return Translator.messageFormat(key, iArgs);
-                        }
-                    });
-
-            // then, print out some version info for debuggers...
-            org.argouml.util.Tools.logVersionInfo();
-
+            initPreinitialize();
+            
             st.mark("arguments");
-
-            /* set properties for application behaviour */
-            System.setProperty("gef.imageLocation", "/org/argouml/Images");
-
-            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",
-                    "ArgoUML");
-
-            boolean doSplash = Configuration.getBoolean(Argo.KEY_SPLASH, true);
-            boolean reloadRecent = Configuration.getBoolean(
-                    Argo.KEY_RELOAD_RECENT_PROJECT, false);
-            boolean batch = false;
-            List<String> commands = new ArrayList<String>();
-
-            String projectName = null;
-
-            // TODO: Move command line parsing to separate method
-        
-            // Parse command line args:
-            // The assumption is that all options precede
-            // the name of a project file to load.
-            String theTheme = null;
-            for (int i = 0; i < args.length; i++) {
-                if (args[i].startsWith("-")) {
-                    String themeName = LookAndFeelMgr.getInstance()
-                            .getThemeClassNameFromArg(args[i]);
-                    if (themeName != null) {
-                        theTheme = themeName;
-                    } else if (
-                            args[i].equalsIgnoreCase("-help")
-                            || args[i].equalsIgnoreCase("-h")
-                            || args[i].equalsIgnoreCase("--help")
-                            || args[i].equalsIgnoreCase("/?")) {
-                        printUsage();
-                        System.exit(0);
-                    } else if (args[i].equalsIgnoreCase("-nosplash")) {
-                        doSplash = false;
-                    } else if (args[i].equalsIgnoreCase("-norecentfile")) {
-                        reloadRecent = false;
-                    } else if (args[i].equalsIgnoreCase("-command")
-                            && i + 1 < args.length) {
-                        commands.add(args[i + 1]);
-                        i++;
-                    } else if (args[i].equalsIgnoreCase("-locale")
-                            && i + 1 < args.length) {
-                        Translator.setLocale(args[i + 1]);
-                        i++;
-                    } else if (args[i].equalsIgnoreCase("-batch")) {
-                        batch = true;
-                    } else if (args[i].equalsIgnoreCase("-open") 
-                            && i + 1 < args.length) {
-                        projectName = args[++i];
-                    } else if (args[i].equalsIgnoreCase("-print") 
-                            && i + 1 < args.length) {
-                        // let's load the project
-                        String projectToBePrinted = 
-                            PersistenceManager.getInstance().fixExtension(
-                                    args[++i]);
-                        URL urlToBePrinted = projectUrl(projectToBePrinted,
-                                null);
-                        ProjectBrowser.getInstance().loadProject(
-                                new File(urlToBePrinted.getFile()), true, null);
-                        // now, let's print it
-                        PrintManager.getInstance().print();
-                        // nothing else to do (?)
-                        System.exit(0);
-                    } else {
-                        System.err
-                                .println("Ignoring unknown/incomplete option '"
-                                        + args[i] + "'");
-                    }
-                } else {
-                    if (projectName == null) {
-                        System.out.println(
-                                "Setting projectName to '" + args[i] + "'");
-                        projectName = args[i];
-                    }
-                }
-            }
-
-            // We have to do this to set the LAF for the splash screen
-            st.mark("initialize laf");
-            LookAndFeelMgr.getInstance().initializeLookAndFeel();
-            if (theTheme != null) {
-                LookAndFeelMgr.getInstance().setCurrentTheme(theTheme);
-            }
+            parseCommandLine(args);
 
             // Get the splash screen up as early as possible
             st.mark("create splash");
             SplashScreen splash = null;
-            if (doSplash && !batch) {
-                splash = initializeSplash();
-            }
-
-            // Initialize the Model subsystem
-            st.mark("initialize model subsystem");
-
-            initModel();
-
-            updateProgress(splash, 5, "statusmsg.bar.model-subsystem");
-            
-            // Initialize the Profile subsystem
-            st.mark("initialize the profile subsystem");
-            new InitProfileSubsystem().init();
-
-            /*
-             * Initialize the module loader. At least the plug-ins that provide
-             * profiles need to be initialized before the project is loaded,
-             * because some of these profile may have been set as default
-             * profiles and need to be applied to the project as soon as it has
-             * been created or loaded. the first instance of a Project is needed
-             * during the gui initialization
-             */
-            st.mark("modules");
-
-            SubsystemUtility.initSubsystem(new InitModuleLoader());
-
-            // Initialize the Java code generator. (why so early? - tfm)
-            GeneratorJava.getInstance();
-
-            // The reason the gui is initialized before the commands are run
-            // is that some of the commands will use the projectbrowser.
-            st.mark("initialize gui");
-            ProjectBrowser pb = initializeGUI(splash);
-
-            SubsystemUtility.initSubsystem(new InitUiCmdSubsystem());
-            SubsystemUtility.initSubsystem(new InitNotationUI());
-            SubsystemUtility.initSubsystem(new InitNotation());
-            SubsystemUtility.initSubsystem(new InitNotationUml());
-            SubsystemUtility.initSubsystem(new InitNotationJava());
-            SubsystemUtility.initSubsystem(new InitDiagramAppearanceUI());
             SubsystemUtility.initSubsystem(new InitCheckListUI());
-
-            if (reloadRecent && projectName == null) {
-                // If no project was entered on the command line,
-                // try to reload the most recent project if that option is true
-                String s = Configuration.getString(
-                        Argo.KEY_MOST_RECENT_PROJECT_FILE, "");
-                if (!("".equals(s))) {
-                    File file = new File(s);
-                    if (file.exists()) {
-                        LOG.info("Re-opening project " + s);
-                        projectName = s;
-                    } else {
-                        LOG.warn("Cannot re-open " + s
-                                + " because it does not exist");
-                    }
+            if (!batch) {
+                // We have to do this to set the LAF for the splash screen
+                st.mark("initialize laf");
+                LookAndFeelMgr.getInstance().initializeLookAndFeel();
+                if (theTheme != null) {
+                    LookAndFeelMgr.getInstance().setCurrentTheme(theTheme);
+                }
+                if (doSplash) {
+                    splash = initializeSplash();
                 }
             }
 
-            URL urlToOpen = null;
-
-            if (projectName != null) {
-                projectName =
-                    PersistenceManager.getInstance().fixExtension(projectName);
-                urlToOpen = projectUrl(projectName, urlToOpen);
-            }
+            // main initialization happens here
+            ProjectBrowser pb = initializeSubsystems(st, splash);
 
+            // Needs to happen after initialization is done & modules loaded
             st.mark("perform commands");
             if (batch) {
-                performCommands(commands);
+                // TODO: Add an "open most recent project" command so that 
+                // command state can be decoupled from user settings?
+                performCommandsInternal(commands);
                 commands = null;
 
                 System.out.println("Exiting because we are running in batch.");
                 new ActionExit().doCommand(null);
                 return;
             }
-
-            if (splash != null) {
-                if (urlToOpen == null) {
-                    splash.getStatusBar().showStatus(
-                            Translator.localize(
-                                    "statusmsg.bar.defaultproject"));
-                } else {
-                    Object[] msgArgs = {projectName};
-                    splash.getStatusBar().showStatus(
-                            Translator.messageFormat(
-                                    "statusmsg.bar.readingproject",
-                                    msgArgs));
-                }
-
-                splash.getStatusBar().showProgress(40);
-            }
-
-            st.mark("make empty project");
-
-            Designer.disableCritiquing();
-            Designer.clearCritiquing();
-
-            boolean projectLoaded = false;
-            if (urlToOpen != null) {
-                String filename = urlToOpen.getFile();
-                File file = new File(filename);
-                System.err.println("The url of the file to open is " 
-                        + urlToOpen);
-                System.err.println("The filename is " + filename);
-                System.err.println("The file is " + file);
-                System.err.println("File.exists = " + file.exists());
-                projectLoaded = pb.loadProject(file, true, null);
+            
+            if (reloadRecent && projectName == null) {
+                projectName = getMostRecentProject();
             }
 
-            if (!projectLoaded) {
-                // Although this looks redundant, it's needed to get all
-                // the initialization state set correctly.  
-                // Too many side effects as part of initialization!
-                ProjectManager.getManager().setCurrentProject(
-                        ProjectManager.getManager().getCurrentProject());
-                ProjectManager.getManager().setSaveEnabled(false);
+            URL urlToOpen = null;
+            if (projectName != null) {
+                projectName =
+                    PersistenceManager.getInstance().fixExtension(projectName);
+                urlToOpen = projectUrl(projectName, urlToOpen);
             }
 
-            st.mark("set project");
-
-            Designer.enableCritiquing();
+            openProject(st, splash, pb, urlToOpen);
 
             st.mark("perspectives");
-
             if (splash != null) {
                 splash.getStatusBar().showProgress(75);
             }
 
             st.mark("open window");
-
             updateProgress(splash, 95, "statusmsg.bar.open-project-browser");
-
             ArgoFrame.getInstance().setVisible(true);
 
             st.mark("close splash");
@@ -436,9 +246,186 @@
             }
         }
     }
+
+
+    private static void initPreinitialize() {
+        if (!preInitialized) {
+            preInitialized = true;
+            checkJVMVersion();
+            checkHostsFile();
+
+            // Force the configuration to load
+            Configuration.load();
+
+            // Synchronize the startup directory
+            String directory = Argo.getDirectory();
+            org.tigris.gef.base.Globals.setLastDirectory(directory);
+
+            initVersion();
+            initTranslator();
+
+            // then, print out some version info for debuggers...
+            org.argouml.util.Tools.logVersionInfo();
+            setSystemProperties();
+        }
+    }
+
+    
+   
+    private static void initTranslator() {
+        // Set the i18n locale
+        Translator.init(Configuration.getString(Argo.KEY_LOCALE));
+
+        // create an anonymous class as a kind of adaptor for the cognitive
+        // System to provide proper translation/i18n.
+        org.argouml.cognitive.Translator.setTranslator(
+                new AbstractCognitiveTranslator() {
+                    public String i18nlocalize(String key) {
+                        return Translator.localize(key);
+                    }
+
+                    public String i18nmessageFormat(String key,
+                            Object[] iArgs) {
+                        return Translator.messageFormat(key, iArgs);
+                    }
+                });
+    }
+
+
+    private static void setSystemProperties() {
+        /* set properties for application behaviour */
+        System.setProperty("gef.imageLocation", "/org/argouml/Images");
+
+        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",
+                "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
+     * later.
+     * 
+     * @param args command line args
+     */
+    private static void parseCommandLine(String[] args) {
+        doSplash = Configuration.getBoolean(Argo.KEY_SPLASH, true);
+        reloadRecent = Configuration.getBoolean(
+                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()
+                        .getThemeClassNameFromArg(args[i]);
+                if (themeName != null) {
+                    theTheme = themeName;
+                } else if (
+                        args[i].equalsIgnoreCase("-help")
+                        || args[i].equalsIgnoreCase("-h")
+                        || args[i].equalsIgnoreCase("--help")
+                        || args[i].equalsIgnoreCase("/?")) {
+                    printUsage();
+                    System.exit(0);
+                } else if (args[i].equalsIgnoreCase("-nosplash")) {
+                    doSplash = false;
+                } else if (args[i].equalsIgnoreCase("-norecentfile")) {
+                    reloadRecent = false;
+                } else if (args[i].equalsIgnoreCase("-command")
+                        && i + 1 < args.length) {
+                    commands.add(args[i + 1]);
+                    i++;
+                } else if (args[i].equalsIgnoreCase("-locale")
+                        && i + 1 < args.length) {
+                    Translator.setLocale(args[i + 1]);
+                    i++;
+                } else if (args[i].equalsIgnoreCase("-batch")) {
+                    batch = true;
+                } else if (args[i].equalsIgnoreCase("-open") 
+                        && i + 1 < args.length) {
+                    projectName = args[++i];
+                } else if (args[i].equalsIgnoreCase("-print") 
+                        && i + 1 < args.length) {
+                    // TODO: Huge side effect.  Hoist out of parse - tfm
+                    // let's load the project
+                    String projectToBePrinted = 
+                        PersistenceManager.getInstance().fixExtension(
+                                args[++i]);
+                    URL urlToBePrinted = projectUrl(projectToBePrinted,
+                            null);
+                    ProjectBrowser.getInstance().loadProject(
+                            new File(urlToBePrinted.getFile()), true, null);
+                    // now, let's print it
+                    PrintManager.getInstance().print();
+                    // nothing else to do (?)
+                    System.exit(0);
+                } else {
+                    System.err
+                            .println("Ignoring unknown/incomplete option '"
+                                    + args[i] + "'");
+                }
+            } else {
+                if (projectName == null) {
+                    System.out.println(
+                            "Setting projectName to '" + args[i] + "'");
+                    projectName = args[i];
+                }
+            }
+        }
+    }
+
+
+    private static ProjectBrowser initializeSubsystems(SimpleTimer st,
+            SplashScreen splash) {
+        ProjectBrowser pb = null;
+
+        if (!initialized) {
+            initialized = true;
+
+            st.mark("initialize model subsystem");
+            initModel();
+            updateProgress(splash, 5, "statusmsg.bar.model-subsystem");
+
+            st.mark("initialize the profile subsystem");
+            new InitProfileSubsystem().init();
+
+            /*
+             * Initialize the module loader. At least the plug-ins that provide
+             * profiles need to be initialized before the project is loaded,
+             * because some of these profile may have been set as default
+             * profiles and need to be applied to the project as soon as it has
+             * been created or loaded. the first instance of a Project is needed
+             * during the gui initialization
+             */
+            st.mark("modules");
+            SubsystemUtility.initSubsystem(new InitModuleLoader());
+
+            // Initialize the Java code generator. (why so early? - tfm)
+            GeneratorJava.getInstance();
+
+            // The reason the gui is initialized before the commands are run
+            // is that some of the commands will use the projectbrowser.
+            st.mark("initialize gui");
+            pb = initializeGUI(splash);
+
+            SubsystemUtility.initSubsystem(new InitUiCmdSubsystem());
+            SubsystemUtility.initSubsystem(new InitNotationUI());
+            SubsystemUtility.initSubsystem(new InitNotation());
+            SubsystemUtility.initSubsystem(new InitNotationUml());
+            SubsystemUtility.initSubsystem(new InitNotationJava());
+            SubsystemUtility.initSubsystem(new InitDiagramAppearanceUI());
+        }
+        return pb;
+    }
+
     
     /**
-     * Initialise the UMl model repository.
+     * Initialize the UML model repository.
      */
     private static void initModel() {
         String className = System.getProperty(
@@ -453,12 +440,81 @@
         }
     }
 
+
+    private static void openProject(SimpleTimer st, SplashScreen splash,
+            ProjectBrowser pb, URL urlToOpen) {
+        if (splash != null) {
+            splash.getStatusBar().showProgress(40);
+        }
+        
+        st.mark("open project");
+        Designer.disableCritiquing();
+        Designer.clearCritiquing();
+
+        boolean projectLoaded = false;
+        if (urlToOpen != null) {
+            if (splash != null) {
+                Object[] msgArgs = {projectName};
+                splash.getStatusBar().showStatus(
+                        Translator.messageFormat(
+                                "statusmsg.bar.readingproject",
+                                msgArgs));
+            }
+            String filename = urlToOpen.getFile();
+            File file = new File(filename);
+            System.err.println("The url of the file to open is " 
+                    + urlToOpen);
+            System.err.println("The filename is " + filename);
+            System.err.println("The file is " + file);
+            System.err.println("File.exists = " + file.exists());
+            projectLoaded = pb.loadProject(file, true, null);
+        } else {
+            if (splash != null) {
+                splash.getStatusBar().showStatus(
+                        Translator.localize(
+                                "statusmsg.bar.defaultproject"));
+            }
+        }
+
+        if (!projectLoaded) {
+            // Although this looks redundant, it's needed to get all
+            // the initialization state set correctly.  
+            // Too many side effects as part of initialization!
+            ProjectManager.getManager().setCurrentProject(
+                    ProjectManager.getManager().getCurrentProject());
+            ProjectManager.getManager().setSaveEnabled(false);
+        }
+
+        st.mark("set project");
+        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
+        String s = Configuration.getString(
+                Argo.KEY_MOST_RECENT_PROJECT_FILE, "");
+        if (!("".equals(s))) {
+            File file = new File(s);
+            if (file.exists()) {
+                LOG.info("Re-opening project " + s);
+                return s;
+            } else {
+                LOG.warn("Cannot re-open " + s
+                        + " because it does not exist");
+            }
+        }
+        return null;
+    }
+
+
     /**
      * Helper to update progress if we have a splash screen displayed.
      *
      * @param splash <code>true</code> if the splash is to be shown
      * @param percent the new percentage for progress bar
-     * @param message the messae to be shown in the splash
+     * @param message the message to be shown in the splash
      */
     private static void updateProgress(SplashScreen splash, int percent,
             String message) {
@@ -576,31 +632,42 @@
      *
      * @param list The commands, a list of strings.
      */
-    public static void performCommands(List list) {
-	Iterator iter = list.iterator();
-
-	while (iter.hasNext()) {
-	    String commandstring = (String) iter.next();
-
-	    int pos = commandstring.indexOf('=');
+    public static void performCommands(List<String> list) {
+        initPreinitialize();
+        initializeSubsystems(new SimpleTimer(), null);
+        ArgoFrame.getInstance().setVisible(true);
+        performCommandsInternal(list);
+    }
+    
+    /**
+     * Perform a list of commands that were given on the command line.
+     *
+     * This first implementation just has a list of commands that
+     * is possible to give.
+     *
+     * @param list The commands, a list of strings.
+     */
+    private static void performCommandsInternal(List<String> list) {
+        for (String commandString : list) {
+	    int pos = commandString.indexOf('=');
 
-	    String commandname;
-	    String commandargument;
+	    String commandName;
+	    String commandArgument;
 
 	    if (pos == -1) {
-		commandname = commandstring;
-		commandargument = null;
+		commandName = commandString;
+		commandArgument = null;
 	    } else {
-		commandname = commandstring.substring(0, pos);
-		commandargument = commandstring.substring(pos + 1);
+		commandName = commandString.substring(0, pos);
+		commandArgument = commandString.substring(pos + 1);
 	    }
 
 	    // Perform one command.
 	    Class c;
 	    try {
-		c = Class.forName(commandname);
+		c = Class.forName(commandName);
 	    } catch (ClassNotFoundException e) {
-		System.out.println("Cannot find the command: " + commandname);
+		System.out.println("Cannot find the command: " + commandName);
 		continue;
 	    }
 
@@ -609,12 +676,12 @@
 	    try {
 		o = c.newInstance();
 	    } catch (InstantiationException e) {
-		System.out.println(commandname
+		System.out.println(commandName
 				   + " could not be instantiated - skipping"
 				   + " (InstantiationException)");
 		continue;
 	    } catch (IllegalAccessException e) {
-		System.out.println(commandname
+		System.out.println(commandName
 				   + " could not be instantiated - skipping"
 				   + " (IllegalAccessException)");
 		continue;
@@ -622,7 +689,7 @@
 
 
 	    if (o == null || !(o instanceof CommandLineInterface)) {
-		System.out.println(commandname
+		System.out.println(commandName
 				   + " is not a command - skipping.");
 		continue;
 	    }
@@ -630,16 +697,16 @@
 	    CommandLineInterface clio = (CommandLineInterface) o;
 
 	    System.out.println("Performing command "
-			       + commandname + "( "
-			       + (commandargument == null
-				  ? "" : commandargument) + " )");
-	    boolean result = clio.doCommand(commandargument);
+			       + 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) + " )");
+				   + commandName + "( "
+				   + (commandArgument == null
+				      ? "" : commandArgument) + " )");
 		System.out.println("Aborting the rest of the commands.");
 		return;
 	    }

Modified: branches/work_issue4925_mvw/org/argouml/application/SubsystemUtility.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/SubsystemUtility.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/application/SubsystemUtility.java&p2=branches/work_issue4925_mvw/org/argouml/application/SubsystemUtility.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/application/SubsystemUtility.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/application/SubsystemUtility.java	2007-12-18 02:51:05-0800
@@ -1,4 +1,4 @@
-// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $

+// $Id$

 // Copyright (c) 2007 The Regents of the University of California. All

 // Rights Reserved. Permission to use, copy, modify, and distribute this

 // software and its documentation without fee, and without a written


Modified: branches/work_issue4925_mvw/org/argouml/application/api/AbstractArgoJPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/api/AbstractArgoJPanel.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/application/api/AbstractArgoJPanel.java&p2=branches/work_issue4925_mvw/org/argouml/application/api/AbstractArgoJPanel.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/application/api/AbstractArgoJPanel.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/application/api/AbstractArgoJPanel.java	2007-12-18 02:51:05-0800
@@ -35,7 +35,7 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
-import org.argouml.ui.ArgoFrame;
+import org.argouml.util.ArgoFrame;
 import org.tigris.swidgets.Orientable;
 import org.tigris.swidgets.Orientation;
 

Modified: branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventPump.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventPump.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventPump.java&p2=branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventPump.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventPump.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventPump.java	2007-12-18 02:51:05-0800
@@ -254,6 +254,31 @@
             break;
         }
     }
+
+    /**
+     * Handle firing a profile event.
+     *
+     * @param event The event to be fired.
+     * @param listener The listener.
+     */
+    private void handleFireProfileEvent(
+        ArgoProfileEvent event,
+        ArgoProfileEventListener listener) {
+        switch (event.getEventType()) {
+        case ArgoEventTypes.PROFILE_ADDED:
+            listener.profileAdded(event);
+            break;
+
+        case ArgoEventTypes.PROFILE_REMOVED:
+            listener.profileRemoved(event);
+            break;
+
+        default:
+            LOG.error("Invalid event:" + event.getEventType());
+            break;
+        }
+    }
+
     /**
      * Handle firing a generator event.
      *
@@ -333,6 +358,13 @@
                             (ArgoStatusEventListener) listener);
                 }
             }
+            if (event.getEventType() >= ArgoEventTypes.ANY_PROFILE_EVENT
+                    && event.getEventType() < ArgoEventTypes.LAST_PROFILE_EVENT) {
+                if (listener instanceof ArgoProfileEventListener) {
+                    handleFireProfileEvent((ArgoProfileEvent) event,
+                            (ArgoProfileEventListener) listener);
+                }
+            }
         }
     }
 

Modified: branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventTypes.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventTypes.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventTypes.java&p2=branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventTypes.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventTypes.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/application/events/ArgoEventTypes.java	2007-12-18 02:51:05-0800
@@ -202,6 +202,26 @@
     int LAST_DIAGRAM_APPEARANCE_EVENT = 1699;
 
     /**
+     * Indicating any profile event.
+     */
+    int ANY_PROFILE_EVENT = 1700;
+
+    /**
+     * Indicating that a profile has been added.
+     */
+    int PROFILE_ADDED = 1701;
+
+    /**
+     * Indicating that a profile has been removed.
+     */
+    int PROFILE_REMOVED = 1702;
+
+    /**
+     * Last profile event.
+     */
+    int LAST_PROFILE_EVENT = 1799;
+
+    /**
      * Id marker for the last Argo event.
      */
     int ARGO_EVENT_END            = 99999;

Modified: branches/work_issue4925_mvw/org/argouml/application/events/ArgoNotationEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/events/ArgoNotationEvent.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/application/events/ArgoNotationEvent.java&p2=branches/work_issue4925_mvw/org/argouml/application/events/ArgoNotationEvent.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/application/events/ArgoNotationEvent.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/application/events/ArgoNotationEvent.java	2007-12-18 02:51:05-0800
@@ -26,8 +26,7 @@
 
 /**
  * ArgoNotationEvent is used to notify interested parties
- * that the module which is the event source
- * has been posted, selected, or canceled.
+ * that the notation has been changed.
  */
 public class ArgoNotationEvent extends ArgoEvent {
 

Added: branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEvent.java?view=auto&rev=13942
==============================================================================
--- (empty file)
+++ branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEvent.java	2007-12-18 02:51:05-0800
@@ -0,0 +1,49 @@
+// $Id$
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.application.events;
+
+/**
+ * ArgoProfileEvent is used to notify interested parties
+ * that the profile is changed.
+ *
+ * @author Michiel
+ */
+public class ArgoProfileEvent extends ArgoEvent {
+
+    /**
+     * @param eT reported by this event
+     * @param src object that caused the event
+     */
+    public ArgoProfileEvent(int eT, Object src) {
+        super(eT, src);
+    }
+
+    /**
+     * Indicates the start of the 100-digit range for profile events.
+     *
+     * @return the first id reserved for events.
+     */
+    public int getEventStartRange() { return ANY_PROFILE_EVENT; }
+}

Added: branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEventListener.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEventListener.java?view=auto&rev=13942
==============================================================================
--- (empty file)
+++ branches/work_issue4925_mvw/org/argouml/application/events/ArgoProfileEventListener.java	2007-12-18 02:51:05-0800
@@ -0,0 +1,47 @@
+// $Id$
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.application.events;
+
+import org.argouml.application.api.ArgoEventListener;
+
+/**
+ * An interface that all objects interested in ProfileEvent 
+ * notifications shall implement.
+ *
+ * @author Michiel
+ */
+public interface ArgoProfileEventListener extends ArgoEventListener {
+    /**
+     * Invoked when a profile has been added.
+     * @param e <code>ArgoProfileEvent</code> describing the added notation.
+     */
+    public void profileAdded(ArgoProfileEvent e);
+
+    /**
+     * Invoked when a profile has been removed.
+     * @param e <code>ArgoProfileEvent</code> describing the removed notation.
+     */
+    public void profileRemoved(ArgoProfileEvent e);
+}

Modified: branches/work_issue4925_mvw/org/argouml/kernel/ProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/kernel/ProfileConfiguration.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/kernel/ProfileConfiguration.java&p2=branches/work_issue4925_mvw/org/argouml/kernel/ProfileConfiguration.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/kernel/ProfileConfiguration.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/kernel/ProfileConfiguration.java	2007-12-18 02:51:05-0800
@@ -25,14 +25,20 @@
 package org.argouml.kernel;

 

 import java.awt.Image;

+import java.beans.PropertyChangeEvent;

+import java.util.ArrayList;

 import java.util.Collection;

 import java.util.HashSet;

 import java.util.Iterator;

 import java.util.List;

 import java.util.Set;

-import java.util.ArrayList;

 

 import org.apache.log4j.Logger;

+import org.argouml.application.events.ArgoEventPump;

+import org.argouml.application.events.ArgoEventTypes;

+import org.argouml.application.events.ArgoProfileEvent;

+import org.argouml.configuration.Configuration;

+import org.argouml.configuration.ConfigurationKey;

 import org.argouml.model.Model;

 import org.argouml.profile.DefaultTypeStrategy;

 import org.argouml.profile.FigNodeStrategy;

@@ -40,7 +46,6 @@
 import org.argouml.profile.Profile;

 import org.argouml.profile.ProfileException;

 import org.argouml.profile.ProfileFacade;

-import org.argouml.ui.explorer.ExplorerEventAdaptor;

 

 /**

  *   This class captures represents the unique access point for the 

@@ -69,6 +74,13 @@
      * The extension used in serialization and returned by {@link #getType()}

      */

     public static final String EXTENSION = "profile";

+    

+

+    /**

+     * The configuration key for the default stereotype view.

+     */

+    public static final ConfigurationKey KEY_DEFAULT_STEREOTYPE_VIEW = 

+        Configuration.makeKey("profiles", "stereotypeView");

         

     /**

      * The default constructor for this class. Sets the Java profile as the 

@@ -165,8 +177,9 @@
             }

 

             updateStrategies();

-            // FIXME: remove this dependency

-            ExplorerEventAdaptor.getInstance().structureChanged();

+            ArgoEventPump.fireEvent(new ArgoProfileEvent(

+                    ArgoEventTypes.PROFILE_ADDED, new PropertyChangeEvent(this,

+                            "profile", null, p)));

         }

     }

         

@@ -210,9 +223,10 @@
             removeProfile(profile);

         }

 

-        updateStrategies();        

-        // FIXME: remove this dependency

-        ExplorerEventAdaptor.getInstance().structureChanged();

+        updateStrategies();

+        ArgoEventPump.fireEvent(new ArgoProfileEvent(

+                ArgoEventTypes.PROFILE_REMOVED, new PropertyChangeEvent(this,

+                        "profile", p, null)));

     }

     

     private FigNodeStrategy compositeFigNodeStrategy = new FigNodeStrategy() {


Modified: branches/work_issue4925_mvw/org/argouml/kernel/ProjectSettings.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/kernel/ProjectSettings.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/kernel/ProjectSettings.java&p2=branches/work_issue4925_mvw/org/argouml/kernel/ProjectSettings.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/kernel/ProjectSettings.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/kernel/ProjectSettings.java	2007-12-18 02:51:05-0800
@@ -38,7 +38,6 @@
 import org.argouml.notation.NotationName;
 import org.argouml.notation.NotationProviderFactory2;
 import org.argouml.uml.diagram.ui.DiagramAppearance;
-import org.argouml.ui.SettingsTabProfile;
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
 import org.tigris.gef.undo.Memento;
 import org.tigris.gef.undo.UndoManager;
@@ -130,7 +129,7 @@
         defaultShadowWidth = Configuration.getInteger(
                 Notation.KEY_DEFAULT_SHADOW_WIDTH, 1);
         defaultStereotypeView = Configuration.getInteger(
-                SettingsTabProfile.KEY_DEFAULT_STEREOTYPE_VIEW,
+                ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
                 FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);
 
         /*
@@ -795,7 +794,7 @@
 
         Memento memento = new Memento() {
             private final ConfigurationKey key = 
-                SettingsTabProfile.KEY_DEFAULT_STEREOTYPE_VIEW;
+                ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW;
 
             public void redo() {
                 defaultStereotypeView = newView;

Added: branches/work_issue4925_mvw/org/argouml/persistence/ProjectFileView.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/persistence/ProjectFileView.java?view=auto&rev=13942
==============================================================================
--- (empty file)
+++ branches/work_issue4925_mvw/org/argouml/persistence/ProjectFileView.java	2007-12-18 02:51:05-0800
@@ -0,0 +1,76 @@
+// $Id$
+// Copyright (c) 2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.persistence;
+
+import java.io.File;
+
+import javax.swing.Icon;
+import javax.swing.filechooser.FileView;
+
+import org.argouml.application.helpers.ResourceLoaderWrapper;
+
+/**
+ * Provides an icon for project files. 
+ * 
+ * @since Jun 2, 2006
+ * @author [email protected] @stereotype singleton
+ */
+public final class ProjectFileView extends FileView {
+
+    private static ProjectFileView instance = new ProjectFileView();
+    
+    /**
+     * Constructor for ProjectFileView.
+     */
+    private ProjectFileView() {
+        
+    }
+
+    /**
+     * Returns the singleton instance.
+     * 
+     * @return ProjectFileView
+     */
+    public static ProjectFileView getInstance() {
+        return instance;
+    }
+    
+    /**
+     * Load an icon for a supported project file.
+     *  
+     * @param   f the file to check 
+     * @return  a nice icon if the file is known as a project file, 
+     * 			otherwise a default one
+     */
+    public Icon getIcon(File f) {
+    	AbstractFilePersister persister = PersistenceManager.getInstance()
+				.getPersisterFromFileName(f.getName());
+        if (persister != null && persister.hasAnIcon()) {
+            return ResourceLoaderWrapper.lookupIconResource("UmlNotation");
+        } else {
+            return null;
+        }
+    } 
+}

Modified: branches/work_issue4925_mvw/org/argouml/profile/StreamModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/profile/StreamModelLoader.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/profile/StreamModelLoader.java&p2=branches/work_issue4925_mvw/org/argouml/profile/StreamModelLoader.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/profile/StreamModelLoader.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/profile/StreamModelLoader.java	2007-12-18 02:51:05-0800
@@ -47,7 +47,7 @@
      * @return the model
      * @throws ProfileException if the XMIReader couldn't read the input stream
      */
-    protected Collection loadModel(InputStream inputStream)
+    public Collection loadModel(InputStream inputStream)
         throws ProfileException {
         
         if (inputStream != null) {

Added: branches/work_issue4925_mvw/org/argouml/profile/init/InitProfileSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/profile/init/InitProfileSubsystem.java?view=auto&rev=13942
==============================================================================
--- (empty file)
+++ branches/work_issue4925_mvw/org/argouml/profile/init/InitProfileSubsystem.java	2007-12-18 02:51:05-0800
@@ -0,0 +1,60 @@
+// $Id$
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.profile.init;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.argouml.application.api.AbstractArgoJPanel;
+import org.argouml.application.api.GUISettingsTabInterface;
+import org.argouml.application.api.InitSubsystem;
+import org.argouml.profile.ProfileFacade;
+
+/**
+ * Initializer class for the Profile subsystem.
+ * 
+ * @author Luis Sergio Oliveira (euluis)
+ */
+public class InitProfileSubsystem implements InitSubsystem {
+
+    public List<GUISettingsTabInterface> getProjectSettingsTabs() {
+        return new ArrayList<GUISettingsTabInterface>();
+    }
+
+    public List<GUISettingsTabInterface> getSettingsTabs() {
+        return new ArrayList<GUISettingsTabInterface>();
+    }
+
+    public void init() {
+        ProfileFacade.setManager(
+                new org.argouml.profile.internal.ProfileManagerImpl());
+    }
+
+    public List<AbstractArgoJPanel> getDetailsTabs() {
+        return Collections.emptyList();
+    }
+
+}

Removed: branches/work_issue4925_mvw/org/argouml/profile/internal/InitProfileSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/profile/internal/InitProfileSubsystem.java?view=auto&rev=13941

Added: branches/work_issue4925_mvw/org/argouml/ui/AbstractArgoJPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/AbstractArgoJPanel.java?view=auto&rev=13942
==============================================================================

Modified: branches/work_issue4925_mvw/org/argouml/ui/ActionExportXMI.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/ActionExportXMI.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/ActionExportXMI.java&p2=branches/work_issue4925_mvw/org/argouml/ui/ActionExportXMI.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/ActionExportXMI.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/ActionExportXMI.java	2007-12-18 02:51:05-0800
@@ -33,7 +33,8 @@
 import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
 import org.argouml.persistence.PersistenceManager;
-import org.argouml.uml.ui.ProjectFileView;
+import org.argouml.persistence.ProjectFileView;
+import org.argouml.util.ArgoFrame;
 
 /**
  * Exports the xmi of a project to a file choosen by the user.

Modified: branches/work_issue4925_mvw/org/argouml/ui/ActionImportXMI.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/ActionImportXMI.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/ActionImportXMI.java&p2=branches/work_issue4925_mvw/org/argouml/ui/ActionImportXMI.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/ActionImportXMI.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/ActionImportXMI.java	2007-12-18 02:51:05-0800
@@ -37,7 +37,7 @@
 import org.argouml.kernel.ProjectManager;
 import org.argouml.persistence.AbstractFilePersister;
 import org.argouml.persistence.PersistenceManager;
-import org.argouml.uml.ui.ProjectFileView;
+import org.argouml.persistence.ProjectFileView;
 
 /**
  * This Action allows import of a XMI file.

Removed: branches/work_issue4925_mvw/org/argouml/ui/ArgoFrame.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/ArgoFrame.java?view=auto&rev=13941

Modified: branches/work_issue4925_mvw/org/argouml/ui/LoadSwingWorker.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/LoadSwingWorker.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/LoadSwingWorker.java&p2=branches/work_issue4925_mvw/org/argouml/ui/LoadSwingWorker.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/LoadSwingWorker.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/LoadSwingWorker.java	2007-12-18 02:51:05-0800
@@ -31,6 +31,7 @@
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
 import org.argouml.taskmgmt.ProgressMonitor;
+import org.argouml.util.ArgoFrame;
 
 /**
  * The specialized SwingWorker used for loading projects 

Modified: branches/work_issue4925_mvw/org/argouml/ui/ProgressMonitorWindow.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/ProgressMonitorWindow.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/ProgressMonitorWindow.java&p2=branches/work_issue4925_mvw/org/argouml/ui/ProgressMonitorWindow.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/ProgressMonitorWindow.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/ProgressMonitorWindow.java	2007-12-18 02:51:05-0800
@@ -32,6 +32,7 @@
 
 import org.argouml.i18n.Translator;
 import org.argouml.taskmgmt.ProgressEvent;
+import org.argouml.util.ArgoFrame;
 
 /**
  * Manages a ProgressMonitor dialog.

Modified: branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java&p2=branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java	2007-12-18 02:51:05-0800
@@ -80,6 +80,7 @@
 import org.argouml.persistence.OpenException;
 import org.argouml.persistence.PersistenceManager;
 import org.argouml.persistence.ProjectFilePersister;
+import org.argouml.persistence.ProjectFileView;
 import org.argouml.persistence.UmlVersionException;
 import org.argouml.persistence.VersionException;
 import org.argouml.persistence.XmiFormatException;
@@ -93,8 +94,8 @@
 import org.argouml.uml.diagram.UMLMutableGraphSupport;
 import org.argouml.uml.diagram.ui.ActionRemoveFromDiagram;
 import org.argouml.uml.ui.ActionSaveProject;
-import org.argouml.uml.ui.ProjectFileView;
 import org.argouml.uml.ui.TabProps;
+import org.argouml.util.ArgoFrame;
 import org.argouml.util.ThreadUtils;
 import org.tigris.gef.base.Diagram;
 import org.tigris.gef.base.Editor;

Modified: branches/work_issue4925_mvw/org/argouml/ui/ProjectSettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/ProjectSettingsTabProfile.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/ProjectSettingsTabProfile.java&p2=branches/work_issue4925_mvw/org/argouml/ui/ProjectSettingsTabProfile.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/ProjectSettingsTabProfile.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/ProjectSettingsTabProfile.java	2007-12-18 02:51:05-0800
@@ -50,15 +50,14 @@
 

 import org.argouml.application.api.GUISettingsTabInterface;

 import org.argouml.i18n.Translator;

+import org.argouml.kernel.ProfileConfiguration;

 import org.argouml.kernel.ProjectManager;

 import org.argouml.kernel.ProjectSettings;

-import org.argouml.ui.explorer.ExplorerEventAdaptor;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

 import org.argouml.profile.Profile;

-import org.argouml.kernel.ProfileConfiguration;

 import org.argouml.profile.ProfileException;

 import org.argouml.profile.ProfileFacade;

 import org.argouml.profile.UserDefinedProfile;

+import org.argouml.uml.diagram.ui.FigNodeModelElement;

 

 /**

  * The Tab where new profiles can be added and the registered

@@ -447,8 +446,7 @@
                 pc.addProfile(profile);

             }

         }

-        

-        ExplorerEventAdaptor.getInstance().structureChanged();        

+     

     }

 

 }


Modified: branches/work_issue4925_mvw/org/argouml/ui/SaveSwingWorker.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/SaveSwingWorker.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/SaveSwingWorker.java&p2=branches/work_issue4925_mvw/org/argouml/ui/SaveSwingWorker.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/SaveSwingWorker.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/SaveSwingWorker.java	2007-12-18 02:51:05-0800
@@ -30,6 +30,7 @@
 
 import org.argouml.i18n.Translator;
 import org.argouml.taskmgmt.ProgressMonitor;
+import org.argouml.util.ArgoFrame;
 import org.tigris.gef.undo.UndoManager;
 
 /**

Modified: branches/work_issue4925_mvw/org/argouml/ui/SettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/SettingsTabProfile.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/SettingsTabProfile.java&p2=branches/work_issue4925_mvw/org/argouml/ui/SettingsTabProfile.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/SettingsTabProfile.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/SettingsTabProfile.java	2007-12-18 02:51:05-0800
@@ -50,13 +50,13 @@
 

 import org.argouml.application.api.GUISettingsTabInterface;

 import org.argouml.configuration.Configuration;

-import org.argouml.configuration.ConfigurationKey;

 import org.argouml.i18n.Translator;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

+import org.argouml.kernel.ProfileConfiguration;

 import org.argouml.profile.Profile;

 import org.argouml.profile.ProfileException;

 import org.argouml.profile.ProfileFacade;

 import org.argouml.profile.UserDefinedProfile;

+import org.argouml.uml.diagram.ui.FigNodeModelElement;

 

 /**

  * The Tab containing the global settings for profiles

@@ -95,12 +95,6 @@
 

     ///////

 

-    /**

-     * The configuration key for the default stereotype view.

-     */

-    public static final ConfigurationKey KEY_DEFAULT_STEREOTYPE_VIEW = 

-        Configuration.makeKey("profiles", "stereotypeView");

-

     private JLabel stereoLabel =

         new JLabel(Translator.localize("menu.popup.stereotype-view") + ": ");

 

@@ -144,16 +138,19 @@
 

                     switch (idx) {

                     case 0:

-                        Configuration.setInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

-                                FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);

+                        Configuration.setInteger(

+                            ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,

+                            FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);

                         break;

                     case 1:

-                        Configuration.setInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

-                                FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);

+                        Configuration.setInteger(

+                            ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,

+                            FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);

                         break;

                     case 2:

-                        Configuration.setInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

-                                FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);

+                        Configuration.setInteger(

+                            ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,

+                            FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);

                         break;

                     }

                 }

@@ -318,7 +315,7 @@
                     return file.isDirectory()

                             || (file.isFile() && (file.getName().toLowerCase()

                                     .endsWith(".xml") || file.getName()

-                                    .toLowerCase().endsWith(".xmi")));

+                                        .toLowerCase().endsWith(".xmi")));

                 }

 

 		public String getDescription() {

@@ -423,7 +420,8 @@
     public void handleSettingsTabRefresh() {

         refreshLists();

  

-        switch (Configuration.getInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

+        switch (Configuration.getInteger(

+                ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,

                 FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL)) {

         case FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL:

             stereoField.setSelectedIndex(0);                


Modified: branches/work_issue4925_mvw/org/argouml/ui/StylePanelFig.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/StylePanelFig.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/StylePanelFig.java&p2=branches/work_issue4925_mvw/org/argouml/ui/StylePanelFig.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/StylePanelFig.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/StylePanelFig.java	2007-12-18 02:51:05-0800
@@ -47,6 +47,7 @@
 import org.argouml.swingext.SpacerPanel;
 import org.argouml.uml.diagram.ui.FigEdgeModelElement;
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.argouml.util.ArgoFrame;
 
 /**
  * The basic stylepanel which provides the boundaries box,

Modified: branches/work_issue4925_mvw/org/argouml/ui/SwingWorker.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/SwingWorker.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/SwingWorker.java&p2=branches/work_issue4925_mvw/org/argouml/ui/SwingWorker.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/SwingWorker.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/SwingWorker.java	2007-12-18 02:51:05-0800
@@ -34,6 +34,7 @@
 import org.apache.log4j.Logger;
 import org.argouml.swingext.GlassPane;
 import org.argouml.taskmgmt.ProgressMonitor;
+import org.argouml.util.ArgoFrame;
 
 /**
  * This is the 3rd version of SwingWorker (also known as

Modified: branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionAboutArgoUML.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionAboutArgoUML.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionAboutArgoUML.java&p2=branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionAboutArgoUML.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionAboutArgoUML.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionAboutArgoUML.java	2007-12-18 02:51:05-0800
@@ -32,7 +32,7 @@
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.i18n.Translator;
 import org.argouml.ui.AboutBox;
-import org.argouml.ui.ArgoFrame;
+import org.argouml.util.ArgoFrame;
 
 
 /**

Modified: branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionShowXMLDump.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionShowXMLDump.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionShowXMLDump.java&p2=branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionShowXMLDump.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionShowXMLDump.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionShowXMLDump.java	2007-12-18 02:51:05-0800
@@ -36,7 +36,7 @@
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.persistence.PersistenceManager;
-import org.argouml.ui.ArgoFrame;
+import org.argouml.util.ArgoFrame;
 import org.argouml.util.UIUtils;
 
 /**

Modified: branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionSystemInfo.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionSystemInfo.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionSystemInfo.java&p2=branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionSystemInfo.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionSystemInfo.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/cmd/ActionSystemInfo.java	2007-12-18 02:51:05-0800
@@ -33,8 +33,8 @@
 
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.i18n.Translator;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.SystemInfoDialog;
+import org.argouml.util.ArgoFrame;
 
 /**
  * System information dialog.

Modified: branches/work_issue4925_mvw/org/argouml/ui/explorer/ActionExportProfileXMI.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/explorer/ActionExportProfileXMI.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/explorer/ActionExportProfileXMI.java&p2=branches/work_issue4925_mvw/org/argouml/ui/explorer/ActionExportProfileXMI.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/explorer/ActionExportProfileXMI.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/explorer/ActionExportProfileXMI.java	2007-12-18 02:51:05-0800
@@ -41,10 +41,10 @@
 import org.argouml.model.UmlException;

 import org.argouml.model.XmiWriter;

 import org.argouml.persistence.PersistenceManager;

+import org.argouml.persistence.ProjectFileView;

 import org.argouml.persistence.UmlFilePersister;

-import org.argouml.ui.ArgoFrame;

 import org.argouml.profile.Profile;

-import org.argouml.uml.ui.ProjectFileView;

+import org.argouml.util.ArgoFrame;

 

 /**

  * Exports the model of a selected profile as XMI


Modified: branches/work_issue4925_mvw/org/argouml/ui/explorer/ExplorerEventAdaptor.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/ui/explorer/ExplorerEventAdaptor.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/ui/explorer/ExplorerEventAdaptor.java&p2=branches/work_issue4925_mvw/org/argouml/ui/explorer/ExplorerEventAdaptor.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/explorer/ExplorerEventAdaptor.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/explorer/ExplorerEventAdaptor.java	2007-12-18 02:51:05-0800
@@ -26,6 +26,10 @@
 
 import java.beans.PropertyChangeListener;
 
+import org.argouml.application.events.ArgoEventPump;
+import org.argouml.application.events.ArgoEventTypes;
+import org.argouml.application.events.ArgoProfileEvent;
+import org.argouml.application.events.ArgoProfileEventListener;
 import org.argouml.configuration.Configuration;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.AddAssociationEvent;
@@ -85,6 +89,8 @@
         // tailored to cut down on event traffic. - tfm 20060410
         Model.getPump().addClassModelEventListener(this,
                 Model.getMetaTypes().getModelElement(), (String[]) null);
+        ArgoEventPump.addListener(
+                ArgoEventTypes.ANY_PROFILE_EVENT, new ProfileChangeListener());
     }
 
     /**
@@ -93,6 +99,7 @@
      * 
      * TODO:  This shouldn't be public.  Components desiring to
      * inform the Explorer of changes should send events.
+     * @deprecated by mvw in V0.25.4. Use events instead.
      */
     public void structureChanged() {
         if (treeModel == null) {
@@ -208,7 +215,24 @@
                 treeModel.modelElementRemoved(pce.getOldValue());
             }
         }
+    }
+    
+    /**
+     * Listener for additions and removals of profiles.
+     * Since they generally have a major impact on the explorer tree, 
+     * we simply update them completely.
+     *
+     * @author Michiel
+     */
+    class ProfileChangeListener implements ArgoProfileEventListener {
 
+        public void profileAdded(ArgoProfileEvent e) {
+            structureChanged();
+        }
 
+        public void profileRemoved(ArgoProfileEvent e) {
+            structureChanged();
+        }
+        
     }
 }

Modified: branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2007-12-18 02:51:05-0800
@@ -2068,8 +2068,10 @@
     }
 
     /**
-     * When using <code>BigIcon</code> mode and zero or more than one stereotype
-     * the practical view should be the default one. 
+     * Return a stereotype view which is most practical for the current
+     * conditions. If the current mode is set to <code>BigIcon</code> mode and
+     * the model element has zero or more than one stereotype the practical view
+     * should be the textual view.
      * 
      * @return current practical stereotype view
      */

Modified: branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&p2=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	2007-12-18 02:51:05-0800
@@ -32,6 +32,7 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.argouml.kernel.Project;
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
@@ -42,7 +43,7 @@
  * A Fig designed to be the child of some FigNode or FigEdge to display the
  * stereotypes of the model element represented by the parent Fig.
  * Currently display of multiple stereotypes are stacked one on top of the
- * each enclosed by guillemots.<p>
+ * each enclosed by guillemets.<p>
  * 
  * The minimum width of this fig is the largest minimum width of its child
  * figs.<p>
@@ -51,8 +52,8 @@
  * figs.<p>
  * 
  * TODO: Allow for UML2 style display where all stereotypes are displayed in
- * the same guillemot pair and are delimited by commas. The style should be
- * changable by calling getOrientation(Orientation). The swidget Orientation
+ * the same guillemet pair and are delimited by commas. The style should be
+ * changeable by calling getOrientation(Orientation). The swidget Orientation
  * class can be used for this.
  * @author Bob Tarling
  */
@@ -95,6 +96,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setOwner(java.lang.Object)
      */
+    @Override
     public void setOwner(Object own) {
         if (own != null) {
             super.setOwner(own);
@@ -106,11 +108,13 @@
     /*
      * @see org.tigris.gef.presentation.Fig#removeFromDiagram()
      */
+    @Override
     public void removeFromDiagram() {
         Model.getPump()
                 .removeModelEventListener(this, getOwner(), "stereotype");
     }
     
+    @Override
     public void propertyChange(PropertyChangeEvent event) {
         if (event instanceof AddAssociationEvent) {
             AddAssociationEvent aae = (AddAssociationEvent) event;
@@ -306,7 +310,12 @@
     }
 
     private Image getIconForStereotype(FigStereotype fs) {
-        return getProject().getProfileConfiguration().getFigNodeStrategy()
+        Project project = getProject();
+        if (project == null) {
+            LOG.warn("getProject() returned null");
+            return null;
+        }
+        return project.getProfileConfiguration().getFigNodeStrategy()
                 .getIconForStereotype(fs.getOwner());
     }
 
@@ -344,10 +353,20 @@
     protected void createModelElement() {
     }
 
+    /**
+     * @return true if textual stereotypes are being hidden in preference to
+     *         displaying icon.
+     */
     public boolean isHidingStereotypesWithIcon() {
         return hidingStereotypesWithIcon;
     }
 
+    /**
+     * Turn on/off textual stereotype display in preference to icon.
+     * 
+     * @param hidingStereotypesWithIcon true to hide textual stereotypes and
+     *                show icon instead.
+     */
     public void setHidingStereotypesWithIcon(boolean hidingStereotypesWithIcon) {
         this.hidingStereotypesWithIcon = hidingStereotypesWithIcon;
         updateHiddenStereotypes();

Modified: branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/SettingsTabDiagramAppearance.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/SettingsTabDiagramAppearance.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/SettingsTabDiagramAppearance.java&p2=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/SettingsTabDiagramAppearance.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/SettingsTabDiagramAppearance.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/SettingsTabDiagramAppearance.java	2007-12-18 02:51:05-0800
@@ -42,8 +42,8 @@
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.kernel.ProjectSettings;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.ArgoJFontChooser;
+import org.argouml.util.ArgoFrame;
 
 /**
  * Settings tab panel for handling diagram appearance settings.

Modified: branches/work_issue4925_mvw/org/argouml/uml/reveng/java/java.g
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/reveng/java/java.g?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/reveng/java/java.g&p2=branches/work_issue4925_mvw/org/argouml/uml/reveng/java/java.g&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/reveng/java/java.g	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/reveng/java/java.g	2007-12-18 02:51:05-0800
@@ -237,7 +237,7 @@
     STATIC_IMPORT; ENUM_DEF; ENUM_CONSTANT_DEF; FOR_EACH_CLAUSE; ANNOTATION_DEF; ANNOTATIONS;
     ANNOTATION; ANNOTATION_MEMBER_VALUE_PAIR; ANNOTATION_FIELD_DEF; ANNOTATION_ARRAY_INIT;
     TYPE_ARGUMENTS; TYPE_ARGUMENT; TYPE_PARAMETERS; TYPE_PARAMETER; WILDCARD_TYPE;
-    TYPE_UPPER_BOUNDS; TYPE_LOWER_BOUNDS;
+    TYPE_UPPER_BOUNDS; TYPE_LOWER_BOUNDS; EMPTY_COMMENT="/**/";
 }
 
 {
@@ -2045,9 +2045,26 @@
           $setType(Token.SKIP); if (nl) newline(); }
     ;
 
+// Empty comment block needs to be distinguished from Javadoc
+EMPTY_COMMENT
+    :    "/**/"
+        { addWhitespace($getText);
+          $setType(Token.SKIP);}
+    ;
+
 // javadoc comments
 JAVADOC
     :    "/**"
+            ( /* Do not allow '/' for first character */
+            options {
+                generateAmbigWarnings=false;
+            }
+        :
+            '\r' '\n'        {newline();}
+        |    '\r'            {newline();}
+        |    '\n'            {newline();}
+        |    ~('/'|'\n'|'\r')
+        )        
         (    /*    '\r' '\n' can be matched in one alternative or by matching
                 '\r' in one iteration and '\n' in another.  I am trying to
                 handle any flavor of newline that comes in, but the language

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/AbstractActionAddModelElement2.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/AbstractActionAddModelElement2.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/AbstractActionAddModelElement2.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/AbstractActionAddModelElement2.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/AbstractActionAddModelElement2.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/AbstractActionAddModelElement2.java	2007-12-18 02:51:05-0800
@@ -34,7 +34,7 @@
 import javax.swing.JOptionPane;

 

 import org.argouml.i18n.Translator;

-import org.argouml.ui.ArgoFrame;

+import org.argouml.util.ArgoFrame;

 import org.tigris.gef.undo.UndoableAction;

 

 /**


Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/ActionDeleteModelElements.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ActionDeleteModelElements.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionDeleteModelElements.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionDeleteModelElements.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/ActionDeleteModelElements.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/ActionDeleteModelElements.java	2007-12-18 02:51:05-0800
@@ -42,13 +42,13 @@
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InvalidElementException;
 import org.argouml.model.Model;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.targetmanager.TargetEvent;
 import org.argouml.ui.targetmanager.TargetListener;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.CommentEdge;
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.diagram.ui.ActionDeleteConcurrentRegion;
+import org.argouml.util.ArgoFrame;
 import org.tigris.gef.base.Editor;
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.presentation.Fig;

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/ActionImportFromSources.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ActionImportFromSources.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionImportFromSources.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionImportFromSources.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/ActionImportFromSources.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/ActionImportFromSources.java	2007-12-18 02:51:05-0800
@@ -31,8 +31,8 @@
 
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.i18n.Translator;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.uml.reveng.Import;
+import org.argouml.util.ArgoFrame;
 import org.tigris.gef.undo.UndoableAction;
 
 

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/ActionOpenProject.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ActionOpenProject.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionOpenProject.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionOpenProject.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/ActionOpenProject.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/ActionOpenProject.java	2007-12-18 02:51:05-0800
@@ -39,9 +39,10 @@
 import org.argouml.kernel.ProjectManager;
 import org.argouml.persistence.AbstractFilePersister;
 import org.argouml.persistence.PersistenceManager;
-import org.argouml.ui.ArgoFrame;
+import org.argouml.persistence.ProjectFileView;
 import org.argouml.ui.ProjectBrowser;
 import org.argouml.ui.UndoableAction;
+import org.argouml.util.ArgoFrame;
 
 /**
  * Action that loads the project.

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/ActionRevertToSaved.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ActionRevertToSaved.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionRevertToSaved.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionRevertToSaved.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/ActionRevertToSaved.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/ActionRevertToSaved.java	2007-12-18 02:51:05-0800
@@ -34,8 +34,8 @@
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.ProjectBrowser;
+import org.argouml.util.ArgoFrame;
 
 /**
  * Action that reverts to the previously saved version of the project.

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveAllGraphics.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveAllGraphics.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveAllGraphics.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveAllGraphics.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveAllGraphics.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveAllGraphics.java	2007-12-18 02:51:05-0800
@@ -43,9 +43,9 @@
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.util.ArgoFrame;
 import org.tigris.gef.base.Diagram;
 import org.tigris.gef.base.SaveGraphicsAction;
 import org.tigris.gef.undo.UndoableAction;

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveGraphics.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveGraphics.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveGraphics.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveGraphics.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveGraphics.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSaveGraphics.java	2007-12-18 02:51:05-0800
@@ -41,9 +41,9 @@
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.ExceptionDialog;
 import org.argouml.ui.ProjectBrowser;
+import org.argouml.util.ArgoFrame;
 import org.argouml.util.SuffixFilter;
 import org.tigris.gef.base.SaveGraphicsAction;
 import org.tigris.gef.base.Diagram;

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSetSourcePath.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSetSourcePath.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSetSourcePath.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSetSourcePath.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSetSourcePath.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/ActionSetSourcePath.java	2007-12-18 02:51:05-0800
@@ -32,9 +32,9 @@
 
 import org.argouml.i18n.Translator;
 import org.argouml.model.Model;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.reveng.ImportInterface;
+import org.argouml.util.ArgoFrame;
 import org.tigris.gef.undo.UndoableAction;
 
 

Removed: branches/work_issue4925_mvw/org/argouml/uml/ui/ProjectFileView.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/ProjectFileView.java?view=auto&rev=13941

Modified: branches/work_issue4925_mvw/org/argouml/uml/ui/model_management/PropPanelPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/ui/model_management/PropPanelPackage.java?view=diff&rev=13942&p1=branches/work_issue4925_mvw/org/argouml/uml/ui/model_management/PropPanelPackage.java&p2=branches/work_issue4925_mvw/org/argouml/uml/ui/model_management/PropPanelPackage.java&r1=13941&r2=13942
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/ui/model_management/PropPanelPackage.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/ui/model_management/PropPanelPackage.java	2007-12-18 02:51:05-0800
@@ -38,7 +38,6 @@
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.i18n.Translator;
 import org.argouml.model.Model;
-import org.argouml.ui.ArgoFrame;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.ui.ActionNavigateNamespace;
 import org.argouml.uml.ui.UMLAddDialog;
@@ -55,6 +54,7 @@
 import org.argouml.uml.ui.foundation.core.UMLGeneralizableElementSpecializationListModel;
 import org.argouml.uml.ui.foundation.extension_mechanisms.ActionNewStereotype;
 import org.argouml.uml.ui.foundation.extension_mechanisms.ActionNewTagDefinition;
+import org.argouml.util.ArgoFrame;
 import org.tigris.gef.undo.UndoableAction;
 import org.tigris.swidgets.Orientation;
 

Added: branches/work_issue4925_mvw/org/argouml/util/ArgoFrame.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/util/ArgoFrame.java?view=auto&rev=13942
==============================================================================
--- (empty file)
+++ branches/work_issue4925_mvw/org/argouml/util/ArgoFrame.java	2007-12-18 02:51:05-0800
@@ -0,0 +1,97 @@
+// $Id$
+// Copyright (c) 2005 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.util;
+
+import java.awt.Frame;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Helper class to store/find a top level application frame.
+ * 
+ * This has been factored out of ProjectBrowser solely to allow easy
+ * identification of things that want a ProjectBrowser because it is the top
+ * level JFrame and those things that want to actually call a ProjectBrowser
+ * method for some other purpose.
+ * 
+ * @author Tom Morris
+ * 
+ */
+public class ArgoFrame {
+
+    private static final Logger LOG = Logger.getLogger(ArgoFrame.class);
+    
+    private static JFrame topFrame;
+    
+    private ArgoFrame() {
+        // prohibit instantiation
+    }
+    
+    /**
+     * Get a top level frame which can be used as the parent for creating new
+     * dialogs. The name is temporarily the same as the old
+     * ProjectBrowser.getInstance() usage for compatibility. The implementation
+     * is just roughed out for experimentation.
+     * 
+     * @return a top level JFrame to use as parent for new dialogs
+     */
+    public static JFrame getInstance() {
+        if (topFrame == null) {
+            Frame rootFrame = JOptionPane.getRootFrame();
+            if ( rootFrame instanceof JFrame) {
+                topFrame = (JFrame) rootFrame;
+            } else {
+                Frame[] frames = Frame.getFrames();
+                for (int i = 0; i < frames.length; i++) {
+                    if (frames[i] instanceof JFrame) {
+                        if (topFrame != null) {
+                            LOG.warn("Found multiple JFrames");
+                        } else {
+                            topFrame = (JFrame) frames[i];
+                        }
+                    }
+                }
+                if (topFrame == null) {
+                    LOG.warn("Failed to find application JFrame");
+                }
+            }
+            ArgoDialog.setFrame(topFrame);
+        }
+
+        return topFrame;
+    }
+
+    /**
+     * Set the JFrame to use as the main application frame.
+     * 
+     * @param frame the main application frame.
+     */
+    public static void setInstance(JFrame frame) {
+        topFrame = frame;
+    }
+}
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.