Author: maurelio1234
Date: 2007-06-28 05:06:22-0700
New Revision: 12913
Added:
branches/gsoc2007/maurelio1234/argouml/argouml/ (props changed)
- copied from r12912, /trunk/src_new/
branches/gsoc2007/maurelio1234/argouml/argouml/.settings/org.eclipse.jdt.ui.prefs.old
- copied, changed from r12911, /trunk/src_new/.settings/org.eclipse.jdt.ui.prefs
branches/gsoc2007/maurelio1234/argouml/argouml/ext/
- copied from r12909, /branches/gsoc2007/maurelio1234/argouml/ext/
branches/gsoc2007/maurelio1234/argouml/argouml/ext/profile-javabeans.jar
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/ext/profile-javabeans.jar
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/ProfileSelectionTab.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/ui/ProfileSelectionTab.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java
- copied unchanged from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/
- copied from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FigNodeStrategy.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FileModelLoader.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FileModelLoader.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FormatingStrategy.java
- copied unchanged from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FormatingStrategy.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/Profile.java
- copied unchanged from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/Profile.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileConfiguration.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileException.java
- copied unchanged from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileException.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManager.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManager.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManagerImpl.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManagerImpl.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileModelLoader.java
- copied unchanged from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileModelLoader.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ResourceModelLoader.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ResourceModelLoader.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/StreamModelLoader.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/StreamModelLoader.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/UserDefinedProfile.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/UserDefinedProfile.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ZipModelLoader.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ZipModelLoader.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/
- copied from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/ProfileJava.java
- copied, changed from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/ProfileJava.java
Removed:
branches/gsoc2007/maurelio1234/argouml/argouml/.settings/org.eclipse.jdt.core.prefs
branches/gsoc2007/maurelio1234/argouml/argouml/.settings/org.eclipse.jdt.ui.prefs
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/Profile.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ProfileException.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ProfileJava.java
Modified:
branches/gsoc2007/maurelio1234/argouml/argouml/.project
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/application/api/InitSubsystem.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/i18n/tab.properties
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/MemberList.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/Project.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/notation/providers/uml/NotationUtilityUml.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ModelMemberFilePersister.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/OldZargoFilePersister.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/UmlFilePersister.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZargoFilePersister.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZipFilePersister.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/GUI.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/SettingsTabPreferences.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/cognitive/critics/WizAddConstructor.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigActionState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPartition.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPool.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponent.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigMNode.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigObject.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigCompositeState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigForkState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigJoinState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSimpleState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigStubState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSubmachineState.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigComment.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInstance.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigModel.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSignal.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigMessage.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeAssociation.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/StereotypeUtility.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigActor.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigUseCase.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/PropPanel.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLComboBoxEntry.java
branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLUserInterfaceContainer.java
Log:
Merged with main branch
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/.project
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/.project?view=diff&rev=12913&p1=/trunk/src_new/.project&p2=branches/gsoc2007/maurelio1234/argouml/argouml/.project&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/.project (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/.project 2007-06-28 05:06:22-0700
@@ -21,17 +21,17 @@
</arguments>
</buildCommand>
<buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
+ <name>de.mvmsoft.checkclipse.CheckclipseBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
+ <name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
- <name>de.mvmsoft.checkclipse.CheckclipseBuilder</name>
+ <name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
Removed: /trunk/src_new/.settings/org.eclipse.jdt.core.prefs
Url: http://argouml.tigris.org/source/browse/argouml//trunk/src_new/.settings/org.eclipse.jdt.core.prefs?view=auto&rev=12912
Removed: /trunk/src_new/.settings/org.eclipse.jdt.ui.prefs
Url: http://argouml.tigris.org/source/browse/argouml//trunk/src_new/.settings/org.eclipse.jdt.ui.prefs?view=auto&rev=12912
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/.settings/org.eclipse.jdt.ui.prefs.old (from r12911, /trunk/src_new/.settings/org.eclipse.jdt.ui.prefs)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/.settings/org.eclipse.jdt.ui.prefs.old?view=diff&rev=12913&p1=/trunk/src_new/.settings/org.eclipse.jdt.ui.prefs&p2=branches/gsoc2007/maurelio1234/argouml/argouml/.settings/org.eclipse.jdt.ui.prefs.old&r1=12911&r2=12913
==============================================================================
--- /trunk/src_new/.settings/org.eclipse.jdt.ui.prefs (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/.settings/org.eclipse.jdt.ui.prefs.old 2007-06-28 05:06:22-0700
@@ -1,3 +1,4 @@
-#Sun Apr 22 20:35:02 CEST 2007
+#Thu Jun 28 07:01:15 BRT 2007
eclipse.preferences.version=1
internal.default.compliance=default
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/ext/profile-javabeans.jar (from r12909, /branches/gsoc2007/maurelio1234/argouml/ext/profile-javabeans.jar)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/ext/profile-javabeans.jar?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/ext/profile-javabeans.jar&p2=branches/gsoc2007/maurelio1234/argouml/argouml/ext/profile-javabeans.jar&r1=12909&r2=12913
==============================================================================
Binary files. No diff available.
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/application/api/InitSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/application/api/InitSubsystem.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/application/api/InitSubsystem.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/application/api/InitSubsystem.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/application/api/InitSubsystem.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/application/api/InitSubsystem.java 2007-06-28 05:06:22-0700
@@ -28,7 +28,7 @@
/**
- * Any subsystem that needs to initialise itself,
+ * Any subsystem that needs to initialize itself,
* could implement this interface.
* The Main class (or any other top-level class
* that knows about the subsystem) then takes care
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/i18n/tab.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/i18n/tab.properties?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/i18n/tab.properties&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/i18n/tab.properties&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/i18n/tab.properties (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/i18n/tab.properties 2007-06-28 05:06:22-0700
@@ -45,4 +45,10 @@
tab.todo-item = ToDo Item
tab.user = User
tab.modules = Modules
-
+tab.profiles = Profiles
+tab.profiles.userdefined.load = Load profile from file...
+tab.profiles.userdefined.unload = Unregister Profile loaded from file
+tab.profiles.userdefined.available = Available Profiles:
+tab.profiles.userdefined.active = Active Profiles:
+tab.profiles.userdefined.errorloading = Error opening profile!
+tab.profiles.cannotdelete = Only user defined profiles can be removed
\ No newline at end of file
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/MemberList.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/MemberList.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/kernel/MemberList.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/MemberList.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/kernel/MemberList.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/MemberList.java 2007-06-28 05:06:22-0700
@@ -34,6 +34,7 @@
import org.argouml.uml.ProjectMemberModel;
import org.argouml.uml.cognitive.ProjectMemberTodoList;
import org.argouml.uml.diagram.ProjectMemberDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
import org.tigris.gef.base.Diagram;
/**
@@ -49,7 +50,8 @@
private AbstractProjectMember model;
private List diagramMembers = new ArrayList(10);
private AbstractProjectMember todoList;
-
+ private AbstractProjectMember profileConfiguration;
+
/**
* The constructor.
*/
@@ -61,12 +63,15 @@
if (member instanceof ProjectMemberModel) {
// Always put the model at the top
- model = (AbstractProjectMember) member;
+ model = (AbstractProjectMember) member;
return true;
} else if (member instanceof ProjectMemberTodoList) {
// otherwise add the diagram at the start
setTodoList((AbstractProjectMember) member);
return true;
+ } else if (member instanceof ProfileConfiguration) {
+ setProfileConfiguration((AbstractProjectMember) member);
+ return true;
} else if (member instanceof ProjectMemberDiagram) {
// otherwise add the diagram at the start
return diagramMembers.add(member);
@@ -87,6 +92,10 @@
LOG.info("Removing todo list");
setTodoList(null);
return true;
+ } else if (profileConfiguration == member) {
+ LOG.info("Removing profile configuration");
+ setProfileConfiguration(null);
+ return true;
} else {
return diagramMembers.remove(member);
}
@@ -101,6 +110,9 @@
if (todoList != null) {
temp.add(todoList);
}
+ if (profileConfiguration != null) {
+ temp.add(profileConfiguration);
+ }
return temp.iterator();
}
@@ -113,6 +125,9 @@
if (todoList != null) {
temp.add(todoList);
}
+ if (profileConfiguration != null) {
+ temp.add(profileConfiguration);
+ }
return temp.listIterator();
}
@@ -125,6 +140,9 @@
if (todoList != null) {
temp.add(todoList);
}
+ if (profileConfiguration != null) {
+ temp.add(profileConfiguration);
+ }
return temp.listIterator(arg0);
}
@@ -150,6 +168,9 @@
if (todoList != null) {
++size;
}
+ if (profileConfiguration != null) {
+ ++size;
+ }
return size;
}
@@ -160,6 +181,9 @@
if (model == member) {
return true;
}
+ if (profileConfiguration == member) {
+ return true;
+ }
return diagramMembers.contains(member);
}
@@ -171,6 +195,10 @@
if (todoList != null) {
todoList.remove();
}
+ if (profileConfiguration != null) {
+ profileConfiguration.remove();
+ }
+
Iterator membersIt = diagramMembers.iterator();
while (membersIt.hasNext()) {
((AbstractProjectMember) membersIt.next()).remove();
@@ -189,6 +217,9 @@
if (type == ProjectMemberTodoList.class) {
return todoList;
}
+ if (type == ProfileConfiguration.class) {
+ return profileConfiguration;
+ }
throw new IllegalArgumentException(
"There is no single instance of a " + type.getName() + " member");
}
@@ -211,6 +242,11 @@
if (type == ProjectMemberDiagram.class) {
return diagramMembers;
}
+ if (type == ProfileConfiguration.class) {
+ List temp = new ArrayList(1);
+ temp.add(profileConfiguration);
+ return temp;
+ }
throw new IllegalArgumentException(
"There is no single instance of a " + type.getName() + " member");
}
@@ -226,6 +262,9 @@
if (i == diagramMembers.size()) {
return todoList;
}
+ if (i == diagramMembers.size()+1) {
+ return profileConfiguration;
+ }
return diagramMembers.get(i);
}
@@ -246,6 +285,9 @@
if (todoList != null) {
temp[pos++] = todoList;
}
+ if (profileConfiguration != null) {
+ temp[pos++] = profileConfiguration;
+ }
return temp;
}
@@ -301,4 +343,12 @@
public List subList(int arg0, int arg1) {
throw new UnsupportedOperationException();
}
+
+ public AbstractProjectMember getProfileConfiguration() {
+ return profileConfiguration;
+ }
+
+ public void setProfileConfiguration(AbstractProjectMember configuration) {
+ this.profileConfiguration = configuration;
+ }
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/Project.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/kernel/Project.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/Project.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/kernel/Project.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/kernel/Project.java 2007-06-28 05:06:22-0700
@@ -51,9 +51,6 @@
import org.argouml.persistence.PersistenceManager;
import org.argouml.ui.explorer.ExplorerEventAdaptor;
import org.argouml.uml.CommentEdge;
-import org.argouml.uml.Profile;
-import org.argouml.uml.ProfileException;
-import org.argouml.uml.ProfileJava;
import org.argouml.uml.ProjectMemberModel;
import org.argouml.uml.cognitive.ProjectMemberTodoList;
import org.argouml.uml.diagram.ArgoDiagram;
@@ -62,6 +59,7 @@
import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.generator.GenerationPreferences;
+import org.argouml.uml.profile.ProfileConfiguration;
import org.tigris.gef.base.Diagram;
import org.tigris.gef.presentation.Fig;
import org.tigris.gef.undo.Memento;
@@ -141,7 +139,7 @@
private GenerationPreferences cgPrefs;
private transient VetoableChangeSupport vetoSupport;
- private Profile profile;
+ private ProfileConfiguration profileConfiguration;
/**
* The active diagram, pointer to a diagram in the list with diagrams.
@@ -169,9 +167,10 @@
* Constructor.
*/
public Project() {
- profile = new ProfileJava();
- projectSettings = new ProjectSettings();
+ setProfileConfiguration(new ProfileConfiguration(this));
+ projectSettings = new ProjectSettings();
+
Model.getModelManagementFactory().setRootModel(null);
authorname = Configuration.getString(Argo.KEY_USER_FULLNAME);
@@ -186,17 +185,13 @@
defaultModelTypeCache = new HashMap();
LOG.info("making empty project with empty model");
- try {
- // Jaap Branderhorst 2002-12-09
- // load the default model
- // this is NOT the way how it should be since this makes argo
- // depend on Java even more.
- setDefaultModel(profile.getProfileModel());
- } catch (ProfileException e) {
- // TODO: how are we going to handle exceptions here?
- // I think we need a ProjectException.
- LOG.error("Exception setting the default profile", e);
- }
+
+ // Jaap Branderhorst 2002-12-09
+ // load the default model
+ // this is NOT the way how it should be since this makes argo
+ // depend on Java even more.
+ setDefaultModel(profileConfiguration.getDefaultProfile().getModel());
+
addSearchPath("PROJECT_DIR");
}
@@ -1356,11 +1351,26 @@
/**
* @return Returns the profile.
*/
- public Profile getProfile() {
- return profile;
+ public ProfileConfiguration getProfileConfiguration() {
+ return profileConfiguration;
}
/**
+ * Sets the profile configuration
+ */
+ public void setProfileConfiguration(ProfileConfiguration pc) {
+ if (this.profileConfiguration != null) {
+ this.members.remove(this.profileConfiguration);
+ }
+
+ this.profileConfiguration = pc;
+
+ // there's just one ProfileConfiguration in a project
+ // and there's no other way to add another one
+ members.add(pc);
+ }
+
+ /**
* Repair all parts of the project before a save takes place.
* @return a report of any fixes
*/
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/notation/providers/uml/NotationUtilityUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/notation/providers/uml/NotationUtilityUml.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/notation/providers/uml/NotationUtilityUml.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/notation/providers/uml/NotationUtilityUml.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/notation/providers/uml/NotationUtilityUml.java 2007-06-28 05:06:22-0700
@@ -29,6 +29,7 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
+import java.util.Set;
import java.util.Stack;
import java.util.Vector;
@@ -37,8 +38,7 @@
import org.argouml.kernel.ProjectManager;
import org.argouml.kernel.ProjectSettings;
import org.argouml.model.Model;
-import org.argouml.uml.Profile;
-import org.argouml.uml.ProfileException;
+import org.argouml.uml.diagram.ui.StereotypeUtility;
import org.argouml.util.MyTokenizer;
/**
@@ -469,28 +469,24 @@
*/
private static Object getStereotype(Object obj, String name) {
Object root = Model.getFacade().getModel(obj);
- Object stereo;
+ Object stereo = null;
- stereo = recFindStereotype(obj, root, name);
- if (stereo != null) {
- return stereo;
- }
-
- try {
- Project project = ProjectManager.getManager().getCurrentProject();
- Profile profile = project.getProfile();
- stereo = recFindStereotype(obj, profile.getProfileModel(), name);
- } catch (ProfileException e) {
- // TODO: How are we going to handle exceptions here?
- // I suspect the profile should be part of the project
- // and not a singleton.
+ Set stereoSet = StereotypeUtility.getAvailableStereotypes(obj);
+ Iterator it = stereoSet.iterator();
+
+ while(it.hasNext()) {
+ stereo = it.next();
+ if (Model.getFacade().getName(stereo).equals(name)) {
+ break;
+ } else {
+ stereo = null;
+ }
}
-
+
if (stereo != null) {
- return Model.getModelManagementHelper().getCorrespondingElement(
- stereo, root);
+ return stereo;
}
-
+
if (root != null && name.length() > 0) {
stereo =
Model.getExtensionMechanismsFactory().buildStereotype(
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ModelMemberFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ModelMemberFilePersister.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/persistence/ModelMemberFilePersister.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ModelMemberFilePersister.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/persistence/ModelMemberFilePersister.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ModelMemberFilePersister.java 2007-06-28 05:06:22-0700
@@ -57,6 +57,7 @@
import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
import org.xml.sax.InputSource;
/**
@@ -213,15 +214,16 @@
* @return the persister
*/
protected MemberFilePersister getMemberFilePersister(ProjectMember pm) {
- MemberFilePersister persister = null;
- if (pm instanceof ProjectMemberDiagram) {
- persister =
- PersistenceManager.getInstance()
- .getDiagramMemberFilePersister();
- } else if (pm instanceof ProjectMemberTodoList) {
- persister = new TodoListMemberFilePersister();
- }
- return persister;
+ MemberFilePersister persister = null;
+ if (pm instanceof ProjectMemberDiagram) {
+ persister = PersistenceManager.getInstance()
+ .getDiagramMemberFilePersister();
+ } else if (pm instanceof ProjectMemberTodoList) {
+ persister = new TodoListMemberFilePersister();
+ } else if (pm instanceof ProfileConfiguration) {
+ persister = new ProfileConfigurationFilePersister();
+ }
+ return persister;
}
public void parse(String label, String xmiExtensionString) {
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/OldZargoFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/OldZargoFilePersister.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/persistence/OldZargoFilePersister.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/OldZargoFilePersister.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/persistence/OldZargoFilePersister.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/OldZargoFilePersister.java 2007-06-28 05:06:22-0700
@@ -71,14 +71,14 @@
public OldZargoFilePersister() {
}
- /*
+ /**
* @see org.argouml.persistence.AbstractFilePersister#getDesc()
*/
protected String getDesc() {
return Translator.localize("combobox.filefilter.zargo");
}
- /*
+ /**
* @see org.argouml.persistence.AbstractFilePersister#isSaveEnabled()
*/
public boolean isSaveEnabled() {
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ProfileConfigurationFilePersister.java 2007-06-28 05:06:22-0700
@@ -28,9 +28,10 @@
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
-import java.util.StringTokenizer;
+import java.util.Iterator;
import java.util.Vector;
import org.argouml.kernel.Project;
@@ -40,14 +41,29 @@
import org.argouml.uml.profile.ProfileManagerImpl;
import org.argouml.uml.profile.UserDefinedProfile;
+/**
+ * Persister for Project's Profile Configuration
+ *
+ * @author maurelio1234
+ */
public class ProfileConfigurationFilePersister extends MemberFilePersister {
- @Override
+ /**
+ * @return the tag used to store this content on the uml file
+ *
+ * @see org.argouml.persistence.MemberFilePersister#getMainTag()
+ */
public String getMainTag() {
return "profile";
}
- @Override
+ /**
+ * @param project
+ * @param inputStream
+ * @throws OpenException
+ *
+ * @see org.argouml.persistence.MemberFilePersister#load(org.argouml.kernel.Project, java.io.InputStream)
+ */
public void load(Project project, InputStream inputStream)
throws OpenException {
try {
@@ -57,7 +73,12 @@
inputStream));
String line = null;
- while (!(line = br.readLine().trim()).equals("<profile>"));
+ while (true) {
+ line = br.readLine();
+ if (line.trim().equals("<profile>")) {
+ break;
+ }
+ }
while (true) {
line = br.readLine().trim();
@@ -118,30 +139,59 @@
}
}
- @Override
- public void save(ProjectMember member, Writer writer, boolean xmlFragment) throws SaveException {
+ /**
+ * @param member
+ * @param writer
+ * @param xmlFragment
+ * @throws SaveException
+ * @deprecated
+ *
+ * @see org.argouml.persistence.MemberFilePersister#save(org.argouml.kernel.ProjectMember, java.io.Writer, boolean)
+ */
+ public void save(ProjectMember member, Writer writer, boolean xmlFragment)
+ throws SaveException {
+ PrintWriter w = new PrintWriter(writer);
+ saveProjectMember(member, w);
+ }
+
+ /**
+ * @param member
+ * @param stream
+ * @throws SaveException
+ *
+ * @see org.argouml.persistence.MemberFilePersister#save(org.argouml.kernel.ProjectMember, java.io.OutputStream)
+ */
+ public void save(ProjectMember member, OutputStream stream)
+ throws SaveException {
+ PrintWriter w = new PrintWriter(stream);
+ saveProjectMember(member, w);
+ }
+
+ private void saveProjectMember(ProjectMember member, PrintWriter w)
+ throws SaveException {
try {
if (member instanceof ProfileConfiguration) {
ProfileConfiguration pc = (ProfileConfiguration) member;
- PrintWriter w = new PrintWriter(writer);
w.println("<?xml version = \"1.0\" encoding = \"UTF-8\" ?>");
w.println("<!DOCTYPE profile SYSTEM \"profile.dtd\" >");
w.println("<profile>");
-
- for (Object p : pc.getProfiles()) {
- Profile profile = (Profile) p;
+
+ Iterator it = pc.getProfiles().iterator();
+ while (it.hasNext()) {
+ Profile profile = (Profile) it.next();
if (profile != pc.getDefaultProfile()) {
if (profile instanceof UserDefinedProfile) {
w.println("\t\t<userDefined>");
- w.println("\t\t\t"+((UserDefinedProfile) profile)
- .getModelFile().getCanonicalPath());
+ w.println("\t\t\t"
+ + ((UserDefinedProfile) profile)
+ .getModelFile().getCanonicalPath());
w.println("\t\t</userDefined>");
} else {
w.println("\t\t<plugin>");
- w.println("\t\t\t"+p.getClass().getName());
- w.println("\t\t</plugin>");
+ w.println("\t\t\t" + profile.getClass().getName());
+ w.println("\t\t</plugin>");
}
}
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/UmlFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/UmlFilePersister.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/persistence/UmlFilePersister.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/UmlFilePersister.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/persistence/UmlFilePersister.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/UmlFilePersister.java 2007-06-28 05:06:22-0700
@@ -67,6 +67,7 @@
import org.argouml.uml.ProjectMemberModel;
import org.argouml.uml.cognitive.ProjectMemberTodoList;
import org.argouml.uml.diagram.ProjectMemberDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
import org.argouml.util.ThreadUtils;
import org.tigris.gef.ocl.ExpansionException;
import org.tigris.gef.ocl.OCLExpander;
@@ -608,6 +609,8 @@
.getDiagramMemberFilePersister();
} else if (pm instanceof ProjectMemberTodoList) {
persister = new TodoListMemberFilePersister();
+ } else if (pm instanceof ProfileConfiguration) {
+ persister = new ProfileConfigurationFilePersister();
} else if (pm instanceof ProjectMemberModel) {
persister = new ModelMemberFilePersister();
}
@@ -628,6 +631,8 @@
.getDiagramMemberFilePersister();
} else if (tag.equals("todo")) {
persister = new TodoListMemberFilePersister();
+ } else if (tag.equals("profile")) {
+ persister = new ProfileConfigurationFilePersister();
} else if (tag.equals("xmi")) {
persister = new ModelMemberFilePersister();
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZargoFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZargoFilePersister.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/persistence/ZargoFilePersister.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZargoFilePersister.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/persistence/ZargoFilePersister.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZargoFilePersister.java 2007-06-28 05:06:22-0700
@@ -47,6 +47,7 @@
import org.argouml.i18n.Translator;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectMember;
+import org.argouml.uml.profile.ProfileConfiguration;
import org.argouml.util.FileConstants;
import org.argouml.util.ThreadUtils;
@@ -200,7 +201,7 @@
throws OpenException, InterruptedException {
ProgressMgr progressMgr = new ProgressMgr();
- progressMgr.setNumberOfPhases(3 + UML_PHASES_LOAD);
+ progressMgr.setNumberOfPhases(4 + UML_PHASES_LOAD);
ThreadUtils.checkIfInterrupted();
try {
@@ -220,7 +221,8 @@
+ encoding + "\" ?>");
int pgmlCount = getPgmlCount(file);
- boolean containsToDo = containsTodo(file);
+ boolean containsToDo = containsTodo(file);
+ boolean containsProfile = containsProfile(file);
// first read the .argo file from Zip
ZipInputStream zis =
@@ -266,6 +268,10 @@
if (containsToDo) {
writer.println("<member type='todo' name='.todo' />");
}
+ if (containsProfile) {
+ String type = ProfileConfiguration.EXTENSION;
+ writer.println("<member type='"+type+"' name='."+type+"' />");
+ }
}
writer.println(line);
}
@@ -318,6 +324,33 @@
reader.close();
}
+ // save the profile information
+ zis = openZipStreamAt(file.toURL(), "." + ProfileConfiguration.EXTENSION);
+
+ if (zis != null) {
+ InputStreamReader isr = new InputStreamReader(zis, encoding);
+ reader = new BufferedReader(isr);
+
+ String firstLine = reader.readLine();
+ if (firstLine.startsWith("<?xml")) {
+ // Skip the 2 lines
+ //<?xml version="1.0" encoding="UTF-8" ?>
+ //<!DOCTYPE todo SYSTEM "todo.dtd" >
+ reader.readLine();
+ } else {
+ writer.println(firstLine);
+ }
+
+
+
+ readerToWriter(reader, writer);
+
+ progressMgr.nextPhase();
+
+ zis.close();
+ reader.close();
+ }
+
writer.println("</uml>");
writer.close();
LOG.info("Completed combining files");
@@ -459,10 +492,18 @@
}
private boolean containsTodo(File file) throws IOException {
+ return containsType(file, "todo");
+ }
+
+ private boolean containsProfile(File file) throws IOException {
+ return containsType(file, ProfileConfiguration.EXTENSION);
+ }
+
+ private boolean containsType(File file, String type) throws IOException {
ZipInputStream zis = new ZipInputStream(file.toURL().openStream());
ZipEntry entry = zis.getNextEntry();
while (entry != null) {
- if (entry.getName().endsWith(".todo")) {
+ if (entry.getName().endsWith("." + type)) {
return true;
}
entry = zis.getNextEntry();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZipFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZipFilePersister.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/persistence/ZipFilePersister.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZipFilePersister.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/persistence/ZipFilePersister.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/persistence/ZipFilePersister.java 2007-06-28 05:06:22-0700
@@ -45,6 +45,7 @@
import org.argouml.uml.ProjectMemberModel;
import org.argouml.uml.cognitive.ProjectMemberTodoList;
import org.argouml.uml.diagram.ProjectMemberDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
import org.xml.sax.InputSource;
/**
@@ -196,6 +197,8 @@
.getDiagramMemberFilePersister();
} else if (pm instanceof ProjectMemberTodoList) {
persister = new TodoListMemberFilePersister();
+ } else if (pm instanceof ProfileConfiguration) {
+ persister = new ProfileConfigurationFilePersister();
} else if (pm instanceof ProjectMemberModel) {
persister = new ModelMemberFilePersister();
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/GUI.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/GUI.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/ui/GUI.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/GUI.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/ui/GUI.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/GUI.java 2007-06-28 05:06:22-0700
@@ -62,6 +62,7 @@
addSettingsTab(new SettingsTabShortcuts());
addProjectSettingsTab(new ProjectSettingsTabProperties());
+ addProjectSettingsTab(new ProfileSelectionTab());
}
/**
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/ProfileSelectionTab.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/ui/ProfileSelectionTab.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/ProfileSelectionTab.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/ui/ProfileSelectionTab.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/ProfileSelectionTab.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/ui/ProfileSelectionTab.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/ProfileSelectionTab.java 2007-06-28 05:06:22-0700
@@ -44,8 +44,9 @@
import javax.swing.event.ListDataListener;
import javax.swing.filechooser.FileFilter;
+import org.argouml.application.api.GUISettingsTabInterface;
+import org.argouml.i18n.Translator;
import org.argouml.kernel.ProjectManager;
-import org.argouml.uml.profile.FileModelLoader;
import org.argouml.uml.profile.Profile;
import org.argouml.uml.profile.ProfileConfiguration;
import org.argouml.uml.profile.ProfileManager;
@@ -61,10 +62,11 @@
public class ProfileSelectionTab extends JPanel implements
GUISettingsTabInterface, ActionListener {
- private JButton loadFromFile = new JButton("Load profile from file...");
+ private JButton loadFromFile = new JButton(Translator
+ .localize("tab.profiles.userdefined.load"));
- private JButton unregisterProfile = new JButton(
- "Unregister Profile loaded from file");
+ private JButton unregisterProfile = new JButton(Translator
+ .localize("tab.profiles.userdefined.unload"));
private JButton addButton = new JButton(">>");
@@ -74,16 +76,29 @@
private JList usedList = new JList(new UsedProfilesListModel());
+ /**
+ * This List contains the registered profiles that have not been applied
+ * to the current project
+ *
+ * @author maurelio1234
+ */
private class AvailableProfilesListModel implements ListModel {
private ProfileManager profileManager = ProfileManagerImpl
.getInstance();
private Vector listeners = new Vector();
+ /**
+ * @param arg0
+ * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)
+ */
public void addListDataListener(ListDataListener arg0) {
listeners.add(arg0);
}
+ /**
+ * Fire listeners
+ */
public void fireListeners() {
ListDataEvent evt = new ListDataEvent(this,
ListDataEvent.CONTENTS_CHANGED, 0, getSize());
@@ -93,7 +108,11 @@
}
}
- public Profile getProfileAt(int arg0) {
+ /**
+ * @param n the profile to be returned
+ * @return the n-th profile at the registered profiles list
+ */
+ public Profile getProfileAt(int n) {
ProfileConfiguration config = ProjectManager.getManager()
.getCurrentProject().getProfileConfiguration();
Vector registeredProfiles = profileManager.getRegisteredProfiles();
@@ -102,7 +121,7 @@
if (!config.getProfiles().contains(
registeredProfiles.elementAt(i))) {
- if (count == arg0) {
+ if (count == n) {
return ((Profile) registeredProfiles.elementAt(i));
}
++count;
@@ -111,6 +130,11 @@
return null;
}
+ /**
+ * @param arg0
+ * @return the arg0-th element of this list
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
public Object getElementAt(int arg0) {
Profile p = getProfileAt(arg0);
if (p != null) {
@@ -120,6 +144,11 @@
}
}
+ /**
+ * @return the amount of registered profiles not applied to current
+ * project
+ * @see javax.swing.ListModel#getSize()
+ */
public int getSize() {
ProfileConfiguration config = ProjectManager.getManager()
.getCurrentProject().getProfileConfiguration();
@@ -134,18 +163,34 @@
return count;
}
+ /**
+ * @param arg0
+ * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)
+ */
public void removeListDataListener(ListDataListener arg0) {
listeners.remove(arg0);
}
}
+ /**
+ * This list contains the profiles that are applied to the current project
+ *
+ * @author maurelio1234
+ */
private class UsedProfilesListModel implements ListModel {
private Vector listeners = new Vector();
+ /**
+ * @param arg0
+ * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)
+ */
public void addListDataListener(ListDataListener arg0) {
listeners.add(arg0);
}
+ /**
+ * Fires listeners
+ */
public void fireListeners() {
ListDataEvent evt = new ListDataEvent(this,
ListDataEvent.CONTENTS_CHANGED, 0, getSize());
@@ -155,30 +200,50 @@
}
}
- public Profile getProfileAt(int arg0) {
+ /**
+ * @param n
+ * @return the n-th profile on this list
+ */
+ public Profile getProfileAt(int n) {
ProfileConfiguration config = ProjectManager.getManager()
.getCurrentProject().getProfileConfiguration();
- return ((Profile) config.getProfiles().elementAt(arg0));
+ return ((Profile) config.getProfiles().elementAt(n));
}
- public Object getElementAt(int arg0) {
+ /**
+ * @param n
+ * @return the n-th profile on this list
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ public Object getElementAt(int n) {
ProfileConfiguration config = ProjectManager.getManager()
.getCurrentProject().getProfileConfiguration();
- return ((Profile) config.getProfiles().elementAt(arg0))
+ return ((Profile) config.getProfiles().elementAt(n))
.getDisplayName();
}
+ /**
+ * @return the amount of elements in the list
+ * @see javax.swing.ListModel#getSize()
+ */
public int getSize() {
ProfileConfiguration config = ProjectManager.getManager()
.getCurrentProject().getProfileConfiguration();
return config.getProfiles().size();
}
+ /**
+ * @param arg0
+ * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)
+ */
public void removeListDataListener(ListDataListener arg0) {
listeners.remove(arg0);
}
}
+ /**
+ * The default constructor for this class
+ */
public ProfileSelectionTab() {
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
@@ -193,7 +258,9 @@
JPanel leftList = new JPanel();
leftList.setLayout(new BorderLayout());
- leftList.add(new JLabel("Available Profiles:"), BorderLayout.NORTH);
+ leftList.add(new JLabel(Translator
+ .localize("tab.profiles.userdefined.unload")),
+ BorderLayout.NORTH);
leftList.add(availableList, BorderLayout.CENTER);
configPanel.add(leftList);
@@ -205,7 +272,9 @@
JPanel rightList = new JPanel();
rightList.setLayout(new BorderLayout());
- rightList.add(new JLabel("Active Profiles:"), BorderLayout.NORTH);
+ rightList.add(new JLabel(Translator
+ .localize("tab.profiles.userdefined.active")),
+ BorderLayout.NORTH);
rightList.add(usedList, BorderLayout.CENTER);
configPanel.add(rightList);
@@ -225,6 +294,10 @@
add(lffPanel);
}
+ /**
+ * @param arg0
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
public void actionPerformed(ActionEvent arg0) {
if (arg0.getSource() == addButton) {
AvailableProfilesListModel model =
@@ -288,7 +361,7 @@
model.fireListeners();
} else {
JOptionPane.showMessageDialog(this,
- "Error opening profile!");
+ Translator.localize("tab.profiles.userdefined.errorloading"));
}
}
}
@@ -297,10 +370,18 @@
usedList.validate();
}
+ /**
+ * @return the internationalization key that containing the name of this tab
+ * @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()
+ */
public String getTabKey() {
return "tab.profiles";
}
+ /**
+ * @return the panel containing this tab
+ * @see org.argouml.application.api.GUISettingsTabInterface#getTabPanel()
+ */
public JPanel getTabPanel() {
return this;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/SettingsTabPreferences.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/SettingsTabPreferences.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/ui/SettingsTabPreferences.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/SettingsTabPreferences.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/ui/SettingsTabPreferences.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/ui/SettingsTabPreferences.java 2007-06-28 05:06:22-0700
@@ -30,17 +30,12 @@
import java.awt.Insets;
import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
-import javax.swing.JTextField;
import org.argouml.application.api.Argo;
import org.argouml.application.api.GUISettingsTabInterface;
import org.argouml.configuration.Configuration;
import org.argouml.i18n.Translator;
-import org.argouml.kernel.ProjectManager;
-import org.argouml.uml.ProfileException;
/**
* Settings tab panel for handling ArgoUML application related settings.
@@ -55,7 +50,6 @@
private JCheckBox chkPreload;
private JCheckBox chkReloadRecent;
private JCheckBox chkStripDiagrams;
- private JTextField defaultProfile;
/**
* The constructor.
@@ -96,16 +90,6 @@
chkStripDiagrams = j3;
top.add(chkStripDiagrams, checkConstraints);
- // TODO: Profile field is currently read-only, need a selector
- checkConstraints.gridy++;
- top.add(new JLabel(Translator.localize("label.default-profile")),
- checkConstraints);
- defaultProfile = new JTextField();
- checkConstraints.gridy++;
- checkConstraints.fill = GridBagConstraints.HORIZONTAL;
- top.add(defaultProfile, checkConstraints);
- //defaultProfile.setEnabled(false);
-
add(top, BorderLayout.NORTH);
}
@@ -122,8 +106,6 @@
chkStripDiagrams.setSelected(
Configuration.getBoolean(Argo.KEY_XMI_STRIP_DIAGRAMS,
false));
- defaultProfile.setText(ProjectManager.getManager().getCurrentProject()
- .getProfile().getProfileModelFilename());
}
/*
@@ -136,14 +118,6 @@
chkReloadRecent.isSelected());
Configuration.setBoolean(Argo.KEY_XMI_STRIP_DIAGRAMS,
chkStripDiagrams.isSelected());
- try {
- ProjectManager.getManager().getCurrentProject().getProfile()
- .setProfileModelFilename(defaultProfile.getText());
- } catch (ProfileException e) {
- // shouldn't happen if profile was validated when selected
- JOptionPane.showMessageDialog(this, "Setting UML profile failed",
- "Profile save error", JOptionPane.ERROR_MESSAGE);
- }
}
/*
Removed: /trunk/src_new/org/argouml/uml/Profile.java
Url: http://argouml.tigris.org/source/browse/argouml//trunk/src_new/org/argouml/uml/Profile.java?view=auto&rev=12912
Removed: /trunk/src_new/org/argouml/uml/ProfileException.java
Url: http://argouml.tigris.org/source/browse/argouml//trunk/src_new/org/argouml/uml/ProfileException.java?view=auto&rev=12912
Removed: /trunk/src_new/org/argouml/uml/ProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml//trunk/src_new/org/argouml/uml/ProfileJava.java?view=auto&rev=12912
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/cognitive/critics/WizAddConstructor.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/cognitive/critics/WizAddConstructor.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/cognitive/critics/WizAddConstructor.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/cognitive/critics/WizAddConstructor.java 2007-06-28 05:06:22-0700
@@ -36,8 +36,7 @@
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
import org.argouml.ui.targetmanager.TargetManager;
-import org.argouml.uml.Profile;
-import org.argouml.uml.ProfileException;
+import org.argouml.uml.profile.ProfileException;
/**
* A wizard to add a constructor to a classifier.
@@ -100,17 +99,11 @@
*/
private Object getCreateStereotype(Object obj) {
Iterator iter = null;
- try {
- Project project = ProjectManager.getManager().getCurrentProject();
- Profile profile = project.getProfile();
- Object profileModel = profile.getProfileModel();
- iter = Model.getFacade().getOwnedElements(profileModel).iterator();
- } catch (ProfileException e) {
- // TODO: How are we going to handle exceptions here?
- // I suspect the profile should be part of the project
- // and not a singleton.
- LOG.error("Failed to get profile", e);
- }
+ Project project = ProjectManager.getManager().getCurrentProject();
+ Object profileModel = project.getProfileConfiguration()
+ .getDefaultProfile().getModel();
+ iter = Model.getFacade().getOwnedElements(profileModel).iterator();
+
while (iter.hasNext()) {
Object stereo = iter.next();
if (!Model.getFacade().isAStereotype(stereo)
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigActionState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigActionState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigActionState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigActionState.java 2007-06-28 05:06:22-0700
@@ -170,7 +170,7 @@
*
* Override setBounds to keep shapes looking right.
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java 2007-06-28 05:06:22-0700
@@ -246,7 +246,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
//if (getNameFig() == null) return;
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPartition.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPartition.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPartition.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPartition.java 2007-06-28 05:06:22-0700
@@ -209,7 +209,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPool.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPool.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPool.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigPool.java 2007-06-28 05:06:22-0700
@@ -161,7 +161,7 @@
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
@Override
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
Rectangle oldBounds = getBounds();
getBigPort().setBounds(x, y, w, h);
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java 2007-06-28 05:06:22-0700
@@ -175,7 +175,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java 2007-06-28 05:06:22-0700
@@ -319,7 +319,7 @@
* @author 10 Apr 2002. Jeremy Bennett ([email protected]). Patch to
* allow for stereotype as well.
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
// In the rather unlikely case that we have no name, we give up.
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponent.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponent.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponent.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponent.java 2007-06-28 05:06:22-0700
@@ -218,7 +218,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
Rectangle oldBounds = getBounds();
getBigPort().setBounds(x + BX, y, w - BX, h);
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java 2007-06-28 05:06:22-0700
@@ -219,7 +219,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigMNode.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigMNode.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigMNode.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigMNode.java 2007-06-28 05:06:22-0700
@@ -224,7 +224,7 @@
/*
* @see org.tigris.gef.presentation.FigNode#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java 2007-06-28 05:06:22-0700
@@ -196,7 +196,7 @@
/*
* @see org.tigris.gef.presentation.FigNode#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigObject.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigObject.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigObject.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/deployment/ui/FigObject.java 2007-06-28 05:06:22-0700
@@ -170,7 +170,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java 2007-06-28 05:06:22-0700
@@ -265,7 +265,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- public void setBoundsImpl(int x, int y, int w, int h) {
+ public void setStandardBounds(int x, int y, int w, int h) {
y = 50;
Rectangle oldBounds = getBounds();
w = headFig.getMinimumSize().width;
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigCompositeState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigCompositeState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigCompositeState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigCompositeState.java 2007-06-28 05:06:22-0700
@@ -146,7 +146,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java 2007-06-28 05:06:22-0700
@@ -191,7 +191,7 @@
*
* {@inheritDoc}
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigForkState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigForkState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigForkState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigForkState.java 2007-06-28 05:06:22-0700
@@ -97,7 +97,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
Rectangle oldBounds = getBounds();
if (w > h) {
h = HEIGHT;
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigJoinState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigJoinState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigJoinState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigJoinState.java 2007-06-28 05:06:22-0700
@@ -97,7 +97,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
Rectangle oldBounds = getBounds();
if (w > h) {
h = HEIGHT;
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSimpleState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSimpleState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSimpleState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSimpleState.java 2007-06-28 05:06:22-0700
@@ -119,7 +119,7 @@
* {@inheritDoc}
*/
@Override
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigStubState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigStubState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigStubState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigStubState.java 2007-06-28 05:06:22-0700
@@ -216,7 +216,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int theX, int theY, int theW, int theH) {
+ protected void setStandardBounds(int theX, int theY, int theW, int theH) {
Rectangle oldBounds = getBounds();
theW = 60;
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSubmachineState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSubmachineState.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSubmachineState.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/state/ui/FigSubmachineState.java 2007-06-28 05:06:22-0700
@@ -197,7 +197,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java 2007-06-28 05:06:22-0700
@@ -581,7 +581,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(final int x, final int y,
+ protected void setStandardBounds(final int x, final int y,
final int w, final int h) {
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigComment.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigComment.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigComment.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigComment.java 2007-06-28 05:06:22-0700
@@ -527,7 +527,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int px, int py, int w, int h) {
+ protected void setStandardBounds(int px, int py, int w, int h) {
if (bodyTextFig == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigDataType.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigDataType.java 2007-06-28 05:06:22-0700
@@ -318,7 +318,7 @@
* @param h Desired height of the figure
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(final int x, final int y, final int w,
+ protected void setStandardBounds(final int x, final int y, final int w,
final int h) {
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java 2007-06-28 05:06:22-0700
@@ -237,7 +237,7 @@
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
@Override
- protected void setBoundsImpl(final int x, final int y, final int w,
+ protected void setStandardBounds(final int x, final int y, final int w,
final int h) {
// Save our old boundaries so it can be used in property message later
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInstance.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInstance.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInstance.java 2007-06-28 05:06:22-0700
@@ -128,7 +128,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) return;
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInterface.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigInterface.java 2007-06-28 05:06:22-0700
@@ -476,7 +476,7 @@
*
* @param h Desired height of the FigInterface
*/
- protected void setBoundsImpl(final int x, final int y, final int w,
+ protected void setStandardBounds(final int x, final int y, final int w,
final int h) {
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigModel.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigModel.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigModel.java 2007-06-28 05:06:22-0700
@@ -73,7 +73,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (figPoly != null) {
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigPackage.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigPackage.java 2007-06-28 05:06:22-0700
@@ -417,7 +417,7 @@
*
* @param h Desired height of the FigClass
*/
- protected void setBoundsImpl(int xa, int ya, int w, int h) {
+ protected void setStandardBounds(int xa, int ya, int w, int h) {
// Save our old boundaries (needed later), and get minimum size
// info. "aSize" will be used to maintain a running calculation of our
// size at various points.
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSignal.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSignal.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSignal.java 2007-06-28 05:06:22-0700
@@ -196,7 +196,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(final int x, final int y, final int w,
+ protected void setStandardBounds(final int x, final int y, final int w,
final int h) {
// Save our old boundaries so it can be used in property message later
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java 2007-06-28 05:06:22-0700
@@ -195,7 +195,7 @@
*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(final int x, final int y,
+ protected void setStandardBounds(final int x, final int y,
final int w, final int h) {
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java 2007-06-28 05:06:22-0700
@@ -67,7 +67,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (figPoly != null) {
Rectangle oldBounds = getBounds();
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java 2007-06-28 05:06:22-0700
@@ -24,36 +24,23 @@
package org.argouml.uml.diagram.ui;
-public class ActionStereotypeViewBigIcon extends AbstractActionRadioMenuItem {
-
- private FigNodeModelElement node;
-
+/**
+ * When this action is triggered the selected node visualization changes into
+ * <code>BigIcon</code> mode. If the node has more than one applied stereotype
+ * it should be displayed exactly as its default visualization. If if has just
+ * one stereotype and it provider an icon, this icon replaces the default
+ * figure for the classifier.
+ *
+ * @author maurelio1234
+ */
+public class ActionStereotypeViewBigIcon extends ActionStereotypeView {
+ /**
+ * Default constructor for this action
+ *
+ * @param node the current node
+ */
public ActionStereotypeViewBigIcon(FigNodeModelElement node) {
- super("menu.popup.stereotype-view.big-icon", false);
-
- this.node = node;
- updateSelection();
- }
- private void updateSelection() {
- putValue("SELECTED",
- Boolean.valueOf(
- node.getStereotypeView() ==
- FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON));
- }
-
- @Override
- void toggleValueOfTarget(Object t) {
- node.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);
- updateSelection();
- }
-
- @Override
- Object valueOfTarget(Object t) {
- if (t instanceof FigNodeModelElement) {
- return ((FigNodeModelElement) t).getStereotypeView();
- } else {
- return t;
- }
+ super(node, "menu.popup.stereotype-view.big-icon",
+ FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);
}
-
}
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java 2007-06-28 05:06:22-0700
@@ -24,38 +24,21 @@
package org.argouml.uml.diagram.ui;
-public class ActionStereotypeViewSmallIcon extends AbstractActionRadioMenuItem {
-
- private FigNodeModelElement node;
-
-
+/**
+ * When this action is triggered the selected node visualization changes into
+ * <code>SmallIcon</code> mode. At this mode, all the stereotypes that provide
+ * an alternate icon should be replaced by the a reduced version of the icon.
+ *
+ * @author maurelio1234
+ */
+public class ActionStereotypeViewSmallIcon extends ActionStereotypeView {
+ /**
+ * Default constructor for this action
+ *
+ * @param node the current node
+ */
public ActionStereotypeViewSmallIcon(FigNodeModelElement node) {
- super("menu.popup.stereotype-view.small-icon", false);
-
- this.node = node;
- updateSelection();
- }
-
- private void updateSelection() {
- putValue("SELECTED",
- Boolean.valueOf(
- node.getStereotypeView() ==
- FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON));
+ super(node, "menu.popup.stereotype-view.small-icon",
+ FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);
}
-
- @Override
- void toggleValueOfTarget(Object t) {
- node.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);
- updateSelection();
- }
-
- @Override
- Object valueOfTarget(Object t) {
- if (t instanceof FigNodeModelElement) {
- return ((FigNodeModelElement) t).getStereotypeView();
- } else {
- return t;
- }
- }
-
}
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java 2007-06-28 05:06:22-0700
@@ -24,37 +24,21 @@
package org.argouml.uml.diagram.ui;
-public class ActionStereotypeViewTextual extends AbstractActionRadioMenuItem {
-
- private FigNodeModelElement node;
-
+/**
+ * When this action is triggered the selected node visualization changes into
+ * <code>Textual</code> mode. This is the default mode for all nodes. The
+ * stereotypes are displayed as the stereotype name between guillemets.
+ *
+ * @author maurelio1234
+ */
+public class ActionStereotypeViewTextual extends ActionStereotypeView {
+ /**
+ * Default constructor for this action
+ *
+ * @param node the current node
+ */
public ActionStereotypeViewTextual(FigNodeModelElement node) {
- super("menu.popup.stereotype-view.textual", false);
-
- this.node = node;
- updateSelection();
+ super(node, "menu.popup.stereotype-view.textual-icon",
+ FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);
}
-
- private void updateSelection() {
- putValue("SELECTED",
- Boolean.valueOf(
- node.getStereotypeView() ==
- FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL));
- }
-
- @Override
- void toggleValueOfTarget(Object t) {
- node.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);
- updateSelection();
- }
-
- @Override
- Object valueOfTarget(Object t) {
- if (t instanceof FigNodeModelElement) {
- return ((FigNodeModelElement) t).getStereotypeView();
- } else {
- return t;
- }
- }
-
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigMessage.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigMessage.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigMessage.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/ui/FigMessage.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigMessage.java 2007-06-28 05:06:22-0700
@@ -289,7 +289,7 @@
* @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
*/
@Override
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
if (getNameFig() == null) {
return;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeAssociation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeAssociation.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeAssociation.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeAssociation.java 2007-06-28 05:06:22-0700
@@ -266,7 +266,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
Rectangle oldBounds = getBounds();
getBigPort().setBounds(x, y, w, h);
head.setBounds(x, y, w, h);
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java 2007-06-28 05:06:22-0700
@@ -28,6 +28,7 @@
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
+import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
@@ -91,6 +92,7 @@
import org.tigris.gef.graph.MutableGraphSupport;
import org.tigris.gef.presentation.Fig;
import org.tigris.gef.presentation.FigGroup;
+import org.tigris.gef.presentation.FigImage;
import org.tigris.gef.presentation.FigNode;
import org.tigris.gef.presentation.FigRect;
import org.tigris.gef.presentation.FigText;
@@ -202,6 +204,32 @@
*/
protected static final int ACTIVE = 8;
+ /**
+ * Used for #setStereotypeView(). Represents the default view for
+ * stereotypes applied to this node.
+ *
+ * @see ActionStereotypeViewTextual
+ */
+ public static final int STEREOTYPE_VIEW_TEXTUAL = 0;
+
+ /**
+ * Used for #setStereotypeView(). Represents the view for
+ * stereotypes where the default representation is replaced by a provided
+ * icon.
+ *
+ * @see ActionStereotypeViewBigIcon
+ */
+ public static final int STEREOTYPE_VIEW_BIG_ICON = 1;
+
+ /**
+ * Used for #setStereotypeView(). Represents the view for
+ * stereotypes where the default view is adorned with a small version of the
+ * provided icon.
+ *
+ * @see ActionStereotypeViewSmallIcon
+ */
+ public static final int STEREOTYPE_VIEW_SMALL_ICON = 2;
+
////////////////////////////////////////////////////////////////
// instance variables
@@ -222,6 +250,43 @@
private Fig stereotypeFig;
/**
+ * The <code>FigProfileIcon</code> being currently displayed
+ */
+ private FigProfileIcon stereotypeFigProfileIcon;
+
+ /**
+ * Contains the figs of the floating stereotypes when viewed in
+ * <code>SmallIcon</code> mode.
+ */
+ private Vector floatingStereotypes = new Vector();
+
+ /**
+ * The current stereotype view
+ *
+ * @see #STEREOTYPE_VIEW_TEXTUAL
+ * @see #STEREOTYPE_VIEW_SMALL_ICON
+ * @see #STEREOTYPE_VIEW_BIG_ICON
+ */
+ private int stereotypeView = STEREOTYPE_VIEW_TEXTUAL;
+
+ /**
+ * The width of the profile icons when viewed at the small icon mode.
+ * The icon width is resized to <code>ICON_WIDTH</code> and the height is
+ * set to a value that attempts to keep the original width/height
+ * proportion.
+ */
+ private static final int ICON_WIDTH = 16;
+
+ /**
+ * When stereotypes are shown in <code>BigIcon</code> mode the
+ * <code>nameFig</code> is replaced by the one provided by the
+ * <code>FigProfileIcon</code>
+ *
+ * @see FigProfileIcon
+ */
+ private FigText originalNameFig;
+
+ /**
* EnclosedFigs are the Figs that are enclosed by this figure. Say that
* it is a Package then these are the Classes, Interfaces, Packages etc
* that are on this figure. This is not the same as the figures in the
@@ -483,8 +548,9 @@
// Add stereotypes submenu
Action[] stereoActions =
StereotypeUtility.getApplyStereotypeActions(getOwner());
+
+ popUpActions.insertElementAt(new JSeparator(), 0);
if (stereoActions != null) {
- popUpActions.insertElementAt(new JSeparator(), 0);
ArgoJMenu stereotypes =
new ArgoJMenu("menu.popup.apply-stereotypes");
for (int i = 0; i < stereoActions.length; ++i) {
@@ -492,8 +558,17 @@
}
popUpActions.insertElementAt(stereotypes, 0);
}
+
+ // add stereotype view submenu
+ ArgoJMenu stereotypesView =
+ new ArgoJMenu("menu.popup.stereotype-view");
+
+ stereotypesView.addRadioItem(new ActionStereotypeViewTextual(this));
+ stereotypesView.addRadioItem(new ActionStereotypeViewBigIcon(this));
+ stereotypesView.addRadioItem(new ActionStereotypeViewSmallIcon(this));
+
+ popUpActions.insertElementAt(stereotypesView, 0);
}
-
return popUpActions;
}
@@ -1092,6 +1167,7 @@
addElementListener(mee.getNewValue(), "name");
}
updateStereotypeText();
+ updateStereotypeIcon();
damage();
}
}
@@ -1192,8 +1268,7 @@
throw new IllegalStateException(
"The owner cannot be changed once set");
}
- if (!Model.getFacade().isAUMLElement(owner)) {
- throw new IllegalArgumentException(
+ if (!Model.getFacade().isAUMLElement(owner)) { throw new IllegalArgumentException(
"The owner must be a model element - got a "
+ owner.getClass().getName());
}
@@ -1406,10 +1481,121 @@
public void renderingChanged() {
updateNameText();
updateStereotypeText();
+ updateStereotypeIcon();
updateBounds();
damage();
}
+ protected void updateStereotypeIcon() {
+ if (getOwner() == null) {
+ LOG.warn("Owner of [" + this.toString() + "/" + this.getClass()
+ + "] is null.");
+ LOG.warn("I return...");
+ return;
+ }
+
+ if (stereotypeFigProfileIcon != null) {
+ Iterator it = getFigs().iterator();
+ while (it.hasNext()) {
+ Object fig = it.next();
+ ((Fig) fig).setVisible(fig != stereotypeFigProfileIcon);
+ }
+
+ this.removeFig(stereotypeFigProfileIcon);
+ stereotypeFigProfileIcon = null;
+ }
+
+ if (originalNameFig != null) {
+ this.setNameFig(originalNameFig);
+ originalNameFig = null;
+ }
+
+ if (!floatingStereotypes.isEmpty()) {
+ Iterator it = floatingStereotypes.iterator();
+ while (it.hasNext()) {
+ Object icon = it.next();
+ this.removeFig((Fig) icon);
+ }
+ floatingStereotypes.clear();
+ }
+
+ int practicalView = getPracticalView();
+ Object modelElement = getOwner();
+ Collection stereos = Model.getFacade().getStereotypes(modelElement);
+
+ Fig stereoFig = getStereotypeFig();
+ if (stereoFig instanceof FigStereotypesCompartment) {
+ ((FigStereotypesCompartment) stereoFig)
+ .setHidingStereotypesWithIcon(practicalView == STEREOTYPE_VIEW_SMALL_ICON);
+ }
+
+ if (practicalView == STEREOTYPE_VIEW_BIG_ICON) {
+
+ if (stereos != null) {
+ Image replaceIcon = null;
+
+ if (stereos.size() == 1) {
+ Object stereo = stereos.iterator().next();
+ replaceIcon = ProjectManager.getManager()
+ .getCurrentProject().getProfileConfiguration()
+ .getFigNodeStrategy().getIconForStereotype(stereo);
+ }
+
+ if (replaceIcon != null) {
+ stereotypeFigProfileIcon = new FigProfileIcon(replaceIcon,
+ getName());
+ stereotypeFigProfileIcon.setOwner(getOwner());
+
+ stereotypeFigProfileIcon.setLocation(getBigPort()
+ .getLocation());
+ this.addFig(stereotypeFigProfileIcon);
+
+ originalNameFig = this.getNameFig();
+ this.setNameFig(stereotypeFigProfileIcon.getLabelFig());
+
+ getBigPort().
+ setBounds(stereotypeFigProfileIcon.getBounds());
+
+ Iterator it = getFigs().iterator();
+ while (it.hasNext()) {
+ Object fig = it.next();
+ ((Fig) fig).setVisible(fig == stereotypeFigProfileIcon);
+ }
+
+ }
+ }
+ } else if (practicalView == STEREOTYPE_VIEW_SMALL_ICON) {
+ int i = this.getX() + this.getWidth() - ICON_WIDTH - 2;
+
+ Iterator it = stereos.iterator();
+ while (it.hasNext()) {
+ Object stereo = it.next();
+ Image icon = ProjectManager.getManager().getCurrentProject()
+ .getProfileConfiguration().getFigNodeStrategy()
+ .getIconForStereotype(stereo);
+ if (icon != null) {
+ FigImage fimg = new FigImage(i, this.getBigPort().getY()+2, icon);
+ fimg.setSize(ICON_WIDTH,
+ (icon.getHeight(null) * ICON_WIDTH)
+ / icon.getWidth(null));
+
+ addFig(fimg);
+ floatingStereotypes.add(fimg);
+
+ i -= ICON_WIDTH - 2;
+ }
+ }
+ }
+
+ updateStereotypeText();
+
+ damage();
+ calcBounds();
+ updateEdges();
+ this.updateBounds();
+ this.redraw();
+ }
+
/*
* @see org.tigris.gef.presentation.Fig#calcBounds()
*/
@@ -1772,5 +1958,97 @@
return TargetManager.getInstance().getSingleModelTarget()
== getOwner();
}
+
+ /**
+ * @return current stereotype view
+ */
+ public int getStereotypeView() {
+ return stereotypeView;
+ }
+
+ /**
+ * When using <code>BigIcon</code> mode and zero or more than one stereotype
+ * the practical view should be the default one.
+ *
+ * @return current practical stereotype view
+ */
+ public int getPracticalView() {
+ int practicalView = getStereotypeView();
+ Object modelElement = getOwner();
+ Collection stereos = Model.getFacade().getStereotypes(modelElement);
+
+ if (getStereotypeView() == STEREOTYPE_VIEW_BIG_ICON &&
+ (stereos == null || stereos.size() != 1)) {
+ practicalView = STEREOTYPE_VIEW_TEXTUAL;
+ }
+ return practicalView;
+ }
+
+ /**
+ * Sets the stereotype view
+ * @param s the stereotype view to be set
+ */
+ public void setStereotypeView(int s) {
+ this.stereotypeView = s;
+ renderingChanged();
+ }
+
+ /**
+ * Sets the bounds of this classifier. Takes the stereotype view into
+ * consideration.<br>
+ *
+ * Do not override this method, override
+ * {@link #setStandardBounds(int, int, int, int)} instead.
+ *
+ * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
+ */
+ protected void setBoundsImpl(final int x, final int y, final int w,
+ final int h) {
+
+ if (getPracticalView() == STEREOTYPE_VIEW_BIG_ICON) {
+ if (stereotypeFigProfileIcon != null) {
+ stereotypeFigProfileIcon.setBounds(stereotypeFigProfileIcon
+ .getX(), stereotypeFigProfileIcon.getY(), w, h);
+ // FigClass calls setBoundsImpl before we set
+ // the stereotypeFigProfileIcon
+ }
+ } else {
+ setStandardBounds(x, y, w, h);
+ if (getStereotypeView() == STEREOTYPE_VIEW_SMALL_ICON) {
+ int i = w + x - ICON_WIDTH - 2;
+
+ Iterator it = this.floatingStereotypes.iterator();
+ while (it.hasNext()) {
+ Object ficon = it.next();
+ ((FigImage) ficon).setLocation(i,
+ y + 2);
+ i -= ICON_WIDTH - 2;
+ }
+ }
+ }
+ }
+
+ /**
+ * Replaces {@link #setBoundsImpl(int, int, int, int)}.
+ *
+ * @param x
+ * Desired X coordinate of upper left corner
+ *
+ * @param y
+ * Desired Y coordinate of upper left corner
+ *
+ * @param w
+ * Desired width of the FigClass
+ *
+ * @param h
+ * Desired height of the FigClass
+ *
+ * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int,
+ * int)
+ */
+ protected void setStandardBounds(final int x, final int y,
+ final int w, final int h) {
+
+ }
} /* end class FigNodeModelElement */
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java 2007-06-28 05:06:22-0700
@@ -24,12 +24,15 @@
package org.argouml.uml.diagram.ui;
+import java.awt.Image;
import java.beans.PropertyChangeEvent;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.Vector;
import org.apache.log4j.Logger;
+import org.argouml.kernel.ProjectManager;
import org.argouml.model.AddAssociationEvent;
import org.argouml.model.Model;
import org.argouml.model.RemoveAssociationEvent;
@@ -75,6 +78,8 @@
private int stereotypeCount = 0;
+ private boolean hidingStereotypesWithIcon = false;
+
/**
* The constructor.
*
@@ -130,6 +135,7 @@
Model.getFacade().getName(stereotype));
stereotypeTextFig.setOwner(stereotype);
addFig(stereotypeTextFig);
+ reorderStereotypeFigs();
damage();
}
} else {
@@ -151,6 +157,40 @@
}
}
+ /**
+ * Keep the probaly invisible figs at the end of the list
+ */
+ private void reorderStereotypeFigs() {
+ List allFigs = getFigs();
+ List figsWithIcon = new Vector();
+ List figsWithOutIcon = new Vector();
+ List others = new Vector();
+
+ Iterator it = allFigs.iterator();
+
+ while(it.hasNext()) {
+ Fig f = (Fig) it.next();
+ if (f instanceof FigStereotype) {
+ FigStereotype s = (FigStereotype) f;
+ if (getIconForStereotype(s) != null) {
+ figsWithIcon.add(s);
+ } else {
+ figsWithOutIcon.add(s);
+ }
+ } else {
+ others.add(f);
+ }
+ }
+
+ Vector n = new Vector();
+
+ n.addAll(others);
+ n.addAll(figsWithOutIcon);
+ n.addAll(figsWithIcon);
+
+ setFigs(n);
+ }
+
private Fig findFig(Object stereotype) {
for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
Fig f = (Fig) it.next();
@@ -214,7 +254,7 @@
stereotypeTextFig.setText(keyword);
acounter++;
}
-
+
Collection stereos = Model.getFacade().getStereotypes(modelElement);
if (stereos != null) {
Iterator iter = stereos.iterator();
@@ -250,12 +290,37 @@
removeFig((Fig) figs.get(i));
}
}
+
+ reorderStereotypeFigs();
+
+ // remove all stereotypes that have a graphical icon
+ updateHiddenStereotypes();
}
}
+ private void updateHiddenStereotypes() {
+ List figs = getFigs();
+
+ for (int i = 0; i < figs.size(); ++i) {
+ Fig f = (Fig) figs.get(i);
+ if (f instanceof FigStereotype) {
+ FigStereotype fs = (FigStereotype) f;
+ fs.setVisible(getIconForStereotype(fs) == null
+ || !isHidingStereotypesWithIcon());
+ }
+ }
+ }
+
+ private Image getIconForStereotype(FigStereotype fs) {
+ return ProjectManager.getManager().getCurrentProject()
+ .getProfileConfiguration().getFigNodeStrategy()
+ .getIconForStereotype(fs.getOwner());
+ }
+
/*
- * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
- */
+ * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int,
+ * int)
+ */
protected void setBoundsImpl(int x, int y, int w, int h) {
Fig fig;
int yy = y;
@@ -285,4 +350,13 @@
protected void createModelElement() {
}
+
+ public boolean isHidingStereotypesWithIcon() {
+ return hidingStereotypesWithIcon;
+ }
+
+ public void setHidingStereotypesWithIcon(boolean hidingStereotypesWithIcon) {
+ this.hidingStereotypesWithIcon = hidingStereotypesWithIcon;
+ updateHiddenStereotypes();
+ }
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/StereotypeUtility.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/StereotypeUtility.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/ui/StereotypeUtility.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/StereotypeUtility.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/ui/StereotypeUtility.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/ui/StereotypeUtility.java 2007-06-28 05:06:22-0700
@@ -91,7 +91,10 @@
});
Collection models =
ProjectManager.getManager().getCurrentProject().getModels();
-
+
+ models.addAll(ProjectManager.getManager().getCurrentProject()
+ .getProfileConfiguration().getProfileModels());
+
addAllUniqueModelElementsFrom(availableStereotypes, paths, Model
.getExtensionMechanismsHelper().getAllPossibleStereotypes(
models, modelElement));
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigActor.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigActor.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/use_case/ui/FigActor.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigActor.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/use_case/ui/FigActor.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigActor.java 2007-06-28 05:06:22-0700
@@ -189,7 +189,7 @@
/*
* @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
int middle = w / 2;
h = _h;
Rectangle oldBounds = getBounds();
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigUseCase.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigUseCase.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/diagram/use_case/ui/FigUseCase.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigUseCase.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/diagram/use_case/ui/FigUseCase.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/diagram/use_case/ui/FigUseCase.java 2007-06-28 05:06:22-0700
@@ -603,7 +603,7 @@
*
* @param h height of bounding box
*/
- protected void setBoundsImpl(int x, int y, int w, int h) {
+ protected void setStandardBounds(int x, int y, int w, int h) {
// Remember where we are at present, so we can tell GEF later. Then
// check we are as big as the minimum size
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FigNodeStrategy.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FigNodeStrategy.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FigNodeStrategy.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FigNodeStrategy.java 2007-06-28 05:06:22-0700
@@ -26,8 +26,21 @@
import java.awt.Image;
+/**
+ * Using this stragey profiles can provide icons to replace the default
+ * visualization of stereotyped node according to UML 2.0 specification.
+ *
+ * @author maurelio1234
+ */
public interface FigNodeStrategy {
- Image getIconForStereotype(Object element);
+ /**
+ * Returns the image of the icon that should replace the model elements
+ * having this stereotype
+ *
+ * @param stereotype the stereotype model element
+ * @return the icon
+ */
+ Image getIconForStereotype(Object stereotype);
}
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FileModelLoader.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FileModelLoader.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FileModelLoader.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FileModelLoader.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FileModelLoader.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FileModelLoader.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/FileModelLoader.java 2007-06-28 05:06:22-0700
@@ -44,6 +44,11 @@
private static final Logger LOG = Logger
.getLogger(FileModelLoader.class);
+ /**
+ * @param modelFilename the model to be loaded
+ * @return the profile model
+ * @see org.argouml.uml.profile.StreamModelLoader#loadModel(java.lang.String)
+ */
public Object loadModel(String modelFilename) {
LOG.info("Loading profile from file'" + modelFilename + "'");
InputStream is = null;
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileConfiguration.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileConfiguration.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileConfiguration.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileConfiguration.java 2007-06-28 05:06:22-0700
@@ -29,14 +29,14 @@
import java.util.Iterator;
import java.util.Vector;
-import org.apache.log4j.Logger;
import org.argouml.kernel.AbstractProjectMember;
import org.argouml.kernel.Project;
import org.argouml.uml.profile.java.ProfileJava;
/**
- * This class captures the configurable behavior of Argo.
+ * This class captures represents the unique access point for the
+ * configurability allowed by the use of profiles.
*
- * @author Marcos Aurélio
+ * @author maurelio1234
*/
public class ProfileConfiguration extends AbstractProjectMember {
@@ -47,77 +47,121 @@
private Vector profiles = new Vector();
private Vector profileModels = new Vector();
+ /**
+ * The extension used in serialization and returned by {@link #getType()}
+ */
public static final String EXTENSION = "profile";
/**
* Logger.
*/
- private static final Logger LOG = Logger.getLogger(ProfileConfiguration.class);
+// private static final Logger LOG =
+// Logger.getLogger(ProfileConfiguration.class);
+ /**
+ * The default constructor for this class. Sets the Java profile as the
+ * default one and its formating strategy as the default one.
+ *
+ * @param project the project that contains this configuration
+ */
public ProfileConfiguration(Project project) {
super(EXTENSION, project);
- defaultProfile = new ProfileJava();
-
- formatingStrategy = defaultProfile.getFormatingStrategy();
-
+ defaultProfile = new ProfileJava();
addProfile(defaultProfile);
+ activateFormatingStrategy(defaultProfile);
}
+ /**
+ * @return the current formating strategy
+ */
public FormatingStrategy getFormatingStrategy() {
return formatingStrategy;
}
- public void setFormatingStrategy(FormatingStrategy formatingStrategy) {
- this.formatingStrategy = formatingStrategy;
+ /**
+ * 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 formating strategy
+ */
+ public void activateFormatingStrategy(Profile profile) {
+ if (profile.getFormatingStrategy() != null
+ && getProfiles().contains(profile)) {
+ this.formatingStrategy = profile.getFormatingStrategy();
+ }
}
+ /**
+ * @return the list of applied profiles
+ */
public Vector getProfiles() {
return profiles;
}
+ /**
+ * @return the default profile
+ */
public Profile getDefaultProfile() {
return defaultProfile;
}
+ /**
+ * Applies a new profile to this configuration
+ *
+ * @param p the profile to be applied
+ */
public void addProfile(Profile p) {
profiles.add(p);
profileModels.add(p.getModel());
FigNodeStrategy fns = p.getFigureStrategy();
- if (fns!=null) {
+ if (fns != null) {
figNodeStrategies.add(fns);
}
}
- public void setDefaultProfile(Profile defaultProfile) {
- this.defaultProfile = defaultProfile;
+ /**
+ * Sets the default profile.
+ *
+ * @param profile the default profile to be set
+ */
+ public void setDefaultProfile(Profile profile) {
+ this.defaultProfile = profile;
}
+ /**
+ * @return the list of models of the currently applied profile.
+ */
public Vector getProfileModels() {
return profileModels;
}
+ /**
+ * Removes the passed profile from the configuration. The default cannot be
+ * removed. Use {@link #setDefaultProfile(Profile)} instead.
+ *
+ * @param p the profile to be removed
+ */
public void removeProfile(Profile p) {
if (p != defaultProfile) {
profiles.remove(p);
profileModels.remove(p.getModel());
-
- FigNodeStrategy fns = p.getFigureStrategy();
- if (fns!=null) {
- figNodeStrategies.remove(fns);
- }
-
+
+ FigNodeStrategy fns = p.getFigureStrategy();
+ if (fns != null) {
+ figNodeStrategies.remove(fns);
+ }
+
}
}
- @SuppressWarnings("unchecked")
private FigNodeStrategy compositeFigNodeStrategy = new FigNodeStrategy() {
public Image getIconForStereotype(Object element) {
Iterator it = figNodeStrategies.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
FigNodeStrategy strat = (FigNodeStrategy) it.next();
Image extra = strat.getIconForStereotype(element);
@@ -130,15 +174,28 @@
};
+ /**
+ * @return the current FigNodeStrategy
+ */
public FigNodeStrategy getFigNodeStrategy() {
return compositeFigNodeStrategy;
}
- @Override
+ /**
+ * @return the extension for this project member
+ * @see org.argouml.kernel.AbstractProjectMember#getType()
+ */
public String getType() {
return EXTENSION;
}
+ /**
+ * Objects of this class are always consistent, there's no need
+ * to repair them.
+ *
+ * @return the empty string.
+ * @see org.argouml.kernel.ProjectMember#repair()
+ */
public String repair() {
return "";
}
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManager.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManager.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManager.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManager.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManager.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManager.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManager.java 2007-06-28 05:06:22-0700
@@ -27,12 +27,26 @@
import java.util.Vector;
/**
- * Manages a set of registered profiles.
+ * Manages the global set of registered profiles.
*
- * @author Marcos Aurélio
+ * @author maurelio1234
*/
public interface ProfileManager {
+ /**
+ * Register a new profile
+ *
+ * @param p the profile
+ */
void registerProfile(Profile p);
+ /**
+ * Remove a profile from the list
+ *
+ * @param p the profile
+ */
void removeProfile(Profile p);
- Vector getRegisteredProfiles();
+
+ /**
+ * @return the list of registered profiles
+ */
+ Vector getRegisteredProfiles();
}
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManagerImpl.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManagerImpl.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManagerImpl.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManagerImpl.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManagerImpl.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileManagerImpl.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ProfileManagerImpl.java 2007-06-28 05:06:22-0700
@@ -27,7 +27,7 @@
import java.util.Vector;
/**
- * Default ProfileManager implementation
+ * Default <code>ProfileManager</code> implementation
*
* @author Marcos Aurélio
*/
@@ -40,6 +40,9 @@
}
+ /**
+ * @return the unique instance for this class
+ */
public static ProfileManager getInstance() {
if (instance == null) {
instance = new ProfileManagerImpl();
@@ -47,14 +50,26 @@
return instance;
}
+ /**
+ * @return the list of profiles
+ * @see org.argouml.uml.profile.ProfileManager#getRegisteredProfiles()
+ */
public Vector getRegisteredProfiles() {
return profiles;
}
+ /**
+ * @param p the profile
+ * @see org.argouml.uml.profile.ProfileManager#registerProfile(org.argouml.uml.profile.Profile)
+ */
public void registerProfile(Profile p) {
profiles.add(p);
}
+ /**
+ * @param p the profile
+ * @see org.argouml.uml.profile.ProfileManager#removeProfile(org.argouml.uml.profile.Profile)
+ */
public void removeProfile(Profile p) {
profiles.remove(p);
}
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ResourceModelLoader.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ResourceModelLoader.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ResourceModelLoader.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ResourceModelLoader.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ResourceModelLoader.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ResourceModelLoader.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ResourceModelLoader.java 2007-06-28 05:06:22-0700
@@ -26,6 +26,11 @@
import org.apache.log4j.Logger;
+/**
+ * Loads models using the default class loader or a provided one.
+ *
+ * @author maurelio1234
+ */
public class ResourceModelLoader extends StreamModelLoader {
/**
@@ -34,16 +39,30 @@
private static final Logger LOG = Logger
.getLogger(ResourceModelLoader.class);
- private static Class classloader;
+ private Class classloader;
+ /**
+ * The default constructor for this class. Loads resources from the same
+ * classloader that loaded this class.
+ */
public ResourceModelLoader() {
this.classloader = this.getClass();
}
+ /**
+ * Loads resources from the classloader that loaded the given class
+ *
+ * @param c the reference class
+ */
public ResourceModelLoader(Class c) {
this.classloader = c;
}
+ /**
+ * @param path the model path
+ * @return the model
+ * @see org.argouml.uml.profile.StreamModelLoader#loadModel(java.lang.String)
+ */
public Object loadModel(String path) {
LOG.info("Loading profile from resource'" + path + "'");
return super.loadModel(this.classloader
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/StreamModelLoader.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/StreamModelLoader.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/StreamModelLoader.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/StreamModelLoader.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/StreamModelLoader.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/StreamModelLoader.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/StreamModelLoader.java 2007-06-28 05:06:22-0700
@@ -46,10 +46,16 @@
.getLogger(StreamModelLoader.class);
/**
+ * @param path the path of the model
+ * @return the loaded model
* @see org.argouml.uml.profile.ProfileModelLoader#loadModel(java.lang.String)
*/
public abstract Object loadModel(String path);
+ /**
+ * @param is the stream from where the model should be loaded
+ * @return the model
+ */
protected Object loadModel(InputStream is) {
if (is != null) {
try {
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/UserDefinedProfile.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/UserDefinedProfile.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/UserDefinedProfile.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/UserDefinedProfile.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/UserDefinedProfile.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/UserDefinedProfile.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/UserDefinedProfile.java 2007-06-28 05:06:22-0700
@@ -37,32 +37,53 @@
private File modelFile;
private ProfileModelLoader modelLoader;
+ /**
+ * The default constructor for this class
+ *
+ * @param file the file from where the model should be read
+ */
public UserDefinedProfile(File file) {
this.displayName = file.getName();
this.modelLoader = new FileModelLoader();
this.modelFile = file;
}
- @Override
+ /**
+ * @return the string that should represent this profile in the GUI.
+ *
+ * @see org.argouml.uml.profile.Profile#getDisplayName()
+ */
public String getDisplayName() {
return displayName;
}
- @Override
+ /**
+ * @return null
+ * @see org.argouml.uml.profile.Profile#getFormatingStrategy()
+ */
public FormatingStrategy getFormatingStrategy() {
return null;
}
- @Override
+ /**
+ * @return the model loaded from the filesystem
+ * @see org.argouml.uml.profile.Profile#getModel()
+ */
public Object getModel() {
return modelLoader.loadModel(modelFile.getPath());
}
- @Override
+ /**
+ * @return null
+ * @see org.argouml.uml.profile.Profile#getFigureStrategy()
+ */
public FigNodeStrategy getFigureStrategy() {
return null;
}
+ /**
+ * @return the file passed at the constructor
+ */
public File getModelFile() {
return modelFile;
}
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ZipModelLoader.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ZipModelLoader.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ZipModelLoader.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ZipModelLoader.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ZipModelLoader.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ZipModelLoader.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/ZipModelLoader.java 2007-06-28 05:06:22-0700
@@ -34,6 +34,11 @@
import org.apache.log4j.Logger;
+/**
+ * Loads model data from a Zip file
+ *
+ * @author maurelio1234
+ */
public class ZipModelLoader extends StreamModelLoader {
/**
* Logger.
@@ -41,6 +46,11 @@
private static final Logger LOG = Logger
.getLogger(ZipModelLoader.class);
+ /**
+ * @param modelFilename the zip file
+ * @return the loaded model
+ * @see org.argouml.uml.profile.StreamModelLoader#loadModel(java.lang.String)
+ */
public Object loadModel(String modelFilename) {
LOG.info("Loading profile from ZIP '" + modelFilename + "'");
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/JavaFormatingStrategy.java 2007-06-28 05:06:22-0700
@@ -36,9 +36,11 @@
*/
public class JavaFormatingStrategy implements FormatingStrategy {
- /*
- * @see org.argouml.uml.Profile#formatElement(java.lang.Object,
- * java.lang.Object)
+ /**
+ * @param element the element to be formated
+ * @param namespace the element's namespace
+ * @return the formated string
+ * @see org.argouml.uml.profile.FormatingStrategy#formatElement(java.lang.Object, java.lang.Object)
*/
public String formatElement(Object element, Object namespace) {
String value = null;
@@ -202,9 +204,11 @@
return "[empty]";
}
- /*
- * @see org.argouml.uml.Profile#formatCollection(java.util.Iterator,
- * java.lang.Object)
+ /**
+ * @param iter the iterator of the collection
+ * @param namespace the namespace to be applied on the elements
+ * @return the formated string
+ * @see org.argouml.uml.profile.FormatingStrategy#formatCollection(java.util.Iterator, java.lang.Object)
*/
public String formatCollection(Iterator iter, Object namespace) {
String value = null;
Copied: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/ProfileJava.java (from r12909, /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/ProfileJava.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/ProfileJava.java?view=diff&rev=12913&p1=/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/ProfileJava.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/ProfileJava.java&r1=12909&r2=12913
==============================================================================
--- /branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/java/ProfileJava.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/profile/java/ProfileJava.java 2007-06-28 05:06:22-0700
@@ -29,7 +29,6 @@
import org.argouml.uml.profile.FormatingStrategy;
import org.argouml.uml.profile.Profile;
import org.argouml.uml.profile.ProfileModelLoader;
-import org.argouml.uml.profile.FileModelLoader;
import org.argouml.uml.profile.ResourceModelLoader;
/**
@@ -37,9 +36,6 @@
* Java language projects. Eventually, this class may be replaced by
* a configurable profile.
*
- * TODO: (MVW) Document the use of "argo.defaultModel" in
- * the argo.user.properties file.
- *
* @author Marcos Aurélio
*/
public class ProfileJava extends Profile {
@@ -48,32 +44,49 @@
private ProfileModelLoader profileModelLoader;
private Object model;
+ /**
+ * The default constructor for this class
+ */
public ProfileJava() {
- formatingStrategy = new JavaFormatingStrategy();
- profileModelLoader = new ResourceModelLoader();
- model = profileModelLoader.loadModel("/org/argouml/model/mdr/profiles/default-uml14.xmi");
-
- if (model == null) {
- model = Model.getModelManagementFactory().createModel();
- }
+ formatingStrategy = new JavaFormatingStrategy();
+ profileModelLoader = new ResourceModelLoader();
+ model = profileModelLoader
+ .loadModel("/org/argouml/model/mdr/profiles/default-uml14.xmi");
+
+ if (model == null) {
+ model = Model.getModelManagementFactory().createModel();
+ }
}
- @Override
+
+ /**
+ * @return the Java formating strategy
+ * @see org.argouml.uml.profile.Profile#getFormatingStrategy()
+ */
public FormatingStrategy getFormatingStrategy() {
return formatingStrategy;
}
- @Override
+ /**
+ * @return the Java model
+ * @see org.argouml.uml.profile.Profile#getModel()
+ */
public Object getModel() {
return model;
}
- @Override
+ /**
+ * @return "Java"
+ * @see org.argouml.uml.profile.Profile#getDisplayName()
+ */
public String getDisplayName() {
return "Java";
}
- @Override
+ /**
+ * @return null
+ * @see org.argouml.uml.profile.Profile#getFigureStrategy()
+ */
public FigNodeStrategy getFigureStrategy() {
return null;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/PropPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/PropPanel.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/ui/PropPanel.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/PropPanel.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/ui/PropPanel.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/PropPanel.java 2007-06-28 05:06:22-0700
@@ -61,7 +61,7 @@
import org.argouml.ui.targetmanager.TargetEvent;
import org.argouml.ui.targetmanager.TargetListener;
import org.argouml.ui.targetmanager.TargettableModelView;
-import org.argouml.uml.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
import org.tigris.gef.presentation.Fig;
import org.tigris.swidgets.GridLayout2;
import org.tigris.swidgets.LabelledLayout;
@@ -445,8 +445,8 @@
/*
* @see org.argouml.uml.ui.UMLUserInterfaceContainer#getProfile()
*/
- public Profile getProfile() {
- return ProjectManager.getManager().getCurrentProject().getProfile();
+ public ProfileConfiguration getProfile() {
+ return ProjectManager.getManager().getCurrentProject().getProfileConfiguration();
}
/*
@@ -460,14 +460,14 @@
* @see org.argouml.uml.ui.UMLUserInterfaceContainer#formatElement(java.lang.Object)
*/
public String formatElement(/* MModelElement */Object element) {
- return getProfile().formatElement(element, getDisplayNamespace());
+ return getProfile().getFormatingStrategy().formatElement(element, getDisplayNamespace());
}
/*
* @see org.argouml.uml.ui.UMLUserInterfaceContainer#formatNamespace(java.lang.Object)
*/
public String formatNamespace(/* MNamespace */Object namespace) {
- return getProfile().formatElement(namespace, null);
+ return getProfile().getFormatingStrategy().formatElement(namespace, null);
}
/*
@@ -475,7 +475,7 @@
*/
public String formatCollection(Iterator iter) {
Object namespace = getDisplayNamespace();
- return getProfile().formatCollection(iter, namespace);
+ return getProfile().getFormatingStrategy().formatCollection(iter, namespace);
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLComboBoxEntry.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLComboBoxEntry.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLComboBoxEntry.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLComboBoxEntry.java 2007-06-28 05:06:22-0700
@@ -28,7 +28,7 @@
import org.apache.log4j.Logger;
import org.argouml.model.Model;
-import org.argouml.uml.Profile;
+import org.argouml.uml.profile.Profile;
/**
* A combobox entry. <p>
@@ -75,7 +75,7 @@
element = modelElement;
if (modelElement != null) {
Object ns = Model.getFacade().getNamespace(modelElement);
- shortName = theProfile.formatElement(modelElement, ns);
+ shortName = theProfile.getFormatingStrategy().formatElement(modelElement, ns);
} else {
shortName = "";
}
@@ -103,7 +103,7 @@
public void updateName() {
if (element != null) {
Object ns = Model.getFacade().getNamespace(element);
- shortName = profile.formatElement(element, ns);
+ shortName = profile.getFormatingStrategy().formatElement(element, ns);
}
}
@@ -138,7 +138,7 @@
public String getLongName() {
if (longName == null) {
if (element != null) {
- longName = profile.formatElement(element, null);
+ longName = profile.getFormatingStrategy().formatElement(element, null);
}
else {
longName = "(unspecified)"; // TODO: I18N
@@ -294,7 +294,7 @@
public void nameChanged(Object modelElement) {
if (modelElement == element && element != null) {
Object ns = Model.getFacade().getNamespace(element);
- shortName = profile.formatElement(element, ns);
+ shortName = profile.getFormatingStrategy().formatElement(element, ns);
displayName = shortName;
longName = null;
}
Modified: branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLUserInterfaceContainer.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLUserInterfaceContainer.java?view=diff&rev=12913&p1=/trunk/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java&p2=branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLUserInterfaceContainer.java&r1=12912&r2=12913
==============================================================================
--- /trunk/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/argouml/org/argouml/uml/ui/UMLUserInterfaceContainer.java 2007-06-28 05:06:22-0700
@@ -26,7 +26,7 @@
package org.argouml.uml.ui;
import java.util.Iterator;
-import org.argouml.uml.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
/**
* Interface supported by any container of UML user interface components.
@@ -53,7 +53,7 @@
/**
* @return the current profile, may not be null
*/
- public Profile getProfile();
+ public ProfileConfiguration getProfile();
/**
* Formats the specified model element. Typically, deferred to the
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.