svn commit: r16637 - trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases
Bob Tarling <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: bobtarling
Date: 2009-01-17 07:05:00-0800
New Revision: 16637
Added:
trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeListModel.java
Modified:
trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeAdditionListModel.java
trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeBaseListModel.java
Log:
Issue 5613: Remove checks for namespace and move common code to shared subclass
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeAdditionListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeAdditionListModel.java?view=diff&pathrev=16637&r1=16636&r2=16637
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeAdditionListModel.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeAdditionListModel.java 2009-01-17 07:05:00-0800
@@ -25,42 +25,26 @@
package org.argouml.uml.ui.behavior.use_cases;
import org.argouml.model.Model;
-import org.argouml.uml.ui.UMLModelElementListModel2;
/**
- *
+ * List model to hold use cases of an includes additions.
+ *
* @author MarkusK
- *
*/
-public class UMLIncludeAdditionListModel extends UMLModelElementListModel2 {
+public class UMLIncludeAdditionListModel extends UMLIncludeListModel {
/**
- * Constructor for UMLIncludeAdditionComboBoxModel.
+ * Constructor for UMLIncludeAdditionListModel.
*/
public UMLIncludeAdditionListModel() {
super("addition");
- Model.getPump().addClassModelEventListener(this,
- Model.getMetaTypes().getNamespace(), "ownedElement");
}
/*
* @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
*/
protected void buildModelList() {
- if (!isEmpty())
- removeAllElements();
+ super.buildModelList();
addElement(Model.getFacade().getAddition(getTarget()));
}
-
-
-
- /*
- * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(java.lang.Object)
- */
- protected boolean isValidElement(Object element) {
- return Model.getFacade().isAUseCase(element)
- && Model.getFacade().getNamespace(getTarget())
- == Model.getFacade().getNamespace(element);
- }
-
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeBaseListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeBaseListModel.java?view=diff&pathrev=16637&r1=16636&r2=16637
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeBaseListModel.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeBaseListModel.java 2009-01-17 07:05:00-0800
@@ -25,37 +25,26 @@
package org.argouml.uml.ui.behavior.use_cases;
import org.argouml.model.Model;
-import org.argouml.uml.ui.UMLModelElementListModel2;
/**
- *
+ * List model to hold use cases of an includes bases.
+ *
* @author MarkusK
- *
*/
-public class UMLIncludeBaseListModel extends UMLModelElementListModel2 {
+public class UMLIncludeBaseListModel extends UMLIncludeListModel {
+ /**
+ * Constructor for UMLIncludeBaseListModel.
+ */
public UMLIncludeBaseListModel() {
super("base");
- Model.getPump().addClassModelEventListener(this,
- Model.getMetaTypes().getNamespace(), "ownedElement");
}
/*
* @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
*/
protected void buildModelList() {
- if (!isEmpty())
- removeAllElements();
+ super.buildModelList();
addElement(Model.getFacade().getBase(getTarget()));
}
-
- /*
- * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(java.lang.Object)
- */
- protected boolean isValidElement(Object element) {
- return Model.getFacade().isAUseCase(element)
- && Model.getFacade().getNamespace(element)
- == Model.getFacade().getNamespace(getTarget());
- }
-
}
Added: trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeListModel.java?view=markup&pathrev=16637
==============================================================================
--- (empty file)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/behavior/use_cases/UMLIncludeListModel.java 2009-01-17 07:05:00-0800
@@ -0,0 +1,67 @@
+// $Id: UMLIncludeAdditionListModel.java 11516 2006-11-25 04:30:15Z tfmorris $
+// Copyright (c) 1996-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.uml.ui.behavior.use_cases;
+
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLModelElementListModel2;
+
+/**
+ * Abstract class for list model to hold use cases of an include.
+ *
+ * @author MarkusK
+ */
+public abstract class UMLIncludeListModel extends UMLModelElementListModel2 {
+
+ /**
+ * Constructor for UMLIncludeListModel.
+ *
+ * @param eventName the name of the event to listen to, which triggers us
+ * to update the list model from the UML data
+ */
+ public UMLIncludeListModel(String eventName) {
+ super(eventName);
+ Model.getPump().addClassModelEventListener(this,
+ Model.getMetaTypes().getNamespace(), "ownedElement");
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+ */
+ protected void buildModelList() {
+ if (!isEmpty()) {
+ removeAllElements();
+ }
+ }
+
+
+
+ /*
+ * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(java.lang.Object)
+ */
+ protected boolean isValidElement(Object element) {
+ return Model.getFacade().isAUseCase(element);
+ }
+
+}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1030640
To unsubscribe from this discussion, e-mail: [[email protected]].