Author: maurelio1234
Date: 2008-08-05 10:33:53-0700
New Revision: 15512
Added:
trunk/src/argouml-app/src/org/argouml/profile/internal/ui/
- copied from r15510, /branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/profile/internal/ui/
trunk/src/argouml-app/src/org/argouml/profile/internal/ui/ProfilePropPanelFactory.java
- copied unchanged from r15510, /branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/profile/internal/ui/ProfilePropPanelFactory.java
trunk/src/argouml-app/src/org/argouml/profile/internal/ui/PropPanelCritic.java
- copied unchanged from r15510, /branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/profile/internal/ui/PropPanelCritic.java
trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionManageProfiles.java
- copied, changed from r15510, /branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/ui/explorer/ActionManageProfiles.java
trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java
- copied unchanged from r15510, /branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/ui/explorer/rules/GoProfileToCritics.java
Modified:
trunk/src/argouml-app/ (props changed)
trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java
trunk/src/argouml-app/src/org/argouml/cognitive/CompoundCritic.java
trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java
trunk/src/argouml-app/src/org/argouml/i18n/action.properties
trunk/src/argouml-app/src/org/argouml/i18n/misc.properties
trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java
trunk/src/argouml-app/src/org/argouml/profile/Profile.java
trunk/src/argouml-app/src/org/argouml/profile/ProfileManager.java
trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java
trunk/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java
trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java
trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java
trunk/src/argouml-app/src/org/argouml/profile/profiles/uml14/metaprofile.xmi
trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsDialog.java
trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java
trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java
trunk/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java
trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToModel.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAlreadyRealizes.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAttrNameConflict.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularAssocClass.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularComposition.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularInheritance.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrClassMustBeAbstract.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrConflictingComposites.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCrossNamespaceAssoc.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigClassName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigStateName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupParamName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupRoleNames.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrEmptyPackage.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrFinalSubclassed.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrForkOutgoingTransition.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalGeneralization.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceAllPublic.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceOperOnly.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidBranch.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidFork.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidForkTriggerOrGuard.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidHistory.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidInitial.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoin.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoinTriggerOrGuard.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidPseudoStateTrigger.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidSynch.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrJoinIncomingTransition.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMergeClasses.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingAttrName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingClassName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingOperName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingStateName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleAgg.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNWayAgg.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflict.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflictAC.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConfusion.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNavFromInterface.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoAssociations.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoGuard.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoIncomingTransitions.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInitialState.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInstanceVariables.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOperations.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTransitions.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTriggerOrGuard.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNodesOverlap.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNonAggDataType.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOperNameConflict.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndConflict.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndVsAttr.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrReservedName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrSubclassReference.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAssoc.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAttr.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyClasses.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyOper.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyStates.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyTransitions.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnnavigableAssoc.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessAbstract.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessInterface.java
trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUtilityViolated.java
trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java
trunk/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java
trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileJava.java
trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java
Log:
resolving issue 5029 + updating comments in critics which are WFRs to reflect their location in UML 1.4.2 documentation
Modified: trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java (original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java 2008-08-05 10:33:53-0700
@@ -31,6 +31,7 @@
import java.util.List;
import java.util.Observable;
import java.util.Observer;
+import java.util.Set;
import java.util.Vector;
import org.apache.log4j.Logger;
@@ -235,6 +236,19 @@
register(cr, (Class) clazz);
}
+ /**
+ * Register a critic in the global table of critics that have been
+ * loaded.
+ *
+ * @param cr the critic to register
+ */
+ public static void register(Critic cr) {
+ Set<Object> metas = cr.getCriticizedDesignMaterials();
+ for (Object meta : metas) {
+ register(cr, meta);
+ }
+ }
+
private static Hashtable<Class, Collection<Critic>> cachedCritics =
new Hashtable<Class, Collection<Critic>>();
Modified: trunk/src/argouml-app/src/org/argouml/cognitive/CompoundCritic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/CompoundCritic.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/cognitive/CompoundCritic.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/CompoundCritic.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/CompoundCritic.java (original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/CompoundCritic.java 2008-08-05 10:33:53-0700
@@ -25,8 +25,11 @@
package org.argouml.cognitive;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import java.util.Vector;
+
import javax.swing.Icon;
/**
@@ -295,4 +298,15 @@
throw new UnsupportedOperationException();
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedMetatypes()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ for (Critic cr : this.critics) {
+ ret.addAll(cr.getCriticizedDesignMaterials());
+ }
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java (original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/Critic.java 2008-08-05 10:33:53-0700
@@ -26,9 +26,11 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Observable;
+import java.util.Set;
import javax.swing.Icon;
@@ -1018,6 +1020,17 @@
args = h;
}
+
+ /**
+ * Get the design materials to be criticized by this critic
+ *
+ * @return the design materials
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ return ret;
+ }
+
////////////////////////////////////////////////////////////////
// design feedback
@@ -1065,6 +1078,7 @@
public void fixIt(ToDoItem item, Object arg) {
}
+
/*
* Reply a string that describes this Critic. Identical to getCriticName()
*
Modified: trunk/src/argouml-app/src/org/argouml/i18n/action.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/i18n/action.properties?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/i18n/action.properties&p2=trunk/src/argouml-app/src/org/argouml/i18n/action.properties&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/i18n/action.properties (original)
+++ trunk/src/argouml-app/src/org/argouml/i18n/action.properties 2008-08-05 10:33:53-0700
@@ -126,6 +126,7 @@
action.invert-selection = Invert Selection
action.javadocs = Javadocs
action.layout = Layout
+action.manage-profiles = Manage Profiles...
action.more-info = More Info...
action.navigate-back = Navigate Back
action.navigate-forward = Navigate Forward
Modified: trunk/src/argouml-app/src/org/argouml/i18n/misc.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/i18n/misc.properties?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/i18n/misc.properties&p2=trunk/src/argouml-app/src/org/argouml/i18n/misc.properties&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/i18n/misc.properties (original)
+++ trunk/src/argouml-app/src/org/argouml/i18n/misc.properties 2008-08-05 10:33:53-0700
@@ -147,11 +147,13 @@
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
misc.project.diagram = Project->Diagram
misc.project.model = Project->Model
+misc.project.critic = Project->Critic
misc.project.profileconfiguration = Project->Profile Configuration
misc.project.roots = Project->Root Elements
misc.project.state-machine = Project->State Machine
Modified: trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java&p2=trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java (original)
+++ trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java 2008-08-05 10:33:53-0700
@@ -41,6 +41,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.StringTokenizer;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
@@ -50,16 +51,21 @@
import org.apache.log4j.Logger;
import org.argouml.application.api.AbstractArgoJPanel;
import org.argouml.application.api.Argo;
+import org.argouml.cognitive.Critic;
import org.argouml.i18n.Translator;
+import org.argouml.profile.ProfileException;
+import org.argouml.profile.ProfileFacade;
+import org.argouml.profile.UserDefinedProfile;
/**
* This is the module loader that loads modules implementing the
- * ModuleInterface.<p>
- *
- * This is a singleton. There are convenience functions that are static
- * to access the module.<p>
- *
+ * ModuleInterface.
+ * <p>
+ * This is a singleton. There are convenience functions that are static to
+ * access the module.
+ * <p>
+ *
* @stereotype singleton
* @author Linus Tolke
* @since 0.15.4
@@ -71,16 +77,16 @@
private static final Logger LOG = Logger.getLogger(ModuleLoader2.class);
/**
- * This map contains the module loader information about the module.<p>
- *
+ * This map contains the module loader information about the module.
+ * <p>
* The keys is the list of available modules.
*/
private Map<ModuleInterface, ModuleStatus> moduleStatus;
-
+
/**
- * List of locations that we've searched and/or loaded modules
- * from. This is for information purposes only to allow it to
- * be displayed in the settings Environment tab.
+ * List of locations that we've searched and/or loaded modules from. This is
+ * for information purposes only to allow it to be displayed in the settings
+ * Environment tab.
*/
private List<String> extensionLocations = new ArrayList<String>();
@@ -108,16 +114,16 @@
* Constructor for this object.
*/
private ModuleLoader2() {
- moduleStatus = new HashMap<ModuleInterface, ModuleStatus>();
+ moduleStatus = new HashMap<ModuleInterface, ModuleStatus>();
}
/**
* Get hold of the instance of this object.
- *
+ *
* @return the instance
*/
public static ModuleLoader2 getInstance() {
- return INSTANCE;
+ return INSTANCE;
}
/**
@@ -132,45 +138,47 @@
}
if (status.isEnabled()) {
if (module instanceof DetailsTabProvider) {
- result.addAll(
- ((DetailsTabProvider) module).getDetailsTabs());
+ result.addAll(((DetailsTabProvider) module)
+ .getDetailsTabs());
}
}
}
return result;
}
+
/**
* Return a collection of all available modules.
- *
+ *
* @return A Collection of all available modules.
*/
private Collection<ModuleInterface> availableModules() {
- return Collections.unmodifiableCollection(moduleStatus.keySet());
+ return Collections.unmodifiableCollection(moduleStatus.keySet());
}
// Access methods for program infrastructure.
/**
- * Enables all selected modules and disabling all modules not selected.<p>
- *
- * In short this attempts to make the modules obey their selection.<p>
- *
+ * Enables all selected modules and disabling all modules not selected.
+ * <p>
+ * In short this attempts to make the modules obey their selection.
+ * <p>
+ *
* @param failingAllowed is <code>true</code> if enabling or disabling of
- * some of the modules is allowed to fail.
+ * some of the modules is allowed to fail.
*/
public static void doLoad(boolean failingAllowed) {
- getInstance().doInternal(failingAllowed);
+ getInstance().doInternal(failingAllowed);
}
// Access methods for modules that need to query about the status of
// other modules.
/**
* Gets the loaded status for some other module.
- *
+ *
* @return true if the module exists and is enabled.
* @param name is the module name of the queried module
*/
public static boolean isEnabled(String name) {
- return getInstance().isEnabledInternal(name);
+ return getInstance().isEnabledInternal(name);
}
// Access methods for the GUI that the user uses to enable and disable
@@ -178,82 +186,82 @@
/**
* Get a Collection with all the names.
- *
+ *
* @return all the names.
*/
public static Collection<String> allModules() {
- Collection<String> coll = new HashSet<String>();
+ Collection<String> coll = new HashSet<String>();
- for (ModuleInterface mf : getInstance().availableModules()) {
- coll.add(mf.getName());
- }
+ for (ModuleInterface mf : getInstance().availableModules()) {
+ coll.add(mf.getName());
+ }
- return coll;
+ return coll;
}
/**
* Get the selected.
- *
+ *
* @param name The name of the module.
* @return <code>true</code> if the module is selected.
*/
public static boolean isSelected(String name) {
- return getInstance().isSelectedInternal(name);
+ return getInstance().isSelectedInternal(name);
}
/**
* Get the selected.
- *
+ *
* @see #isSelected(String)
* @param name The name of the module.
* @return <code>true</code> if the module is selected.
*/
private boolean isSelectedInternal(String name) {
- Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
+ Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
- if (entry != null) {
- ModuleStatus status = entry.getValue();
+ if (entry != null) {
+ ModuleStatus status = entry.getValue();
- if (status == null) {
- return false;
- }
+ if (status == null) {
+ return false;
+ }
- return status.isSelected();
- }
- return false;
+ return status.isSelected();
+ }
+ return false;
}
/**
* Set the selected value.
- *
+ *
* @param name The name of the module.
* @param value Selected or not.
*/
public static void setSelected(String name, boolean value) {
- getInstance().setSelectedInternal(name, value);
+ getInstance().setSelectedInternal(name, value);
}
/**
* Set the selected value.
- *
+ *
* @see #setSelected(String, boolean)
* @param name The name of the module.
* @param value Selected or not.
*/
private void setSelectedInternal(String name, boolean value) {
- Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
+ Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
- if (entry != null) {
- ModuleStatus status = entry.getValue();
+ if (entry != null) {
+ ModuleStatus status = entry.getValue();
- status.setSelected(value);
- }
+ status.setSelected(value);
+ }
}
/**
- * Create a description of the module based on the information provided
- * by the module itself.
- *
+ * Create a description of the module based on the information provided by
+ * the module itself.
+ *
* @param name The name of the module.
* @return The description.
*/
@@ -262,21 +270,21 @@
}
/**
- * Create a description of the module based on the information provided
- * by the module itself.
- *
+ * Create a description of the module based on the information provided by
+ * the module itself.
+ *
* @see #getDescription(String)
* @param name The name of the module.
* @return The description.
*/
private String getDescriptionInternal(String name) {
- Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
+ Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
- if (entry == null) {
- throw new IllegalArgumentException("Module does not exist.");
- }
+ if (entry == null) {
+ throw new IllegalArgumentException("Module does not exist.");
+ }
- ModuleInterface module = entry.getKey();
+ ModuleInterface module = entry.getKey();
StringBuffer sb = new StringBuffer();
String desc = module.getInfo(ModuleInterface.DESCRIPTION);
if (desc != null) {
@@ -296,28 +304,27 @@
return sb.toString();
}
-
// Access methods for the program infrastructure
/**
* Enables all selected modules.
- *
- * @param failingAllowed is true if this is not the last attempt at
- * turning on.
+ *
+ * @param failingAllowed is true if this is not the last attempt at turning
+ * on.
*/
private void doInternal(boolean failingAllowed) {
- huntForModules();
+ huntForModules();
- boolean someModuleSucceeded;
- do {
- someModuleSucceeded = false;
+ boolean someModuleSucceeded;
+ do {
+ someModuleSucceeded = false;
- for (ModuleInterface module : getInstance().availableModules()) {
+ for (ModuleInterface module : getInstance().availableModules()) {
- ModuleStatus status = moduleStatus.get(module);
+ ModuleStatus status = moduleStatus.get(module);
- if (status == null) {
- continue;
- }
+ if (status == null) {
+ continue;
+ }
if (!status.isEnabled() && status.isSelected()) {
try {
@@ -347,68 +354,67 @@
}
} while (someModuleSucceeded);
- if (!failingAllowed) {
- // Notify the user that the modules in the list that are selected
- // but not enabled were not possible to enable and that are not
- // selected that we cannot disable.
- //
- // Currently we just log this.
- //
- // TODO: We could eventually pop up some warning window.
- //
- for (ModuleInterface module : getInstance().availableModules()) {
+ if (!failingAllowed) {
+ // Notify the user that the modules in the list that are selected
+ // but not enabled were not possible to enable and that are not
+ // selected that we cannot disable.
+ //
+ // Currently we just log this.
+ //
+ // TODO: We could eventually pop up some warning window.
+ //
+ for (ModuleInterface module : getInstance().availableModules()) {
- ModuleStatus status = moduleStatus.get(module);
+ ModuleStatus status = moduleStatus.get(module);
- if (status == null) {
- continue;
- }
+ if (status == null) {
+ continue;
+ }
- if (status.isEnabled() && status.isSelected()) {
- continue;
- }
+ if (status.isEnabled() && status.isSelected()) {
+ continue;
+ }
- if (!status.isEnabled() && !status.isSelected()) {
- continue;
- }
+ if (!status.isEnabled() && !status.isSelected()) {
+ continue;
+ }
- if (status.isSelected()) {
- LOG.warn("ModuleLoader was not able to enable module "
- + module.getName());
- } else {
- LOG.warn("ModuleLoader was not able to disable module "
- + module.getName());
- }
- }
- }
+ if (status.isSelected()) {
+ LOG.warn("ModuleLoader was not able to enable module "
+ + module.getName());
+ } else {
+ LOG.warn("ModuleLoader was not able to disable module "
+ + module.getName());
+ }
+ }
+ }
}
/**
* Gets the loaded status for some other module.
- *
+ *
* @return true if the module exists and is enabled.
* @param name is the module name of the queried module
*/
private boolean isEnabledInternal(String name) {
- Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
+ Map.Entry<ModuleInterface, ModuleStatus> entry = findModule(name);
- if (entry != null) {
- ModuleStatus status = entry.getValue();
+ if (entry != null) {
+ ModuleStatus status = entry.getValue();
- if (status == null) {
- return false;
- }
+ if (status == null) {
+ return false;
+ }
- return status.isEnabled();
- }
- return false;
+ return status.isEnabled();
+ }
+ return false;
}
-
/**
- * Return the ModuleInterface, ModuleStatus pair for the module
- * with the given name or <code>null</code> if there isn't any.
- *
+ * Return the ModuleInterface, ModuleStatus pair for the module with the
+ * given name or <code>null</code> if there isn't any.
+ *
* @param name The given name.
* @return A pair (Map.Entry).
*/
@@ -420,13 +426,14 @@
return entry;
}
}
- return null;
+ return null;
}
/**
- * Tries to find as many available modules as possible.<p>
- *
- * As the modules are found they are appended to {@link #moduleStatus}.<p>
+ * Tries to find as many available modules as possible.
+ * <p>
+ * As the modules are found they are appended to {@link #moduleStatus}.
+ * <p>
*/
private void huntForModules() {
huntForModulesFromExtensionDir();
@@ -449,75 +456,72 @@
}
}
}
-
+
/**
- * Find and enable modules from our "ext" directory and from the
- * directory specified in "argo.ext.dir".<p>
- *
- * TODO: This does a calculation of where our "ext" directory is.
- * We should eventually make sure that this calculation is
- * only present in one place in the code and not several.
+ * Find and enable modules from our "ext" directory and from the directory
+ * specified in "argo.ext.dir".
+ * <p>
+ * TODO: This does a calculation of where our "ext" directory is. We should
+ * eventually make sure that this calculation is only present in one place
+ * in the code and not several.
*/
private void huntForModulesFromExtensionDir() {
- // Use a little trick to find out where Argo is being loaded from.
+ // Use a little trick to find out where Argo is being loaded from.
String extForm = getClass().getResource(Argo.ARGOINI).toExternalForm();
- String argoRoot =
- extForm.substring(0,
- extForm.length() - Argo.ARGOINI.length());
-
- // If it's a jar, clean it up and make it look like a file url
- if (argoRoot.startsWith(JAR_PREFIX)) {
- argoRoot = argoRoot.substring(JAR_PREFIX.length());
- if (argoRoot.endsWith("!")) {
- argoRoot = argoRoot.substring(0, argoRoot.length() - 1);
- }
- }
+ String argoRoot = extForm.substring(0, extForm.length()
+ - Argo.ARGOINI.length());
+
+ // If it's a jar, clean it up and make it look like a file url
+ if (argoRoot.startsWith(JAR_PREFIX)) {
+ argoRoot = argoRoot.substring(JAR_PREFIX.length());
+ if (argoRoot.endsWith("!")) {
+ argoRoot = argoRoot.substring(0, argoRoot.length() - 1);
+ }
+ }
- String argoHome = null;
+ String argoHome = null;
- if (argoRoot != null) {
- LOG.info("argoRoot is " + argoRoot);
- if (argoRoot.startsWith(FILE_PREFIX)) {
- argoHome =
- new File(argoRoot.substring(FILE_PREFIX.length()))
- .getAbsoluteFile().getParent();
- } else {
- argoHome = new File(argoRoot).getAbsoluteFile().getParent();
- }
+ if (argoRoot != null) {
+ LOG.info("argoRoot is " + argoRoot);
+ if (argoRoot.startsWith(FILE_PREFIX)) {
+ argoHome = new File(argoRoot.substring(FILE_PREFIX.length()))
+ .getAbsoluteFile().getParent();
+ } else {
+ argoHome = new File(argoRoot).getAbsoluteFile().getParent();
+ }
- try {
- argoHome = java.net.URLDecoder.decode(argoHome,
- Argo.getEncoding());
- } catch (UnsupportedEncodingException e) {
- LOG.warn("Encoding "
- + Argo.getEncoding()
- + " is unknown.");
- }
+ try {
+ argoHome = java.net.URLDecoder.decode(argoHome, Argo
+ .getEncoding());
+ } catch (UnsupportedEncodingException e) {
+ LOG.warn("Encoding " + Argo.getEncoding() + " is unknown.");
+ }
- LOG.info("argoHome is " + argoHome);
- }
+ LOG.info("argoHome is " + argoHome);
+ }
- if (argoHome != null) {
+ if (argoHome != null) {
String extdir;
- if (argoHome.startsWith(FILE_PREFIX)) {
- extdir = argoHome.substring(FILE_PREFIX.length())
+ if (argoHome.startsWith(FILE_PREFIX)) {
+ extdir = argoHome.substring(FILE_PREFIX.length())
+ File.separator + "ext";
- } else {
- extdir = argoHome + File.separator + "ext";
- }
+ } else {
+ extdir = argoHome + File.separator + "ext";
+ }
extensionLocations.add(extdir);
- huntModulesFromNamedDirectory(extdir);
- }
+ huntModulesFromNamedDirectory(extdir);
+ }
String extdir = System.getProperty("argo.ext.dir");
- if (extdir != null) {
+ if (extdir != null) {
extensionLocations.add(extdir);
- huntModulesFromNamedDirectory(extdir);
- }
+ huntModulesFromNamedDirectory(extdir);
+ }
}
-
+
/**
* Get the list of locations that we've loaded extension modules from.
+ *
* @return A list of the paths we've loaded from.
*/
public List<String> getExtensionLocations() {
@@ -526,62 +530,58 @@
/**
* Find and enable a module from a given directory.
- *
+ *
* @param dirname The name of the directory.
*/
private void huntModulesFromNamedDirectory(String dirname) {
- File extensionDir = new File(dirname);
- if (extensionDir.isDirectory()) {
- File[] files = extensionDir.listFiles(new JarFileFilter());
- for (File file : files) {
- JarFile jarfile = null;
- // Try-catch only the JarFile instantiation so we
- // don't accidentally mask anything in ArgoJarClassLoader
- // or processJarFile.
- try {
- jarfile = new JarFile(file);
- if (jarfile != null) {
- // TODO: Should we be delegating to a different
- // classloader than the default here? - - tfm
- ClassLoader classloader =
- new URLClassLoader(new URL[] {
- file.toURI().toURL(),
- });
- try {
- processJarFile(classloader, file);
- } catch (ClassNotFoundException e) {
- LOG.error("The class is not found.", e);
- return;
- }
- }
- } catch (IOException ioe) {
- LOG.debug("Cannot open Jar file " + file, ioe);
- }
- }
- }
+ File extensionDir = new File(dirname);
+ if (extensionDir.isDirectory()) {
+ File[] files = extensionDir.listFiles(new JarFileFilter());
+ for (File file : files) {
+ JarFile jarfile = null;
+ // Try-catch only the JarFile instantiation so we
+ // don't accidentally mask anything in ArgoJarClassLoader
+ // or processJarFile.
+ try {
+ jarfile = new JarFile(file);
+ if (jarfile != null) {
+ // TODO: Should we be delegating to a different
+ // classloader than the default here? - - tfm
+ ClassLoader classloader = new URLClassLoader(
+ new URL[] {file.toURI().toURL()} );
+ try {
+ processJarFile(classloader, file);
+ } catch (ClassNotFoundException e) {
+ LOG.error("The class is not found.", e);
+ return;
+ }
+ }
+ } catch (IOException ioe) {
+ LOG.debug("Cannot open Jar file " + file, ioe);
+ }
+ }
+ }
}
/**
- * Check a jar file for an ArgoUML extension/module.<p>
- *
+ * Check a jar file for an ArgoUML extension/module.
+ * <p>
* If there isn't a manifest or it isn't readable, we fail silently.
- *
- * @param classloader The classloader to use.
- * @param file The file to process.
- * @throws ClassNotFoundException if the manifest file contains a class
- * that doesn't exist.
+ *
+ * @throws ClassNotFoundException if the manifest file contains a class that
+ * doesn't exist.
*/
private void processJarFile(ClassLoader classloader, File file)
throws ClassNotFoundException {
- LOG.info("Opening jar file " + file);
+ LOG.info("Opening jar file " + file);
JarFile jarfile;
- try {
- jarfile = new JarFile(file);
- } catch (IOException e) {
- LOG.error("Unable to open " + file, e);
+ try {
+ jarfile = new JarFile(file);
+ } catch (IOException e) {
+ LOG.error("Unable to open " + file, e);
return;
- }
+ }
Manifest manifest;
try {
@@ -593,26 +593,30 @@
LOG.error("Unable to read manifest of " + file, e);
return;
}
-
+
+ LOG.info("Reading profiles...");
+ try {
+ loadProfilesFromJarFile(jarfile.getManifest(), file, classloader);
+ } catch (IOException e) {
+ LOG.error("Unable to get MANIFEST from Jar of " + file, e);
+ }
+
boolean loadedClass = false;
if (manifest == null) {
Enumeration<JarEntry> jarEntries = jarfile.entries();
while (jarEntries.hasMoreElements()) {
JarEntry entry = jarEntries.nextElement();
- loadedClass =
- loadedClass
- | processEntry(classloader, entry.getName());
+ loadedClass = loadedClass
+ | processEntry(classloader, entry.getName());
}
} else {
Map<String, Attributes> entries = manifest.getEntries();
for (String key : entries.keySet()) {
// Look for our specification
- loadedClass =
- loadedClass
- | processEntry(classloader, key);
+ loadedClass = loadedClass | processEntry(classloader, key);
}
}
-
+
if (loadedClass) {
// Add this to search list for I18N properties
Translator.addClassLoader(classloader);
@@ -623,13 +627,124 @@
}
/**
+ * Interprets the MANIFEST file in the JAR in order to load the declared
+ * profile.
+ *
+ * @param file the file object referencing the Jar
+ * @param manifest the manifest file of the Jar
+ * @param classloader the classloader that loads the classes referenced by
+ * the Jar
+ */
+ private void loadProfilesFromJarFile(Manifest manifest, File file,
+ ClassLoader classloader) {
+ Map<String, Attributes> entries = manifest.getEntries();
+ boolean classLoaderAlreadyAdded = false;
+
+ for (String entryName : entries.keySet()) {
+ Attributes attr = entries.get(entryName);
+ if (new Boolean(attr.getValue("Profile") + "").booleanValue()) {
+ try {
+ // we only need to add the classloader once
+ // and if and only if there is at least a profile
+ // in the JAR
+ if (!classLoaderAlreadyAdded) {
+ Translator.addClassLoader(classloader);
+ classLoaderAlreadyAdded = true;
+ }
+ Set<Critic> critics = loadJavaCriticsForProfile(attr,
+ classloader);
+ String modelPath = attr.getValue("Model");
+ URL modelURL = null;
+
+ if (modelPath != null) {
+ modelURL = new URL(JAR_PREFIX + FILE_PREFIX
+ + file.getCanonicalPath() + "!" + modelPath);
+ }
+
+ UserDefinedProfile udp = new UserDefinedProfile(entryName,
+ modelURL, critics,
+ loadManifestDependenciesForProfile(attr));
+
+ ProfileFacade.getManager().registerProfile(udp);
+ LOG.debug("Registered Profile: " + udp.getDisplayName()
+ + "...");
+ } catch (ProfileException e) {
+ LOG.error("Exception", e);
+ } catch (IOException e) {
+ LOG.error("Exception", e);
+ }
+ }
+
+ }
+ }
+
+ /**
+ * Resolves the dependencies for a Profile
+ *
+ * TODO How do we deal with the non-determinism in the order of the loaded
+ * profiles? (Maybe the d depended profiles were not loaded yet)
+ *
+ * @param attr a group of attributes in the MANIFEST file for this JAR
+ *
+ * @return the set of defined profiles
+ */
+ private Set<String> loadManifestDependenciesForProfile(Attributes attr) {
+ Set<String> ret = new HashSet<String>();
+ String value = attr.getValue("Depends-on");
+ if (value != null) {
+ StringTokenizer st = new StringTokenizer(value, ",");
+
+ while (st.hasMoreElements()) {
+ String entry = st.nextToken().trim();
+ ret.add(entry);
+ }
+ }
+
+ return ret;
+ }
+
+ /**
+ * Loads the Java critics defined by a profile
+ *
+ * @param attr the Manifest section of the profile
+ * @param classloader the classloader of the Jar
+ *
+ * @return the set of defined critics
+ */
+ private Set<Critic> loadJavaCriticsForProfile(Attributes attr,
+ ClassLoader classloader) {
+ Set<Critic> ret = new HashSet<Critic>();
+
+ String value = attr.getValue("Java-Critics");
+ if (value != null) {
+ StringTokenizer st = new StringTokenizer(value, ",");
+
+ while (st.hasMoreElements()) {
+ String entry = st.nextToken().trim();
+
+ try {
+ Class cl = classloader.loadClass(entry);
+ Critic critic = (Critic) cl.newInstance();
+ ret.add(critic);
+ } catch (ClassNotFoundException e) {
+ LOG.error("Error loading class: " + entry, e);
+ } catch (InstantiationException e) {
+ LOG.error("Error instantianting class: " + entry, e);
+ } catch (IllegalAccessException e) {
+ LOG.error("Exception", e);
+ }
+ }
+ }
+
+ return ret;
+ }
+
+ /**
* Process a JAR file entry, attempting to load anything that looks like a
* Java class.
*
- * @param classloader
- * the classloader to use when loading the class
- * @param cname
- * the class name
+ * @param classloader the classloader to use when loading the class
+ * @param cname the class name
* @throws ClassNotFoundException
* @return true if class was a module class and loaded successfully
*/
@@ -646,23 +761,21 @@
/**
* Add a class from the current class loader.
- *
+ *
* @param classname The name of the class (including package).
* @throws ClassNotFoundException if the class classname is not found.
*/
- public static void addClass(String classname)
- throws ClassNotFoundException {
+ public static void addClass(String classname) throws ClassNotFoundException {
- getInstance().addClass(ModuleLoader2.class.getClassLoader(),
- classname);
+ getInstance().addClass(ModuleLoader2.class.getClassLoader(), classname);
}
/**
- * Try to load a module from the given ClassLoader.<p>
- *
+ * Try to load a module from the given ClassLoader.
+ * <p>
* Only add it as a module if it is a module (i.e. it implements the
* {@link ModuleInterface} interface.
- *
+ *
* @param classLoader The ClassLoader to load from.
* @param classname The name.
* @throws ClassNotFoundException if the class classname is not found.
@@ -689,7 +802,7 @@
LOG.error("Unexpected error while loading " + classname, e);
return false;
}
-
+
if (!ModuleInterface.class.isAssignableFrom(moduleClass)) {
LOG.debug("The class " + classname + " is not a module.");
return false;
@@ -697,16 +810,15 @@
Constructor defaultConstructor;
try {
- defaultConstructor =
- moduleClass.getDeclaredConstructor(new Class[] {});
+ defaultConstructor = moduleClass
+ .getDeclaredConstructor(new Class[] {});
} catch (SecurityException e) {
LOG.error("The default constructor for class " + classname
- + " is not accessable.",
- e);
+ + " is not accessable.", e);
return false;
} catch (NoSuchMethodException e) {
LOG.error("The default constructor for class " + classname
- + " is not found.", e);
+ + " is not found.", e);
return false;
} catch (NoClassDefFoundError e) {
LOG.error("Unable to find required class while loading "
@@ -725,7 +837,7 @@
}
Object moduleInstance;
try {
- moduleInstance = defaultConstructor.newInstance(new Object[]{});
+ moduleInstance = defaultConstructor.newInstance(new Object[] {});
} catch (IllegalArgumentException e) {
LOG.error("The constructor for class " + classname
+ " is called with incorrect argument.", e);
@@ -766,51 +878,48 @@
}
/**
- * Add a newly found module to {@link #moduleStatus}. If we already
- * know about it, don't add it.
- *
+ * Add a newly found module to {@link #moduleStatus}. If we already know
+ * about it, don't add it.
+ *
* @param mf The module to add.
*/
private void addModule(ModuleInterface mf) {
- // Since there is no way to compare the objects as equal,
- // we have to search through the list at this point.
+ // Since there is no way to compare the objects as equal,
+ // we have to search through the list at this point.
for (ModuleInterface foundMf : moduleStatus.keySet()) {
- if (foundMf.getName().equals(mf.getName())) {
- return;
- }
- }
+ if (foundMf.getName().equals(mf.getName())) {
+ return;
+ }
+ }
- // We havn't found it. Add it.
- ModuleStatus ms = new ModuleStatus();
+ // We havn't found it. Add it.
+ ModuleStatus ms = new ModuleStatus();
- // Enable it.
- // TODO: This by default selects all modules that are found.
- // Eventually we would rather obey a default either from the
- // modules themselves, from how they are found, and also
- // have information on what modules are selected from the
- // configuration.
- ms.setSelected();
+ // Enable it.
+ // TODO: This by default selects all modules that are found.
+ // Eventually we would rather obey a default either from the
+ // modules themselves, from how they are found, and also
+ // have information on what modules are selected from the
+ // configuration.
+ ms.setSelected();
- moduleStatus.put(mf, ms);
+ moduleStatus.put(mf, ms);
}
-
/**
* The file filter that selects Jar files.
*/
static class JarFileFilter implements FileFilter {
- /*
- * @see java.io.FileFilter#accept(java.io.File)
- */
- public boolean accept(File pathname) {
- return (pathname.canRead()
- && pathname.isFile()
- && pathname.getPath().toLowerCase().endsWith(".jar"));
- }
+ /*
+ * @see java.io.FileFilter#accept(java.io.File)
+ */
+ public boolean accept(File pathname) {
+ return (pathname.canRead() && pathname.isFile() && pathname
+ .getPath().toLowerCase().endsWith(".jar"));
+ }
}
}
-
/**
* Status for each of the available modules. This is created in one copy per
* available module.
@@ -828,61 +937,60 @@
/**
* Tells if the module is enabled or not.
- *
+ *
* @return true if the module is enabled.
*/
public boolean isEnabled() {
- return enabled;
+ return enabled;
}
/**
* Setter for enabled.
*/
public void setEnabled() {
- enabled = true;
+ enabled = true;
}
/**
* Setter for enabled.
*/
public void setDisabled() {
- enabled = false;
+ enabled = false;
}
/**
* Tells if the module is selected by the user or not.
- *
+ *
* @return true if it is selected.
*/
public boolean isSelected() {
- return selected;
+ return selected;
}
-
/**
* Setter for selected.
*/
public void setSelected() {
- selected = true;
+ selected = true;
}
/**
* Setter for selected.
*/
public void setUnselect() {
- selected = false;
+ selected = false;
}
/**
* Setter for selected.
- *
+ *
* @param value The value to set.
*/
public void setSelected(boolean value) {
- if (value) {
- setSelected();
- } else {
- setUnselect();
- }
+ if (value) {
+ setSelected();
+ } else {
+ setUnselect();
+ }
}
}
Modified: trunk/src/argouml-app/src/org/argouml/profile/Profile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/Profile.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/profile/Profile.java&p2=trunk/src/argouml-app/src/org/argouml/profile/Profile.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/Profile.java (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/Profile.java 2008-08-05 10:33:53-0700
@@ -28,55 +28,76 @@
import java.util.HashSet;
import java.util.Set;
+import org.argouml.cognitive.Critic;
/**
- * Abstract class representing a Profile. It contains default types and
+ * Abstract class representing a Profile. It contains default types and
* presentation characteristics that can be tailored to various modeling
* environments.
*
- * @author Marcos Aurélio
+ * @author Marcos Aur�lio
*/
public abstract class Profile {
-
- private Set<Profile> importedProfiles = new HashSet<Profile>();
- private Set<Profile> importingProfiles = new HashSet<Profile>();
-
+
+ private Set<String> dependencies = new HashSet<String>();
+
+ /**
+ * The critics provided by this profile
+ */
+ private Set<Critic> critics = new HashSet<Critic>();
+
/**
* Add a dependency on the given profile from this profile.
*
- * @param p
- * the profile
- * @throws IllegalArgumentException
- * if there is some cycle on the dependency graph
+ * @param p the profile
+ * @throws IllegalArgumentException never thrown
*/
protected final void addProfileDependency(Profile p)
throws IllegalArgumentException {
-
- if (importingProfiles.contains(p)) {
- throw new IllegalArgumentException("This profile causes a cycle "
- + "in the profile dependency graph!");
- } else {
- importedProfiles.add(p);
- importedProfiles.addAll(p.importedProfiles);
+ addProfileDependency(p.getProfileIdentifier());
+ }
- for (Profile importedProfile : importedProfiles) {
- importedProfile.importingProfiles.add(this);
- }
- }
- }
+ /**
+ * Add a dependency on the given profile from this profile.
+ *
+ * @param profileIdentifier the profile identifier
+ */
+ protected void addProfileDependency(String profileIdentifier) {
+ dependencies.add(profileIdentifier);
+ }
/**
* @return the dependencies
*/
public final Set<Profile> getDependencies() {
- return importedProfiles;
+ if (ProfileFacade.isInitiated()) {
+ Set<Profile> ret = new HashSet<Profile>();
+ for (String pid : dependencies) {
+ Profile p = ProfileFacade.getManager()
+ .lookForRegisteredProfile(pid);
+ if (p != null) {
+ ret.add(p);
+ ret.addAll(p.getDependencies());
+ }
+ }
+ return ret;
+ } else {
+ return new HashSet<Profile>();
+ }
+ }
+
+ /**
+ * @return the ids of the dependencies
+ */
+ public final Set<String> getDependenciesID() {
+ return dependencies;
}
-
+
/**
- * @return the name for this profile
+ * @return the name for this profile
*/
public abstract String getDisplayName();
-
+
/**
* @return the formating strategy offered by this profile, if any. Returns
* <code>null</code> if this profile has no formating strategy.
@@ -100,15 +121,14 @@
public DefaultTypeStrategy getDefaultTypeStrategy() {
return null;
}
-
+
/**
* @return a collection of the top level UML Packages containing the
* profile.
- * @throws ProfileException
- * if failed to get profile.
+ * @throws ProfileException if failed to get profile.
*/
public abstract Collection getProfilePackages() throws ProfileException;
-
+
/**
* @return the display name
*/
@@ -116,4 +136,25 @@
public String toString() {
return getDisplayName();
}
+
+ /**
+ * @return Returns the critics defined by this profile.
+ */
+ public Set<Critic> getCritics() {
+ return critics;
+ }
+
+ /**
+ * @return a unique identifier for this profile
+ */
+ public String getProfileIdentifier() {
+ return getDisplayName();
+ }
+
+ /**
+ * @param criticsSet The critics to set.
+ */
+ protected void setCritics(Set<Critic> criticsSet) {
+ this.critics = criticsSet;
+ }
}
Modified: trunk/src/argouml-app/src/org/argouml/profile/ProfileManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/ProfileManager.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/profile/ProfileManager.java&p2=trunk/src/argouml-app/src/org/argouml/profile/ProfileManager.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/ProfileManager.java (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/ProfileManager.java 2008-08-05 10:33:53-0700
@@ -28,7 +28,7 @@
/**
* Interface to the manager for the global set of registered profiles.
- *
+ *
* @author maurelio1234
*/
public interface ProfileManager {
@@ -37,23 +37,24 @@
* Register a new profile.
*
* @param profile A profile to be registered so that it is available to the
- * users.
+ * users.
*/
void registerProfile(Profile profile);
/**
* Remove a profile from the list of registered profiles.
+ * Only User defined profiles can be removed.
*
* @param profile the profile to unregister. It will no longer be available
- * for selection by users
+ * for selection by users
*/
void removeProfile(Profile profile);
-
+
/**
* @return the list of registered profiles
*/
List<Profile> getRegisteredProfiles();
-
+
/**
* Search for a Profile with the given Java classname.
*
@@ -61,56 +62,64 @@
* @param className the name of the Java class to search for.
*/
Profile getProfileForClass(String className);
-
+
/**
* @return the default list of profiles
*/
List<Profile> getDefaultProfiles();
-
+
/**
* Add a profile to the default list.
*
* @param profile profile to be added to the default application profiles.
- * New models will reference it by default
+ * New models will reference it by default
*/
void addToDefaultProfiles(Profile profile);
-
+
/**
* Remove a profile from the default list.
*
* @param profile the profile to be removed
*/
void removeFromDefaultProfiles(Profile profile);
-
+
/**
* Add a new directory to the directory list.
*
- * @param path a directory name where the manager will try to look for
- * user defined profiles as XMI files
+ * @param path a directory name where the manager will try to look for user
+ * defined profiles as XMI files
*/
void addSearchPathDirectory(String path);
-
+
/**
* Remove a directory from the directory list.
*
* @param path the directory path to be removed.
*/
void removeSearchPathDirectory(String path);
-
+
/**
* @return the current directory list
*/
List<String> getSearchPathDirectories();
-
+
/**
- * Look for XMI files at the current directory list and registers
- * them as user defined profiles.
+ * Look for XMI files at the current directory list and registers them as
+ * user defined profiles.
*/
void refreshRegisteredProfiles();
/**
- * @return the Profile for UML, i.e., the base UML profile as defined by
- * the standard.
+ * @return the Profile for UML, i.e., the base UML profile as defined by the
+ * standard.
*/
Profile getUMLProfile();
+
+ /**
+ * Looks for registered Profile
+ *
+ * @param profile identifier
+ * @return profile
+ */
+ Profile lookForRegisteredProfile(String profile);
}
Modified: trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java&p2=trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java 2008-08-05 10:33:53-0700
@@ -1,4 +1,4 @@
-// $Id$
+// // $Id$
// 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
@@ -24,35 +24,90 @@
package org.argouml.profile;
+import java.awt.Image;
+import java.io.BufferedInputStream;
import java.io.File;
-import java.io.Reader;
+import java.io.FileInputStream;
+import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Collection;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Set;
import java.util.StringTokenizer;
+import javax.swing.ImageIcon;
+
+import org.apache.log4j.Logger;
+import org.argouml.cognitive.Critic;
+import org.argouml.cognitive.Translator;
import org.argouml.model.Model;
/**
* Represents a profile defined by the user
- *
- * @author Marcos Aur�lio
+ *
+ * @author maurelio1234
*/
public class UserDefinedProfile extends Profile {
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = Logger
+ .getLogger(UserDefinedProfile.class);
+
private String displayName;
+
private File modelFile;
+
private Collection profilePackages;
- private boolean fromZargo;
+
+ private UserDefinedFigNodeStrategy figNodeStrategy = new UserDefinedFigNodeStrategy();
+
+ private class UserDefinedFigNodeStrategy implements FigNodeStrategy {
+
+ private HashMap<String, Image> images = new HashMap<String, Image>();
+
+ public Image getIconForStereotype(Object stereotype) {
+ return images.get(Model.getFacade().getName(stereotype));
+ }
+
+ /**
+ * Adds a new descriptor to this strategy
+ *
+ * @param fnd
+ */
+ public void addDesrciptor(FigNodeDescriptor fnd) {
+ images.put(fnd.stereotype, fnd.img);
+ }
+ }
+
+ private class FigNodeDescriptor {
+ private String stereotype;
+
+ private Image img;
+
+ private String src;
+
+ private int length;
+
+ /**
+ * @return if this descriptor ir valid
+ */
+ public boolean isValid() {
+ return stereotype != null && src != null && length > 0;
+ }
+ }
/**
* 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 {
+ LOG.info("load " + file);
displayName = file.getName();
modelFile = file;
ProfileReference reference = null;
@@ -60,58 +115,65 @@
reference = new UserProfileReference(file.getPath());
} catch (MalformedURLException e) {
throw new ProfileException(
- "Failed to create the ProfileReference.", e);
+ "Failed to create the ProfileReference.", e);
}
profilePackages = new FileModelLoader().loadModel(reference);
- fromZargo = false;
- completeLoading();
+ finishLoading();
}
-
/**
- * A constructor that takes a file name and a reader, being the reader the
- * input method to get the profile model.
+ * A constructor that reads a file from an URL
*
- * @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.
- */
- public UserDefinedProfile(String fileName, Reader reader)
- throws ProfileException {
- displayName = fileName;
+ * @param url the URL
+ * @throws ProfileException if the profile can't be read or is not valid
+ */
+ public UserDefinedProfile(URL url) throws ProfileException {
+ LOG.info("load " + url);
+
ProfileReference reference = null;
- try {
- reference = new UserProfileReference(fileName);
- } catch (MalformedURLException e) {
- throw new ProfileException(
- "Failed to create the ProfileReference.", e);
- }
- profilePackages = new ReaderModelLoader(reader).loadModel(reference);
- fromZargo = true;
-
- completeLoading();
+ reference = new UserProfileReference(url.getPath(), url);
+ profilePackages = new URLModelLoader().loadModel(reference);
+
+ finishLoading();
}
+ /**
+ * A constructor that reads a file from an URL associated with some profiles
+ *
+ * @param dn the display name of the profile
+ * @param url the URL of the profile mode
+ * @param critics the Critics defined by this profile
+ * @param dependencies the dependencies of this profile
+ * @throws ProfileException if the model cannot be loaded
+ */
+ public UserDefinedProfile(String dn, URL url, Set<Critic> critics,
+ Set<String> dependencies) throws ProfileException {
+ LOG.info("load " + url);
+
+ this.displayName = dn;
+ if (url != null) {
+ ProfileReference reference = null;
+ reference = new UserProfileReference(url.getPath(), url);
+ profilePackages = new URLModelLoader().loadModel(reference);
+ } else {
+ profilePackages = new ArrayList(0);
+ }
- // TODO: Add missing Javadoc
- public UserDefinedProfile(URL url) throws ProfileException {
- ProfileReference reference =
- new UserProfileReference(url.getPath(), url);
- profilePackages = new URLModelLoader().loadModel(reference);
- fromZargo = false;
+ this.setCritics(critics);
- completeLoading();
- }
+ for (String profileID : dependencies) {
+ addProfileDependency(profileID);
+ }
+ finishLoading();
+ }
/**
* Reads the informations defined as TaggedValues
*/
- private void completeLoading() {
-
+ private void finishLoading() {
+
for (Object obj : profilePackages) {
if (Model.getExtensionMechanismsHelper().hasStereotype(obj,
"profile")) {
@@ -120,57 +182,77 @@
String name = Model.getFacade().getName(obj);
if (name != null) {
displayName = name;
+ } else {
+ if (displayName == null) {
+ displayName = Translator
+ .localize("misc.profile.unnamed");
+ }
}
+ LOG.info("profile " + displayName);
- // TODO: Instead of a TaggedValue, why can't this just use
- // Dependencies with the <<appliedProfile>> stereotype? It
- // seems designed exactly for cases like this.
-
// load profile dependencies
- String dep = Model.getFacade().getTaggedValueValue(obj,
- "Dependency");
- StringTokenizer st = new StringTokenizer(dep, " ,;:");
+ String dependencyListStr = Model.getFacade()
+ .getTaggedValueValue(obj, "Dependency");
+ StringTokenizer st = new StringTokenizer(dependencyListStr,
+ " ,;:");
- String prof = null;
+ String profile = null;
while (st.hasMoreTokens()) {
- prof = st.nextToken();
- if (prof != null) {
- this.addProfileDependency(
- lookForRegisteredProfile(prof));
+ profile = st.nextToken();
+ if (profile != null) {
+ LOG.debug("AddingDependency " + profile);
+ this.addProfileDependency(ProfileFacade.getManager()
+ .lookForRegisteredProfile(profile));
}
}
}
}
-
- }
- private Profile lookForRegisteredProfile(String name) {
- ProfileManager man = ProfileFacade.getManager();
- List<Profile> regs = man.getRegisteredProfiles();
-
- for (Profile profile : regs) {
- if (profile.getDisplayName().equalsIgnoreCase(name)) {
- return profile;
+ // load fig nodes
+ Collection allStereotypes = Model.getExtensionMechanismsHelper()
+ .getStereotypes(profilePackages);
+ for (Object stereotype : allStereotypes) {
+ Collection tags = Model.getFacade().getTaggedValuesCollection(
+ stereotype);
+
+ for (Object tag : tags) {
+ if (Model.getFacade().getTag(tag).toLowerCase()
+ .equals("figure")) {
+ LOG.debug("AddFigNode "
+ + Model.getFacade().getName(stereotype));
+
+ String value = Model.getFacade().getValueOfTag(tag);
+ File f = new File(value);
+ FigNodeDescriptor fnd = null;
+ try {
+ fnd = loadImage(Model.getFacade().getName(stereotype)
+ .toString(), f);
+ figNodeStrategy.addDesrciptor(fnd);
+ } catch (IOException e) {
+ LOG.error("Error loading FigNode", e);
+ }
+ }
}
}
- return null;
+
+ // load critiques
+ // TODO read critics in OCL from xmi
+ Set<Critic> myCritics = this.getCritics();
+ this.setCritics(myCritics);
}
-
/**
- * @return the string that should represent this profile in the GUI. An
- * start (*) is placed on it if it comes from the currently opened
- * zargo file.
+ * @return the string that should represent this profile in the GUI.
*/
public String getDisplayName() {
- return displayName + (fromZargo ? "*" : "");
+ return displayName;
}
-
/**
- * Returns null. This profile has no formatting strategy.
+ * Returns null. This profile has no formatting strategy.
+ *
* @return null.
*/
@Override
@@ -179,12 +261,13 @@
}
/**
- * Returns null. This profile has no figure strategy.
+ * Returns null. This profile has no figure strategy.
+ *
* @return null.
*/
@Override
public FigNodeStrategy getFigureStrategy() {
- return null;
+ return figNodeStrategy;
}
/**
@@ -199,13 +282,34 @@
*/
@Override
public String toString() {
- // TODO: I18N
- return super.toString() + " [" + getModelFile() + "]";
+ File str = getModelFile();
+ return super.toString() + (str != null ? " [" + str + "]" : "");
}
-
@Override
public Collection getProfilePackages() {
return profilePackages;
}
+
+ 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();
+ }
+
+ descriptor.img = new ImageIcon(buf).getImage();
+
+ return descriptor;
+ }
}
Modified: trunk/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java&p2=trunk/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,9 @@
package org.argouml.profile.init;
import org.argouml.profile.ProfileFacade;
+import org.argouml.profile.internal.ui.ProfilePropPanelFactory;
+import org.argouml.uml.ui.PropPanelFactory;
+import org.argouml.uml.ui.PropPanelFactoryManager;
/**
* Initializer class for the Profile subsystem.
@@ -45,6 +48,10 @@
// }
ProfileFacade.setManager(
new org.argouml.profile.internal.ProfileManagerImpl());
+
+ /* Set up the property panels for critics: */
+ PropPanelFactory factory = new ProfilePropPanelFactory();
+ PropPanelFactoryManager.addPropPanelFactory(factory);
}
}
Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java 2008-08-05 10:33:53-0700
@@ -44,7 +44,7 @@
/**
* Default <code>ProfileManager</code> implementation
*
- * @author Marcos Aur�lio
+ * @author Marcos Aurelio
*/
public class ProfileManagerImpl implements ProfileManager {
@@ -325,7 +325,7 @@
if (p instanceof UserDefinedProfile) {
UserDefinedProfile udp = (UserDefinedProfile) p;
- if (udp.getModelFile().equals(file)) {
+ if (file.equals(udp.getModelFile())) {
return udp;
}
}
@@ -338,4 +338,18 @@
return profileUML;
}
+ /*
+ * @see org.argouml.profile.ProfileManager#lookForRegisteredProfile(java.lang.String)
+ */
+ public Profile lookForRegisteredProfile(String value) {
+ List<Profile> registeredProfiles = getRegisteredProfiles();
+
+ for (Profile profile : registeredProfiles) {
+ if (profile.getProfileIdentifier().equalsIgnoreCase(value)) {
+ return profile;
+ }
+ }
+ return null;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java&p2=trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java 2008-08-05 10:33:53-0700
@@ -37,19 +37,21 @@
import org.argouml.profile.ResourceModelLoader;
/**
- * Meta Profile which defines the TaggedValues to be used in User defined Profiles
- *
+ * Meta Profile which defines the TaggedValues to be used in User defined
+ * Profiles
+ *
* @author maas
*/
public class ProfileMeta extends Profile {
private static final String PROFILE_FILE = "metaprofile.xmi";
+
private Collection model;
/**
* Creates a new instance of this profile
*
- * @throws ProfileException
+ * @throws ProfileException if something goes wrong
*/
@SuppressWarnings("unchecked")
public ProfileMeta() throws ProfileException {
@@ -59,7 +61,7 @@
profileReference = new CoreProfileReference(PROFILE_FILE);
} catch (MalformedURLException e) {
throw new ProfileException(
- "Exception while creating profile reference.", e);
+ "Exception while creating profile reference.", e);
}
model = profileModelLoader.loadModel(profileReference);
@@ -69,7 +71,7 @@
}
}
-
+
@Override
public String getDisplayName() {
return "MetaProfile";
Modified: trunk/src/argouml-app/src/org/argouml/profile/profiles/uml14/metaprofile.xmi
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/profiles/uml14/metaprofile.xmi?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/profile/profiles/uml14/metaprofile.xmi&p2=trunk/src/argouml-app/src/org/argouml/profile/profiles/uml14/metaprofile.xmi&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/profiles/uml14/metaprofile.xmi (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/profiles/uml14/metaprofile.xmi 2008-08-05 10:33:53-0700
@@ -1,8 +1,8 @@
<?xml version = '1.0' encoding = 'UTF-8' ?>
-<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Sun May 25 10:34:59 CEST 2008'>
+<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Thu Jul 17 07:16:58 CEST 2008'>
<XMI.header> <XMI.documentation>
<XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
- <XMI.exporterVersion>PRE-0.25.5(6) revised on $Date: 2007-05-12 08:08:08 +0200 (sam., 12 mai 2007) $ </XMI.exporterVersion>
+ <XMI.exporterVersion>PRE-0.26.beta1(6) revised on $Date: 2007-05-12 08:08:08 +0200 (sam., 12 mai 2007) $ </XMI.exporterVersion>
</XMI.documentation>
<XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>
<XMI.content>
@@ -20,9 +20,9 @@
<UML:TagDefinition xmi.id = '127-0-1-1--3790810c:11a1f2b16a5:-8000:00000000000007C8'
name = 'Dependency' visibility = 'public' isSpecification = 'false'>
<UML:TagDefinition.multiplicity>
- <UML:Multiplicity xmi.id = '127-0-1-1--3790810c:11a1f2b16a5:-8000:00000000000007D7'>
+ <UML:Multiplicity xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:0000000000000898'>
<UML:Multiplicity.range>
- <UML:MultiplicityRange xmi.id = '127-0-1-1--3790810c:11a1f2b16a5:-8000:00000000000007D6'
+ <UML:MultiplicityRange xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:0000000000000897'
lower = '0' upper = '-1'/>
</UML:Multiplicity.range>
</UML:Multiplicity>
@@ -39,6 +39,77 @@
</UML:Multiplicity>
</UML:TagDefinition.multiplicity>
</UML:TagDefinition>
+ <UML:Stereotype xmi.id = '127-0-1-1--259518d7:11a5dd26371:-8000:00000000000008DF'
+ name = 'Critic' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
+ isAbstract = 'false'>
+ <UML:Stereotype.baseClass>Comment</UML:Stereotype.baseClass>
+ </UML:Stereotype>
+ <UML:TagDefinition xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:0000000000000899'
+ name = 'Description' isSpecification = 'false'>
+ <UML:TagDefinition.multiplicity>
+ <UML:Multiplicity xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:000000000000089A'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:000000000000089B'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:TagDefinition.multiplicity>
+ </UML:TagDefinition>
+ <UML:TagDefinition xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:000000000000089C'
+ name = 'Headline' isSpecification = 'false'>
+ <UML:TagDefinition.multiplicity>
+ <UML:Multiplicity xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:000000000000089D'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '127-0-1-1--231af496:11aa229b828:-8000:000000000000089E'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:TagDefinition.multiplicity>
+ </UML:TagDefinition>
+ <UML:TagDefinition xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008AC'
+ name = 'Priority' isSpecification = 'false'>
+ <UML:TagDefinition.multiplicity>
+ <UML:Multiplicity xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B0'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008AF'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:TagDefinition.multiplicity>
+ </UML:TagDefinition>
+ <UML:TagDefinition xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B1'
+ name = 'SupportedDecision' isSpecification = 'false'>
+ <UML:TagDefinition.multiplicity>
+ <UML:Multiplicity xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B2'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B3'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:TagDefinition.multiplicity>
+ </UML:TagDefinition>
+ <UML:TagDefinition xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B4'
+ name = 'KnowldgeType' isSpecification = 'false'>
+ <UML:TagDefinition.multiplicity>
+ <UML:Multiplicity xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B5'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B6'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:TagDefinition.multiplicity>
+ </UML:TagDefinition>
+ <UML:TagDefinition xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B7'
+ name = 'MoreInfoURL' isSpecification = 'false'>
+ <UML:TagDefinition.multiplicity>
+ <UML:Multiplicity xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B8'>
+ <UML:Multiplicity.range>
+ <UML:MultiplicityRange xmi.id = '127-0-1-1--690faa61:11b2f4ae818:-8000:00000000000008B9'
+ lower = '0' upper = '1'/>
+ </UML:Multiplicity.range>
+ </UML:Multiplicity>
+ </UML:TagDefinition.multiplicity>
+ </UML:TagDefinition>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
Modified: trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsDialog.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsDialog.java&p2=trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsDialog.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsDialog.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsDialog.java 2008-08-05 10:33:53-0700
@@ -32,6 +32,7 @@
import java.util.Iterator;
import javax.swing.JButton;
+import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingConstants;
@@ -46,7 +47,8 @@
*
* @author michiel
*/
-class ProjectSettingsDialog extends ArgoDialog implements WindowListener {
+public class ProjectSettingsDialog
+ extends ArgoDialog implements WindowListener {
private JButton applyButton;
private JButton resetToDefaultButton;
@@ -248,4 +250,18 @@
handleCancel();
}
+ /**
+ * Show the dialog with the tab as selected
+ *
+ * @param tab tab to be selected
+ */
+ public void showDialog(JPanel tab) {
+ try {
+ tabs.setSelectedComponent(tab);
+ } catch (Throwable t) {
+
+ }
+ showDialog();
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java&p2=trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java 2008-08-05 10:33:53-0700
@@ -46,6 +46,7 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.MutableComboBoxModel;
+import javax.swing.filechooser.FileFilter;
import org.argouml.application.api.GUISettingsTabInterface;
import org.argouml.i18n.Translator;
@@ -56,14 +57,13 @@
import org.argouml.profile.ProfileException;
import org.argouml.profile.ProfileFacade;
import org.argouml.profile.UserDefinedProfile;
-import org.argouml.profile.UserDefinedProfileHelper;
import org.argouml.uml.diagram.DiagramAppearance;
/**
* The Tab where new profiles can be added and the registered ones can be
* activated or deactivated on current project
*
- * @author Marcos Aur�lio
+ * @author Marcos Aurelio
*/
public class ProjectSettingsTabProfile extends JPanel implements
GUISettingsTabInterface, ActionListener {
@@ -71,6 +71,9 @@
private JButton loadFromFile = new JButton(Translator
.localize("tab.profiles.userdefined.load"));
+ private JButton unregisterProfile = new JButton(Translator
+ .localize("tab.profiles.userdefined.unload"));
+
private JButton addButton = new JButton(">>");
private JButton removeButton = new JButton("<<");
@@ -121,22 +124,22 @@
if (src == stereoField) {
Object item = e.getItem();
- DefaultComboBoxModel model = (DefaultComboBoxModel) stereoField
- .getModel();
+ DefaultComboBoxModel model =
+ (DefaultComboBoxModel) stereoField.getModel();
int idx = model.getIndexOf(item);
switch (idx) {
case 0:
- ps
- .setDefaultStereotypeView(DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL);
+ ps.setDefaultStereotypeView(
+ DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL);
break;
case 1:
- ps
- .setDefaultStereotypeView(DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON);
+ ps.setDefaultStereotypeView(
+ DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON);
break;
case 2:
- ps
- .setDefaultStereotypeView(DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON);
+ ps.setDefaultStereotypeView(
+ DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON);
break;
}
}
@@ -186,9 +189,11 @@
JPanel lffPanel = new JPanel();
lffPanel.setLayout(new FlowLayout());
+ lffPanel.add(unregisterProfile);
lffPanel.add(loadFromFile);
loadFromFile.addActionListener(this);
+ unregisterProfile.addActionListener(this);
add(lffPanel);
}
@@ -196,8 +201,8 @@
private void refreshLists() {
availableList.setModel(new DefaultComboBoxModel(getAvailableProfiles()
.toArray()));
- usedList
- .setModel(new DefaultComboBoxModel(getUsedProfiles().toArray()));
+ usedList.setModel(
+ new DefaultComboBoxModel(getUsedProfiles().toArray()));
}
private List<Profile> getUsedProfiles() {
@@ -223,10 +228,10 @@
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent arg0) {
- MutableComboBoxModel modelAvailable = ((MutableComboBoxModel) availableList
- .getModel());
- MutableComboBoxModel modelUsed = ((MutableComboBoxModel) usedList
- .getModel());
+ MutableComboBoxModel modelAvailable =
+ ((MutableComboBoxModel) availableList.getModel());
+ MutableComboBoxModel modelUsed =
+ ((MutableComboBoxModel) usedList.getModel());
if (arg0.getSource() == addButton) {
if (availableList.getSelectedIndex() != -1) {
@@ -245,72 +250,91 @@
Profile selected = (Profile) modelUsed.getElementAt(usedList
.getSelectedIndex());
- if (selected == ProfileFacade.getManager().getUMLProfile()) {
- JOptionPane.showMessageDialog(this, Translator
- .localize("tab.profiles.cantremoveuml"));
- } else {
- List<Profile> dependents = getActiveDependents(selected);
- boolean remove = true;
+ List<Profile> dependents = getActiveDependents(selected);
+ boolean remove = true;
+
+ if (!dependents.isEmpty()) {
+ String message = Translator.localize(
+ "tab.profiles.confirmdeletewithdependencies",
+ new Object[] {dependents});
+ String title = Translator.localize(
+ "tab.profiles.confirmdeletewithdependencies.title");
+ remove = (JOptionPane.showConfirmDialog(
+ this, message, title, JOptionPane.YES_NO_OPTION)
+ == JOptionPane.YES_OPTION);
+ }
- if (!dependents.isEmpty()) {
- String message = Translator.localize(
- "tab.profiles.confirmdeletewithdependencies",
- new Object[] { dependents });
- String title = Translator
- .localize("tab.profiles.confirmdeletewithdependencies.title");
- remove = (JOptionPane.showConfirmDialog(this, message,
- title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);
+ if (remove) {
+ if (!ProfileFacade.getManager().getRegisteredProfiles()
+ .contains(selected)
+ && !ProfileFacade.getManager().getDefaultProfiles()
+ .contains(selected)) {
+ remove = (JOptionPane
+ .showConfirmDialog(
+ this,
+ Translator.localize(
+ "tab.profiles.confirmdeleteunregistered"),
+ Translator.localize(
+ "tab.profiles.confirmdeleteunregistered.title"),
+ JOptionPane.YES_NO_OPTION)
+ == JOptionPane.YES_OPTION);
}
if (remove) {
- if (!ProfileFacade.getManager().getRegisteredProfiles()
- .contains(selected)
- && !ProfileFacade.getManager()
- .getDefaultProfiles()
- .contains(selected)) {
- remove = (JOptionPane
- .showConfirmDialog(
- this,
- Translator
- .localize("tab.profiles.confirmdeleteunregistered"),
- Translator
- .localize("tab.profiles.confirmdeleteunregistered.title"),
- JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);
- }
+ modelUsed.removeElement(selected);
+ modelAvailable.addElement(selected);
- if (remove) {
- modelUsed.removeElement(selected);
- modelAvailable.addElement(selected);
-
- for (Profile profile : dependents) {
- modelUsed.removeElement(profile);
- modelAvailable.addElement(profile);
- }
+ for (Profile profile : dependents) {
+ modelUsed.removeElement(profile);
+ modelAvailable.addElement(profile);
}
}
}
}
+ } else if (arg0.getSource() == unregisterProfile) {
+ if (availableList.getSelectedIndex() != -1) {
+ Profile selected = (Profile) modelAvailable
+ .getElementAt(availableList.getSelectedIndex());
+ if (selected instanceof UserDefinedProfile) {
+ ProfileFacade.getManager().removeProfile(selected);
+ modelAvailable.removeElement(selected);
+ } else {
+ JOptionPane.showMessageDialog(this, Translator
+ .localize("tab.profiles.cannotdelete"));
+ }
+ }
} else if (arg0.getSource() == loadFromFile) {
- JFileChooser fileChooser =
- UserDefinedProfileHelper.createUserDefinedProfileFileChooser();
+ JFileChooser fileChooser = new JFileChooser();
+ fileChooser.setFileFilter(new FileFilter() {
+
+ public boolean accept(File file) {
+ return file.isDirectory()
+ || (file.isFile() && (file.getName().endsWith(
+ ".xmi")
+ || file.getName().endsWith(".xml")
+ || file.getName().toLowerCase().endsWith(
+ ".xmi.zip")
+ || file.getName().toLowerCase().endsWith(".xml.zip")));
+ }
+
+ public String getDescription() {
+ return "*.xmi *.xml *.xmi.zip *.xml.zip";
+ }
+
+ });
+
int ret = fileChooser.showOpenDialog(this);
- List<File> files = null;
if (ret == JFileChooser.APPROVE_OPTION) {
- files = UserDefinedProfileHelper.getFileList(
- fileChooser.getSelectedFiles());
- }
- if (files != null && files.size() > 0) {
- for (File file : files) {
- try {
- UserDefinedProfile profile =
- new UserDefinedProfile(file);
- ProfileFacade.getManager().registerProfile(profile);
- modelAvailable.addElement(profile);
- } catch (ProfileException e) {
- JOptionPane.showMessageDialog(this, Translator
- .localize("tab.profiles.userdefined.errorloading")
- + ": " + file.getAbsolutePath());
- }
+ File file = fileChooser.getSelectedFile();
+
+ try {
+ UserDefinedProfile profile = new UserDefinedProfile(file);
+ ProfileFacade.getManager().registerProfile(profile);
+
+ modelAvailable.addElement(profile);
+ } catch (ProfileException e) {
+ JOptionPane.showMessageDialog(this, Translator
+ .localize("tab.profiles.userdefined.errorloading"));
}
}
}
@@ -425,4 +449,5 @@
}
}
+
}
Copied: trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionManageProfiles.java (from r15510, /branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/ui/explorer/ActionManageProfiles.java)
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionManageProfiles.java?view=diff&rev=15512&p1=/branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/ui/explorer/ActionManageProfiles.java&p2=trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionManageProfiles.java&r1=15510&r2=15512
==============================================================================
--- /branches/gsoc2008/work_issue5029_maurelio1234/src/org/argouml/ui/explorer/ActionManageProfiles.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionManageProfiles.java 2008-08-05 10:33:53-0700
@@ -37,6 +37,11 @@
import org.argouml.ui.ProjectSettingsDialog;
import org.argouml.ui.ProjectSettingsTabProfile;
+/**
+ * Action for opening Project->Properties->Profiles from ExplorerPopup
+ *
+ * @author maurelio1234
+ */
public class ActionManageProfiles extends AbstractAction {
/**
@@ -56,7 +61,7 @@
Translator.localize("action.manage-profiles"));
}
- /**
+ /*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
Modified: trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java&p2=trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java 2008-08-05 10:33:53-0700
@@ -40,6 +40,7 @@
import javax.swing.JPopupMenu;
import org.apache.log4j.Logger;
+import org.argouml.cognitive.Critic;
import org.argouml.i18n.Translator;
import org.argouml.kernel.ProfileConfiguration;
import org.argouml.kernel.Project;
@@ -188,11 +189,20 @@
initMenuCreateDiagrams();
this.add(createDiagrams);
}
-
- if (!multiSelect && selectedItem instanceof Profile) {
- this.add(new ActionExportProfileXMI((Profile) selectedItem));
+
+ try {
+ if (!multiSelect && selectedItem instanceof Profile
+ && !((Profile) selectedItem).getProfilePackages().isEmpty()) {
+ this.add(new ActionExportProfileXMI((Profile) selectedItem));
+ }
+ } catch (Exception e) {
+
}
-
+
+ if (!multiSelect && selectedItem instanceof ProfileConfiguration) {
+ this.add(new ActionManageProfiles());
+ }
+
if (modelElementsOnly) {
initMenuCreateModelElements();
}
@@ -763,7 +773,8 @@
Object selectedItem) {
boolean found = selectedItem instanceof ProfileConfiguration
|| selectedItem instanceof Profile
- || selectedItem instanceof ArgoDiagram;
+ || selectedItem instanceof ArgoDiagram
+ || selectedItem instanceof Critic;
/* The next statement fixes an exception
* when right-clicking on e.g. an AssociationsNode
Modified: trunk/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java&p2=trunk/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java 2008-08-05 10:33:53-0700
@@ -77,6 +77,7 @@
import org.argouml.ui.explorer.rules.GoPackageToClass;
import org.argouml.ui.explorer.rules.GoPackageToElementImport;
import org.argouml.ui.explorer.rules.GoProfileConfigurationToProfile;
+import org.argouml.ui.explorer.rules.GoProfileToCritics;
import org.argouml.ui.explorer.rules.GoProfileToModel;
import org.argouml.ui.explorer.rules.GoProjectToCollaboration;
import org.argouml.ui.explorer.rules.GoProjectToDiagram;
@@ -332,6 +333,7 @@
classPerspective.addRule(new GoProjectToProfileConfiguration());
classPerspective.addRule(new GoProfileConfigurationToProfile());
classPerspective.addRule(new GoProfileToModel());
+ classPerspective.addRule(new GoProfileToCritics());
classPerspective.addRule(new GoProjectToRoots());
classPerspective.addRule(new GoNamespaceToClassifierAndPackage());
classPerspective.addRule(new GoNamespaceToDiagram());
@@ -350,6 +352,7 @@
packagePerspective.addRule(new GoProjectToProfileConfiguration());
packagePerspective.addRule(new GoProfileConfigurationToProfile());
packagePerspective.addRule(new GoProfileToModel());
+ packagePerspective.addRule(new GoProfileToCritics());
packagePerspective.addRule(new GoProjectToRoots());
packagePerspective.addRule(new GoNamespaceToOwnedElements());
packagePerspective.addRule(new GoPackageToElementImport());
@@ -398,6 +401,7 @@
diagramPerspective.addRule(new GoProjectToProfileConfiguration());
diagramPerspective.addRule(new GoProfileConfigurationToProfile());
diagramPerspective.addRule(new GoProfileToModel());
+ diagramPerspective.addRule(new GoProfileToCritics());
diagramPerspective.addRule(new GoModelToDiagrams());
diagramPerspective.addRule(new GoDiagramToNode());
diagramPerspective.addRule(new GoDiagramToEdge());
@@ -412,6 +416,7 @@
inheritancePerspective.addRule(new GoProjectToProfileConfiguration());
classPerspective.addRule(new GoProfileConfigurationToProfile());
classPerspective.addRule(new GoProfileToModel());
+ classPerspective.addRule(new GoProfileToCritics());
inheritancePerspective.addRule(new GoModelToBaseElements());
inheritancePerspective
.addRule(new GoGeneralizableElementToSpecialized());
@@ -423,6 +428,7 @@
associationsPerspective.addRule(new GoProjectToProfileConfiguration());
associationsPerspective.addRule(new GoProfileConfigurationToProfile());
associationsPerspective.addRule(new GoProfileToModel());
+ associationsPerspective.addRule(new GoProfileToCritics());
associationsPerspective.addRule(new GoNamespaceToDiagram());
associationsPerspective.addRule(new GoPackageToClass());
associationsPerspective.addRule(new GoClassToAssociatedClass());
@@ -434,6 +440,7 @@
residencePerspective.addRule(new GoProjectToProfileConfiguration());
residencePerspective.addRule(new GoProfileConfigurationToProfile());
residencePerspective.addRule(new GoProfileToModel());
+ residencePerspective.addRule(new GoProfileToCritics());
residencePerspective.addRule(new GoModelToNode());
residencePerspective.addRule(new GoNodeToResidentComponent());
residencePerspective.addRule(new GoComponentToResidentModelElement());
@@ -468,6 +475,7 @@
compositionPerspective.addRule(new GoProjectToProfileConfiguration());
compositionPerspective.addRule(new GoProfileConfigurationToProfile());
compositionPerspective.addRule(new GoProfileToModel());
+ compositionPerspective.addRule(new GoProfileToCritics());
compositionPerspective.addRule(new GoProjectToRoots());
compositionPerspective.addRule(new GoModelElementToContents());
compositionPerspective.addRule(new GoModelElementToContainedDiagrams());
@@ -533,6 +541,7 @@
new GoProjectToProfileConfiguration(),
new GoProfileConfigurationToProfile(),
new GoProfileToModel(),
+ new GoProfileToCritics(),
new GoProjectToRoots(),
new GoSignalToReception(), new GoStateMachineToTop(),
new GoStatemachineToDiagram(), new GoStateMachineToState(),
Modified: trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToModel.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToModel.java&p2=trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToModel.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToModel.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/explorer/rules/GoProfileToModel.java 2008-08-05 10:33:53-0700
@@ -33,7 +33,7 @@
import org.argouml.profile.ProfileException;
/**
- * Rule for Project->Profile.
+ * Rule for Profile->Model.
*
*/
public class GoProfileToModel extends AbstractPerspectiveRule {
@@ -51,7 +51,8 @@
public Collection getChildren(Object parent) {
if (parent instanceof Profile) {
try {
- return ((Profile) parent).getProfilePackages();
+ Collection col = ((Profile) parent).getProfilePackages();
+ return col;
} catch (ProfileException e) {
return Collections.EMPTY_SET;
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAlreadyRealizes.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAlreadyRealizes.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAlreadyRealizes.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAlreadyRealizes.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAlreadyRealizes.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAlreadyRealizes.java 2008-08-05 10:33:53-0700
@@ -70,6 +70,15 @@
return problem;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedMetatypes()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAssocNameConflict.java 2008-08-05 10:33:53-0700
@@ -41,6 +41,9 @@
* Well-formedness rule [2] for Namespace. See section 2.5.3.26 of
* UML 1.4 spec. Rule [1] is checked by CrNameConfusion.
*
+ * Well-formedness rule [1] for Namespace. See page 62 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author mkl
*/
public class CrAssocNameConflict extends CrUML {
@@ -147,4 +150,14 @@
}
return list;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getNamespace());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAttrNameConflict.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAttrNameConflict.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAttrNameConflict.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAttrNameConflict.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAttrNameConflict.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrAttrNameConflict.java 2008-08-05 10:33:53-0700
@@ -26,7 +26,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import javax.swing.Icon;
@@ -41,7 +43,8 @@
* Check the:
* Well-formedness rule [2] for Classifier.
* See page 29 of UML 1.1, Semantics. OMG document ad/97-08-04.
- * See page 2-49 in UML V1.3<p>
+ * See page 2-49 in UML V1.3
+ * See page 55 in UMl 1.4.2 formal/04-07-02<p>
*
* In the process of modifying this to use the new Facade object
* (Jan 2003) this was changed to no longer detect StructuralFeatures
@@ -104,5 +107,14 @@
return ClAttributeCompartment.getTheInstance();
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getClassifier());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularAssocClass.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularAssocClass.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularAssocClass.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularAssocClass.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularAssocClass.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularAssocClass.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -76,7 +78,15 @@
return NO_PROBLEM;
}
-
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularComposition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularComposition.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularComposition.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularComposition.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularComposition.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularComposition.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.log4j.Logger;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -119,4 +122,13 @@
return WizBreakCircularComp.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularInheritance.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularInheritance.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularInheritance.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularInheritance.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularInheritance.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCircularInheritance.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.log4j.Logger;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -34,6 +37,9 @@
/**
* Well-formedness rule [2] for GeneralizableElement. See page 31 of UML 1.1
* Semantics. OMG document ad/97-08-04.
+ *
+ * Well-formedness rule [3] for GeneralizableElement. See page 59 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
*
* @author jrobbins
*/
@@ -73,5 +79,14 @@
return problem;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getGeneralizableElement());
+ return ret;
+ }
+
} /* end class CrCircularInheritance */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrClassMustBeAbstract.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrClassMustBeAbstract.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrClassMustBeAbstract.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrClassMustBeAbstract.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrClassMustBeAbstract.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrClassMustBeAbstract.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -71,6 +73,16 @@
return NO_PROBLEM;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrConflictingComposites.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrConflictingComposites.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrConflictingComposites.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrConflictingComposites.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrConflictingComposites.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrConflictingComposites.java 2008-08-05 10:33:53-0700
@@ -35,6 +35,9 @@
/**
* Well-formedness rule [2] for association end. See page 28 of UML 1.1
* Semantics. OMG document ad/97-08-04.
+ *
+ * Well-formedness rule [2] for AssociationEnd. See page 53 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
*
* @author jrobbins
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCrossNamespaceAssoc.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCrossNamespaceAssoc.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCrossNamespaceAssoc.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCrossNamespaceAssoc.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCrossNamespaceAssoc.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrCrossNamespaceAssoc.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -38,6 +40,9 @@
* This is the fourth well-formedness rule for associations in the UML 1.3
* standard (see section 2.5.3 of the standard).<p>
*
+ * Well-formedness rule [4] for Association. See page 52 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* See the ArgoUML User Manual: Classifier not in Namespace of its Association
*
* @author Jason Robbins
@@ -100,4 +105,14 @@
// If we drop out there is no problem
return NO_PROBLEM;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
+
} /* end class CrCrossNamespaceAssoc */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigClassName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigClassName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigClassName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigClassName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigClassName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigClassName.java 2008-08-05 10:33:53-0700
@@ -38,7 +38,7 @@
/**
* Well-formedness rule for Package. Check that the alias for an imported
- * element doesn't conflict with any existing name. Section 2.14.3.3 of UML 1.4
+ * element doesn't conflict with any existing name. Section 4.14.3.3 of UML 1.4
* spec.
* <p>
* Other types of name conflicts in a Namespace are checked by
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigStateName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigStateName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigStateName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigStateName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigStateName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDisambigStateName.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import javax.swing.Icon;
@@ -112,6 +114,15 @@
return ClClassName.getTheInstance();
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getState());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupParamName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupParamName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupParamName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupParamName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupParamName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupParamName.java 2008-08-05 10:33:53-0700
@@ -26,7 +26,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -36,6 +38,9 @@
/**
* Well-formedness rule [1] for BehavioralFeature. See page 28 of UML 1.1
* Semantics. OMG document ad/97-08-04.
+ *
+ * Well-formedness rule [1] for Behavioral. See page 53 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
*
* @author jrobbins
*/
@@ -82,4 +87,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getOperation());
+ return ret;
+ }
+
}
\ No newline at end of file
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupRoleNames.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupRoleNames.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupRoleNames.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupRoleNames.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupRoleNames.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrDupRoleNames.java 2008-08-05 10:33:53-0700
@@ -26,7 +26,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -42,6 +44,9 @@
* This is the first well-formedness rule for associations in the UML 1.3
* standard (see section 2.5.3 of the standard).<p>
*
+ * Well-formedness rule [1] for Association. See page 51 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* See ArgoUML User Manual: Duplicate end (role) names for <association>
*
* @author Jason Robbins
@@ -143,5 +148,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrEmptyPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrEmptyPackage.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrEmptyPackage.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrEmptyPackage.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrEmptyPackage.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrEmptyPackage.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.apache.log4j.Logger;
import org.argouml.cognitive.Designer;
@@ -69,5 +71,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPackage());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrFinalSubclassed.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrFinalSubclassed.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrFinalSubclassed.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrFinalSubclassed.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrFinalSubclassed.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrFinalSubclassed.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -34,9 +36,13 @@
/**
* Well-formedness rule [2] for GeneralizableElement. See page 31 of UML 1.1
* Semantics. OMG document ad/97-08-04.
+ *
* In UML 1.3 it is rule [2] in section 2.5.3.18 page 2-54.
* Remove final keyword or remove subclasses
*
+ * Well-formedness rule [2] for GeneralizableElement. See page 59 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
public class CrFinalSubclassed extends CrUML {
@@ -69,5 +75,15 @@
return specs.hasNext() ? PROBLEM_FOUND : NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getClassifier());
+ ret.add(Model.getMetaTypes().getInterface());
+ return ret;
+ }
+
} /* end class CrFinalSubclassed */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrForkOutgoingTransition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrForkOutgoingTransition.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrForkOutgoingTransition.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrForkOutgoingTransition.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrForkOutgoingTransition.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrForkOutgoingTransition.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
@@ -31,6 +34,9 @@
/**
* UML 1.5 Well-formedness rule [3] for Transition.
*
+ * Well-formedness rule [3] for Transition. See page 140 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrForkOutgoingTransition extends CrUML {
@@ -62,4 +68,13 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getTransition());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalGeneralization.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalGeneralization.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalGeneralization.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalGeneralization.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalGeneralization.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalGeneralization.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
@@ -31,6 +34,10 @@
/**
* Well-formedness rule [1] for Generalization. See page 32 of UML 1.1
* Semantics. OMG document ad/97-08-04.
+ *
+ * Well-formedness rule [5] for GeneralizableElement. See page 59 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* This critic checks that the parent and child in a generalization are
* of the same metatype.
*
@@ -71,4 +78,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getGeneralizableElement());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrIllegalName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.swing.Icon;
import org.argouml.cognitive.Designer;
@@ -81,4 +84,18 @@
return ClClassName.getTheInstance();
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ ret.add(Model.getMetaTypes().getInterface());
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ ret.add(Model.getMetaTypes().getOperation());
+ ret.add(Model.getMetaTypes().getParameter());
+ ret.add(Model.getMetaTypes().getState());
+ return ret;
+ }
+
} /* end class CrIllegalName */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceAllPublic.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceAllPublic.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceAllPublic.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceAllPublic.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceAllPublic.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceAllPublic.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -35,6 +37,9 @@
/**
* Well-formedness rule [3] for Interface. See page 32 of UML 1.1
*
+ * Well-formedness rule [3] for Interface. See page 60 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
* Semantics. OMG document ad/97-08-04.
*/
@@ -77,4 +82,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getInterface());
+ return ret;
+ }
+
} /* end class CrInterfaceAllPublic */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceOperOnly.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceOperOnly.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceOperOnly.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceOperOnly.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceOperOnly.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInterfaceOperOnly.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -36,6 +38,9 @@
* Well-formedness rule [1] for Interface. See page 32 of UML 1.1
* Semantics. OMG document ad/97-08-04.
*
+ * Well-formedness rule [2] for GeneralizableElement. See page 60 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
public class CrInterfaceOperOnly extends CrUML {
@@ -66,4 +71,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getInterface());
+ return ret;
+ }
+
} /* end class CrInterfaceOperOnly */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidBranch.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidBranch.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidBranch.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidBranch.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidBranch.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidBranch.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -46,6 +48,9 @@
* (self.kind = #choice) implies
* ((self.incoming->size >= 1) and (self.outgoing->size >= 1))
*
+ * Well-formedness rule [7] and [8] for PseudoState. See page 138 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
public class CrInvalidBranch extends CrUML {
@@ -87,5 +92,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidFork.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidFork.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidFork.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidFork.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidFork.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidFork.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -35,6 +37,9 @@
* transitions. Implements constraint [5] on Pseudostate in the UML
* Semantics v1.1, pp. 104.
*
+ * Well-formedness rule [5] for PseudoState. See page 137 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
public class CrInvalidFork extends CrUML {
@@ -75,5 +80,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidForkTriggerOrGuard.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidForkTriggerOrGuard.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidForkTriggerOrGuard.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidForkTriggerOrGuard.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidForkTriggerOrGuard.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidForkTriggerOrGuard.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
@@ -32,6 +35,9 @@
* UML 1.5 Well-formedness rule [1] for Transition, to remove
* a trigger or guard from fork outgoing transition.
*
+ * Well-formedness rule [1] for Transition. See page 139 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrInvalidForkTriggerOrGuard extends CrUML {
@@ -85,6 +91,15 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getTransition());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidHistory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidHistory.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidHistory.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidHistory.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidHistory.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidHistory.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -34,6 +36,9 @@
* UML 1.5 Well-formedness rule [2] for Pseudostates: <p>
* History vertices can have at most one outgoing transition.
*
+ * Well-formedness rule [2] for PseudoState. See page 137 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrInvalidHistory extends CrUML {
@@ -65,5 +70,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidInitial.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidInitial.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidInitial.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidInitial.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidInitial.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidInitial.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -73,5 +75,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoin.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoin.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoin.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoin.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoin.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoin.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -36,6 +38,9 @@
* transitions. Implements constraint [4] on Pseudostate in the UML
* Semantics v1.1, pp. 104.
*
+ * Well-formedness rule [3] for PseudoState. See page 137 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
public class CrInvalidJoin extends CrUML {
@@ -75,5 +80,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoinTriggerOrGuard.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoinTriggerOrGuard.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoinTriggerOrGuard.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoinTriggerOrGuard.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoinTriggerOrGuard.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidJoinTriggerOrGuard.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
@@ -31,6 +34,9 @@
/**
* UML 1.5 Well-formedness rule [2] for Transition.
*
+ * Well-formedness rule [2] for Transition. See page 139 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrInvalidJoinTriggerOrGuard extends CrUML {
@@ -88,6 +94,15 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getTransition());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidPseudoStateTrigger.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidPseudoStateTrigger.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidPseudoStateTrigger.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidPseudoStateTrigger.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidPseudoStateTrigger.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidPseudoStateTrigger.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
@@ -31,6 +34,9 @@
/**
* UML 1.5 Well-formedness rule [5] for Transition.
*
+ * Well-formedness rule [5] for Transition. See page 140 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrInvalidPseudoStateTrigger extends CrUML {
@@ -67,4 +73,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getTransition());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidSynch.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidSynch.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidSynch.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidSynch.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidSynch.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrInvalidSynch.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -33,6 +35,9 @@
/**
* UML 1.5 Well-formedness rule [2] for Sync States.
*
+ * Well-formedness rule [2] for SynchState. See page 139 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrInvalidSynch extends CrUML {
@@ -92,5 +97,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getSynchState());
+ return ret;
+ }
+
} /* end class CrInvalidSynch */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrJoinIncomingTransition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrJoinIncomingTransition.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrJoinIncomingTransition.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrJoinIncomingTransition.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrJoinIncomingTransition.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrJoinIncomingTransition.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
@@ -31,6 +34,9 @@
/**
* UML 1.5 Well-formedness rule [4] for Transition.
*
+ * Well-formedness rule [4] for Transition. See page 140 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrJoinIncomingTransition extends CrUML {
@@ -62,4 +68,13 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getTransition());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMergeClasses.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMergeClasses.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMergeClasses.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMergeClasses.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMergeClasses.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMergeClasses.java 2008-08-05 10:33:53-0700
@@ -26,7 +26,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.cognitive.ToDoItem;
@@ -91,4 +93,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
} /* end class CrMergeClasses */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingAttrName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingAttrName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingAttrName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingAttrName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingAttrName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingAttrName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.swing.Icon;
import org.argouml.cognitive.Critic;
@@ -97,4 +100,13 @@
*/
public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAttribute());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingClassName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingClassName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingClassName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingClassName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingClassName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingClassName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.swing.Icon;
import org.argouml.cognitive.Critic;
@@ -98,4 +101,13 @@
*/
public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getModel());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingOperName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingOperName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingOperName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingOperName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingOperName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingOperName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
import org.argouml.cognitive.ToDoItem;
@@ -92,4 +95,13 @@
return WizMEName.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getOperation());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingStateName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingStateName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingStateName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingStateName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingStateName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMissingStateName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.swing.Icon;
import org.argouml.cognitive.Critic;
@@ -126,6 +129,15 @@
return WizMEName.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getStateVertex());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultiComposite.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
import org.argouml.cognitive.ToDoItem;
@@ -34,6 +37,9 @@
* Well-formedness rule [2] for MAssociationEnd. See page 2-45 of UML
* chapter 2: Semantics. OMG document UML V1.3 June 1999.
*
+ * Well-formedness rule [1] for AssociationEnd. See page 53 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
public class CrMultiComposite extends CrUML {
@@ -72,4 +78,13 @@
return WizAssocComposite.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationEnd());
+ return ret;
+ }
+
} /* end class CrMultiComposite */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleAgg.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleAgg.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleAgg.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleAgg.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleAgg.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleAgg.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -40,6 +42,9 @@
* This is the second well-formedness rule for associations in the UML 1.3
* standard (see section 2.5.3 of the standard).<p>
*
+ * Well-formedness rule [2] for Association. See page 52 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* <em>Note</em>. This only applies to binary associations. There is a
* separate critic (see {@link org.argouml.uml.cognitive.critics.CrNWayAgg})
* which deals with 3- or more-way assocations.<p>
@@ -156,4 +161,13 @@
return WizAssocComposite.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
+
} /* end class CrMultipleAgg */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleDeepHistoryStates.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.apache.log4j.Logger;
import org.argouml.cognitive.Designer;
@@ -38,6 +40,9 @@
/**
* UML 1.5 Well-formedness rule [2] for Composite States.
*
+ * Well-formedness rule [2] for CompositeState. See page 136 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author [email protected]
*/
public class CrMultipleDeepHistoryStates extends CrUML {
@@ -142,6 +147,15 @@
return res;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleInitialStates.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.apache.log4j.Logger;
import org.argouml.cognitive.Designer;
@@ -147,6 +149,15 @@
return res;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrMultipleShallowHistoryStates.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.apache.log4j.Logger;
import org.argouml.cognitive.Designer;
@@ -36,6 +38,9 @@
/**
* UML 1.5 Well-formedness rule [3] for Composite States.
+ *
+ * Well-formedness rule [3] for CompositeState. See page 136 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
*
* @author [email protected]
*/
@@ -144,6 +149,15 @@
return res;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPseudostate());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNWayAgg.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNWayAgg.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNWayAgg.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNWayAgg.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNWayAgg.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNWayAgg.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -39,6 +41,9 @@
* This is the third well-formedness rule for associations in the UML 1.3
* standard (see section 2.5.3 of the standard).<p>
*
+ * Well-formedness rule [3] for Association. See page 52 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* <em>Note</em>. This only applies to 3-way or more
* associations. There is a separate critic (see {@link
* org.argouml.uml.cognitive.critics.CrMultipleAgg}) which deals with
@@ -141,6 +146,16 @@
return NO_PROBLEM;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflict.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflict.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflict.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflict.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflict.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflict.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -37,7 +39,10 @@
/**
* Well-formedness rule [1] for Namespace. See page 33 of UML 1.1 Semantics.
* OMG document ad/97-08-04. <p>
- *
+ *
+ * Well-formedness rule [1] for Namespace. See page 62 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* Names of contained elements in a namespace (i.e. the design material)
* must be unique.
* This condition does not apply to names of Generalizations,
@@ -128,4 +133,13 @@
return res;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getNamespace());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflictAC.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflictAC.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflictAC.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflictAC.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflictAC.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConflictAC.java 2008-08-05 10:33:53-0700
@@ -24,14 +24,21 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
+import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
/**
* Well-formedness rule [1] for AssociationClass. See page 28 of UML 1.1
* Semantics. OMG document ad/97-08-04.
*
+ * Well-formedness rule [1] for AssociationClass. See page 52 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
public class CrNameConflictAC extends CrUML {
@@ -54,5 +61,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
+
} /* end class CrNameConflictAC */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConfusion.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConfusion.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConfusion.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConfusion.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConfusion.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNameConfusion.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import javax.swing.Icon;
@@ -229,4 +231,14 @@
return WizManyNames.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getClassifier());
+ ret.add(Model.getMetaTypes().getState());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNavFromInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNavFromInterface.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNavFromInterface.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNavFromInterface.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNavFromInterface.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNavFromInterface.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -146,6 +148,15 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoAssociations.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoAssociations.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoAssociations.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoAssociations.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoAssociations.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoAssociations.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -178,4 +180,15 @@
return false;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ ret.add(Model.getMetaTypes().getActor());
+ ret.add(Model.getMetaTypes().getUseCase());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoGuard.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoGuard.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoGuard.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoGuard.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoGuard.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoGuard.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -83,4 +86,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getTransition());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoIncomingTransitions.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoIncomingTransitions.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoIncomingTransitions.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoIncomingTransitions.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoIncomingTransitions.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoIncomingTransitions.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -90,4 +92,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getStateVertex());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInitialState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInitialState.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInitialState.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInitialState.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInitialState.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInitialState.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -83,4 +85,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getCompositeState());
+ return ret;
+ }
+
} /* end class CrNoInitialState */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInstanceVariables.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInstanceVariables.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInstanceVariables.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInstanceVariables.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInstanceVariables.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoInstanceVariables.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import javax.swing.Icon;
@@ -172,5 +174,16 @@
public Class getWizardClass(ToDoItem item) {
return WizAddInstanceVariable.class;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
}
+
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOperations.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOperations.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOperations.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOperations.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOperations.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOperations.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import javax.swing.Icon;
@@ -154,5 +156,16 @@
public Class getWizardClass(ToDoItem item) {
return WizAddOperation.class;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ ret.add(Model.getMetaTypes().getInterface());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoOutgoingTransitions.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -80,4 +82,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getStateVertex());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTransitions.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTransitions.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTransitions.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTransitions.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTransitions.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTransitions.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -90,4 +92,13 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedMetatypes()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getStateVertex());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTriggerOrGuard.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTriggerOrGuard.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTriggerOrGuard.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTriggerOrGuard.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTriggerOrGuard.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNoTriggerOrGuard.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -103,6 +106,15 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getTransition());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNodesOverlap.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNodesOverlap.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNodesOverlap.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNodesOverlap.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNodesOverlap.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNodesOverlap.java 2008-08-05 10:33:53-0700
@@ -25,12 +25,15 @@
package org.argouml.uml.cognitive.critics;
import java.awt.Rectangle;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
import org.argouml.cognitive.ListSet;
import org.argouml.cognitive.ToDoItem;
+import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
import org.argouml.uml.diagram.deployment.ui.FigObject;
import org.argouml.uml.diagram.deployment.ui.UMLDeploymentDiagram;
@@ -176,6 +179,14 @@
return offs;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNonAggDataType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNonAggDataType.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNonAggDataType.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNonAggDataType.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNonAggDataType.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrNonAggDataType.java 2008-08-05 10:33:53-0700
@@ -24,8 +24,12 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
+import org.argouml.model.Model;
import org.argouml.uml.cognitive.UMLDecision;
/**
@@ -56,5 +60,14 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getDataType());
+ return ret;
+ }
+
} /* end class CrNonAggDataType */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOperNameConflict.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOperNameConflict.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOperNameConflict.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOperNameConflict.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOperNameConflict.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOperNameConflict.java 2008-08-05 10:33:53-0700
@@ -26,7 +26,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import javax.swing.Icon;
@@ -267,4 +269,13 @@
return false;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getClassifier());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndConflict.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndConflict.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndConflict.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndConflict.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndConflict.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndConflict.java 2008-08-05 10:33:53-0700
@@ -26,8 +26,10 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -38,6 +40,8 @@
* Well-formedness rule [2] for MClassifier. See page 29 of UML 1.1
* Semantics. OMG document ad/97-08-04.
*
+ * Well-formedness rule [3] for Classifier. See page 55 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
* @author jrobbins
*/
//TODO: split into an inherited attr critic and a local
@@ -80,4 +84,14 @@
}
return problem;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationEnd());
+ return ret;
+ }
+
} /* end class CrOppEndConflict */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndVsAttr.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndVsAttr.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndVsAttr.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndVsAttr.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndVsAttr.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrOppEndVsAttr.java 2008-08-05 10:33:53-0700
@@ -26,7 +26,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -37,6 +39,9 @@
* Well-formedness rule [2] for Classifier. See page 29 of UML 1.1
* Semantics. OMG document ad/97-08-04.
*
+ * Well-formedness rule [4] for Classifier. See page 55 of UML 1.4
+ * Semantics. OMG document UML 1.4.2 formal/04-07-02.
+ *
* @author jrobbins
*/
//TODO: split into one critic for inherited problems and
@@ -136,6 +141,15 @@
return NO_PROBLEM;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getClassifier());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrReservedName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrReservedName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrReservedName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrReservedName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrReservedName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrReservedName.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javax.swing.Icon;
@@ -219,6 +221,18 @@
return WizMEName.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getClassifier());
+ ret.add(Model.getMetaTypes().getOperation());
+ ret.add(Model.getMetaTypes().getState());
+ ret.add(Model.getMetaTypes().getAssociation());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrSubclassReference.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrSubclassReference.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrSubclassReference.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrSubclassReference.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrSubclassReference.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrSubclassReference.java 2008-08-05 10:33:53-0700
@@ -27,7 +27,9 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -147,4 +149,13 @@
return offs;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAssoc.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAssoc.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAssoc.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAssoc.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAssoc.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAssoc.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -64,4 +66,13 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
} /* end class CrTooManyAssoc */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAttr.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAttr.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAttr.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAttr.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAttr.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyAttr.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -78,6 +80,15 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyClasses.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyClasses.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyClasses.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyClasses.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyClasses.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyClasses.java 2008-08-05 10:33:53-0700
@@ -26,6 +26,8 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -73,6 +75,15 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getNamespace());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyOper.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyOper.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyOper.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyOper.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyOper.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyOper.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -79,6 +81,15 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyStates.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyStates.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyStates.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyStates.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyStates.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyStates.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -67,6 +69,15 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getCompositeState());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyTransitions.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyTransitions.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyTransitions.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyTransitions.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyTransitions.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrTooManyTransitions.java 2008-08-05 10:33:53-0700
@@ -25,6 +25,8 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -71,6 +73,15 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getStateVertex());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUML.java 2008-08-05 10:33:53-0700
@@ -54,6 +54,13 @@
*/
private static final Logger LOG = Logger.getLogger(CrUML.class);
+ /**
+ * By default looks for the localized strings at the <code>critics</code>
+ * Resource, but critics defined elsewhere (out of ArgoUML main tree)
+ * may override this parameter
+ */
+ private String localizationPrefix = "critics";
+
/**
* The constructor for this class.
*/
@@ -61,6 +68,19 @@
}
/**
+ * The constructor for this class overriding the default
+ * localization resource.
+ *
+ * @param nonDefaultLocalizationPrefix the overriding localization resource
+ */
+ public CrUML(String nonDefaultLocalizationPrefix) {
+ if (nonDefaultLocalizationPrefix != null) {
+ this.localizationPrefix = nonDefaultLocalizationPrefix;
+ setupHeadAndDesc();
+ }
+ }
+
+ /**
* Set the resources for this critic based on the class name.
*
* @param key is the class name.
@@ -88,7 +108,7 @@
* @return the localized string
*/
protected String getLocalizedString(String key, String suffix) {
- return Translator.localize("critics." + key + suffix);
+ return Translator.localize(localizationPrefix + "." + key + suffix);
}
/**
@@ -118,11 +138,13 @@
* appears in the to-do tab of the details pane).
*
* MVW: Maybe we can make it part of the constructor CrUML()?
+ *
+ * FIXME: why override if nobody uses?
*/
- @Override
- public final void setHeadline(String s) {
- setupHeadAndDesc();
- }
+ //@Override
+ //public final void setHeadline(String s) {
+ //setupHeadAndDesc();
+ //}
/**
* Set up the locale specific text for the critic headline
@@ -242,7 +264,6 @@
return className.substring(className.lastIndexOf('.') + 1);
}
-
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalAttrName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.swing.Icon;
import org.argouml.cognitive.Critic;
@@ -215,6 +218,15 @@
return WizMEName.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAttribute());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalClassName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.swing.Icon;
import org.argouml.cognitive.Critic;
@@ -125,6 +128,15 @@
@Override
public Class getWizardClass(ToDoItem item) { return WizMEName.class; }
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalOperName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
import org.argouml.cognitive.ListSet;
@@ -193,4 +196,13 @@
return WizOperName.class;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getOperation());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnconventionalPackName.java 2008-08-05 10:33:53-0700
@@ -24,6 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.swing.Icon;
import org.argouml.cognitive.Critic;
@@ -125,6 +128,15 @@
}
/*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getPackage());
+ return ret;
+ }
+
+ /*
* @see org.argouml.cognitive.critics.Critic#getWizardClass(org.argouml.cognitive.ToDoItem)
*/
@Override
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnnavigableAssoc.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnnavigableAssoc.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnnavigableAssoc.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnnavigableAssoc.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnnavigableAssoc.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUnnavigableAssoc.java 2008-08-05 10:33:53-0700
@@ -25,7 +25,9 @@
package org.argouml.uml.cognitive.critics;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.cognitive.ToDoItem;
@@ -69,4 +71,13 @@
*/
public Class getWizardClass(ToDoItem item) { return WizNavigable.class; }
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getAssociationClass());
+ return ret;
+ }
+
} /* end class CrUnnavigableAssoc */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessAbstract.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessAbstract.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessAbstract.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessAbstract.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessAbstract.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessAbstract.java 2008-08-05 10:33:53-0700
@@ -28,7 +28,9 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.cognitive.Goal;
@@ -78,6 +80,15 @@
return true; // no concrete subclasses defined, this class is "useless"
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getUMLClass());
+ return ret;
+ }
+
} /* end class CrUselessAbstract */
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessInterface.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessInterface.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessInterface.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessInterface.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUselessInterface.java 2008-08-05 10:33:53-0700
@@ -24,7 +24,9 @@
package org.argouml.uml.cognitive.critics;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Critic;
import org.argouml.cognitive.Designer;
@@ -77,6 +79,15 @@
return PROBLEM_FOUND;
}
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getInterface());
+ return ret;
+ }
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUtilityViolated.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUtilityViolated.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUtilityViolated.java&p2=trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUtilityViolated.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUtilityViolated.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/CrUtilityViolated.java 2008-08-05 10:33:53-0700
@@ -26,7 +26,9 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.argouml.cognitive.Designer;
import org.argouml.model.Model;
@@ -94,4 +96,14 @@
}
return NO_PROBLEM;
}
+
+ /*
+ * @see org.argouml.uml.cognitive.critics.CrUML#getCriticizedDesignMaterials()
+ */
+ public Set<Object> getCriticizedDesignMaterials() {
+ Set<Object> ret = new HashSet<Object>();
+ ret.add(Model.getMetaTypes().getClassifier());
+ return ret;
+ }
+
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java?view=diff&rev=15512&p1=trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java&p2=trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/TabProps.java 2008-08-05 10:33:53-0700
@@ -33,6 +33,7 @@
import org.apache.log4j.Logger;
import org.argouml.application.api.AbstractArgoJPanel;
+import org.argouml.cognitive.Critic;
import org.argouml.model.Model;
import org.argouml.swingext.UpArrowIcon;
import org.argouml.ui.TabModelTarget;
@@ -171,7 +172,9 @@
target = (target instanceof Fig) ? ((Fig) target).getOwner() : target;
if (!(target == null || Model.getFacade().isAUMLElement(target)
- || target instanceof ArgoDiagram)) {
+ || target instanceof ArgoDiagram
+ // TODO Improve extensibility of this!
+ || target instanceof Critic)) {
return;
}
@@ -266,8 +269,8 @@
: PropPanelFactoryManager.getFactories()) {
propPanel = factory.createPropPanel(targetObject);
if (propPanel != null) return propPanel;
- }
-
+ }
+
/* This does not work (anymore/yet?),
* since we never have a FigText here: */
if (targetObject instanceof FigText) {
@@ -324,7 +327,11 @@
if (target instanceof Fig) {
target = ((Fig) target).getOwner();
}
- return ((target instanceof Diagram || Model.getFacade().isAUMLElement(target))
+
+ // TODO: this should be more extensible... may be only
+ // "findPanelFor(target)" if there is a panel why not show it?
+ return ((target instanceof Diagram || Model.getFacade().isAUMLElement(
+ target)) || target instanceof Critic
&& findPanelFor(target) != null);
}
Modified: trunk/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java?view=diff&rev=15512&p1=trunk/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java&p2=trunk/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java (original)
+++ trunk/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java 2008-08-05 10:33:53-0700
@@ -25,34 +25,41 @@
package org.argouml.profile;
import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
import junit.framework.TestCase;
import org.argouml.FileHelper;
+import org.argouml.cognitive.Critic;
import org.argouml.model.InitializeModel;
+import org.argouml.profile.internal.ProfileManagerImpl;
/**
* Some basic tests for the {@link UserDefinedProfile} class.
*
* @author Luis Sergio Oliveira (euluis)
+ * @authos maurelio1234
*/
public class TestUserDefinedProfile extends TestCase {
-
+
private File testDir;
@Override
protected void setUp() throws Exception {
super.setUp();
InitializeModel.initializeDefault();
+ ProfileFacade.setManager(new ProfileManagerImpl());
+
testDir = FileHelper.setUpDir4Test(getClass());
}
-
+
@Override
protected void tearDown() throws Exception {
FileHelper.deleteDir(testDir);
super.tearDown();
}
-
+
/**
* Test loading of a very simple profile via its constructor. Check that its
* display name contains the file name.
@@ -70,4 +77,30 @@
assertTrue(profile.getDisplayName().contains(profileFile.getName()));
}
+ /**
+ * Test the constructor used for loading a profile from a Jar file TODO Test
+ * FigNode!
+ *
+ * @throws Exception if something goes wrong
+ */
+ public void testLoadingAsFromJar() throws Exception {
+ ProfileManager pm = ProfileFacade.getManager();
+
+ // create profile model
+ ProfileMother profileMother = new ProfileMother();
+ Object model = profileMother.createSimpleProfileModel();
+ // save the profile into a xmi file
+ File profileFile = new File(testDir, "testLoadingConstructor.xmi");
+ profileMother.saveProfileModel(model, profileFile);
+
+ Set<Critic> critics = new HashSet<Critic>();
+ Set<String> profiles = new HashSet<String>();
+ profiles.add(pm.getUMLProfile().getProfileIdentifier());
+
+ Profile profile = new UserDefinedProfile("displayName", profileFile
+ .toURI().toURL(), critics, profiles);
+
+ assertEquals(profile.getDisplayName(), "displayName");
+ assertTrue(profile.getDependencies().contains(pm.getUMLProfile()));
+ }
}
Modified: trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileJava.java?view=diff&rev=15512&p1=trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileJava.java&p2=trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileJava.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileJava.java (original)
+++ trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileJava.java 2008-08-05 10:33:53-0700
@@ -32,11 +32,11 @@
/**
* Tests for the ProfileJava class.
- *
+ *
* @author Luis Sergio Oliveira (euluis)
*/
public class TestProfileJava extends TestCase {
-
+
@Override
protected void setUp() throws Exception {
super.setUp();
@@ -44,10 +44,20 @@
new InitProfileSubsystem().init();
}
+ /**
+ * test java profile creation
+ *
+ * @throws ProfileException if something goes wrong
+ */
public void testProfileJava() throws ProfileException {
new ProfileJava(new ProfileUML());
}
-
+
+ /**
+ * test java profile creation
+ *
+ * @throws Exception if something goes wrong
+ */
public void testProfileJavaNoArgs() throws Exception {
new ProfileJava();
}
Modified: trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java?view=diff&rev=15512&p1=trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java&p2=trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java&r1=15511&r2=15512
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java (original)
+++ trunk/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java 2008-08-05 10:33:53-0700
@@ -39,11 +39,11 @@
/**
* Tests for the ProfileManagerImpl class.
- *
+ *
* @author Luis Sergio Oliveira (euluis)
*/
public class TestProfileManagerImpl extends TestCase {
-
+
private ProfileManager manager;
@Override
@@ -53,28 +53,46 @@
manager = new ProfileManagerImpl();
}
+ /**
+ * test profile manager
+ */
public void testProfileManagerImpl() {
List<Profile> registeredProfiles = manager.getRegisteredProfiles();
assertTrue(2 <= registeredProfiles.size());
Set<String> internalProfileNameSet = new HashSet<String>();
for (Profile profile : registeredProfiles) {
- if (profile.getDisplayName().equals(ProfileUML.NAME)
- || profile.getDisplayName().equals(ProfileJava.NAME))
+ if (profile.getDisplayName().equals(ProfileUML.NAME)
+ || profile.getDisplayName().equals(ProfileJava.NAME)) {
internalProfileNameSet.add(profile.getDisplayName());
+ }
}
assertEquals(2, internalProfileNameSet.size());
}
-
+
+ /**
+ * test remove profile
+ */
public void testRemoveProfileThatIsntDefault() {
- Profile javaProfile = manager.getProfileForClass(
- ProfileJava.class.getName());
+ Profile javaProfile = manager.getProfileForClass(ProfileJava.class
+ .getName());
assertNotNull(javaProfile);
assertTrue(manager.getRegisteredProfiles().contains(javaProfile));
manager.removeProfile(javaProfile);
assertFalse(manager.getRegisteredProfiles().contains(javaProfile));
}
-
+
+ /**
+ * test remove profile
+ */
public void testRemoveDefaultProfile() {
+ Profile umlProfile = manager.getProfileForClass(ProfileUML.class
+ .getName());
+ assertNotNull(umlProfile);
+ assertTrue(manager.getRegisteredProfiles().contains(umlProfile));
+ assertTrue(manager.getDefaultProfiles().contains(umlProfile));
+ manager.removeProfile(umlProfile);
+ assertFalse(manager.getRegisteredProfiles().contains(umlProfile));
+ assertFalse(manager.getDefaultProfiles().contains(umlProfile));
Profile testProfile = new Profile() {
@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.