svn commit: r13958 - branches/work_issue4925_mvw/org/argouml: kernel ui uml/diagram/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-12-20 14:17:14-0800
New Revision: 13958

Added:
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigUtil.java
      - copied unchanged from r13957, /trunk/src_new/org/argouml/uml/diagram/ui/ArgoFigUtil.java
Modified:
   branches/work_issue4925_mvw/org/argouml/kernel/Project.java
   branches/work_issue4925_mvw/org/argouml/kernel/ProjectImpl.java
   branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigGroup.java
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigText.java
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
   branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigNodeModelElement.java

Log:
Merge updates from trunk

Modified: branches/work_issue4925_mvw/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/kernel/Project.java?view=diff&rev=13958&p1=branches/work_issue4925_mvw/org/argouml/kernel/Project.java&p2=branches/work_issue4925_mvw/org/argouml/kernel/Project.java&r1=13957&r2=13958
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/kernel/Project.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/kernel/Project.java	2007-12-20 14:17:14-0800
@@ -253,7 +253,9 @@
      * If there isn't exactly one model, <code>null</code> is returned.
      *
      * @return the model.
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #getModels()}.
      */
+    @Deprecated
     public Object getModel();
 
 

Modified: branches/work_issue4925_mvw/org/argouml/kernel/ProjectImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/kernel/ProjectImpl.java?view=diff&rev=13958&p1=branches/work_issue4925_mvw/org/argouml/kernel/ProjectImpl.java&p2=branches/work_issue4925_mvw/org/argouml/kernel/ProjectImpl.java&r1=13957&r2=13958
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/kernel/ProjectImpl.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/kernel/ProjectImpl.java	2007-12-20 14:17:14-0800
@@ -517,6 +517,7 @@
     }
 
 
+    @Deprecated
     public Object getModel() {
         if (models.size() != 1) {
             return null;
@@ -1097,8 +1098,10 @@
         members.clear();
 
         for (Object model : roots) {
-            LOG.debug("Deleting root element "
-                    + Model.getFacade().getName(model));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Deleting root element "
+                        + Model.getFacade().getName(model));
+            }
             Model.getUmlFactory().delete(model);
         }
         roots.clear();

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=13958&p1=branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java&p2=branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java&r1=13957&r2=13958
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/ui/ProjectBrowser.java	2007-12-20 14:17:14-0800
@@ -215,7 +215,9 @@
     private NavigatorPane explorerPane;
 
     /**
-     * The todopane (lower left corner of screen).
+     * The todopane (lower left corner of screen). This may actually be a blank
+     * JPanel if the ProjectBrowser was lazily initialized via
+     * {@link #getInstance()}.
      */
     private JPanel todoPane;
 
@@ -357,7 +359,7 @@
      * @param mainApplication
      *            true to create a top level application, false if integrated
      *            with something else.
-     * @param leftBottomPane the panel to fit in the left bottom corner
+     * @param leftBottomPane panel to place in the bottom left corner of the GUI
      * 
      * @return the singleton instance of the projectbrowser
      */
@@ -380,7 +382,8 @@
      * Creates the panels in the working area.
      *
      * @param splash true if we show  the splashscreen during startup
-     * @param leftBottomPane the panel to fit in the left bottom corner
+     * @param leftBottomPane panel to be placed in the bottom left (southwest)
+     *                corner of the UI.
      */
     protected void createPanels(SplashScreen splash, JPanel leftBottomPane) {
 
@@ -401,7 +404,7 @@
         explorerPane = new NavigatorPane(splash);
 
         // The workarea is all the visible space except the menu,
-        // toolbar and status bar.  Workarea is layed out as a
+        // toolbar and status bar.  Workarea is laid out as a
         // BorderSplitPane where the various components that make up
         // the argo application can be positioned.
         workAreaPane = new BorderSplitPane();

Modified: branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigGroup.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigGroup.java?view=diff&rev=13958&p1=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigGroup.java&p2=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigGroup.java&r1=13957&r2=13958
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigGroup.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigGroup.java	2007-12-20 14:17:14-0800
@@ -33,6 +33,7 @@
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.Layer;
 import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.graph.GraphModel;
 import org.tigris.gef.presentation.FigGroup;
 
 /**
@@ -68,29 +69,7 @@
      * @see org.argouml.uml.diagram.ui.ArgoFig#getProject()
      */
     public Project getProject() {
-        LayerPerspective layer = (LayerPerspective) getLayer();
-        if (layer == null) {
-            /* TODO: Without this, we fail to draw e.g. a Class.
-             * But is this a good solution? 
-             * Why is the Layer not set in the constructor? */
-            Editor editor = Globals.curEditor();
-            if (editor == null) {
-                // TODO: The above doesn't work reliably in a constructor.  We
-                // need a better way of getting default fig settings 
-                // for the owning project rather than using the 
-                // project manager singleton. - tfm
-                return ProjectManager.getManager().getCurrentProject();
-            }
-            Layer lay = editor.getLayerManager().getActiveLayer();
-            if (lay instanceof LayerPerspective) {
-                layer = (LayerPerspective) lay;
-            }
-        }
-        if (layer == null) {
-            return null;
-        }
-        UMLMutableGraphSupport gm = 
-            (UMLMutableGraphSupport) layer.getGraphModel();
-        return gm.getProject();
+        return ArgoFigUtil.getProject(this);
     }
+
 }

