Author: tfmorris
Date: 2007-08-03 13:05:09-0700
New Revision: 13228
Modified:
trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java
trunk/src/model/src/org/argouml/model/CoreFactory.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/MetaTypes.java
Log:
Add methods for UML 2.x PackageImport. Deprecate UML 1.x Permission methods.
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=13228&p1=trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java&p2=trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java&r1=13227&r2=13228
==============================================================================
--- trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java (original)
+++ trunk/src/model/src/org/argouml/model/AbstractCoreHelperDecorator.java 2007-08-03 13:05:09-0700
@@ -228,10 +228,18 @@
return impl.getDestination(relationship);
}
- public Collection getDependencies(Object supplierObj, Object clientObj) {
- return impl.getDependencies(supplierObj, clientObj);
+ public Collection getDependencies(Object supplier, Object client) {
+ return impl.getDependencies(supplier, client);
}
+ public Object getPackageImport(Object supplier, Object client) {
+ return impl.getPackageImport(supplier, client);
+ }
+
+ public Collection getPackageImports(Object client) {
+ return impl.getPackageImports(client);
+ }
+
public Collection getRelationships(Object source, Object dest) {
return impl.getRelationships(source, dest);
}
Modified: trunk/src/model/src/org/argouml/model/CoreFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/CoreFactory.java?view=diff&rev=13228&p1=trunk/src/model/src/org/argouml/model/CoreFactory.java&p2=trunk/src/model/src/org/argouml/model/CoreFactory.java&r1=13227&r2=13228
==============================================================================
--- trunk/src/model/src/org/argouml/model/CoreFactory.java (original)
+++ trunk/src/model/src/org/argouml/model/CoreFactory.java 2007-08-03 13:05:09-0700
@@ -509,15 +509,67 @@
Object buildDependency(Object clientObj, Object supplierObj);
/**
- * Builds a modelelement permission between two modelelements.
- *
- * @param clientObj is the client
- * @param supplierObj is the supplier
+ * Builds a Permission between two Namespaces. For backward compatibility
+ * with pre 0.25.4 versions of ArgoUML, this builds an import (a Permission
+ * with the <<import>> stereotype).
+ *
+ * @param client
+ * is the client package
+ * @param supplier
+ * is the supplier
* @return Permission
+ * @see CoreFactory#buildPackageImport(Object, Object)
+ * @deprecated for 0.25.4 by tfmorris. Use
+ * {@link #buildPackageImport(Object, Object)}.
*/
- Object buildPermission(Object clientObj, Object supplierObj);
+ @Deprecated
+ Object buildPermission(Object client, Object supplier);
/**
+ * Build an import Permission between a Namespace and a Package. All model
+ * elements in the supplier namespace will be added to the client namespace.
+ * The Permission will be placed in the client namespace.
+ * <p>
+ * UML 1.4 spec - "Import is a stereotyped permission dependency between two
+ * namespaces, denoting that the public contents of the target package are
+ * added to the namespace of the source package."
+ * <p>
+ * NOTE: For compatibility with UML 2.x, we adopt the slightly stricter
+ * requirement that the target namespace must be a Package.
+ *
+ * @param client
+ * is the client Namespace
+ * @param supplier
+ * is the supplier Package
+ * @return Permission
+ */
+ Object buildPackageImport(Object client, Object supplier);
+
+
+ /**
+ * Build an access Permission between a Namespace and a Package. All model
+ * elements in the supplier namespace will be accessible from the client
+ * namespace, but they are not added to the client namespace. The Permission
+ * will be placed in the client namespace.
+ * <p>
+ * UML 1.4 spec - "Access is a stereotyped permission dependency between two
+ * namespaces, denoting that the public contents of the target namespace are
+ * accessible to the namespace of the source package."
+ * <p>
+ * NOTE: For compatibility with UML 2.x, we adopt the slightly stricter
+ * requirement that the target namespace must be a Package. In UML 2.x, this
+ * translates to a packageImport with non-public visibility.
+ *
+ * @param client
+ * is the client Namespace
+ * @param supplier
+ * is the supplier Package
+ * @return Permission
+ */
+ Object buildPackageAccess(Object client, Object supplier);
+
+
+ /**
* Builds a generalization between a parent and a child with a given name.
*
* @param child
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=13228&p1=trunk/src/model/src/org/argouml/model/CoreHelper.java&p2=trunk/src/model/src/org/argouml/model/CoreHelper.java&r1=13227&r2=13228
==============================================================================
--- trunk/src/model/src/org/argouml/model/CoreHelper.java (original)
+++ trunk/src/model/src/org/argouml/model/CoreHelper.java 2007-08-03 13:05:09-0700
@@ -423,12 +423,34 @@
* a client ModelElement. Does not return the inverse
* relationship (dependency 'from client to supplier').<p>
*
- * @param supplierObj a MModelElement
- * @param clientObj a MModelElement
+ * @param supplier a ModelElement
+ * @param client a ModelElement
* @return Collection
*/
- Collection getDependencies(Object supplierObj, Object clientObj);
+ Collection getDependencies(Object supplier, Object client);
+
+ /**
+ * Return the packageImport (Permission with <<import>> or <<access>>
+ * stereotype in UML 1.4) between a supplier Package and
+ * a client Namespace, if any.
+ *
+ * @param supplier a Package
+ * @param client a Namespace
+ * @return the import or null
+ */
+ Object getPackageImport(Object supplier, Object client);
+
+
+ /**
+ * Return all packageImports (Permissions with <<import>> or <<access>>
+ * stereotype in UML 1.4) that this Namespace is a client of.
+ *
+ * @param client a Namespace
+ * @return Collection of imports
+ */
+ Collection getPackageImports(Object client);
+
/**
* Return all relationships between the source and destination
* ModelElement and vice versa.<p>
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=13228&p1=trunk/src/model/src/org/argouml/model/Facade.java&p2=trunk/src/model/src/org/argouml/model/Facade.java&r1=13227&r2=13228
==============================================================================
--- trunk/src/model/src/org/argouml/model/Facade.java (original)
+++ trunk/src/model/src/org/argouml/model/Facade.java 2007-08-03 13:05:09-0700
@@ -827,13 +827,27 @@
/**
* Recognizer for Permission.
- *
- * @param handle candidate
+ *
+ * @param handle
+ * candidate
* @return true if handle is an Permission
+ * @deprecated for 0.25.4 by tfmorris. Removed from UML 2.x. Use
+ * {@link #isAPackageImport()}
+ *
*/
boolean isAPermission(Object handle);
/**
+ * Recognizer for PackageImport (was Permission in UML 1.x).
+ *
+ * @param handle
+ * candidate
+ * @return true if handle is an PackageImport (or Permission in UML 1.4)
+ * @since UML 2.0
+ */
+ boolean isAPackageImport(Object handle);
+
+ /**
* Recognizer for Package.
*
* @param handle candidate
Modified: trunk/src/model/src/org/argouml/model/MetaTypes.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/MetaTypes.java?view=diff&rev=13228&p1=trunk/src/model/src/org/argouml/model/MetaTypes.java&p2=trunk/src/model/src/org/argouml/model/MetaTypes.java&r1=13227&r2=13228
==============================================================================
--- trunk/src/model/src/org/argouml/model/MetaTypes.java (original)
+++ trunk/src/model/src/org/argouml/model/MetaTypes.java 2007-08-03 13:05:09-0700
@@ -331,10 +331,18 @@
/**
* @return Returns the Permission.
+ * @deprecated for 0.25.4 by tfmorris. Removed for UML 2.x. Use
+ * {@link #getPackageImport()}.
*/
Object getPermission();
/**
+ * @return Return the PackageImport type.
+ * @since UML 2.0
+ */
+ Object getPackageImport();
+
+ /**
* @return Returns the Pseudostate.
*/
Object getPseudostate();
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.