Author: maurelio1234
Date: 2007-08-14 15:29:11-0700
New Revision: 13355
Added:
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/DefaultTypeStrategy.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ModelUtils.java
Modified:
branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java
branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java
Log:
moving default types definition to the profiles
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar&p2=branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar&r1=13354&r2=13355
==============================================================================
Binary files. No diff available.
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi 2007-08-14 15:29:11-0700
@@ -1,5 +1,5 @@
<?xml version = '1.0' encoding = 'UTF-8' ?>
-<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Tue Aug 14 09:04:21 BRT 2007'>
+<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Tue Aug 14 18:51:04 BRT 2007'>
<XMI.header> <XMI.documentation>
<XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
<XMI.exporterVersion>PRE-0.25.4(5) revised on $Date: 2007-05-12 03:08:08 -0300 $ </XMI.exporterVersion>
@@ -245,6 +245,25 @@
</UML:Multiplicity>
</UML:TagDefinition.multiplicity>
</UML:TagDefinition>
+ <UML:DataType xmi.id = '-84-17--56-5-43645a83:11466542d86:-8000:000000000000087C'
+ name = 'Integer' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
+ isAbstract = 'false'/>
+ <UML:DataType xmi.id = '-84-17--56-5-43645a83:11466542d86:-8000:000000000000087D'
+ name = 'UnlimitedInteger' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
+ isAbstract = 'false'/>
+ <UML:DataType xmi.id = '-84-17--56-5-43645a83:11466542d86:-8000:000000000000087E'
+ name = 'String' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
+ isAbstract = 'false'/>
+ <UML:Enumeration xmi.id = '-84-17--56-5-43645a83:11466542d86:-8000:0000000000000880'
+ name = 'Boolean' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'
+ isAbstract = 'false'>
+ <UML:Enumeration.literal>
+ <UML:EnumerationLiteral xmi.id = '-84-17--56-5-43645a83:11466542d86:-8000:0000000000000881'
+ name = 'TRUE' isSpecification = 'false'/>
+ <UML:EnumerationLiteral xmi.id = '-84-17--56-5-43645a83:11466542d86:-8000:0000000000000882'
+ name = 'FALSE' isSpecification = 'false'/>
+ </UML:Enumeration.literal>
+ </UML:Enumeration>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java 2007-08-14 15:29:11-0700
@@ -530,15 +530,27 @@
}
public Object getDefaultAttributeType() {
- return profileConfiguration.getDefaultAttributeType();
+ if (profileConfiguration.getDefaultTypeStrategy() != null) {
+ return profileConfiguration.getDefaultTypeStrategy()
+ .getDefaultAttributeType();
+ }
+ return null;
}
public Object getDefaultParameterType() {
- return profileConfiguration.getDefaultParameterType();
+ if (profileConfiguration.getDefaultTypeStrategy() != null) {
+ return profileConfiguration.getDefaultTypeStrategy()
+ .getDefaultParameterType();
+ }
+ return null;
}
-
+
public Object getDefaultReturnType() {
- return profileConfiguration.getDefaultReturnType();
+ if (profileConfiguration.getDefaultTypeStrategy() != null) {
+ return profileConfiguration.getDefaultTypeStrategy()
+ .getDefaultReturnType();
+ }
+ return null;
}
@SuppressWarnings("deprecation")
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java 2007-08-14 15:29:11-0700
@@ -692,22 +692,26 @@
private boolean isRelatedToProfiles(Project currentProject, Object selectedItem) {
boolean found = selectedItem instanceof ProfileConfiguration ||
- selectedItem instanceof Profile;
-
- for (Profile profile : currentProject.getProfileConfiguration().getProfiles()) {
- Collection models;
- try {
- models = profile.getProfilePackages();
- for (Object model : models) {
- if ((Model.getFacade().getModel(selectedItem).equals(model))) {
- found = true;
- break;
- }
+ selectedItem instanceof Profile ||
+ selectedItem instanceof ArgoDiagram;
+
+ if (!found) {
+ for (Profile profile : currentProject.getProfileConfiguration()
+ .getProfiles()) {
+ Collection models;
+ try {
+ models = profile.getProfilePackages();
+ for (Object model : models) {
+ if ((Model.getFacade().getModel(selectedItem)
+ .equals(model))) {
+ found = true;
+ break;
+ }
+ }
+ } catch (ProfileException e) {
}
- } catch (ProfileException e) {
- }
+ }
}
-
return found;
}
}
Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/DefaultTypeStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/DefaultTypeStrategy.java?view=auto&rev=13355
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/DefaultTypeStrategy.java 2007-08-14 15:29:11-0700
@@ -0,0 +1,48 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.profile;
+
+/**
+ * Using this strategy profiles can provide the default used when creating new
+ * parameters, operations and attributes.
+ *
+ * @author maurelio1234
+ */
+public interface DefaultTypeStrategy {
+ /**
+ * @return the default type used in new attributes
+ */
+ public Object getDefaultAttributeType();
+
+ /**
+ * @return the default type used in new parameters
+ */
+ public Object getDefaultParameterType();
+
+ /**
+ * @return the default type used in new operations
+ */
+ public Object getDefaultReturnType();
+}
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java 2007-08-14 15:29:11-0700
@@ -27,7 +27,7 @@
import java.awt.Image;
/**
- * Using this stragey profiles can provide icons to replace the default
+ * Using this strategy profiles can provide icons to replace the default
* visualization of stereotyped node according to UML 2.0 specification.
*
* @author maurelio1234
Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ModelUtils.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ModelUtils.java?view=auto&rev=13355
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ModelUtils.java 2007-08-14 15:29:11-0700
@@ -0,0 +1,61 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.profile;
+
+import java.util.Collection;
+
+import org.argouml.model.Model;
+
+public class ModelUtils {
+ public static Object findTypeInModel(String s, Object model) {
+
+ if (!Model.getFacade().isANamespace(model)) {
+ throw new IllegalArgumentException(
+ "Looking for the classifier " + s
+ + " in a non-namespace object of " + model
+ + ". A namespace was expected.");
+ }
+
+ Collection allClassifiers =
+ Model.getModelManagementHelper()
+ .getAllModelElementsOfKind(model,
+ Model.getMetaTypes().getClassifier());
+
+ Object[] classifiers = allClassifiers.toArray();
+ Object classifier = null;
+
+ for (int i = 0; i < classifiers.length; i++) {
+
+ classifier = classifiers[i];
+ if (Model.getFacade().getName(classifier) != null
+ && Model.getFacade().getName(classifier).equals(s)) {
+ return classifier;
+ }
+ }
+
+ return null;
+ }
+
+}
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java 2007-08-14 15:29:11-0700
@@ -97,15 +97,27 @@
* @return the formating strategy offered by this profile, if any. <br>
* <b>null</b> if this profile has no formating strategy.
*/
- public abstract FormatingStrategy getFormatingStrategy();
+ public FormatingStrategy getFormatingStrategy() {
+ return null;
+ }
/**
* @return the FigNodeStrategy offered by this profile, if any. <br>
* <b>null</b> if this profile has no FigNodeStrategy.
*/
- public abstract FigNodeStrategy getFigureStrategy();
+ public FigNodeStrategy getFigureStrategy() {
+ return null;
+ }
/**
+ * @return the DefaultTypeStrategy offered by this profile, if any. <br>
+ * <b>null</b> if this profile has no DefaultTypeStrategy.
+ */
+ public DefaultTypeStrategy getDefaultTypeStrategy() {
+ return null;
+ }
+
+ /**
* This method produces a string that represents the specific
* model element in the context of the specified namespace.
* @param element element to represent.
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java 2007-08-14 15:29:11-0700
@@ -51,6 +51,7 @@
.getLogger(ProfileConfiguration.class);
private FormatingStrategy formatingStrategy;
+ private DefaultTypeStrategy defaultTypeStrategy;
private Vector figNodeStrategies = new Vector();
private Vector<Profile> profiles = new Vector<Profile>();
@@ -75,17 +76,44 @@
while (it.hasNext()) {
Profile p = (Profile) it.next();
addProfile(p);
- activateFormatingStrategy(p);
}
-
+
+ updateStrategies();
}
+ private void updateStrategies() {
+ for (Profile profile : profiles) {
+ activateFormatingStrategy(profile);
+ activateDefaultTypeStrategy(profile);
+ }
+ }
+
/**
* @return the current formating strategy
*/
public FormatingStrategy getFormatingStrategy() {
return formatingStrategy;
}
+
+ /**
+ * @return the current default type strategy
+ */
+ public DefaultTypeStrategy getDefaultTypeStrategy() {
+ return defaultTypeStrategy;
+ }
+
+ /**
+ * Updates the current strategy to the strategy provided by the
+ * passed profile. The profile should have been previously registered.
+ *
+ * @param profile the profile providing the current default type strategy
+ */
+ public void activateDefaultTypeStrategy(Profile p) {
+ if (p != null && p.getDefaultTypeStrategy() != null
+ && getProfiles().contains(p)) {
+ this.defaultTypeStrategy = p.getDefaultTypeStrategy();
+ }
+ }
/**
* Updates the current strategy to the strategy provided by the
@@ -129,7 +157,8 @@
for (Profile dependency : p.getDependencies()) {
addProfile(dependency);
}
-
+
+ updateStrategies();
ExplorerEventAdaptor.getInstance().structureChanged();
}
}
@@ -174,6 +203,7 @@
removeProfile(profile);
}
+ updateStrategies();
ExplorerEventAdaptor.getInstance().structureChanged();
}
@@ -268,41 +298,12 @@
Object result = null;
Iterator it = getProfileModels().iterator();
while (result == null && it.hasNext()) {
- result = findTypeInModel(name, it.next());
+ result = ModelUtils.findTypeInModel(name, it.next());
}
return result;
}
- private Object findTypeInModel(String s, Object model) {
-
- if (!Model.getFacade().isANamespace(model)) {
- throw new IllegalArgumentException(
- "Looking for the classifier " + s
- + " in a non-namespace object of " + model
- + ". A namespace was expected.");
- }
-
- Collection allClassifiers =
- Model.getModelManagementHelper()
- .getAllModelElementsOfKind(model,
- Model.getMetaTypes().getClassifier());
-
- Object[] classifiers = allClassifiers.toArray();
- Object classifier = null;
-
- for (int i = 0; i < classifiers.length; i++) {
-
- classifier = classifiers[i];
- if (Model.getFacade().getName(classifier) != null
- && Model.getFacade().getName(classifier).equals(s)) {
- return classifier;
- }
- }
-
- return null;
- }
-
/**
* @param metaType
* @return
@@ -328,16 +329,4 @@
return Model.getExtensionMechanismsHelper().getAllPossibleStereotypes(
getProfileModels(), modelElement);
}
-
- public Object getDefaultAttributeType() {
- return findType("int");
- }
-
- public Object getDefaultParameterType() {
- return findType("int");
- }
-
- public Object getDefaultReturnType() {
- return findType("void");
- }
}
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java 2007-08-14 15:29:11-0700
@@ -41,7 +41,6 @@
*/
private static final Logger LOG = Logger.getLogger(ProfileCpp.class);
- private FormatingStrategy formatingStrategy;
private ProfileModelLoader profileModelLoader;
private Collection model;
private static ProfileCpp instance;
@@ -80,15 +79,6 @@
addProfileDependency(ProfileUML.getInstance());
}
-
- /**
- * @return the Java formating strategy
- * @see org.argouml.uml.profile.Profile#getFormatingStrategy()
- */
- public FormatingStrategy getFormatingStrategy() {
- return formatingStrategy;
- }
-
/**
* @return "C++"
* @see org.argouml.uml.profile.Profile#getDisplayName()
@@ -98,17 +88,30 @@
}
/**
- * @return null
- * @see org.argouml.uml.profile.Profile#getFigureStrategy()
+ * @see org.argouml.uml.profile.Profile#getProfilePackages()
*/
- public FigNodeStrategy getFigureStrategy() {
- return null;
- }
-
-
@Override
public Collection getProfilePackages() throws ProfileException {
return model;
}
-
+
+ /**
+ * @see org.argouml.uml.profile.Profile#getDefaultTypeStrategy()
+ */
+ public DefaultTypeStrategy getDefaultTypeStrategy() {
+ return new DefaultTypeStrategy() {
+ public Object getDefaultAttributeType() {
+ return ModelUtils.findTypeInModel("int", model.iterator().next());
+ }
+
+ public Object getDefaultParameterType() {
+ return ModelUtils.findTypeInModel("int", model.iterator().next());
+ }
+
+ public Object getDefaultReturnType() {
+ return ModelUtils.findTypeInModel("void", model.iterator().next());
+ }
+
+ };
+ }
}
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java 2007-08-14 15:29:11-0700
@@ -42,7 +42,6 @@
*/
private static final Logger LOG = Logger.getLogger(ProfileJava.class);
- private FormatingStrategy formatingStrategy;
private ProfileModelLoader profileModelLoader;
private Collection model;
private static ProfileJava instance;
@@ -79,17 +78,8 @@
addProfileDependency(ProfileUML.getInstance());
}
-
/**
- * @return the Java formating strategy
- * @see org.argouml.uml.profile.Profile#getFormatingStrategy()
- */
- public FormatingStrategy getFormatingStrategy() {
- return formatingStrategy;
- }
-
- /**
* @return "Java"
* @see org.argouml.uml.profile.Profile#getDisplayName()
*/
@@ -98,16 +88,30 @@
}
/**
- * @return null
- * @see org.argouml.uml.profile.Profile#getFigureStrategy()
+ * @see org.argouml.uml.profile.Profile#getProfilePackages()
*/
- public FigNodeStrategy getFigureStrategy() {
- return null;
- }
-
@Override
public Collection getProfilePackages() throws ProfileException {
return model;
}
+ /**
+ * @see org.argouml.uml.profile.Profile#getDefaultTypeStrategy()
+ */
+ public DefaultTypeStrategy getDefaultTypeStrategy() {
+ return new DefaultTypeStrategy() {
+ public Object getDefaultAttributeType() {
+ return ModelUtils.findTypeInModel("int", model.iterator().next());
+ }
+
+ public Object getDefaultParameterType() {
+ return ModelUtils.findTypeInModel("int", model.iterator().next());
+ }
+
+ public Object getDefaultReturnType() {
+ return ModelUtils.findTypeInModel("void", model.iterator().next());
+ }
+
+ };
+ }
}
Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java?view=diff&rev=13355&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java&r1=13354&r2=13355
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java (original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java 2007-08-14 15:29:11-0700
@@ -97,16 +97,30 @@
}
/**
- * @return null
- * @see org.argouml.uml.profile.Profile#getFigureStrategy()
+ * @see org.argouml.uml.profile.Profile#getProfilePackages()
*/
- public FigNodeStrategy getFigureStrategy() {
- return null;
- }
-
@Override
public Collection getProfilePackages() throws ProfileException {
return model;
}
+ /**
+ * @see org.argouml.uml.profile.Profile#getDefaultTypeStrategy()
+ */
+ public DefaultTypeStrategy getDefaultTypeStrategy() {
+ return new DefaultTypeStrategy() {
+ public Object getDefaultAttributeType() {
+ return ModelUtils.findTypeInModel("Integer", model.iterator().next());
+ }
+
+ public Object getDefaultParameterType() {
+ return ModelUtils.findTypeInModel("Integer", model.iterator().next());
+ }
+
+ public Object getDefaultReturnType() {
+ return null;
+ }
+
+ };
+ }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.