svn commit: r14859 - branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml: i18n moduleloader profile profile/wfr profile/wfr/init

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2008-06-02 01:02:09-0700
New Revision: 14859

Added:
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRFacade.java
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRManager.java
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WellFormednessRule.java
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/init/
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/init/InitWFRSubsystem.java
Modified:
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/i18n/misc.properties
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/moduleloader/ModuleLoader2.java
   branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/UserDefinedProfile.java

Log:
working on wfrs

Modified: branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/i18n/misc.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/i18n/misc.properties?view=diff&rev=14859&p1=branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/i18n/misc.properties&p2=branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/i18n/misc.properties&r1=14858&r2=14859
==============================================================================
--- branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/i18n/misc.properties	(original)
+++ branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/i18n/misc.properties	2008-06-02 01:02:09-0700
@@ -147,6 +147,7 @@
 misc.primitive.rounded-rectangle = Rounded Rectangle
 misc.primitive.spline = Spline
 misc.primitive.text = Text
+misc.profile.unnamed = Unnamed Profile
 misc.profile.model = Profile->Model
 misc.profileconfiguration.profile = Profile Configuration->Profile
 misc.project.collaboration = Project->Collaboration

Modified: branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/moduleloader/ModuleLoader2.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/moduleloader/ModuleLoader2.java?view=diff&rev=14859&p1=branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/moduleloader/ModuleLoader2.java&p2=branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/moduleloader/ModuleLoader2.java&r1=14858&r2=14859
==============================================================================
--- branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/moduleloader/ModuleLoader2.java	(original)
+++ branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/moduleloader/ModuleLoader2.java	2008-06-02 01:02:09-0700
@@ -27,7 +27,6 @@
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
@@ -55,8 +54,6 @@
 import org.argouml.profile.ProfileException;
 import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.UserDefinedProfile;
