svn commit: r12728 - trunk/src/model/src/org/argouml/model

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-05-30 12:03:53-0700
New Revision: 12728

Modified:
   trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java
   trunk/src/model/src/org/argouml/model/ChangeableKind.java
   trunk/src/model/src/org/argouml/model/CoreHelper.java
   trunk/src/model/src/org/argouml/model/Facade.java
   trunk/src/model/src/org/argouml/model/Model.java
   trunk/src/model/src/org/argouml/model/PseudostateKind.java
   trunk/src/model/src/org/argouml/model/ScopeKind.java
   trunk/src/model/src/org/argouml/model/UndoCoreHelperDecorator.java

Log:
UML 2.x Model API Updates - first round of additions & deprecations

Modified: trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java&p2=trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java	(original)
+++ trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java	2007-05-30 12:03:53-0700
@@ -32,6 +32,7 @@
  *
  * @author Bob Tarling
  */
+@SuppressWarnings("deprecation")
 public abstract class AbstractCoreHelperDecorator implements CoreHelper {
 
     /**
@@ -118,7 +119,7 @@
         return impl.getSpecification(object);
     }
 
-    @SuppressWarnings("deprecation")
+
     public Collection getSpecifications(Object classifier) {
         return impl.getSpecifications(classifier);
     }
@@ -203,7 +204,6 @@
         return impl.getAssociationEnd(type, assoc);
     }
 
-    @SuppressWarnings("deprecation")
     public Collection getAllContents(Object clazz) {
         return impl.getAllContents(clazz);
     }
@@ -402,8 +402,6 @@
         impl.addSupplierDependency(supplier, dependency);
     }
 
-    
-    @SuppressWarnings("deprecation")
     public void addTaggedValue(Object handle, Object taggedValue) {
         impl.addTaggedValue(handle, taggedValue);
     }
@@ -496,7 +494,11 @@
     public void setOwnerScope(Object handle, Object os) {
         impl.setOwnerScope(handle, os);
     }
-
+    
+    public void setStatic(Object handle, boolean isStatic) {
+        impl.setStatic(handle, isStatic);
+    }
+    
     public void setParameter(Object handle, Object parameter) {
         impl.setParameter(handle, parameter);
     }
@@ -529,12 +531,10 @@
         impl.setSpecifications(handle, specifications);
     }
 
-    @SuppressWarnings("deprecation")
     public void setTaggedValue(Object handle, String tag, String value) {
         impl.setTaggedValue(handle, tag, value);
     }
 
-    @SuppressWarnings("deprecation")
     public void setTaggedValues(Object handle, Collection taggedValues) {
         impl.setTaggedValues(handle, taggedValues);
     }
@@ -570,7 +570,11 @@
     public void setChangeable(Object handle, boolean flag) {
         impl.setChangeable(handle, flag);
     }
-
+    
+    public void setReadOnly(Object handle, boolean isReadOnly) {
+        impl.setReadOnly(handle, isReadOnly);
+    }
+    
     public void setConcurrency(Object handle, Object concurrencyKind) {
         impl.setConcurrency(handle, concurrencyKind);
     }

Modified: trunk/src/model/src/org/argouml/model/ChangeableKind.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/ChangeableKind.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/ChangeableKind.java&p2=trunk/src/model/src/org/argouml/model/ChangeableKind.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/ChangeableKind.java	(original)
+++ trunk/src/model/src/org/argouml/model/ChangeableKind.java	2007-05-30 12:03:53-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2006 The Regents of the University of California. All
+// Copyright (c) 2005-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
@@ -26,6 +26,9 @@
 
 /**
  * The different ChangeableKinds.
+ * 
+ * @deprecated for 0.25.4 by tfmorris. This enumeration has been removed from
+ *             UML 2. Use the getter for the isReadOnly attribute.
  */
 public interface ChangeableKind {
     /**

Modified: trunk/src/model/src/org/argouml/model/CoreHelper.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/CoreHelper.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/CoreHelper.java&p2=trunk/src/model/src/org/argouml/model/CoreHelper.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/CoreHelper.java	(original)
+++ trunk/src/model/src/org/argouml/model/CoreHelper.java	2007-05-30 12:03:53-0700
@@ -158,10 +158,12 @@
 
     /**
      * Return all Interfaces of which this class is a realization.
-     *
-     * @param classifier  the class you want to have the interfaces for
+     * 
+     * @param classifier
+     *            the class you want to have the interfaces for
      * @return a collection of the Interfaces
-     * @deprecated for 0.25.2 by tfmorris - use {@link Facade#getSpecifications(Object)}
+     * @deprecated for 0.25.2 by tfmorris. Use
+     *             {@link Facade#getSpecifications(Object)}
      */
     Collection getSpecifications(Object classifier);
 
@@ -888,6 +890,9 @@
      * @param ck
      *            a {@link ChangeableKind} of Changeable, Frozen or AddOnly
      *            returned from {@link Model#getChangeableKind()}.
+     * @deprecated for 0.25.4 by tfmorris - use
+     *             {@link #setReadOnly(Object, boolean)}. NOTE: The UML 1.x
+     *             enum of AddOnly has no equivalent in UML 2.x.
      */
     void setChangeability(Object handle, Object ck);
 
@@ -900,12 +905,24 @@
      * @param handle
      *            is the feature
      * @param changeable true for Changeable and false for Frozen.
-     * @see #setChangeability(Object, Object)
-     * 
+     * @deprecated for 0.25.4 by tfmorris - use
+     *             {@link #setReadOnly(Object, boolean)} with a negated value.
      */
     void setChangeable(Object handle, boolean changeable);
 
     /**
+     * Set the isReadOnly (UML 2.x) or changeable (UML 1.x) attribute of a
+     * StructuralFeature or AssociationEnd.
+     * 
+     * @param handle
+     *            is the feature
+     * @param isReadOnly
+     *            true for ReadOnly (Frozen in UML 1.x).
+     * 
+     */
+    void setReadOnly(Object handle, boolean isReadOnly);
+    
+    /**
      * Set the child for a generalization.
      *
      * @param handle Generalization
@@ -1101,9 +1118,22 @@
      * @param scopeKind
      *            a {@link ScopeKind} of Instance or Classifier
      *            {@link Model#getScopeKind()}.
+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #setStatic}.
      */
     void setOwnerScope(Object feature, Object scopeKind);
 
+    /**
+     * Set the isStatic (UML 2.x) or ownerScope (UML 1.x) attribute of a
+     * Feature.
+     * 
+     * @param feature
+     *            Feature
+     * @param isStatic
+     *            true if static (Classifier scope in UML 1.x). False is
+     *            equivalent to the UML 1.x ScopeKind of 'Instance'.
+     * @since 0.25.4
+     */
+    void setStatic(Object feature, boolean isStatic);
 
     /**
      * Set the parameter of a TemplateParameter.
@@ -1287,6 +1317,8 @@
      * @param targetScope
      *            a {@link ScopeKind} of Instance or Classifier returned from
      *            {@link Model#getScopeKind()}.
+     * @deprecated for 0.25.4 by tfmorris.  Target Scope has been removed from 
+     * the UML 2.x spec so this should not be used.
      */
     void setTargetScope(Object handle, Object targetScope);
 

Modified: trunk/src/model/src/org/argouml/model/Facade.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/Facade.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/Facade.java&p2=trunk/src/model/src/org/argouml/model/Facade.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/Facade.java	(original)
+++ trunk/src/model/src/org/argouml/model/Facade.java	2007-05-30 12:03:53-0700
@@ -1146,19 +1146,28 @@
     boolean isActive(Object handle);
 
     /**
-     * Recognizer for StructuralFeatures and AssociationEnds that are 
+     * Recognizer for StructuralFeatures and AssociationEnds that are
      * changeable.
-     *
-     * @param handle candidate
+     * 
+     * @param handle
+     *            candidate
      * @return true if handle is changeable
+     * @deprecated for 0.25.4 by tfmorris - use {@link #isReadOnly(Object)}.
+     *             Note that isChangeable() != !isReadOnly() because UML 1.4
+     *             also has an enum point of ADD_ONLY. This has been removed in
+     *             UML 2.x.
      */
     boolean isChangeable(Object handle);
 
     /**
      * Recognizer for Attributes and Features with classifier scope.
-     *
-     * @param handle candidate
+     * 
+     * @param handle
+     *            candidate
      * @return true if handle has classifier scope.
+     * @deprecated for 0.25.4 by tfmorris - use {@link #isStatic()} which has
+     *             the same semantics, but is compatible with the UML 2.x
+     *             naming.
      */
     boolean isClassifierScope(Object handle);
 
@@ -1229,9 +1238,12 @@
 
     /**
      * Recognizer for attributes with instance scope.
-     *
-     * @param handle candidate
+     * 
+     * @param handle
+     *            candidate
      * @return true if handle has instance scope.
+     * @deprecated for 0.25.4 by tfmorris - use !{@link #isStatic(Object)}
+     *             which is compatible with the UML 2.x naming.
      */
     boolean isInstanceScope(Object handle);
 
@@ -1521,6 +1533,7 @@
      *
      * @param handle the StructuralFeature or AssociationEnd
      * @return the Changeability
+     * @deprecated for 0.25.4 by tfmorris - use {@link #isReadOnly(Object)}
      */
     Object getChangeability(Object handle);
 
@@ -2373,9 +2386,13 @@
 
     /**
      * Get the owner scope of a feature.
-     *
-     * @param handle feature
+     * 
+     * @param handle
+     *            feature
      * @return owner scope
+     * @deprecated for 0.25.4 by tfmorris. Use {@link #isStatic(Object)}. The
+     *             ScopeKind with only two enumerated values has been replaced
+     *             by a boolean in UML 2.x.
      */
     Object getOwnerScope(Object handle);
 
@@ -2751,9 +2768,12 @@
 
     /**
      * Return the target scope of a ModelElement.
-     *
-     * @param handle the model element
+     * 
+     * @param handle
+     *            the model element
      * @return Object
+     * @deprecated for 0.25.4 by tmorris. This has been removed from UML 2.x and
+     *             should no longer be used.
      */
     Object getTargetScope(Object handle);
 
@@ -2954,6 +2974,8 @@
     Object getAggregation(Object handle);
 
     /**
+     * Return the alias of an ElementImport.
+     * 
      * @param handle the ElementImport
      * @return the alias Name
      */
@@ -3201,4 +3223,28 @@
      * @return true if this ObjectFlowState is a synch state.
      */
     boolean isSynch(Object handle);
+    
+    /**
+     * Return the value of the isStatic attribute. This replaces the ScopeKind
+     * enumeration of UML 1.x and is equivalent to a ScopeKind of CLASSIFIER.
+     * 
+     * @param handle
+     *            the Feature
+     * @return true if the element is static
+     * @since 0.25.4
+     */
+    boolean isStatic(Object handle);
+    
+    /**
+     * Return the value of the isReadOnly attribute. This replaces the
+     * ChangeableKind enumeration of UML 1.x and is equivalent to a
+     * ChangeableKind of FROZEN. The UML 1.x enum of ADD_ONLY has been removed
+     * from UML 2.x.
+     * 
+     * @param handle
+     *            the StructuralFeature
+     * @return true if the element is readonly
+     * @since 0.25.4
+     */
+    boolean isReadOnly(Object handle);
 }

Modified: trunk/src/model/src/org/argouml/model/Model.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/Model.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/Model.java&p2=trunk/src/model/src/org/argouml/model/Model.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/Model.java	(original)
+++ trunk/src/model/src/org/argouml/model/Model.java	2007-05-30 12:03:53-0700
@@ -369,6 +369,8 @@
      * Getter for the ChangeableKind object.
      *
      * @return The object implementing the interface.
+     * @deprecated for 0.25.4 by tfmorris.  This enumeration has been
+     * removed from UML 2.  Use the getter for the isReadOnly attribute.
      */
     public static ChangeableKind getChangeableKind() {
         return impl.getChangeableKind();
@@ -396,6 +398,8 @@
      * Getter for the ScopeKind object.
      *
      * @return The object implementing the interface.
+     * @deprecated for 0.25.4 by tfmorris.  This has been removed from 
+     * UML 2.  Use the getter for the isStatic attribute instead.
      */
     public static ScopeKind getScopeKind() {
         return impl.getScopeKind();

Modified: trunk/src/model/src/org/argouml/model/PseudostateKind.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/PseudostateKind.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/PseudostateKind.java&p2=trunk/src/model/src/org/argouml/model/PseudostateKind.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/PseudostateKind.java	(original)
+++ trunk/src/model/src/org/argouml/model/PseudostateKind.java	2007-05-30 12:03:53-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2006 The Regents of the University of California. All
+// Copyright (c) 2005-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
@@ -25,7 +25,7 @@
 package org.argouml.model;
 
 /**
- * The different PseudostateKinds.
+ * Encapsulation of the enumeration PseudostateKind.
  */
 public interface PseudostateKind {
     /**
@@ -63,4 +63,22 @@
      * @return Returns the ShallowHistory PseudostateKind.
      */
     Object getShallowHistory();
+    
+    /**
+     * @return the EntryPoint kind.
+     * @since 0.25.4 UML 2.x only
+     */
+    public Object getEntryPoint();
+
+    /**
+     * @return the ExitPoint kind.
+     * @since 0.25.4 UML 2.x only
+     */
+    public Object getExitPoint();
+    
+    /**
+     * @return the Terminate kind.
+     * @since 0.25.4 UML 2.x only
+     */
+    public Object getTerminate();
 }

Modified: trunk/src/model/src/org/argouml/model/ScopeKind.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/ScopeKind.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/ScopeKind.java&p2=trunk/src/model/src/org/argouml/model/ScopeKind.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/ScopeKind.java	(original)
+++ trunk/src/model/src/org/argouml/model/ScopeKind.java	2007-05-30 12:03:53-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2006 The Regents of the University of California. All
+// Copyright (c) 2005-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
@@ -26,6 +26,9 @@
 
 /**
  * The different ScopeKinds.
+ * 
+ * @deprecated for 0.25.4 by tfmorris. This enumeration has been removed from
+ *             UML 2. Use the getter for the isStatic attribute.
  */
 public interface ScopeKind {
     /**

Modified: trunk/src/model/src/org/argouml/model/UndoCoreHelperDecorator.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/UndoCoreHelperDecorator.java?view=diff&rev=12728&p1=trunk/src/model/src/org/argouml/model/UndoCoreHelperDecorator.java&p2=trunk/src/model/src/org/argouml/model/UndoCoreHelperDecorator.java&r1=12727&r2=12728
==============================================================================
--- trunk/src/model/src/org/argouml/model/UndoCoreHelperDecorator.java	(original)
+++ trunk/src/model/src/org/argouml/model/UndoCoreHelperDecorator.java	2007-05-30 12:03:53-0700
@@ -35,6 +35,7 @@
  * @author Bob Tarling
  * @author Linus Tolke
  */
+@SuppressWarnings("deprecation")
 class UndoCoreHelperDecorator extends AbstractCoreHelperDecorator {
 
     /**
@@ -46,8 +47,6 @@
         super(component);
     }
 
-
-
     // Helper interfaces and methods.
     /**
      * Interface to set a boolean value.
@@ -205,7 +204,7 @@
         }, flag, Model.getFacade().isLeaf(handle));
     }
 
-
+    @Override
     public void setChangeability(final Object handle, Object ck) {
         createMemento(new ObjectSetter() {
             public void set(Object value) {
@@ -214,7 +213,7 @@
         }, ck, Model.getFacade().getChangeability(handle));
     }
 
-
+    @Override
     public void setChangeable(final Object handle, boolean flag) {
         createMemento(new BooleanSetter() {
             public void set(boolean value) {
@@ -223,6 +222,14 @@
         }, flag, Model.getFacade().isChangeable(handle));
     }
 
+    @Override
+    public void setReadOnly(final Object handle, boolean flag) {
+        createMemento(new BooleanSetter() {
+            public void set(boolean value) {
+                getComponent().setReadOnly(handle, value);
+            }
+        }, flag, Model.getFacade().isReadOnly(handle));
+    }
 
     public void setConcurrency(final Object handle, Object concurrencyKind) {
         createMemento(new ObjectSetter() {
@@ -341,6 +348,7 @@
     }
 
     
+    @Override
     public void setTargetScope(final Object handle, Object scopeKind) {
         createMemento(new ObjectSetter() {
             public void set(Object value) {
@@ -350,6 +358,7 @@
     }
 
     
+    @Override
     public void setVisibility(final Object handle, Object visibility) {
         createMemento(new ObjectSetter() {
             public void set(Object value) {
@@ -696,7 +705,11 @@
         super.setOwnerScope(handle, os);
         Model.notifyMementoCreationObserver(new DummyModelMemento());
     }
-
+    
+    public void setStatic(Object handle, boolean isStatic) {
+        super.setStatic(handle, isStatic);
+        Model.notifyMementoCreationObserver(new DummyModelMemento());
+    }
     public void setParameters(Object handle, Collection parameters) {
         super.setParameters(handle, parameters);
         Model.notifyMementoCreationObserver(new DummyModelMemento());
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.