Modified: branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigText.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigText.java?view=diff&rev=13958&p1=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigText.java&p2=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigText.java&r1=13957&r2=13958
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigText.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/ArgoFigText.java	2007-12-20 14:17:14-0800
@@ -122,34 +122,7 @@
     }
     
     public Project getProject() {
-        LayerPerspective layer = (LayerPerspective) getLayer();
-        if (layer == null) {
-            /* TODO: Without this, we fail to draw e.g. a Class.
-             * But is this a good solution? 
-             * Why is the Layer not set in the constructor? */
-            Editor editor = Globals.curEditor();
-            if (editor == null) {
-                /* TODO: The above doesn't work reliably in a constructor. 
-                * We need a better way of getting default fig settings 
-                * for the owning project rather than using the project 
-                * manager singleton. - tfm
-                */
-                return ProjectManager.getManager().getCurrentProject();
-            }
-            Layer lay = editor.getLayerManager().getActiveLayer();
-            if (lay instanceof LayerPerspective) {
-                layer = (LayerPerspective) lay;
-            }
-        }
-        if (layer == null) {
-            return null;
-        }
-        GraphModel gm = layer.getGraphModel();
-        if (gm instanceof UMLMutableGraphSupport) {
-            return ((UMLMutableGraphSupport) gm).getProject();
-        } else {
-            return ProjectManager.getManager().getCurrentProject();
-        }
+        return ArgoFigUtil.getProject(this);
     }
 
     /**

Modified: branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&rev=13958&p1=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigEdgeModelElement.java&p2=branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigEdgeModelElement.java&r1=13957&r2=13958
==============================================================================
--- branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	(original)
+++ branches/work_issue4925_mvw/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	2007-12-20 14:17:14-0800
@@ -66,7 +66,6 @@
 import org.argouml.kernel.DelayedChangeNotify;
 import org.argouml.kernel.DelayedVChangeListener;
 import org.argouml.kernel.Project;
-import org.argouml.kernel.ProjectManager;
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.AssociationChangeEvent;
 import org.argouml.model.AttributeChangeEvent;
@@ -83,12 +82,9 @@
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.StereotypeUtility;
 import org.argouml.uml.diagram.IItemUID;
-import org.argouml.uml.diagram.UMLMutableGraphSupport;
 import org.argouml.uml.ui.ActionDeleteModelElements;
-import org.tigris.gef.base.Editor;
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.Layer;
-import org.tigris.gef.base.LayerPerspective;
 import org.tigris.gef.base.PathConvPercent;
 import org.tigris.gef.base.Selection;
 import org.tigris.gef.presentation.Fig;
@@ -1369,26 +1365,7 @@
     }
     
     public Project getProject() {
-        LayerPerspective layer = (LayerPerspective) getLayer();
-        if (layer == null) {
-            /* TODO: Without this, we fail to draw e.g. a Class.
-             * But is this a good solution? 
-             * Why is the Layer not set in the constructor? */
-            Editor editor = Globals.curEditor();
-            if (editor == null) {
-                // TODO: The above doesn't work reliably in a constructor.  We
-                // need a better way of getting default fig settings for the owning
-                // project rather than using the project manager singleton. - tfm
-                return ProjectManager.getManager().getCurrentProject();
-            }
-            Layer lay = editor.getLayerManager().getActiveLayer();
-            if (lay instanceof LayerPerspective) {
-                layer = (LayerPerspective) lay;
-            }
-        }
-        UMLMutableGraphSupport gm = 
-            (UMLMutableGraphSupport) layer.getGraphModel();
-        return gm.getProject();
+        return ArgoFigUtil.getProject(this);
     }
     
     /**

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=13958&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=13957&r2=13958
==============================================================================
--- 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-20 14:17:14-0800
@@ -88,15 +88,12 @@
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.diagram.IItemUID;
 import org.argouml.uml.diagram.PathContainer;
-import org.argouml.uml.diagram.UMLMutableGraphSupport;
 import org.argouml.uml.ui.ActionDeleteModelElements;
 import org.tigris.gef.base.Diagram;
-import org.tigris.gef.base.Editor;
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.Layer;
 import org.tigris.gef.base.LayerPerspective;
 import org.tigris.gef.base.Selection;
-import org.tigris.gef.graph.GraphModel;
 import org.tigris.gef.graph.MutableGraphSupport;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigGroup;
@@ -2019,34 +2016,7 @@
      * @see org.argouml.uml.diagram.ui.ArgoFig#getProject()
      */
     public Project getProject() {
-        LayerPerspective layer = (LayerPerspective) getLayer();
-        if (layer == null) {
-            /* TODO: Without this, we fail to draw e.g. a Class.
-             * But is this a good solution? 
-             * Why is the Layer not set in the constructor? */
-            Editor editor = Globals.curEditor();
-            if (editor == null) {
-                // TODO: The above doesn't work reliably in a constructor.  We
-                // need a better way of getting default fig settings 
-                // for the owning project rather than using the 
-                // project manager singleton. - tfm
-                return ProjectManager.getManager().getCurrentProject();
-            }
-            Layer lay = editor.getLayerManager().getActiveLayer();
-            if (lay instanceof LayerPerspective) {
-                layer = (LayerPerspective) lay;
-            }
-        }
-        if (layer == null) {
-            return null;
-        }
-
-	GraphModel gm = layer.getGraphModel();
-        if (gm instanceof UMLMutableGraphSupport) {
-            return ((UMLMutableGraphSupport) gm).getProject();
-        } else {
-            return ProjectManager.getManager().getCurrentProject();
-        }
+        return ArgoFigUtil.getProject(this);
     }
     
     /**
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.