svn commit: r19148 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2011-03-30 10:21:00-0700
New Revision: 19148

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java

Log:
createModelElement is no longer abstract - it implements functionality for all child classes

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java?view=diff&pathrev=19148&r1=19147&r2=19148
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigCompartment.java	2011-03-30 10:21:00-0700
@@ -1,6 +1,6 @@
 /* $Id$
  *******************************************************************************
- * Copyright (c) 2009-2010 Contributors - see below
+ * Copyright (c) 2009-2011 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -46,8 +46,12 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.argouml.kernel.Project;
 import org.argouml.model.InvalidElementException;
+import org.argouml.model.Model;
+import org.argouml.model.UmlFactoryDefaults;
 import org.argouml.notation.NotationProvider;
+import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.DiagramSettings;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigRect;
@@ -213,7 +217,12 @@
     /**
      * Create a new model element for the compartment.
      */
-    protected abstract void createModelElement();
+    protected void createModelElement() {
+        Project project = getProject();
+        UmlFactoryDefaults defaults = project.getUmlFactoryDefaults();
+        Object attr = Model.getUmlFactory().buildNode(getCompartmentType(), getOwner(), null, defaults);
+        TargetManager.getInstance().setTarget(attr);
+    }
 
     @Override
     public void setFilled(boolean f) {

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2715374

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.