svn commit: r13847 - trunk/src_new: META-INF org/argouml/profile org/argouml/profile/internal

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: euluis
Date: 2007-11-29 15:59:13-0800
New Revision: 13847

Modified:
   trunk/src_new/META-INF/MANIFEST.MF
   trunk/src_new/org/argouml/profile/InitProfileSubsystem.java
   trunk/src_new/org/argouml/profile/ProfileFacade.java
   trunk/src_new/org/argouml/profile/UserDefinedProfile.java
   trunk/src_new/org/argouml/profile/internal/ProfileJava.java
   trunk/src_new/org/argouml/profile/internal/ProfileManagerImpl.java
   trunk/src_new/org/argouml/profile/internal/ProfileUML.java

Log:
Issue #4885: exporting the profile subsystem; fixing checkstyle problems and when returning internal containers, return non-modifiable references.

Modified: trunk/src_new/META-INF/MANIFEST.MF
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/META-INF/MANIFEST.MF?view=diff&rev=13847&p1=trunk/src_new/META-INF/MANIFEST.MF&p2=trunk/src_new/META-INF/MANIFEST.MF&r1=13846&r2=13847
==============================================================================
--- trunk/src_new/META-INF/MANIFEST.MF	(original)
+++ trunk/src_new/META-INF/MANIFEST.MF	2007-11-29 15:59:13-0800
@@ -35,6 +35,7 @@
  org.argouml.ocl,
  org.argouml.pattern.cognitive.critics,
  org.argouml.persistence,
+ org.argouml.profile,
  org.argouml.swingext,
  org.argouml.taskmgmt,
  org.argouml.ui,

Modified: trunk/src_new/org/argouml/profile/InitProfileSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/InitProfileSubsystem.java?view=diff&rev=13847&p1=trunk/src_new/org/argouml/profile/InitProfileSubsystem.java&p2=trunk/src_new/org/argouml/profile/InitProfileSubsystem.java&r1=13846&r2=13847
==============================================================================
--- trunk/src_new/org/argouml/profile/InitProfileSubsystem.java	(original)
+++ trunk/src_new/org/argouml/profile/InitProfileSubsystem.java	2007-11-29 15:59:13-0800
@@ -36,21 +36,25 @@
  */
 public class InitProfileSubsystem implements InitSubsystem {
 
-    /*
+    /**
      * @see org.argouml.application.api.InitSubsystem#getProjectSettingsTabs()
+     * 
+     * @return the settings for this subsystem
      */
     public List<GUISettingsTabInterface> getProjectSettingsTabs() {
         return new ArrayList<GUISettingsTabInterface>();
     }
 
-    /*
+    /**
      * @see org.argouml.application.api.InitSubsystem#getSettingsTabs()
+     * 
+     * @return the settings for this subsystem
      */
     public List<GUISettingsTabInterface> getSettingsTabs() {
         return new ArrayList<GUISettingsTabInterface>();
     }
 
-    /*
+    /**
      * @see org.argouml.application.api.InitSubsystem#init()
      */
     public void init() {

Modified: trunk/src_new/org/argouml/profile/ProfileFacade.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/ProfileFacade.java?view=diff&rev=13847&p1=trunk/src_new/org/argouml/profile/ProfileFacade.java&p2=trunk/src_new/org/argouml/profile/ProfileFacade.java&r1=13846&r2=13847
==============================================================================
--- trunk/src_new/org/argouml/profile/ProfileFacade.java	(original)
+++ trunk/src_new/org/argouml/profile/ProfileFacade.java	2007-11-29 15:59:13-0800
@@ -35,14 +35,25 @@
  */
 public class ProfileFacade {
 
+    /**
+     * Register a profile in the {@link ProfileManager}.
+     * @param profile the profile to be registered
+     */
     public static void register(Profile profile) {
         getManager().registerProfile(profile);
     }
 
+    /**
+     * Remove or unregister the profile from the {@link ProfileManager}.
+     * @param profile the profile to be removed
+     */
     public static void remove(Profile profile) {
         getManager().removeProfile(profile);
     }
 
+    /**
+     * @return the profile manager
+     */
     public static ProfileManager getManager() {
         if (manager == null)
             notInitialized("manager");

Modified: trunk/src_new/org/argouml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/UserDefinedProfile.java?view=diff&rev=13847&p1=trunk/src_new/org/argouml/profile/UserDefinedProfile.java&p2=trunk/src_new/org/argouml/profile/UserDefinedProfile.java&r1=13846&r2=13847
==============================================================================
--- trunk/src_new/org/argouml/profile/UserDefinedProfile.java	(original)
+++ trunk/src_new/org/argouml/profile/UserDefinedProfile.java	2007-11-29 15:59:13-0800
@@ -78,11 +78,19 @@
     }

 

 

+    /**

+     * @return null

+     * @see org.argouml.profile.Profile#getFormatingStrategy()

+     */

     @Override

     public FormatingStrategy getFormatingStrategy() {

 	return null;

     }

 

+    /**

+     * @return null

+     * @see org.argouml.profile.Profile#getFigureStrategy()

+     */

     @Override

     public FigNodeStrategy getFigureStrategy() {

 	return null;

@@ -95,13 +103,21 @@
         return modelFile;

     }

     

+    /**

+     * @return the name of the model and the file name

+     * @see org.argouml.profile.Profile#toString()

+     */

     @Override

     public String toString() {

         return super.toString() + " [" + getModelFile() + "]";

     }

 

+    /**

+     * @return the container that contains the model

+     * @see org.argouml.profile.Profile#getProfilePackages()

+     */

     @Override

-    public Collection getProfilePackages() throws ProfileException {

+    public Collection getProfilePackages() {

         return model;

     }

 }


Modified: trunk/src_new/org/argouml/profile/internal/ProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/internal/ProfileJava.java?view=diff&rev=13847&p1=trunk/src_new/org/argouml/profile/internal/ProfileJava.java&p2=trunk/src_new/org/argouml/profile/internal/ProfileJava.java&r1=13846&r2=13847
==============================================================================
--- trunk/src_new/org/argouml/profile/internal/ProfileJava.java	(original)
+++ trunk/src_new/org/argouml/profile/internal/ProfileJava.java	2007-11-29 15:59:13-0800
@@ -1,4 +1,4 @@
-// $Id: ProfileJava.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// $Id: ProfileJava.java 13298 2007-08-12 19:40:57Z euluis $

 // Copyright (c) 1996-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

@@ -69,7 +69,7 @@
                 ProfileUML.class.getName()));

     }

 

