Author: tfmorris
Date: 2008-09-21 06:29:38-0700
New Revision: 15752
Modified:
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java
Log:
RESOLVED - issue 5360: Include State elements in cascading delete processing
http://argouml.tigris.org/issues/show_bug.cgi?id=5360
Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java?view=diff&rev=15752&p1=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java&p2=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java&r1=15751&r2=15752
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java (original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/StateMachinesFactoryMDRImpl.java 2008-09-21 06:29:38-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 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
@@ -584,6 +584,29 @@
* @param elem
* the UML element to be deleted
*/
+ void deleteState(Object elem) {
+ if (!(elem instanceof State)) {
+ throw new IllegalArgumentException();
+ }
+ State state = (State) elem;
+ deleteNonNull(state.getDoActivity());
+ deleteNonNull(state.getEntry());
+ deleteNonNull(state.getExit());
+ modelImpl.getUmlHelper().deleteCollection(
+ state.getInternalTransition());
+
+ }
+
+ private void deleteNonNull(ModelElement action) {
+ if (action != null) {
+ modelImpl.getUmlFactory().delete(action);
+ }
+ }
+
+ /**
+ * @param elem
+ * the UML element to be deleted
+ */
void deleteSimpleState(Object elem) {
if (!(elem instanceof SimpleState)) {
throw new IllegalArgumentException();
Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java?view=diff&rev=15752&p1=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java&p2=trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java&r1=15751&r2=15752
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java (original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java 2008-09-21 06:29:38-0700
@@ -1238,6 +1238,7 @@
} else if (elem instanceof StubState) {
getStateMachines().deleteStubState(elem);
} else if (elem instanceof State) {
+ getStateMachines().deleteState(elem);
if (elem instanceof CompositeState) {
getStateMachines().deleteCompositeState(elem);
if (elem instanceof SubmachineState) {
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.