-import org.argouml.profile.internal.ProfileManagerImpl;
-import org.argouml.ui.ProjectBrowser;
 
 /**
  * This is the module loader that loads modules implementing the
@@ -624,13 +621,18 @@
      */
     private void loadProfilesFromJarFile(JarFile jarfile, File file) {       
         Enumeration<JarEntry> entries = jarfile.entries();
-        for(JarEntry entry = entries.nextElement(); entries.hasMoreElements(); entry = entries.nextElement()) {
+        for(JarEntry entry = entries.nextElement(); 
+                entries.hasMoreElements(); 
+                    entry = entries.nextElement()) {
             if (entry.getName().toLowerCase().endsWith(".xmi")) {
                 try {
-                    UserDefinedProfile udp = new UserDefinedProfile(new URL("jar:file:"+file.getCanonicalPath()+"!/"+entry.getName()));
+                    UserDefinedProfile udp = new UserDefinedProfile(new URL(
+                            "jar:file:" + file.getCanonicalPath() + "!/"
+                                    + entry.getName()));
                     ProfileFacade.getManager().registerProfile(udp);
-                    
-                    LOG.debug("Registered Profile: " + udp.getDisplayName()+"...");
+
+                    LOG.debug("Registered Profile: " + udp.getDisplayName()
+                            + "...");
                 } catch (ProfileException e) {
                     LOG.error("Exception", e);
                 } catch (IOException e) {

Modified: branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/UserDefinedProfile.java?view=diff&rev=14859&p1=branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/UserDefinedProfile.java&p2=branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/UserDefinedProfile.java&r1=14858&r2=14859
==============================================================================
--- branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/UserDefinedProfile.java	(original)
+++ branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/UserDefinedProfile.java	2008-06-02 01:02:09-0700
@@ -39,23 +39,27 @@
 
 import javax.swing.ImageIcon;
 
+import org.argouml.i18n.Translator;
 import org.argouml.model.Model;
 
-
 /**
  * Represents a profile defined by the user
- *
+ * 
  * @author maurelio1234
  */
 public class UserDefinedProfile extends Profile {
 
     private String displayName;
+
     private File modelFile;
+
     private Collection model;
+
     private boolean fromZargo;
 
-    private UserDefinedFigNodeStrategy figNodeStrategy = new UserDefinedFigNodeStrategy();
-    
+    private UserDefinedFigNodeStrategy figNodeStrategy 
+                                    = new UserDefinedFigNodeStrategy();
+
     private class UserDefinedFigNodeStrategy implements FigNodeStrategy {
 
         private HashMap<String, Image> images = new HashMap<String, Image>();
@@ -94,7 +98,7 @@
     /**
      * The default constructor for this class
      * 
-     * @param file the file from where the model should be read  
+     * @param file the file from where the model should be read
      * @throws ProfileException if the profile could not be loaded
      */
     public UserDefinedProfile(File file) throws ProfileException {
@@ -105,25 +109,24 @@
             reference = new UserProfileReference(file.getPath());
         } catch (MalformedURLException e) {
             throw new ProfileException(
-                "Failed to create the ProfileReference.", e);
+                    "Failed to create the ProfileReference.", e);
         }
         model = new FileModelLoader().loadModel(reference);
         fromZargo = false;
         finishLoading();
     }
 
-    
     /**
-     * A constructor that takes a file name and a reader, being the reader the 
+     * A constructor that takes a file name and a reader, being the reader the
      * input method to get the profile model.
      * 
      * @param fileName name of the profile model file.
-     * @param reader a reader opened from where the profile model will be 
-     * loaded. 
-     * @throws ProfileException if something goes wrong in initializing the 
-     * profile.
+     * @param reader a reader opened from where the profile model will be
+     *            loaded.
+     * @throws ProfileException if something goes wrong in initializing the
+     *             profile.
      */
-    public UserDefinedProfile(String fileName, Reader reader) 
+    public UserDefinedProfile(String fileName, Reader reader)
         throws ProfileException {
         displayName = fileName;
         ProfileReference reference = null;
@@ -131,14 +134,13 @@
             reference = new UserProfileReference(fileName);
         } catch (MalformedURLException e) {
             throw new ProfileException(
-                "Failed to create the ProfileReference.", e);
+                    "Failed to create the ProfileReference.", e);
         }
         model = new ReaderModelLoader(reader).loadModel(reference);
         fromZargo = true;
         finishLoading();
     }
 
-
     /**
      * A constructor that reads a file from an URL
      * 
@@ -152,14 +154,13 @@
         fromZargo = false;
 
         finishLoading();
-     }
-
+    }
 
     /**
      * Reads the informations defined as TaggedValues
      */
     private void finishLoading() {
-        
+
         for (Object obj : model) {
             if (Model.getExtensionMechanismsHelper().hasStereotype(obj,
                     "profile")) {
@@ -169,40 +170,44 @@
                 if (name != null) {
                     displayName = name;
                 } else {
-                    displayName = "Untitled";
+                    displayName = Translator.localize("misc.profile.unnamed");
                 }
-                                
+
                 // load profile dependencies
-                String dep = Model.getFacade().getTaggedValueValue(obj, "Dependency");
-                StringTokenizer st = new StringTokenizer(dep, " ,;:");
-                
-                String prof = null;
-                
+                String dependencyListStr = Model.getFacade().getTaggedValueValue(obj,
+                        "Dependency");
+                StringTokenizer st = new StringTokenizer(dependencyListStr, " ,;:");
+
+                String profile = null;
+
                 do {
-                    prof = st.nextToken();
-                    if (prof != null) {
-                        this.addProfileDependency(lookForRegisteredProfile(prof));
+                    profile = st.nextToken();
+                    if (profile != null) {
+                      this.
+                        addProfileDependency(lookForRegisteredProfile(profile));
                     }
-                } while(st.hasMoreTokens());
-                
+                } while (st.hasMoreTokens());
+
             }
         }
 
         // load fig nodes
-        Collection col = Model.getExtensionMechanismsHelper().getStereotypes(model);
-        for (Object mel : col) {
-            Collection tags = Model.getFacade().getTaggedValuesCollection(mel);
-            
+        Collection allStereotypes = Model.getExtensionMechanismsHelper().getStereotypes(
+                model);
+        for (Object stereotype : allStereotypes) {
+            Collection tags = Model.getFacade().getTaggedValuesCollection(stereotype);
+
             for (Object tag : tags) {
-                if (Model.getFacade().getTag(tag).toLowerCase().equals("figure")) {
+                if (Model.getFacade().getTag(tag).toLowerCase()
+                        .equals("figure")) {
                     String value = Model.getFacade().getValueOfTag(tag);
                     File f = new File(value);
                     FigNodeDescriptor fnd = null;
                     try {
-                        fnd = loadImage(Model.getFacade().getName(mel).toString(), f);
+                        fnd = loadImage(Model.getFacade().getName(stereotype)
+                                .toString(), f);
                         figNodeStrategy.addDesrciptor(fnd);
                     } catch (IOException e) {
-                        //LOG.error("Exception", e);
                     }
                 }
             }
@@ -210,17 +215,17 @@
     }
 
     private Profile lookForRegisteredProfile(String value) {
-        ProfileManager man = ProfileFacade.getManager();
-        List<Profile> regs = man.getRegisteredProfiles();
+        ProfileManager manager = ProfileFacade.getManager();
+        List<Profile> registeredProfiles = manager.getRegisteredProfiles();
 
-        for (Profile profile : regs) {
+        for (Profile profile : registeredProfiles) {
             if (profile.getDisplayName().equalsIgnoreCase(value)) {
                 return profile;
             }
         }
         return null;
     }
-    
+
     /**
      * @return the string that should represent this profile in the GUI. An
      *         start (*) is placed on it if it comes from the currently opened
@@ -230,9 +235,9 @@
         return displayName + (fromZargo ? "*" : "");
     }
 
-
     /**
-     * Returns null.  This profile has no formatting strategy.
+     * Returns null. This profile has no formatting strategy.
+     * 
      * @return null.
      */
     @Override
@@ -241,7 +246,8 @@
     }
 
     /**
-     * Returns null.  This profile has no figure strategy.
+     * Returns null. This profile has no figure strategy.
+     * 
      * @return null.
      */
     @Override
@@ -261,7 +267,6 @@
      */
     @Override
     public String toString() {
-        // TODO: I18N
         return super.toString() + " [" + getModelFile() + "]";
     }
 
@@ -269,26 +274,26 @@
     public Collection getProfilePackages() {
         return model;
     }
-    
-    private FigNodeDescriptor loadImage(String stereotype, File f) throws IOException {
-        FigNodeDescriptor desc = new FigNodeDescriptor();
-        desc.length = (int) f.length();
-        desc.src    = f.getPath();
-        desc.stereotype = stereotype;
-        
-        BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f)); 
-        //new BufferedInputStream(this.referenceClass.getResourceAsStream(desc.src));
 
-        byte[] buf = new byte[desc.length];
+    private FigNodeDescriptor loadImage(String stereotype, File f)
+        throws IOException {
+        FigNodeDescriptor descriptor = new FigNodeDescriptor();
+        descriptor.length = (int) f.length();
+        descriptor.src = f.getPath();
+        descriptor.stereotype = stereotype;
+
+        BufferedInputStream bis = new BufferedInputStream(
+                new FileInputStream(f));
+
+        byte[] buf = new byte[descriptor.length];
         try {
             bis.read(buf);
         } catch (IOException e) {
             e.printStackTrace();
         }
-        
-        // LOG.info("IMAGE READ: " + fileName);
-        desc.img = new ImageIcon(buf).getImage();// Toolkit.getDefaultToolkit().createImage(buf);
 
-        return desc;
-    }    
+        descriptor.img = new ImageIcon(buf).getImage();
+
+        return descriptor;
+    }
 }

Added: branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRFacade.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRFacade.java?view=auto&rev=14859
==============================================================================
--- (empty file)
+++ branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRFacade.java	2008-06-02 01:02:09-0700
@@ -0,0 +1,71 @@
+// $Id: ProfileFacade.java 14666 2008-05-08 16:18:39Z tfmorris $
+// Copyright (c) 2007-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
+// 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.wfr;
+
+/**
+ * The <a href="http://en.wikipedia.org/wiki/Facade_pattern">Facade</a> of the 
+ * WFR subsystem. 
+ * It provides a simplified interface to the subsystem, and access to objects 
+ * of the subsystem when the methods it provides directly aren't enough.
+ *
+ * @author maurelio1234
+ */
+public class WFRFacade {
+
+    /**
+     * @return the WFR manager
+     */
+    public static WFRManager getManager() {
+        if (manager == null)
+            notInitialized("manager");
+        return manager;
+    }
+
+    private static void notInitialized(String string) {
+        throw new RuntimeException("ProfileFacade's " + string  
+                + " isn't initialized!");
+    }
+
+    /**
+     * @param profileManager the manager of the profiles to be used
+     */
+    public static void setManager(WFRManager profileManager) {
+        manager = profileManager;
+    }
+
+    static void reset() {
+        manager = null;
+    }
+
+    private static WFRManager manager;
+
+    /**
+     * @return true is subsystem is initialized or false otherwise
+     */
+    public static boolean isInitiated() {
+        return manager != null;
+    }
+    
+}

Added: branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRManager.java?view=auto&rev=14859
==============================================================================
--- (empty file)
+++ branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WFRManager.java	2008-06-02 01:02:09-0700
@@ -0,0 +1,41 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $
+// Copyright (c) 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
+// 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.wfr;
+
+import java.util.Collection;
+
+/**
+ * Responsible for:
+ *      Find the WFR implementations
+ *      Keep the updated list of Enabled/Disabled WFRs
+ *      Know which WFRs are interested in which model elements
+ *
+ * @author maas
+ */
+public interface WFRManager {
+
+    void setObservedModels(Collection roots);
+    
+}

Added: branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WellFormednessRule.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WellFormednessRule.java?view=auto&rev=14859
==============================================================================
--- (empty file)
+++ branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/WellFormednessRule.java	2008-06-02 01:02:09-0700
@@ -0,0 +1,144 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $
+// Copyright (c) 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
+// 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.wfr;
+
+import org.argouml.cognitive.ToDoItem;
+
+/**
+ * Represents a WellFormedneddRule (WFR) for a UML2 model
+ *
+ * @author maurelio1234
+ */
+public abstract class WellFormednessRule {
+
+    /**
+     * Enables or disables this WFR
+     */
+    public boolean enabled = true;
+        
+    /**
+     * This WFR can be automatically corrected
+     */
+    public boolean canAutomate;
+
+    /**
+     * The user allows automatic corrections
+     */
+    public boolean automateAllowed;
+    
+    /**
+     * The edition of the user model is restricted
+     */
+    public boolean blockEdition;
+ 
+    /**
+     * A description for this WFR
+     */
+    public String description;
+    
+    /**
+     * A name for this WFR
+     */
+    public String name;
+    
+    public abstract boolean  doCheck(Object reason);
+    public abstract void     doAutomate(Object reason);
+    public abstract ToDoItem doNotify();
+    public abstract boolean  isInterestedIn(Object modelElement);
+    
+    /**
+     * @return Returns the automateAllowed.
+     */
+    public boolean isAutomateAllowed() {
+        return automateAllowed;
+    }
+    /**
+     * @param automateAllowed The automateAllowed to set.
+     */
+    public void setAutomateAllowed(boolean automateAllowed) {
+        this.automateAllowed = automateAllowed;
+    }
+    /**
+     * @return Returns the blockEdition.
+     */
+    public boolean isBlockEdition() {
+        return blockEdition;
+    }
+    /**
+     * @param blockEdition The blockEdition to set.
+     */
+    public void setBlockEdition(boolean blockEdition) {
+        this.blockEdition = blockEdition;
+    }
+    /**
+     * @return Returns the canAutomate.
+     */
+    public boolean isCanAutomate() {
+        return canAutomate;
+    }
+    /**
+     * @param canAutomate The canAutomate to set.
+     */
+    public void setCanAutomate(boolean canAutomate) {
+        this.canAutomate = canAutomate;
+    }
+    /**
+     * @return Returns the description.
+     */
+    public String getDescription() {
+        return description;
+    }
+    /**
+     * @param description The description to set.
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    /**
+     * @return Returns the enabled.
+     */
+    public boolean isEnabled() {
+        return enabled;
+    }
+    /**
+     * @param enabled The enabled to set.
+     */
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+    }
+    /**
+     * @return Returns the name.
+     */
+    public String getName() {
+        return name;
+    }
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+        
+}
\ No newline at end of file

Added: branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/init/InitWFRSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/init/InitWFRSubsystem.java?view=auto&rev=14859
==============================================================================
--- (empty file)
+++ branches/gsoc2008-maurelio1234-profiles-2/src/org/argouml/profile/wfr/init/InitWFRSubsystem.java	2008-06-02 01:02:09-0700
@@ -0,0 +1,72 @@
+// $Id: InitProfileSubsystem.java 14265 2008-03-31 15:09:01Z mvw $
+// 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
+// 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.wfr.init;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+import org.argouml.application.api.AbstractArgoJPanel;
+import org.argouml.application.api.GUISettingsTabInterface;
+import org.argouml.application.api.InitSubsystem;
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
+import org.argouml.uml.wfr.WFRFacade;
+
+/**
+ * Initializer class for the WellFormednessRules (WFR) subsystem.
+ * 
+ * @author maurelio1234
+ */
+public class InitWFRSubsystem implements InitSubsystem {
+
+    /**
+     * Initialize the WFR subsystem.
+     */
+    public void init() {
+        WFRFacade.setManager(null);
+        ProjectManager.getManager().addPropertyChangeListener(new PropertyChangeListener(){
+
+            public void propertyChange(PropertyChangeEvent evt) {
+                if (evt.getPropertyName().equals(ProjectManager.CURRENT_PROJECT_PROPERTY_NAME)) {
+                    WFRFacade.getManager().setObservedModels(((Project)evt.getNewValue()).getRoots());
+                }
+            }            
+        });
+     }
+
+    public List<AbstractArgoJPanel> getDetailsTabs() {
+        return null;
+    }
+
+    public List<GUISettingsTabInterface> getProjectSettingsTabs() {
+        return null;
+    }
+
+    public List<GUISettingsTabInterface> getSettingsTabs() {
+        return null;
+    }
+
+}
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.