-    /*

+    /**

      * @return "Java"

      * @see org.argouml.uml.profile.Profile#getDisplayName()

      */

@@ -77,15 +77,17 @@
 	return NAME;

     }

 

-    /*

+    /**

+     * @return the Collection containing the profile model

      * @see org.argouml.uml.profile.Profile#getProfilePackages()

      */

     @Override

-    public Collection getProfilePackages() throws ProfileException {

+    public Collection getProfilePackages() {

         return model;

     }

     

-    /*

+    /**

+     * @return the default type strategy

      * @see org.argouml.uml.profile.Profile#getDefaultTypeStrategy()

      */

     @Override


Modified: trunk/src_new/org/argouml/profile/internal/ProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/internal/ProfileManagerImpl.java?view=diff&rev=13847&p1=trunk/src_new/org/argouml/profile/internal/ProfileManagerImpl.java&p2=trunk/src_new/org/argouml/profile/internal/ProfileManagerImpl.java&r1=13846&r2=13847
==============================================================================
--- trunk/src_new/org/argouml/profile/internal/ProfileManagerImpl.java	(original)
+++ trunk/src_new/org/argouml/profile/internal/ProfileManagerImpl.java	2007-11-29 15:59:13-0800
@@ -1,4 +1,4 @@
-// $Id: ProfileManagerImpl.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// $Id: ProfileManagerImpl.java 13298 2007-11-30 19:40:57Z euluis $

 // Copyright (c) 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

@@ -26,6 +26,7 @@
 

 import java.io.File;

 import java.util.ArrayList;

+import java.util.Collections;

 import java.util.Iterator;

 import java.util.List;

 import java.util.StringTokenizer;

@@ -68,6 +69,9 @@
 

     private List<String> searchDirectories = new ArrayList<String>();

 

+    /**

+     * Constructor - includes initialization of built-in default profiles.

+     */

     public ProfileManagerImpl() {

         try {

             Profile uml = new ProfileUML();

@@ -156,11 +160,18 @@
         }

     }

 

+    /**

+     * @return the list of registered profiles

+     * @see org.argouml.profile.ProfileManager#getRegisteredProfiles()

+     */

     public List<Profile> getRegisteredProfiles() {

         return profiles;

     }

 

-

+    /**

+     * @param p a profile to be registered so that it is available to the users

+     * @see org.argouml.profile.ProfileManager#registerProfile(org.argouml.profile.Profile)

+     */

     public void registerProfile(Profile p) {        

         if (p != null && !profiles.contains(p)) {

             if (p instanceof UserDefinedProfile

@@ -175,7 +186,11 @@
         }

     }

 

-

+    /**

+     * @param p the profile to unregister - it will no longer be available for 

+     *          selection by users

+     * @see org.argouml.profile.ProfileManager#removeProfile(org.argouml.profile.Profile)

+     */

     public void removeProfile(Profile p) {

         if (p != null) {

             profiles.remove(p);

@@ -183,7 +198,11 @@
         }

     }

 

-

+    /**

+     * @param profileClass a string with the profile class name

+     * @return the profile if found, null otherwise

+     * @see org.argouml.profile.ProfileManager#getProfileForClass(java.lang.String)

+     */

     public Profile getProfileForClass(String profileClass) {

         Iterator it = profiles.iterator();

         Profile found = null;

@@ -195,11 +214,14 @@
                 break;

             }

         }

-

         return found;

     }

 

-

+    /**

+     * @param p profile to be added to the default application profiles - new 

+     *          models will reference it by default

+     * @see org.argouml.profile.ProfileManager#addToDefaultProfiles(org.argouml.profile.Profile)

+     */

     public void addToDefaultProfiles(Profile p) {

         if (p != null && profiles.contains(p) && !defaultProfiles.contains(p)) {

             defaultProfiles.add(p);

@@ -207,12 +229,18 @@
         }

     }

 

-

+    /**

+     * @return the list of default profiles

+     * @see org.argouml.profile.ProfileManager#getDefaultProfiles()

+     */

     public List<Profile> getDefaultProfiles() {

-        return defaultProfiles;

+        return Collections.unmodifiableList(defaultProfiles);

     }

 

-

+    /**

+     * @param p the profile to remove from the default profiles

+     * @see org.argouml.profile.ProfileManager#removeFromDefaultProfiles(org.argouml.profile.Profile)

+     */

     public void removeFromDefaultProfiles(Profile p) {

         if (p != null && profiles.contains(p)) {

             defaultProfiles.remove(p);

@@ -220,6 +248,11 @@
         }

     }

 

+    /**

+     * @param path a directory name where the manager will try to look for 

+     *             user defined profiles as XMI files

+     * @see org.argouml.profile.ProfileManager#addSearchPathDirectory(java.lang.String)

+     */

     public void addSearchPathDirectory(String path) {

         if (path != null && !searchDirectories.contains(path)) {

             searchDirectories.add(path);

@@ -228,11 +261,19 @@
     }

 

 

+    /**

+     * @return the list of search directories

+     * @see org.argouml.profile.ProfileManager#getSearchPathDirectories()

+     */

     public List<String> getSearchPathDirectories() {

-        return searchDirectories;

+        return Collections.unmodifiableList(searchDirectories);

     }

 

 

+    /**

+     * @param path the directory to remove

+     * @see org.argouml.profile.ProfileManager#removeSearchPathDirectory(java.lang.String)

+     */

     public void removeSearchPathDirectory(String path) {

         if (path != null) {

             searchDirectories.remove(path);

@@ -241,6 +282,9 @@
     }

 

 

+    /**

+     * @see org.argouml.profile.ProfileManager#refreshRegisteredProfiles()

+     */

     public void refreshRegisteredProfiles() {

 

         for (String dirName : searchDirectories) {

@@ -283,6 +327,10 @@
         return null;

     }

 

+    /**

+     * @return the UML profile

+     * @see org.argouml.profile.ProfileManager#getUMLProfile()

+     */

     public Profile getUMLProfile() {

         for (Profile p : getRegisteredProfiles())

             if (p.getDisplayName() != null 


Modified: trunk/src_new/org/argouml/profile/internal/ProfileUML.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/internal/ProfileUML.java?view=diff&rev=13847&p1=trunk/src_new/org/argouml/profile/internal/ProfileUML.java&p2=trunk/src_new/org/argouml/profile/internal/ProfileUML.java&r1=13846&r2=13847
==============================================================================
--- trunk/src_new/org/argouml/profile/internal/ProfileUML.java	(original)
+++ trunk/src_new/org/argouml/profile/internal/ProfileUML.java	2007-11-29 15:59:13-0800
@@ -76,7 +76,7 @@
 	return formatingStrategy;

     }

 

-    /*

+    /**

      * @return "UML 1.4"

      * @see org.argouml.uml.profile.Profile#getDisplayName()

      */

@@ -84,15 +84,17 @@
 	return NAME;

     }

 

-    /*

+    /**

+     * @return the container which contains the profile model(s).

      * @see org.argouml.uml.profile.Profile#getProfilePackages()

      */

     @Override

-    public Collection getProfilePackages() throws ProfileException {

+    public Collection getProfilePackages() {

         return model;

     }

     

-    /*

+    /**

+     * @return the type strategy

      * @see org.argouml.uml.profile.Profile#getDefaultTypeStrategy()

      */

     @Override
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.