svn commit: r15194 - branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app: . src src/org/argouml/application src/org/argouml/application/events src/org/argouml/application/helpers src/org/argouml/cognitive src/org/argouml/i18n src/org/argouml/kernel src/org/argouml/moduleloader src/org/argouml/notation/providers src/org/argouml/notation/providers/uml src/org/argouml/persistence src/org/argouml/ui src/org/argouml/ui/cmd src/org/argouml/ui/explorer src/org/argouml/uml/diagram src/org/argouml/uml/diagram/activity/ui src/org/argouml/uml/diagram/collaboration/ui src/org/argouml/uml/diagram/sequence src/org/argouml/uml/diagram/sequence/ui src/org/argouml/uml/diagram/state/ui src/org/argouml/uml/diagram/static_structure/ui src/org/argouml/uml/diagram/ui src/org/argouml/uml/diagram/use_case/u i src/org/argouml/uml/reveng src/org/argouml/uml/reveng/java src/org/argouml/uml/reveng/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: hudsonb
Date: 2008-07-07 12:54:30-0700
New Revision: 15194

Added:
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustPageBreaks.java
      - copied unchanged from r15193, /trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionAdjustPageBreaks.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionSelectAll.java
      - copied unchanged from r15193, /trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectAll.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionSelectInvert.java
      - copied unchanged from r15193, /trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionSelectInvert.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionWrapper.java
      - copied unchanged from r15193, /trunk/src/argouml-app/src/org/argouml/ui/cmd/ActionWrapper.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactoryInterface.java
      - copied unchanged from r15139, /trunk/src/argouml-app/src/org/argouml/uml/diagram/DiagramFactoryInterface.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeContract.java
      - copied unchanged from r15193, /trunk/src/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeContract.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeExpand.java
      - copied unchanged from r15193, /trunk/src/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeExpand.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBoxWithAttributes.java
      - copied unchanged from r15139, /trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBoxWithAttributes.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeAddToDiagram.java
      - copied unchanged from r15193, /trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeAddToDiagram.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UmlObjectPropPanelFactory.java
      - copied unchanged from r15139, /trunk/src/argouml-app/src/org/argouml/uml/ui/UmlObjectPropPanelFactory.java
Removed:
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/Action.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ExtendedImportInterface.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommand.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommandInterface.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingUniqueSelection.java
Modified:
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/   (props changed)
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML DEBUG.launch
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML.launch
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/build.xml
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/default.properties
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/default.properties
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/Main.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/events/ArgoEventPump.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/cognitive/Critic.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/label.properties
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/menu.properties
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/statusmsg.properties
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/kernel/DefaultUndoManager.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/AttributeNotation.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/StateBodyNotationUml.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/persistence/PersistenceManager.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ArgoStatusBar.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DetailsPane.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DisplayTextTree.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/HelpBox.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ProjectBrowser.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/StatusBar.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustGrid.java   (contents, props changed)
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustSnap.java   (contents, props changed)
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/SettingsTabShortcuts.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPartition.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPool.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeChangeHeight.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramLayer.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigState.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigException.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigSignal.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNode.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNodes.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/CompartmentFigText.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationEnd.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEditableCompartment.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigSingleLineText.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotype.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateGraphEdge.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Import.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Setting.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionRESequenceDiagram.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ElementPropPanelFactory.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/InitUmlUI.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabDocumentation.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabProps.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLExpressionBodyField.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/collaborations/UMLMessageActivatorComboBoxModel.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/state_machines/UMLChangeExpressionModel.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/ActionSetModelElementNamespace.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelMethod.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelModelElement.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/UMLModelElementNamespaceComboBoxModel.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelTagDefinition.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/FileFilters.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/SuffixFilter.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/templates/ArgoVersion.template
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/AllTests.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/TestCoreFactory.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java
   branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java

Log:
Merging changes to trunk into my branch

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML DEBUG.launch
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML%20DEBUG.launch?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML%20DEBUG.launch&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML%20DEBUG.launch&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML DEBUG.launch	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML DEBUG.launch	2008-07-07 12:54:30-0700
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>

+<?xml version="1.0" encoding="UTF-8" standalone="no"?>

 <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">

 <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">

 <listEntry value="/argouml-app/src/org/argouml/application/Main.java"/>

@@ -11,19 +11,29 @@
 <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>

 </listAttribute>

 <listAttribute key="org.eclipse.jdt.launching.CLASSPATH">

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;argouml-app&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;argouml-app&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-tools&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/junit-3.8.2/junit.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/lib/easymock12.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/apache-ant-1.7.0/lib/ant.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-model-mdr&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmiutils.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mdrapi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mof.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/nbmdr.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/openide-util.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;argouml-app&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;argouml-app&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-tools&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/junit-3.8.2/junit.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/lib/easymock12.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/apache-ant-1.7.0/lib/ant.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-model-mdr&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmiutils.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mdrapi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mof.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/nbmdr.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/openide-util.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-model&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-app&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/antlr-2.7.7.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/commons-logging-1.0.2.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/gef-0.12.4BETA3.jar&quot; path=&quot;3&quot; sourceAttachmentPath=&quot;/gef/src&quot; sourceRootPath=&quot;&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/ocl-argo-1.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/swidgets-0.1.4.jar&quot; path=&quot;3&quot; sourceAttachmentPath=&quot;/swidgets/src&quot; sourceRootPath=&quot;&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/toolbar-1.4.1-20071227.jar&quot; path=&quot;3&quot; sourceAttachmentPath=&quot;/toolbar/src&quot; sourceRootPath=&quot;&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-infra&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-infra/lib/log4j-1.2.6.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

 </listAttribute>

 <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>

 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.argouml.application.Main"/>


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML.launch
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML.launch?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML.launch&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML.launch&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML.launch	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/ArgoUML.launch	2008-07-07 12:54:30-0700
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>

+<?xml version="1.0" encoding="UTF-8" standalone="no"?>

 <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">

 <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">

 <listEntry value="/argouml-app/src/org/argouml/application/Main.java"/>

@@ -11,19 +11,29 @@
 <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>

 </listAttribute>

 <listAttribute key="org.eclipse.jdt.launching.CLASSPATH">

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;argouml-app&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-model-mdr&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmiutils.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mdrapi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mof.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/nbmdr.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/openide-util.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;argouml-app&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-tools&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/junit-3.8.2/junit.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/lib/easymock12.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/apache-ant-1.7.0/lib/ant.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;argouml-app&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-model-mdr&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/jmiutils.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mdrapi.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/mof.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/nbmdr.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-model-mdr/lib/openide-util.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;argouml-app&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-tools&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/junit-3.8.2/junit.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/lib/easymock12.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-tools/apache-ant-1.7.0/lib/ant.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-model&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-app&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/antlr-2.7.7.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/commons-logging-1.0.2.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/gef-0.12.4BETA3.jar&quot; path=&quot;3&quot; sourceAttachmentPath=&quot;/gef/src&quot; sourceRootPath=&quot;&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/ocl-argo-1.1.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/swidgets-0.1.4.jar&quot; path=&quot;3&quot; sourceAttachmentPath=&quot;/swidgets/src&quot; sourceRootPath=&quot;&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-app/lib/toolbar-1.4.1-20071227.jar&quot; path=&quot;3&quot; sourceAttachmentPath=&quot;/toolbar/src&quot; sourceRootPath=&quot;&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;argouml-core-infra&quot; type=&quot;1&quot;/&gt;&#13;&#10;"/>

+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/argouml-core-infra/lib/log4j-1.2.6.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>

 </listAttribute>

 <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>

 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.argouml.application.Main"/>


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/build.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/build.xml?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/build.xml&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/build.xml&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/build.xml	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/build.xml	2008-07-07 12:54:30-0700
@@ -175,7 +175,7 @@
 
   <target name="prepare" depends="init,check-version">
     <!-- create directories -->
-    <echo message="Preparing the build directories"/>
+    <echo message="Preparing the build directories in argouml-app"/>
     <mkdir dir="${build.dir}"/>
     <mkdir dir="${build.classes}"/>
 
@@ -221,7 +221,7 @@
 
   <target name="generateparser" depends="init"
           description="Generate the antlr parsers.">
-    <echo message="Generate parsers"/>
+    <echo message="Generate parsers in argouml-app"/>
 
     <uptodate property="parser.re.is.current"
               targetfile="src/org/argouml/uml/reveng/java/JavaTokenTypes.txt">
@@ -313,7 +313,7 @@
 
   <target name="update-version" depends="check-version"
           unless="version.is.current">
-    <echo message="Creating ArgoVersion.java for version ${argo.build.version}"/>
+    <echo message="Creating ArgoVersion.java for version ${argo.build.version} in argouml-app"/>
     <filter token="ARGO_RELEASE_VERSION" value="${argo.build.version}"/>
     <copy file="src/templates/ArgoVersion.template"
           filtering="on" 
@@ -328,7 +328,7 @@
       depends="prepare,update-version,generateparser"
       description="Compile the sources.">
 
-    <echo message="Compiling the sources"/>
+    <echo message="Compiling the sources in argouml-app"/>
 
     <javac debug="${debug}" 
     	   deprecation="${deprecation}"

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/default.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/default.properties?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/default.properties&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/default.properties&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/default.properties	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/default.properties	2008-07-07 12:54:30-0700
@@ -11,7 +11,7 @@
 #
 # Argo version
 #
-argo.core.version=PRE-0.25.6
+argo.core.version=PRE-0.26.beta1
 #
 # Compilation properties
 #

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/default.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/default.properties?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/default.properties&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/default.properties&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/default.properties	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/default.properties	2008-07-07 12:54:30-0700
@@ -11,7 +11,7 @@
 #
 # Argo version
 #
-argo.core.version=PRE-0.25.5
+argo.core.version=PRE-0.26.beta1
 #
 # Compilation properties
 #

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/Main.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/Main.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/Main.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/Main.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/Main.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/Main.java	2008-07-07 12:54:30-0700
@@ -538,12 +538,12 @@
      * If the file does not exist or cannot be converted the default
      * {@link URL} is returned.
      *
-     * @param projectName is the file name of the project
+     * @param theProjectName is the file name of the project
      * @param urlToOpen is the default {@link URL}
      * @return the new URL.
      */
-    private static URL projectUrl(final String projectName, URL urlToOpen) {
-        File projectFile = new File(projectName);
+    private static URL projectUrl(final String theProjectName, URL urlToOpen) {
+        File projectFile = new File(theProjectName);
         if (!projectFile.exists()) {
             System.err.println("Project file '" + projectFile
 			       + "' does not exist.");
@@ -976,7 +976,8 @@
      * @see java.lang.Runnable#run()
      */
     public void run() {
-	new JavaImport().init();
+        // Why is this done separately? - tfm?
+	new JavaImport().enable();
 	huntForInternalModules();
         LOG.info("Module loading done");
     }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/events/ArgoEventPump.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/events/ArgoEventPump.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/events/ArgoEventPump.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/events/ArgoEventPump.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/events/ArgoEventPump.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/events/ArgoEventPump.java	2008-07-07 12:54:30-0700
@@ -26,7 +26,6 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.ListIterator;
 
 import org.apache.log4j.Logger;
 import org.argouml.application.api.ArgoEventListener;
@@ -104,7 +103,9 @@
         if (listeners == null) {
             listeners = new ArrayList<Pair>();
         }
-        listeners.add(new Pair(event, listener));
+        synchronized (listeners) {
+            listeners.add(new Pair(event, listener));
+        }
     }
 
     /**
@@ -120,23 +121,25 @@
         if (listeners == null) {
             return;
         }
-        List<Pair> removeList = new ArrayList<Pair>();
-        if (event == ArgoEventTypes.ANY_EVENT) {
-            for (Pair p : listeners) {
-                if (p.listener == listener) {
-                    removeList.add(p);
+        synchronized (listeners) {
+            List<Pair> removeList = new ArrayList<Pair>();
+            if (event == ArgoEventTypes.ANY_EVENT) {
+                for (Pair p : listeners) {
+                    if (p.listener == listener) {
+                        removeList.add(p);
+                    }
                 }
-            }
 
-        } else {
-            Pair test = new Pair(event, listener);
-            for (Pair p : listeners) {
-                if (p.equals(test)) {
-                    removeList.add(p);
+            } else {
+                Pair test = new Pair(event, listener);
+                for (Pair p : listeners) {
+                    if (p.equals(test)) {
+                        removeList.add(p);
+                    }
                 }
             }
+            listeners.removeAll(removeList);
         }
-        listeners.removeAll(removeList);
     }
 
     /**
@@ -383,18 +386,22 @@
      * @param event the event to be fired
      */
     protected void doFireEvent(ArgoEvent event) {
-
         if (listeners == null) {
             return;
         }
 
-        ListIterator iterator = listeners.listIterator();
-        while (iterator.hasNext()) {
-            Pair pair = (Pair) iterator.next();
+        // Make a read-only copy of the listeners list so that reentrant calls
+        // back to add/removeListener won't mess us up.
+        // TODO: Potential performance issue, but we need the correctness - tfm
+        List<Pair> readOnlyListeners;
+        synchronized (listeners) {
+            readOnlyListeners = new ArrayList<Pair>(listeners);
+        }
+
+        for (Pair pair : readOnlyListeners) {
             if (pair.getEventType() == ArgoEventTypes.ANY_EVENT) {
                 handleFireEvent(event, pair.getListener());
-            } else if (
-                    pair.getEventType() == event.getEventStartRange()
+            } else if (pair.getEventType() == event.getEventStartRange()
                     || pair.getEventType() == event.getEventType()) {
                 handleFireEvent(event, pair.getListener());
             }
@@ -434,16 +441,14 @@
             return listener;
         }
 
-        /*
-         * @see java.lang.Object#toString()
-         */
+
+        @Override
         public String toString() {
             return "{Pair(" + eventType + "," + listener + ")}";
         }
 
-        /*
-         * @see java.lang.Object#hashCode()
-         */
+
+        @Override
         public int hashCode() {
             if (listener != null) {
                 return eventType + listener.hashCode();
@@ -451,9 +456,8 @@
             return eventType;
         }
 
-        /*
-         * @see java.lang.Object#equals(java.lang.Object)
-         */
+
+        @Override
         public boolean equals(Object o) {
             if (o instanceof Pair) {
                 Pair p = (Pair) o;

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/application/helpers/ApplicationVersion.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -26,6 +26,7 @@
 
 /**
  * Receives the version of the application at initialisation time.
+ * Also knows about website locations that depend on the version of ArgoUML.
  *
  * @author Michiel
  */
@@ -34,6 +35,7 @@
      * Version number.
      */
     private static String version;
+    private static String stableVersion;
 
     /**
      * Retrieve the version number of the application.
@@ -43,6 +45,45 @@
     public static String getVersion() {
         return version;
     }
+    
+    /**
+     * Retrieve the online HTML manual of ArgoUML for a critic. 
+     * You need to append the critic class-name.
+     * This syntax is synchronized with:
+     * <ol>
+     * <li>Tags in the manual.
+     * <li>Name of the ArgoUML site.
+     * <li>How the manual is deployed on the site.
+     * </ol>
+     * so this must be updated when any of these change.
+     *
+     * @return the URL
+     */
+    public static String getManualForCritic() {
+        return "http://argouml-stats.tigris.org/documentation/"
+            + "manual-" 
+            + stableVersion
+            + "-single/argomanual.html#critics.";
+    }
+
+    /**
+     * Retrieve the URL of the online manual of ArgoUML.
+     * 
+     * @return the URL
+     */
+    public static String getOnlineManual() {
+        return "http://argouml-stats.tigris.org/nonav/documentation/"
+                + "manual-" + stableVersion + "/";
+    }
+
+    /**
+     * Retrieve the URL of the location for online support for ArgoUML.
+     * 
+     * @return the URL
+     */
+    public static String getOnlineSupport() {
+        return "http://argouml.tigris.org/nonav/support.html";
+    }
 
     /**
      * Don't allow instantiation.
@@ -52,9 +93,12 @@
 
     /**
      * @param v The version to set.
+     * @param sv The stable version to set.
      */
-    public static void init(String v) {
+    public static void init(String v, String sv) {
         assert version == null;
         version = v;
+        assert stableVersion == null;
+        stableVersion = sv;
     }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/cognitive/Critic.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/cognitive/Critic.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/cognitive/Critic.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/cognitive/Critic.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/cognitive/Critic.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/cognitive/Critic.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -33,6 +33,7 @@
 import javax.swing.Icon;
 
 import org.apache.log4j.Logger;
+import org.argouml.application.helpers.ApplicationVersion;
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.cognitive.critics.SnoozeOrder;
 import org.argouml.cognitive.critics.Wizard;
@@ -148,23 +149,15 @@
 	Translator.localize("misc.knowledge.tool");
 
     /**
-     * This function calculates the default url to describe this critic.
-     * This syntax is synchronized with:
-     * <ol>
-     * <li>Tags in the manual.
-     * <li>Name of the ArgoUML site.
-     * <li>How the manual is deployed on the site.
-     * </ol>
-     * so this must be updated when any of these change.
+     * This function calculates the default URL to describe this critic.
      *
-     * @return the url in string format
+     * @return the URL in string format
      */
     public final String defaultMoreInfoURL() {
 	String clsName = getClass().getName();
 	clsName = clsName.substring(clsName.lastIndexOf(".") + 1);
-	return "http://argouml-stats.tigris.org/documentation/"
-	    + "manual-0.24-single/argomanual.html"
-	    + "#critics." + clsName;
+	return ApplicationVersion.getManualForCritic()
+	    + clsName;
     }
 
     ////////////////////////////////////////////////////////////////

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/label.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/label.properties?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/label.properties&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/label.properties&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/label.properties	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/label.properties	2008-07-07 12:54:30-0700
@@ -260,7 +260,6 @@
 label.object-flow-state = ObjectFlowState
 label.off = Off
 label.offenders = Offenders:
-label.open-project-status-read = Read {0}.
 label.operations = Operations:
 label.operation = Operation:
 label.operation.navigate.tooltip = Go to selected Operation
@@ -328,8 +327,6 @@
 label.return-action = ReturnAction
 label.root = Root
 label.rules-library = Rules Library
-label.save-project-status-writing = Writing {0}...
-label.save-project-status-wrote = Wrote {0}
 label.sax-factory1 = SAX Parser Factory {0} specified using system property\n
 label.sax-factory2 = SAX-Parser {0} wird verwendet\n
 label.script = Script:

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/menu.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/menu.properties?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/menu.properties&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/menu.properties&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/menu.properties	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/menu.properties	2008-07-07 12:54:30-0700
@@ -129,6 +129,9 @@
 menu.item.snap-32 = Snap 32
 menu.item.snap-32.mnemonic = 3
 
+menu.adjust-pagebreaks = Adjust PageBreaks
+menu.adjust-pagebreaks.mnemonic = P
+
 menu.toolbars = Toolbars
 menu.toolbars.mnemonic = T
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/statusmsg.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/statusmsg.properties?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/statusmsg.properties&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/statusmsg.properties&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/statusmsg.properties	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/i18n/statusmsg.properties	2008-07-07 12:54:30-0700
@@ -70,7 +70,16 @@
 statusmsg.bar.making-todopane = Making TodoPane: Setting Perspectives
 statusmsg.bar.model-subsystem = Initializing Model Subsystem
 statusmsg.bar.open-project-browser = Opening Project Browser
+# Previously label.open-project-status-read
+statusmsg.bar.open-project-status-read = Read {0}.
+statusmsg.bar.project-modified = Modified {0}.
 statusmsg.bar.readingproject = Reading \"{0}\"
+statusmsg.bar.save-graphics-status-writing = Writing {0} ...
+statusmsg.bar.save-graphics-status-wrote = Wrote {0}
+# Previously label.open-project-status-writing
+statusmsg.bar.save-project-status-writing = Writing {0} ...
+# Previously label.open-project-status-wrote
+statusmsg.bar.save-project-status-wrote = Wrote {0}
 statusmsg.help.create.circle = Drag to define a circle
 statusmsg.help.create.ink = Drag to draw a stream of ink
 statusmsg.help.create.line = Drag to define a line

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/kernel/DefaultUndoManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/kernel/DefaultUndoManager.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/kernel/DefaultUndoManager.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/kernel/DefaultUndoManager.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/kernel/DefaultUndoManager.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/kernel/DefaultUndoManager.java	2008-07-07 12:54:30-0700
@@ -143,7 +143,7 @@
     }
     
     public synchronized void startInteraction(String label) {
-        LOG.info("Starting interaction " + label);
+        LOG.debug("Starting interaction " + label);
         this.newInteractionLabel = label;
         newInteraction = true;
     }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java	2008-07-07 12:54:30-0700
@@ -51,9 +51,6 @@
 import org.argouml.application.api.AbstractArgoJPanel;
 import org.argouml.application.api.Argo;
 import org.argouml.i18n.Translator;
-import org.argouml.profile.ProfileException;
-import org.argouml.profile.ProfileFacade;
-import org.argouml.profile.UserDefinedProfile;
 
 
 /**
@@ -323,14 +320,28 @@
 		}
 
 		if (!status.isEnabled() && status.isSelected()) {
-		    if (module.enable()) {
-		        someModuleSucceeded = true;
-		        status.setEnabled();
+		    try {
+		        if (module.enable()) {
+		            someModuleSucceeded = true;
+		            status.setEnabled();
+		        }
+		    }
+		    // Catch all exceptions and errors, however severe
+		    catch (Throwable e) {                       
+		        LOG.info("Exception or error while trying to "
+                                + "enable module " + module.getName(), e);
 		    }
 		} else if (status.isEnabled() && !status.isSelected()) {
-		    if (module.disable()) {
-		        someModuleSucceeded = true;
-		        status.setDisabled();
+		    try { 
+		        if (module.disable()) {
+		            someModuleSucceeded = true;
+		            status.setDisabled();
+		        }
+		    }
+                    // Catch all exceptions and errors, however severe
+		    catch (Throwable e) {
+		        LOG.info("Exception or error while trying to "
+                                + "disable module " + module.getName(), e);
 		    }
 		}
 	    }
@@ -572,7 +583,6 @@
             return;
 	}
 
-        
         Manifest manifest;
         try {
             manifest = jarfile.getManifest();
@@ -606,9 +616,6 @@
         if (loadedClass) {
             // Add this to search list for I18N properties
             Translator.addClassLoader(classloader);
-            
-            LOG.info("Reading profiles...");
-            loadProfilesFromJarFile(jarfile, file);
         } else {
             LOG.error("Failed to find any loadable ArgoUML modules in jar "
                     + file);
@@ -616,37 +623,6 @@
     }
 
     /**
-     * Searches for Profiles models (*.xmi) files in the directory "
-     * 
-     * @param jarfile the jarfile
-     * @param file 
-     */
-    private void loadProfilesFromJarFile(JarFile jarfile, File file) {       
-        Enumeration<JarEntry> entries = jarfile.entries();
-        // TODO: This should ask the module for its profiles rather than just
-        // assuming that any .xmi file is a profile.  The module may have 
-        // bundled .xmi files for other reasons.
-        for (JarEntry entry = entries.nextElement(); entries.hasMoreElements(); 
-                entry = entries.nextElement()) {
-            if (entry.getName().toLowerCase().endsWith(".xmi")) {
-                try {
-                    URL url = new URL("jar:file:" + file.getCanonicalPath()
-                            + "!/" + entry.getName());
-                    UserDefinedProfile udp = new UserDefinedProfile(url);
-                    ProfileFacade.getManager().registerProfile(udp);
-                    
-                    LOG.debug("Registered Profile: " + udp.getDisplayName()
-                            + "...");
-                } catch (ProfileException e) {
-                    LOG.error("Exception", e);
-                } catch (IOException e) {
-                    LOG.error("Exception", e);
-                }
-            }
-        }
-    }
-
-    /**
      * Process a JAR file entry, attempting to load anything that looks like a
      * Java class.
      * 
@@ -701,6 +677,17 @@
         } catch (UnsupportedClassVersionError e) {
             LOG.error("Unsupported Java class version for " + classname);
             return false;
+        } catch (NoClassDefFoundError e) {
+            LOG.error("Unable to find required class while loading "
+                    + classname + " - may indicate an obsolete"
+                    + " extension module or an unresolved dependency", e);
+            return false;
+        } catch (Throwable e) {
+            if (e instanceof ClassNotFoundException) {
+                throw (ClassNotFoundException) e;
+            }
+            LOG.error("Unexpected error while loading " + classname, e);
+            return false;
         }
         
         if (!ModuleInterface.class.isAssignableFrom(moduleClass)) {
@@ -726,7 +713,7 @@
                     + classname + " - may indicate an obsolete"
                     + " extension module or an unresolved dependency", e);
             return false;
-        } catch (Exception e) {
+        } catch (Throwable e) {
             LOG.error("Unexpected error while loading " + classname, e);
             return false;
         }
@@ -760,7 +747,7 @@
                     + classname + " - may indicate an obsolete"
                     + " extension module or an unresolved dependency", e);
             return false;
-        } catch (Exception e) {
+        } catch (Throwable e) {
             LOG.error("Unexpected error while instantiating " + classname, e);
             return false;
         }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/AttributeNotation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/AttributeNotation.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/AttributeNotation.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/AttributeNotation.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/AttributeNotation.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/AttributeNotation.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2007 The Regents of the University of California. All
+// Copyright (c) 2005-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -37,7 +37,7 @@
  * for the text shown in the attribute compartment of a Class.
  * Subclass this for all languages.
  *
- * @author [email protected]
+ * @author Michiel
  */
 public abstract class AttributeNotation extends NotationProvider {
 
@@ -51,7 +51,7 @@
     public void initialiseListener(PropertyChangeListener listener, 
             Object modelElement) {
         addElementListener(listener, modelElement);
-        if (Model.getFacade().isAOperation(modelElement)) {
+        if (Model.getFacade().isAAttribute(modelElement)) {
             // We also show stereotypes
             for (Object uml : Model.getFacade().getStereotypes(modelElement)) {
                 addElementListener(listener, uml);

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java	2008-07-07 12:54:30-0700
@@ -375,7 +375,7 @@
             Object nspe =
                 Model.getModelManagementHelper().getElement(
                         path,
-                        Model.getFacade().getModel(me));
+                        Model.getFacade().getRoot(me));
 
             if (nspe == null || !(Model.getFacade().isANamespace(nspe))) {
                 String msg = 
@@ -509,7 +509,7 @@
         // Copy returned parameters because it will be a live collection for MDR
         Collection origParam =
             new ArrayList(Model.getFacade().getParameters(op));
-        Object ns = Model.getFacade().getModel(op);
+        Object ns = Model.getFacade().getRoot(op);
         if (Model.getFacade().isAOperation(op)) {
             Object ow = Model.getFacade().getOwner(op);
 
@@ -811,7 +811,7 @@
 
         /**
          * Constructs a new PropertySpecialString that will invoke the
-         * action in op when {@link #invoke(Object, String, String)} is
+         * action in propop when {@link #invoke(Object, String, String)} is
          * called with name equal to str and then return true from invoke.
          *
          * @param str
@@ -825,8 +825,9 @@
         }
 
         /**
-         * Called by {@link ParserDisplay#setProperties(Object, java.util.Vector,
-         * PropertySpecialString[])} while searching for an action to
+         * Called by {@link NotationUtilityUml#setProperties(Object, 
+         * java.util.Vector, PropertySpecialString[])} while 
+         * searching for an action to
          * invoke for a property. If it returns true, then setProperties
          * may assume that all required actions have been taken and stop
          * searching.
@@ -835,10 +836,12 @@
          *            The name of a property.
          * @param value
          *            The value of a property.
+         * @param element
+         *            A model element to apply the properties to.
          * @return <code>true</code> if an action is performed, otherwise
          *         <code>false</code>.
          */
-        public boolean invoke(Object element, String pname, String value) {
+        boolean invoke(Object element, String pname, String value) {
             if (!name.equalsIgnoreCase(pname)) {
                 return false;
             }
@@ -898,18 +901,74 @@
     }
 
     /**
-     * TODO: Rewrite this, so that it does not use the Project.
+     * Generate the text for one or more stereotype(s).
      * 
      * @param st a stereotype UML object
      *                 or a string
      *                 or a collection of stereotypes
      *                 or a modelelement of which the stereotypes are retrieved
      * @param args arguments that may determine the notation
-     * @return a string representing the given stereotype(s). 
-     * This string is guaranteed not null.
+     * The values of "leftGuillemot" and "rightGuillemot" influence the outcome.
+     * @return a string representing the given stereotype(s)
      */
     public static String generateStereotype(Object st, Map args) {
-        return generateStereotype(st);
+        if (st == null) {
+            return "";
+        }
+
+        if (st instanceof String) {
+            return formatSingleStereotype((String) st, args);
+        }
+        if (Model.getFacade().isAStereotype(st)) {
+            return formatSingleStereotype(Model.getFacade().getName(st), args);
+        }
+
+        if (Model.getFacade().isAModelElement(st)) {
+            st = Model.getFacade().getStereotypes(st);
+        }
+        if (st instanceof Collection) {
+            Object o;
+            StringBuffer sb = new StringBuffer(10);
+            boolean first = true;
+            Iterator iter = ((Collection) st).iterator();
+            while (iter.hasNext()) {
+                if (!first) {
+                    sb.append(',');
+                }
+                o = iter.next();
+                if (o != null) {
+                    sb.append(Model.getFacade().getName(o));
+                    first = false;
+                }
+            }
+            if (!first) {
+                return formatSingleStereotype(sb.toString(), args);
+            }
+        }
+        return "";
+    }
+
+    /**
+     * Create a string representation of a single stereotype.
+     * This function generates angled brackets or guillemets 
+     * depending in the project's settings.
+     * 
+     * @param name the name of the stereotype
+     * @param args any arguments
+     * @return the string representation
+     */
+    public static String formatSingleStereotype(String name, Map args) {
+        if (name == null || name.length() == 0) {
+            return "";
+        }
+        if (args != null) {
+            if (args.get("leftGuillemot") != null 
+                    && args.get("rightGuillemot") != null) {
+                return args.get("leftGuillemot") + name 
+                    + args.get("rightGuillemot");
+            }
+        }
+        return "<<" + name + ">>";
     }
 
     /**
@@ -922,6 +981,7 @@
      * with the arguments Map.
      * Rationale: Use the args Map instead of accessing the Project from here.
      */
+    @Deprecated
     public static String generateStereotype(Object st) {
         if (st == null) {
             return "";
@@ -1066,6 +1126,7 @@
      * @param m the given multiplicity
      * @return a string (guaranteed not null)
      */
+    @Deprecated
     public static String generateMultiplicity(Object m) {
         Project p = ProjectManager.getManager().getCurrentProject();
         ProjectSettings ps = p.getProjectSettings();
@@ -1099,7 +1160,7 @@
         }
         if (!NotationProvider.isValue("singularMultiplicityVisible", args)) {
             if ("1".equals(s)) {
-                s =""; 
+                s = ""; 
             }
         }
         return s;
@@ -1139,7 +1200,8 @@
                 }
 
                 if (Model.getFacade().getValue(arg) != null) {
-                    p.append(generateExpression(Model.getFacade().getValue(arg)));
+                    p.append(generateExpression(
+                            Model.getFacade().getValue(arg)));
                 }
                 first = false;
             }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/StateBodyNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/StateBodyNotationUml.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/StateBodyNotationUml.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/StateBodyNotationUml.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/StateBodyNotationUml.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/StateBodyNotationUml.java	2008-07-07 12:54:30-0700
@@ -28,25 +28,28 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Map;
-import java.util.Iterator;
 import java.util.StringTokenizer;
 
 import org.argouml.application.events.ArgoEventPump;
 import org.argouml.application.events.ArgoEventTypes;
 import org.argouml.application.events.ArgoHelpEvent;
 import org.argouml.i18n.Translator;
-import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.notation.providers.StateBodyNotation;
 
 /**
  * UML notation for the body of a state.
  * 
- * @author [email protected]
+ * @author Michiel
  */
 public class StateBodyNotationUml extends StateBodyNotation {
 
     /**
+     * The default language for an expression.
+     */
+    private static final String LANGUAGE = "Java";
+    
+    /**
      * The constructor.
      *
      * @param state the state represented by the notation
@@ -113,12 +116,10 @@
         Collection internaltrans =
             Model.getFacade().getInternalTransitions(modelElement);
         if (internaltrans != null) {
-            Iterator iter = internaltrans.iterator();
-            while (iter.hasNext()) {
+            for (Object trans : internaltrans) {
                 if (s.length() > 0) {
                     s.append("\n");
                 }
-                Object trans = iter.next();
                 /* TODO: Is this a good way of handling nested notation? */
                 s.append((new TransitionNotationUml(trans))
                             .toString(trans, null));
@@ -129,7 +130,7 @@
 
     /**
      * Parse user input for state bodies and assign the individual lines to
-     * according actions or transistions. The user input consists of multiple
+     * according actions or transitions. The user input consists of multiple
      * lines like:<pre>
      *   action-label / action-expression
      * </pre> or the format of a regular
@@ -226,7 +227,7 @@
         /**
          * The list that we maintain.
          */
-        private Collection theList;
+        private Collection<InfoItem> theList;
 
         /**
          * An item in a list, maintains all info about one UML object,
@@ -242,7 +243,7 @@
 
             /**
              * The constructor.
-             * @param obj the uml object
+             * @param obj the UML object
              */
             InfoItem(Object obj) {
                 umlObject = obj;
@@ -252,7 +253,7 @@
             /**
              * The constructor.
              *
-             * @param obj the uml object.
+             * @param obj the UML object.
              * @param r
              */
             InfoItem(Object obj, boolean r) {
@@ -297,10 +298,9 @@
          *          that were present before
          */
         ModelElementInfoList(Collection c) {
-            theList = new ArrayList();
-            Iterator i = c.iterator();
-            while (i.hasNext()) {
-                theList.add(new InfoItem(i.next()));
+            theList = new ArrayList<InfoItem>();
+            for (Object obj : c) {
+                theList.add(new InfoItem(obj));
             }
         }
 
@@ -319,10 +319,7 @@
          * @return true if the item was already present in the list
          */
         boolean checkRetain(String line) {
-            Iterator i = theList.iterator();
-            while (i.hasNext()) {
-                InfoItem tInfo =
-                    (InfoItem) i.next();
+            for (InfoItem tInfo : theList) {
                 if (tInfo.getGenerated().equals(line)) {
                     tInfo.retain();
                     return true;
@@ -340,11 +337,8 @@
          */
         Collection finalisedList() {
             // don't forget to remove old internals!
-            Collection newModelElementsList = new ArrayList();
-            Iterator i = theList.iterator();
-            while (i.hasNext()) {
-                InfoItem tInfo =
-                    (InfoItem) i.next();
+            Collection<Object> newModelElementsList = new ArrayList<Object>();
+            for (InfoItem tInfo : theList) {
                 if (tInfo.isRetained()) {
                     newModelElementsList.add(tInfo.getUmlObject());
                 } else {
@@ -434,7 +428,7 @@
         Object a =
             Model.getCommonBehaviorFactory().createCallAction();
         Object ae =
-            Model.getDataTypesFactory().createActionExpression("Java", s);
+            Model.getDataTypesFactory().createActionExpression(LANGUAGE, s);
         Model.getCommonBehaviorHelper().setScript(a, ae);
         Model.getCoreHelper().setName(a, "anon");
         return a;
@@ -449,7 +443,7 @@
      */
     private void updateAction(Object old, String s) {
         Object ae = Model.getFacade().getScript(old); // the ActionExpression
-        String language = "Java";
+        String language = LANGUAGE;
         if (ae != null) {
             language = Model.getDataTypesHelper().getLanguage(ae);
             String body = (String) Model.getFacade().getBody(ae);
@@ -464,13 +458,13 @@
     /**
      * This deletes modelelements, and swallows null without barking.
      *
-     * @author [email protected]
+     * @author Michiel
      * @param obj
      *            the modelelement to be deleted
      */
     private void delete(Object obj) {
         if (obj != null) {
-            ProjectManager.getManager().getCurrentProject().moveToTrash(obj);
+            Model.getUmlFactory().delete(obj);
         }
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/notation/providers/uml/TransitionNotationUml.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2007 The Regents of the University of California. All
+// Copyright (c) 2005-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -27,15 +27,14 @@
 import java.beans.PropertyChangeListener;
 import java.text.ParseException;
 import java.util.Collection;
-import java.util.Map;
 import java.util.Iterator;
+import java.util.Map;
 import java.util.StringTokenizer;
 
 import org.argouml.application.events.ArgoEventPump;
 import org.argouml.application.events.ArgoEventTypes;
 import org.argouml.application.events.ArgoHelpEvent;
 import org.argouml.i18n.Translator;
-import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.model.StateMachinesFactory;
 import org.argouml.notation.providers.TransitionNotation;
@@ -93,7 +92,7 @@
      * Remark: The UML standard does not make a distinction between
      * the syntax of a CallEvent and SignalEvent:
      * both may have parameters between ().
-     * For simplicity and user-friendlyness, we chose for this distinction.
+     * For simplicity and user-friendliness, we chose for this distinction.
      * If a user wants parameters for a SignalEvent,
      * then he may add them in the properties panels, but not on the diagram.<p>
      *
@@ -209,8 +208,8 @@
         /*
          * We can distinguish between 4 cases:
          * 1. A trigger is given. None exists yet.
-         * 2. The name of the trigger was present, but is (the same or)
-         * altered.
+         * 2. The trigger was present, and it is the same type, 
+         * or a different type, and its text is changed, or the same.
          * 3. A trigger is not given. None exists yet.
          * 4. The name of the trigger was present, but is removed.
          * The reaction in these cases should be:
@@ -220,11 +219,11 @@
          * 4. Unhook and erase the existing trigger.
          */
         Object evt = Model.getFacade().getTrigger(trans);
-        Object model =
-                ProjectManager.getManager().getCurrentProject().getModel();
+        /* It is safe to give a null to the next function,
+         * since a statemachine is always composed by a model anyhow. */
         Object ns =
             Model.getStateMachinesHelper()
-                .findNamespaceForEvent(trans, model);
+                .findNamespaceForEvent(trans, null);
         StateMachinesFactory sMFactory =
                 Model.getStateMachinesFactory();
         boolean createdEvent = false;
@@ -234,9 +233,11 @@
                 // case 1
                 if (timeEvent) { // after(...)
                     evt = sMFactory.buildTimeEvent(s, ns);
+                    /* Do not set the name. */
                 }
                 if (changeEvent) { // when(...)
                     evt = sMFactory.buildChangeEvent(s, ns);
+                    /* Do not set the name. */
                 }
                 if (callEvent) { // operation(paramlist)
                     String triggerName =
@@ -253,28 +254,62 @@
                 createdEvent = true;
             } else {
                 // case 2
-                if (!Model.getFacade().getName(evt).equals(trigger)) {
-                    Model.getCoreHelper().setName(evt, trigger);
-                    if (timeEvent && !Model.getFacade().isATimeEvent(evt)) {
-                        delete(evt);
+                if (timeEvent) {
+                    if (Model.getFacade().isATimeEvent(evt)) {
+                        /* Just change the time expression */
+                        Object timeExpr = Model.getFacade().getWhen(evt);
+                        Model.getDataTypesHelper().setBody(timeExpr, s);
+                    } else {
+                        /* It's a time-event now, 
+                         * but was of another type before! */
+                        delete(evt); /* TODO: What if used elsewhere? */
                         evt = sMFactory.buildTimeEvent(s, ns);
                         createdEvent = true;
                     }
-                    if (changeEvent && !Model.getFacade().isAChangeEvent(evt)) {
-                        delete(evt);
+                }
+                if (changeEvent) {
+                    if (Model.getFacade().isAChangeEvent(evt)) {
+                        /* Just change the ChangeExpression */
+                        Object changeExpr = 
+                            Model.getFacade().getChangeExpression(evt);
+                        Model.getDataTypesHelper().setBody(changeExpr, s);
+                    } else {
+                        /* The parsed text describes a change-event,
+                         * but the model contains another type! */
+                        delete(evt); /* TODO: What if used elsewhere? */
                         evt = sMFactory.buildChangeEvent(s, ns);
                         createdEvent = true;
                     }
-                    if (callEvent && !Model.getFacade().isACallEvent(evt)) {
-                        delete(evt);
+                }
+                if (callEvent) {
+                    if (Model.getFacade().isACallEvent(evt)) {
+                        /* Just change the Name and linked operation */
+                        String triggerName =
+                            trigger.indexOf("(") > 0
+                            ? trigger.substring(0, trigger.indexOf("(")).trim()
+                                    : trigger;
+                        if (!Model.getFacade().getName(evt)
+                                .equals(triggerName)) {
+                            Model.getCoreHelper().setName(evt, triggerName);
+                        }
+                            /* TODO: Change the linked operation. */
+                    } else {
+                        delete(evt); /* TODO: What if used elsewhere? */
                         evt = sMFactory.buildCallEvent(trans, trigger, ns);
                         // and parse the parameter list
                         NotationUtilityUml.parseParamList(evt, s, 0);
                         createdEvent = true;
                     }
-                    if (signalEvent
-                            && !Model.getFacade().isASignalEvent(evt)) {
-                        delete(evt);
+                }
+                if (signalEvent) {
+                    if (Model.getFacade().isASignalEvent(evt)) {
+                        /* Just change the Name and linked signal */
+                        if (!Model.getFacade().getName(evt).equals(trigger)) {
+                            Model.getCoreHelper().setName(evt, trigger);
+                        }
+                        /* TODO: link to the Signal. */
+                    } else {
+                        delete(evt); /* TODO: What if used elsewhere? */
                         evt = sMFactory.buildSignalEvent(trigger, ns);
                         createdEvent = true;
                     }
@@ -428,7 +463,7 @@
      */
     private void delete(Object obj) {
         if (obj != null) {
-            ProjectManager.getManager().getCurrentProject().moveToTrash(obj);
+            Model.getUmlFactory().delete(obj);
         }
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/persistence/PersistenceManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/persistence/PersistenceManager.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/persistence/PersistenceManager.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/persistence/PersistenceManager.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/persistence/PersistenceManager.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/persistence/PersistenceManager.java	2008-07-07 12:54:30-0700
@@ -24,6 +24,7 @@
 
 package org.argouml.persistence;
 
+import java.awt.Component;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.OutputStream;
@@ -36,6 +37,7 @@
 import java.util.List;
 
 import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
 import javax.swing.filechooser.FileFilter;
 
 import org.argouml.configuration.Configuration;
@@ -360,6 +362,36 @@
     }
 
     /**
+     * Returns true if we are allowed to overwrite the given file.
+     *
+     * @param overwrite if true, then the user is not asked
+     * @param file the given file
+     * @return true if we are allowed to overwrite the given file
+     * @param frame the Component to display the confirmation dialog on
+     */
+    public boolean confirmOverwrite(Component frame, 
+            boolean overwrite, File file) {
+        if (file.exists() && !overwrite) {
+            String sConfirm =
+                Translator.messageFormat(
+                    "optionpane.confirm-overwrite",
+                    new Object[] {file});
+            int nResult =
+                JOptionPane.showConfirmDialog(
+                        frame,
+                        sConfirm,
+                        Translator.localize(
+                            "optionpane.confirm-overwrite-title"),
+                        JOptionPane.YES_NO_OPTION,
+                        JOptionPane.QUESTION_MESSAGE);
+            if (nResult != JOptionPane.YES_OPTION) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
      * Get the last message which caused loading to fail. Used for junit tests.
      *
      * @return the last message which caused loading to fail

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ArgoStatusBar.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ArgoStatusBar.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ArgoStatusBar.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ArgoStatusBar.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ArgoStatusBar.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ArgoStatusBar.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -24,30 +24,83 @@
 
 package org.argouml.ui;
 
+import java.text.MessageFormat;
+
+import javax.swing.SwingUtilities;
+
 import org.argouml.application.events.ArgoEventPump;
 import org.argouml.application.events.ArgoEventTypes;
+import org.argouml.application.events.ArgoHelpEvent;
+import org.argouml.application.events.ArgoHelpEventListener;
+import org.argouml.application.events.ArgoStatusEvent;
+import org.argouml.application.events.ArgoStatusEventListener;
+import org.argouml.i18n.Translator;
 import org.tigris.gef.ui.IStatusBar;
 
 /**
  * A StatusBar that registers itself with the ArgoEventPump to receive
- * help events.
- * <p>
- * Note: it does not register directly for Status events, but instead
- * relies on ProjectBrowser to get the status events (since it needs to
- * monitor them anyway for project save/load events.
+ * help and status events.
  * 
  * @author Tom Morris <[email protected]>
  */
-public class ArgoStatusBar extends StatusBar implements IStatusBar {
+public class ArgoStatusBar extends StatusBar implements IStatusBar,
+        ArgoStatusEventListener, ArgoHelpEventListener {
 
     /**
-     * Default constructor.  Registers itself to receive Help events
+     * Default constructor.  Registers itself to receive Help & Status events
      * from the ArgoUML event pump.
      */
     public ArgoStatusBar() {
         super();
-        ArgoEventPump.addListener(ArgoEventTypes.ANY_HELP_EVENT,
-                new HelpListener(this));
+        ArgoEventPump.addListener(ArgoEventTypes.ANY_HELP_EVENT, this);
+        ArgoEventPump.addListener(ArgoEventTypes.ANY_STATUS_EVENT, this);
+    }
+
+    public void projectLoaded(ArgoStatusEvent e) {
+        String status = MessageFormat.format(
+                Translator.localize("statusmsg.bar.open-project-status-read"),
+                new Object[] {e.getText()});
+        showStatusOnSwingThread(status);
+    }
+
+    public void projectModified(ArgoStatusEvent e) {
+        String status = MessageFormat.format(
+                Translator.localize("statusmsg.bar.project-modified"),
+                new Object[] {e.getText()});
+        showStatusOnSwingThread(status);
+    }
+
+    public void projectSaved(ArgoStatusEvent e) {
+        String status = MessageFormat.format(
+                Translator.localize("statusmsg.bar.save-project-status-wrote"),
+                new Object[] {e.getText()});
+        showStatusOnSwingThread(status);
+    }
+
+    public void statusCleared(ArgoStatusEvent e) {
+        showStatusOnSwingThread("");
+    }
+
+    public void statusText(ArgoStatusEvent e) {
+        showStatusOnSwingThread(e.getText());
+    }
+
+    public void helpChanged(ArgoHelpEvent e) {
+        showStatusOnSwingThread(e.getHelpText());
+    }
+
+    public void helpRemoved(ArgoHelpEvent e) {
+        showStatusOnSwingThread("");
+    }
+    
+    // We don't know what thread events will be delivered on, so make sure
+    // we run Swing methods on the Swing thread
+    private void showStatusOnSwingThread(final String status) {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                showStatus(status);
+            }
+        });
     }
 
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DetailsPane.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DetailsPane.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DetailsPane.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DetailsPane.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DetailsPane.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DetailsPane.java	2008-07-07 12:54:30-0700
@@ -216,8 +216,8 @@
         enableTabs(item);
         for (JPanel t : tabPanelList) {
             if (t instanceof TabToDoTarget) {
-                ((TabToDoTarget) t).setTarget(item);
                 topLevelTabbedPane.setSelectedComponent(t);
+                ((TabToDoTarget) t).setTarget(item);
                 return true;
             }
         }
@@ -447,8 +447,7 @@
      */
     public void stateChanged(ChangeEvent e) {
         LOG.debug("DetailsPane state changed");
-        Component sel = topLevelTabbedPane.getSelectedComponent();
-
+        
         // update the previously selected tab
         if (lastNonNullTab >= 0) {
 	    JPanel tab = tabPanelList.get(lastNonNullTab);
@@ -459,21 +458,6 @@
 	}
         Object target = TargetManager.getInstance().getSingleTarget();
 
-        if (sel instanceof TabToDoTarget) {
-            ((TabToDoTarget) sel).setTarget(target);
-        } else if (sel instanceof TabTarget) {
-            ((TabTarget) sel).setTarget(target);
-        }
-        if (sel instanceof TargetListener) {
-            removeTargetListener((TargetListener) sel);
-            addTargetListener((TargetListener) sel);
-            // Newly selected tab may have stale target info, so generate
-            // a new set target event for it to refresh it
-            ((TargetListener) sel).targetSet(new TargetEvent(this,
-                    TargetEvent.TARGET_SET, new Object[] {},
-                    new Object[] {target}));
-        }
-
         if (target != null
             && Model.getFacade().isAUMLElement(target)
             && topLevelTabbedPane.getSelectedIndex() > 0) {
@@ -574,11 +558,11 @@
     /*
      * @see org.tigris.swidgets.Orientable#setOrientation(org.tigris.swidgets.Orientation)
      */
-    public void setOrientation(Orientation orientation) {
+    public void setOrientation(Orientation newOrientation) {
         for (JPanel t : tabPanelList) {
             if (t instanceof Orientable) {
                 Orientable o = (Orientable) t;
-                o.setOrientation(orientation);
+                o.setOrientation(newOrientation);
             }
         }
     }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DisplayTextTree.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DisplayTextTree.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DisplayTextTree.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DisplayTextTree.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DisplayTextTree.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/DisplayTextTree.java	2008-07-07 12:54:30-0700
@@ -28,6 +28,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
@@ -153,7 +154,18 @@
                             .getNotationProvider(
                                 NotationProviderFactory2.TYPE_EXTENSION_POINT,
                                 value);
-                    name = notationProvider.toString(value, null);
+                    /* TODO: move this Map outside this method 
+                     * for performance. */
+                    HashMap<String, Object> npArguments = 
+                        new HashMap<String, Object>();
+                    Project p = ProjectManager.getManager().getCurrentProject();
+                    if (p != null) {
+                        npArguments.put("rightGuillemot", 
+                                p.getProjectSettings().getRightGuillemot());
+                        npArguments.put("leftGuillemot", 
+                                p.getProjectSettings().getLeftGuillemot());
+                    }
+                    name = notationProvider.toString(value, npArguments);
                 } else if (Model.getFacade().isAComment(value)) {
                     name = (String) Model.getFacade().getBody(value);
                 } else if (Model.getFacade().isATaggedValue(value)) {

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/HelpBox.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/HelpBox.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/HelpBox.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/HelpBox.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/HelpBox.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/HelpBox.java	2008-07-07 12:54:30-0700
@@ -39,6 +39,7 @@
 import javax.swing.event.HyperlinkListener;
 
 import org.apache.log4j.Logger;
+import org.argouml.application.helpers.ApplicationVersion;
 
 /**
  * This is what you see after you activate the "Help->Help" menu-item.
@@ -61,11 +62,10 @@
      * The names and URLs for the pages.
      */
     private String pages[][] = {{"Manual",
-            "http://argouml-stats.tigris.org/nonav/documentation/"
-                + "manual-0.24/" ,
+            ApplicationVersion.getOnlineManual() ,
             "The ArgoUML online manual"},
         {"Support",
-            "http://argouml.tigris.org/nonav/support.html",
+            ApplicationVersion.getOnlineSupport(),
             "The ArgoUML support page" }};
 
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ProjectBrowser.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ProjectBrowser.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ProjectBrowser.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ProjectBrowser.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ProjectBrowser.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/ProjectBrowser.java	2008-07-07 12:54:30-0700
@@ -69,6 +69,7 @@
 import org.argouml.application.api.Argo;
 import org.argouml.application.events.ArgoEventPump;
 import org.argouml.application.events.ArgoEventTypes;
+import org.argouml.application.events.ArgoStatusEvent;
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.cognitive.Designer;
 import org.argouml.configuration.Configuration;
@@ -197,7 +198,7 @@
      * Partially implemented. Needs work to display
      * import of source and saving of zargo.
      */
-    private StatusBar statusBar = new StatusBar();
+    private StatusBar statusBar = new ArgoStatusBar();
 
     /**
      * TODO: this needs work so that users can set the font
@@ -304,8 +305,6 @@
             // Rationale: reset the undo manager to start a new chain.
             addKeyboardFocusListener();
         }
-        ArgoEventPump.addListener(ArgoEventTypes.ANY_HELP_EVENT, 
-                new HelpListener(getStatusBar()));
     }
 
     private void addKeyboardFocusListener() {
@@ -976,15 +975,28 @@
     public void setVisible(boolean b) {
         super.setVisible(b);
         if (b) {
-            Globals.setStatusBar(this);
+            Globals.setStatusBar(getStatusBar());
         }
     }
 
-    /*
-     * @see org.tigris.gef.ui.IStatusBar#showStatus(java.lang.String)
+    /**
+     * Show a string in the status bar.
+     * 
+     * @param s the new status string
+     * 
+     * @deprecated for 0.26 by tfmorris. Use {@link ArgoEventPump#fireEvent} to
+     *             send a status event instead.  When this method is removed
+     *             also remove the implements clause for GEF's IStatusBar from
+     *             this (ProjectBrowser) class.
      */
+    @Deprecated
     public void showStatus(String s) {
-        statusBar.showStatus(s);
+        updateStatus(s);
+    }
+    
+    private void updateStatus(String status) {
+        ArgoEventPump.fireEvent(new ArgoStatusEvent(ArgoEventTypes.STATUS_TEXT,
+                this, status));
     }
 
     /**
@@ -1130,6 +1142,9 @@
                 // update all panes
                 TargetManager.getInstance().setTarget(p.getInitialTarget());
             }
+            // TODO: Do we want to use the Project here instead of just its name?
+            ArgoEventPump.fireEvent(new ArgoStatusEvent(
+                    ArgoEventTypes.STATUS_PROJECT_LOADED, this, p.getName()));
         }
     }
 
@@ -1343,7 +1358,7 @@
         ProjectFilePersister persister = null;
 
         try {
-            if (!confirmOverwrite(
+            if (!PersistenceManager.getInstance().confirmOverwrite(
                     ArgoFrame.getInstance(), overwrite, file)) {
                 return false;
             }
@@ -1361,9 +1376,9 @@
 
             String sStatus =
                 MessageFormat.format(Translator.localize(
-                    "label.save-project-status-writing"),
+                    "statusmsg.bar.save-project-status-writing"),
                          new Object[] {file});
-            this.showStatus (sStatus);
+            updateStatus (sStatus);
 
             persister = pm.getSavePersister();
             pm.setSavePersister(null);
@@ -1400,11 +1415,9 @@
             persister.save(project, file);
             project.postSave();
 
-            sStatus =
-                MessageFormat.format(Translator.localize(
-                    "label.save-project-status-wrote"),
-                         new Object[] {project.getURI()});
-            showStatus(sStatus);
+            ArgoEventPump.fireEvent(new ArgoStatusEvent(
+                    ArgoEventTypes.STATUS_PROJECT_SAVED, this, project.getURI()
+                            .toString()));
             LOG.debug ("setting most recent project file to "
                    + file.getCanonicalPath());
 
@@ -1630,9 +1643,9 @@
                 Configuration.setString(Argo.KEY_MOST_RECENT_PROJECT_FILE,
                         file.getCanonicalPath());
                 
-                ProjectBrowser.getInstance().showStatus(
+                updateStatus(
                         Translator.localize(
-                                "label.open-project-status-read",
+                                "statusmsg.bar.open-project-status-read",
                                 new Object[] {file.getName(), }));
             } catch (VersionException ex) {
                 project = oldProject;
@@ -1929,36 +1942,6 @@
     }
     
     /**
-     * Returns true if we are allowed to overwrite the given file.
-     *
-     * @param overwrite if true, then the user is not asked
-     * @param file the given file
-     * @return true if we are allowed to overwrite the given file
-     * @param frame the Component to display the confirmation dialog on
-     */
-    public boolean confirmOverwrite(Component frame, 
-            boolean overwrite, File file) {
-        if (file.exists() && !overwrite) {
-            String sConfirm =
-                Translator.messageFormat(
-                    "optionpane.confirm-overwrite",
-                    new Object[] {file});
-            int nResult =
-                JOptionPane.showConfirmDialog(
-                        frame,
-                        sConfirm,
-                        Translator.localize(
-                            "optionpane.confirm-overwrite-title"),
-                        JOptionPane.YES_NO_OPTION,
-                        JOptionPane.QUESTION_MESSAGE);
-            if (nResult != JOptionPane.YES_OPTION) {
-                return false;
-            }
-        }
-        return true;
-    }
-    
-    /**
      * The UID.
      */
     private static final long serialVersionUID = 6974246679451284917L;

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/StatusBar.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/StatusBar.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/StatusBar.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/StatusBar.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/StatusBar.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/StatusBar.java	2008-07-07 12:54:30-0700
@@ -111,12 +111,12 @@
 	    progress.setValue(i);
 	    repaint();
 	    try { wait(10); }
-	    catch (Exception ex) { }
+	    catch (InterruptedException ex) { }
 	}
 	showStatus(statusText + "... done.");
 	repaint();
 	try { wait(1000); }
-	catch (Exception ex) { }
+	catch (InterruptedException ex) { }
 	progress.setValue(0);
 	showStatus("");
 	repaint();

Removed: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/Action.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/Action.java?view=auto&rev=15193

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustGrid.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustGrid.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustGrid.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustGrid.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustGrid.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustGrid.java	2008-07-07 12:54:30-0700
@@ -1,186 +1,185 @@
-// $Id: eclipse-argo-codetemplates.xml 10612 2006-05-25 12:58:04Z linus $

-// Copyright (c) 2006-2007 The Regents of the University of California. All

-// Rights Reserved. Permission to use, copy, modify, and distribute this

-// software and its documentation without fee, and without a written

-// agreement is hereby granted, provided that the above copyright notice

-// and this paragraph appear in all copies. This software program and

-// documentation are copyrighted by The Regents of the University of

-// California. The software program and documentation are supplied "AS

-// IS", without any accompanying services from The Regents. The Regents

-// does not warrant that the operation of the program will be

-// uninterrupted or error-free. The end-user understands that the program

-// was developed for research purposes and is advised not to rely

-// exclusively on the program for any reason. IN NO EVENT SHALL THE

-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

-

-package org.argouml.ui.cmd;

-

-import java.awt.Toolkit;

-import java.awt.event.ActionEvent;

-import java.awt.event.KeyEvent;

-import java.util.ArrayList;

-import java.util.Enumeration;

-import java.util.HashMap;

-import java.util.List;

-import java.util.Map;

-

-import javax.swing.AbstractAction;

-import javax.swing.AbstractButton;

-import javax.swing.Action;

-import javax.swing.ButtonGroup;

-import javax.swing.KeyStroke;

-

-import org.argouml.application.api.Argo;

-import org.argouml.configuration.Configuration;

-import org.argouml.i18n.Translator;

-import org.tigris.gef.base.Editor;

-import org.tigris.gef.base.Globals;

-import org.tigris.gef.base.Layer;

-import org.tigris.gef.base.LayerGrid;

-

-

-/**

- * This action changes the grid shown on the diagram.

- * 

- * @author Michiel

- */

-public class ActionAdjustGrid extends AbstractAction {

-    private final Map<String, Comparable> myMap;

-    private static final String DEFAULT_ID = "03";

-    private static ButtonGroup myGroup;

-

-    private static final int DEFAULT_MASK = 

-        Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();

-

-    /**

-     * @param map this map contains the values for 

-     *          the spacing, paintLines and paintDots. 

-     * @param name the name for this action

-     */

-    public ActionAdjustGrid(final Map<String, Comparable> map,

-            final String name) {

-        super();

-        myMap = map;

-        putValue(Action.NAME, name);

-    }

-

-    public void actionPerformed(final ActionEvent e) {

-        final Editor editor = Globals.curEditor();

-        final Layer grid = editor.getLayerManager().findLayerNamed("Grid");

-        if (grid instanceof LayerGrid) {

-            if (myMap != null) {

-                // Kludge required by GEF's use of HashMap in the API

-                // TODO: This can be removed if they ever fix GEF to use Maps

-                if (myMap instanceof HashMap) {

-                    grid.adjust((HashMap<String, Comparable>) myMap);

-                } else {

-                    grid.adjust(new HashMap<String, Comparable>(myMap));

-                }

-                Configuration.setString(Argo.KEY_GRID, (String) getValue("ID"));

-            }

-        }

-    }

-    

-    static void setGroup(final ButtonGroup group) {

-        myGroup = group;

-    }

-    

-    /**

-     * This executes one of the actions, 

-     * based on the stored ArgoUML configuration. 

-     * This function is intended for the initial setting 

-     * of the grid when ArgoUML is started. <p>

-     * 

-     * Additionally, the ButtonGroup is searched for the right Action, 

-     * and when found, the button's model initialised.

-     */

-    static void init() {

-        String id = Configuration.getString(Argo.KEY_GRID, DEFAULT_ID);

-        List<Action> actions = createAdjustGridActions(false);

-        for (Action a : actions) {

-            if (a.getValue("ID").equals(id)) {

-                a.actionPerformed(null);

-

-                if (myGroup != null) {

-                    for (Enumeration e = myGroup.getElements(); 

-                        e.hasMoreElements();) {

-                        AbstractButton ab = (AbstractButton) e.nextElement();

-                        Action action = ab.getAction();

-                        if (action instanceof ActionAdjustGrid) {

-                            String currentID = (String) action.getValue("ID"); 

-                            if (id.equals(currentID)) {

-                                myGroup.setSelected(ab.getModel(), true);

-                                return;

-                            }

-                        }

-                    }

-                }

-                return;

-            }

-        }

-    }

-    

-    /**

-     * This function is the one and only location 

-     * that defines the number of grid settings, and their content.

-     * 

-     * @constraint one of the actions should have the ID 'defaultID', 

-     *          since this is used in init().

-     * @param longStrings

-     * @return List of Actions which adjust the grid

-     */

-    static List<Action> createAdjustGridActions(final boolean longStrings) {

-        List<Action> result = new ArrayList<Action>();

-

-        result.add(buildGridAction(longStrings ? "action.adjust-grid.lines-16"

-                : "menu.item.lines-16", 16, true, true, "01", KeyEvent.VK_1));

-        result.add(buildGridAction(longStrings ? "action.adjust-grid.lines-8"

-                : "menu.item.lines-8", 8, true, true, "02", KeyEvent.VK_2));

-        result.add(buildGridAction(longStrings ? "action.adjust-grid.lines-16"

-                : "menu.item.lines-16", 16, false, true, "03", KeyEvent.VK_3));

-        result.add(buildGridAction(longStrings ? "action.adjust-grid.lines-32"

-                : "menu.item.lines-32", 32, false, true, "04", KeyEvent.VK_4));

-        result.add(buildGridAction(

-                longStrings ? "action.adjust-grid.lines-none"

-                        : "menu.item.lines-none", 16, false, false, "05",

-                KeyEvent.VK_5));

-     

-        return result;

-    }

-

-    /**

-     * Builder method for Grid actions

-     * 

-     * @param property

-     * @param spacing

-     * @param paintLines whether or not to paint lines

-     * @param paintDots whether or not to paint dots

-     * @param id identifier action identifier

-     * @param key shortcut key

-     * @return grid action

-     */

-    public static Action buildGridAction(final String property,

-            final int spacing, final boolean paintLines,

-            final boolean paintDots, final String id, final int key) {

-        String name = Translator.localize(property);

-        HashMap<String, Comparable> map1 = new HashMap<String, Comparable>(4);

-        map1.put("spacing", Integer.valueOf(spacing));

-        map1.put("paintLines", Boolean.valueOf(paintLines));

-        map1.put("paintDots", Boolean.valueOf(paintDots));

-        Action action = new ActionAdjustGrid(map1, name);

-        action.putValue("ID", id);

-        action.putValue("shortcut", KeyStroke.getKeyStroke(

-                key, DEFAULT_MASK));

-        return action;

-    }

-

+// $Id$
+// Copyright (c) 2006-2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.ui.cmd;
+
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.Action;
+import javax.swing.ButtonGroup;
+import javax.swing.KeyStroke;
+
+import org.argouml.application.api.Argo;
+import org.argouml.configuration.Configuration;
+import org.argouml.i18n.Translator;
+import org.tigris.gef.base.Editor;
+import org.tigris.gef.base.Globals;
+import org.tigris.gef.base.Layer;
+import org.tigris.gef.base.LayerGrid;
+
+
+/**
+ * This action changes the grid shown on the diagram.
+ * 
+ * @author Michiel
+ */
+public class ActionAdjustGrid extends AbstractAction {
+
+    private final Map<String, Comparable> myMap;
+    private static final String DEFAULT_ID = "03";
+    private static ButtonGroup myGroup;
+
+    private static final int DEFAULT_MASK = 
+        Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
+
+    /**
+     * @param map this map contains the values for 
+     *          the spacing, paintLines and paintDots. 
+     * @param name the name for this action
+     */
+    private ActionAdjustGrid(final Map<String, Comparable> map,
+            final String name) {
+        super();
+        myMap = map;
+        putValue(Action.NAME, name);
+    }
+
+    public void actionPerformed(final ActionEvent e) {
+        final Editor editor = Globals.curEditor();
+        final Layer grid = editor.getLayerManager().findLayerNamed("Grid");
+        if (grid instanceof LayerGrid) {
+            if (myMap != null) {
+                // Kludge required by GEF's use of HashMap in the API
+                // TODO: This can be removed if they ever fix GEF to use Maps
+                if (myMap instanceof HashMap) {
+                    grid.adjust((HashMap<String, Comparable>) myMap);
+                } else {
+                    grid.adjust(new HashMap<String, Comparable>(myMap));
+                }
+                Configuration.setString(Argo.KEY_GRID, (String) getValue("ID"));
+            }
+        }
+    }
+    
+    static void setGroup(final ButtonGroup group) {
+        myGroup = group;
+    }
+    
+    /**
+     * This executes one of the actions, 
+     * based on the stored ArgoUML configuration. 
+     * This function is intended for the initial setting 
+     * of the grid when ArgoUML is started. <p>
+     * 
+     * Additionally, the ButtonGroup is searched for the right Action, 
+     * and when found, the button's model initialised.
+     */
+    static void init() {
+        String id = Configuration.getString(Argo.KEY_GRID, DEFAULT_ID);
+        List<Action> actions = createAdjustGridActions(false);
+        for (Action a : actions) {
+            if (a.getValue("ID").equals(id)) {
+                a.actionPerformed(null);
+
+                if (myGroup != null) {
+                    for (Enumeration e = myGroup.getElements(); 
+                        e.hasMoreElements();) {
+                        AbstractButton ab = (AbstractButton) e.nextElement();
+                        Action action = ab.getAction();
+                        if (action instanceof ActionAdjustGrid) {
+                            String currentID = (String) action.getValue("ID"); 
+                            if (id.equals(currentID)) {
+                                myGroup.setSelected(ab.getModel(), true);
+                                return;
+                            }
+                        }
+                    }
+                }
+                return;
+            }
+        }
+    }
+    
+    /**
+     * This function is the one and only location 
+     * that defines the number of grid settings, and their content.
+     * 
+     * @constraint one of the actions should have the ID 'defaultID', 
+     *          since this is used in init().
+     * @param longStrings
+     * @return List of Actions which adjust the grid
+     */
+    static List<Action> createAdjustGridActions(final boolean longStrings) {
+        List<Action> result = new ArrayList<Action>();
+
+        result.add(buildGridAction(longStrings ? "action.adjust-grid.lines-16"
+                : "menu.item.lines-16", 16, true, true, "01", KeyEvent.VK_1));
+        result.add(buildGridAction(longStrings ? "action.adjust-grid.lines-8"
+                : "menu.item.lines-8", 8, true, true, "02", KeyEvent.VK_2));
+        result.add(buildGridAction(longStrings ? "action.adjust-grid.dots-16"
+                : "menu.item.dots-16", 16, false, true, "03", KeyEvent.VK_3));
+        result.add(buildGridAction(longStrings ? "action.adjust-grid.dots-32"
+                : "menu.item.dots-32", 32, false, true, "04", KeyEvent.VK_4));
+        result.add(buildGridAction(
+                longStrings ? "action.adjust-grid.none"
+                        : "menu.item.none", 16, false, false, "05",
+                KeyEvent.VK_5));
+     
+        return result;
+    }
+
+    /**
+     * @param property the name (not yet localised)
+     * @param spacing the spacing distance
+     * @param paintLines show lines
+     * @param paintDots show dots
+     * @param id identifier
+     * @param key keyCode
+     * @return the Action
+     */
+    public static Action buildGridAction(final String property,
+            final int spacing, final boolean paintLines,
+            final boolean paintDots, final String id, final int key) {
+        String name = Translator.localize(property);
+        HashMap<String, Comparable> map1 = new HashMap<String, Comparable>(4);
+        map1.put("spacing", Integer.valueOf(spacing));
+        map1.put("paintLines", Boolean.valueOf(paintLines));
+        map1.put("paintDots", Boolean.valueOf(paintDots));
+        Action action = new ActionAdjustGrid(map1, name);
+        action.putValue("ID", id);
+        action.putValue("shortcut", KeyStroke.getKeyStroke(
+                key, DEFAULT_MASK));
+        return action;
+    }
+
 }
\ No newline at end of file

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustSnap.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustSnap.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustSnap.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustSnap.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustSnap.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ActionAdjustSnap.java	2008-07-07 12:54:30-0700
@@ -1,157 +1,156 @@
-// $Id: eclipse-argo-codetemplates.xml 10612 2006-05-25 12:58:04Z linus $

-// Copyright (c) 2006-2007 The Regents of the University of California. All

-// Rights Reserved. Permission to use, copy, modify, and distribute this

-// software and its documentation without fee, and without a written

-// agreement is hereby granted, provided that the above copyright notice

-// and this paragraph appear in all copies. This software program and

-// documentation are copyrighted by The Regents of the University of

-// California. The software program and documentation are supplied "AS

-// IS", without any accompanying services from The Regents. The Regents

-// does not warrant that the operation of the program will be

-// uninterrupted or error-free. The end-user understands that the program

-// was developed for research purposes and is advised not to rely

-// exclusively on the program for any reason. IN NO EVENT SHALL THE

-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

-

-package org.argouml.ui.cmd;

-

-import java.awt.Event;

-import java.awt.event.ActionEvent;

-import java.awt.event.KeyEvent;

-import java.util.ArrayList;

-import java.util.Enumeration;

-import java.util.List;

-

-import javax.swing.AbstractAction;

-import javax.swing.AbstractButton;

-import javax.swing.Action;

-import javax.swing.ButtonGroup;

-import javax.swing.KeyStroke;

-

-import org.argouml.application.api.Argo;

-import org.argouml.configuration.Configuration;

-import org.argouml.i18n.Translator;

-import org.tigris.gef.base.Editor;

-import org.tigris.gef.base.Globals;

-import org.tigris.gef.base.Guide;

-import org.tigris.gef.base.GuideGrid;

-

-/**

- * This action changes the snap (called guide or grid-guide in GEF).

- * 

- * @author Michiel

- */

-public class ActionAdjustSnap extends AbstractAction {

-

-    private int guideSize;

-

-    private static final String DEFAULT_ID = "8";

-

-    private static ButtonGroup myGroup;

-

-    /**

-     * @param size the size of the snap in pixels

-     * @param name the name of the action

-     */

-    public ActionAdjustSnap(int size, String name) {

-        super();

-        guideSize = size;

-        putValue(Action.NAME, name);

-    }

-

-    public void actionPerformed(ActionEvent e) {

-        Editor ce = Globals.curEditor();

-        Guide guide = ce.getGuide();

-        if (guide instanceof GuideGrid) {

-            ((GuideGrid) guide).gridSize(guideSize);

-            Configuration.setString(Argo.KEY_SNAP, (String) getValue("ID"));

-        }

-    }

-

-    static void setGroup(ButtonGroup group) {

-        myGroup = group;

-    }

-

-    /**

-     * This executes one of the actions, based on the stored ArgoUML

-     * configuration. This function is intended for the initial setting of the

-     * snap when ArgoUML is started.

-     */

-    static void init() {

-        String id = Configuration.getString(Argo.KEY_SNAP, DEFAULT_ID);

-        List<Action> actions = createAdjustSnapActions();

-        for (Action a : actions) {

-            if (a.getValue("ID").equals(id)) {

-                a.actionPerformed(null);

-

-                if (myGroup != null) {

-                    for (Enumeration e = myGroup.getElements(); e

-                            .hasMoreElements();) {

-                        AbstractButton ab = (AbstractButton) e.nextElement();

-                        Action action = ab.getAction();

-                        if (action instanceof ActionAdjustSnap) {

-                            String currentID = (String) action.getValue("ID");

-                            if (id.equals(currentID)) {

-                                myGroup.setSelected(ab.getModel(), true);

-                                return;

-                            }

-                        }

-                    }

-                }

-                return;

-            }

-        }

-    }

-

-    /**

-     * Return a list of actions to adjust the size of the snap grid. Current

-     * values are 4, 8, 16, and 32.

-     * 

-     * @return List of Actions which adjust the size of the snap grid

-     */

-    static List<Action> createAdjustSnapActions() {

-        List<Action> result = new ArrayList<Action>();

-        Action a;

-        String name;

-

-        name = Translator.localize("menu.item.snap-4");

-        a = new ActionAdjustSnap(4, name);

-        a.putValue("ID", "4");

-        a.putValue("shortcut", KeyStroke.getKeyStroke(KeyEvent.VK_1,

-                Event.ALT_MASK + Event.CTRL_MASK));

-        result.add(a);

-

-        name = Translator.localize("menu.item.snap-8");

-        a = new ActionAdjustSnap(8, name);

-        a.putValue("ID", "8"); /* This ID is used as DEFAULT_ID ! */

-        a.putValue("shortcut", KeyStroke.getKeyStroke(KeyEvent.VK_2,

-                Event.ALT_MASK + Event.CTRL_MASK));

-        result.add(a);

-

-        name = Translator.localize("menu.item.snap-16");

-        a = new ActionAdjustSnap(16, name);

-        a.putValue("ID", "16");

-        a.putValue("shortcut", KeyStroke.getKeyStroke(KeyEvent.VK_3,

-                Event.ALT_MASK + Event.CTRL_MASK));

-        result.add(a);

-

-        name = Translator.localize("menu.item.snap-32");

-        a = new ActionAdjustSnap(32, name);

-        a.putValue("ID", "32");

-        a.putValue("shortcut", KeyStroke.getKeyStroke(KeyEvent.VK_4,

-                Event.ALT_MASK + Event.CTRL_MASK));

-        result.add(a);

-

-        return result;

-    }

-

-}

+// $Id$
+// Copyright (c) 2006-2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.ui.cmd;
+
+import java.awt.Event;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.Action;
+import javax.swing.ButtonGroup;
+import javax.swing.KeyStroke;
+
+import org.argouml.application.api.Argo;
+import org.argouml.configuration.Configuration;
+import org.argouml.i18n.Translator;
+import org.tigris.gef.base.Editor;
+import org.tigris.gef.base.Globals;
+import org.tigris.gef.base.Guide;
+import org.tigris.gef.base.GuideGrid;
+
+/**
+ * This action changes the snap (called guide or grid-guide in GEF).
+ *
+ * @author Michiel
+ */
+public class ActionAdjustSnap extends AbstractAction {
+
+    private int guideSize;
+    private static final String DEFAULT_ID = "8";
+    private static ButtonGroup myGroup;
+    
+    /**
+     * @param size the size of the snap in pixels
+     * @param name the name of the action
+     */
+    public ActionAdjustSnap(int size, String name) {
+        super();
+        guideSize = size;
+        putValue(Action.NAME, name);
+    }
+    
+    public void actionPerformed(ActionEvent e) {
+        Editor ce = Globals.curEditor();
+        Guide guide = ce.getGuide();
+        if (guide instanceof GuideGrid) {
+            ((GuideGrid) guide).gridSize(guideSize);
+            Configuration.setString(Argo.KEY_SNAP, (String) getValue("ID"));
+        }
+    }
+
+    static void setGroup(ButtonGroup group) {
+        myGroup = group;
+    }
+
+    /**
+     * This executes one of the actions, 
+     * based on the stored ArgoUML configuration. 
+     * This function is intended for the initial setting 
+     * of the snap when ArgoUML is started.
+     */
+    static void init() {
+        String id = Configuration.getString(Argo.KEY_SNAP, DEFAULT_ID);
+        List<Action> actions = createAdjustSnapActions();
+        for (Action a : actions) {
+            if (a.getValue("ID").equals(id)) {
+                a.actionPerformed(null);
+
+                if (myGroup != null) {
+                    for (Enumeration e = myGroup.getElements(); 
+                        e.hasMoreElements();) {
+                        AbstractButton ab = (AbstractButton) e.nextElement();
+                        Action action = ab.getAction();
+                        if (action instanceof ActionAdjustSnap) {
+                            String currentID = (String) action.getValue("ID"); 
+                            if (id.equals(currentID)) {
+                                myGroup.setSelected(ab.getModel(), true);
+                                return;
+                            }
+                        }
+                    }
+                }
+                return;
+            }
+        }
+    }
+
+    /**
+     * Return a list of actions to adjust the size of the snap grid.
+     * Current values are 4, 8, 16, and 32.
+     * 
+     * @return List of Actions which adjust the size of the snap grid
+     */
+    static List<Action> createAdjustSnapActions() {
+        List<Action> result = new ArrayList<Action>();
+        Action a;
+        String name;
+        
+        name = Translator.localize("menu.item.snap-4");
+        a = new ActionAdjustSnap(4, name);
+        a.putValue("ID", "4");
+        a.putValue("shortcut", KeyStroke.getKeyStroke(
+                KeyEvent.VK_1, Event.ALT_MASK + Event.CTRL_MASK));
+        result.add(a);
+        
+        name = Translator.localize("menu.item.snap-8");
+        a = new ActionAdjustSnap(8, name);
+        a.putValue("ID", "8"); /* This ID is used as DEFAULT_ID ! */
+        a.putValue("shortcut", KeyStroke.getKeyStroke(
+                KeyEvent.VK_2, Event.ALT_MASK + Event.CTRL_MASK));
+        result.add(a);
+        
+        name = Translator.localize("menu.item.snap-16");
+        a = new ActionAdjustSnap(16, name);
+        a.putValue("ID", "16");
+        a.putValue("shortcut", KeyStroke.getKeyStroke(
+                KeyEvent.VK_3, Event.ALT_MASK + Event.CTRL_MASK));
+        result.add(a);
+        
+        name = Translator.localize("menu.item.snap-32");
+        a = new ActionAdjustSnap(32, name);
+        a.putValue("ID", "32");
+        a.putValue("shortcut", KeyStroke.getKeyStroke(
+                KeyEvent.VK_4, Event.ALT_MASK + Event.CTRL_MASK));
+        result.add(a);
+        
+        return result;
+    }
+
+}

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java	2008-07-07 12:54:30-0700
@@ -28,7 +28,6 @@
 import java.awt.event.KeyEvent;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.swing.Action;
@@ -82,8 +81,6 @@
 import org.tigris.gef.base.AlignAction;
 import org.tigris.gef.base.DistributeAction;
 import org.tigris.gef.base.ReorderAction;
-import org.tigris.gef.base.SelectAllAction;
-import org.tigris.gef.base.SelectInvertAction;
 import org.tigris.toolbar.ToolBarFactory;
 
 /**
@@ -370,7 +367,9 @@
         file.addSeparator();
         JMenuItem exitItem = file.add(new ActionExit());
         setMnemonic(exitItem, "Exit");
-        // exit shortcut is not user configurable!
+        /* The "Close window" shortcut (ALT+F4) actually can't 
+         * be registered as a shortcut, 
+         * because it closes the configuration dialog! */
         exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4,
               InputEvent.ALT_MASK));
 
@@ -404,8 +403,7 @@
         setMnemonic(select, "Select");
         edit.add(select);
 
-        JMenuItem selectAllItem = select.add(
-                new SelectAllAction(menuItemLocalize("Select All")));
+        JMenuItem selectAllItem = select.add(new ActionSelectAll());
         setMnemonic(selectAllItem, "Select All");
         ShortcutMgr.assignAccelerator(selectAllItem,
                 ShortcutMgr.ACTION_SELECT_ALL);
@@ -420,8 +418,7 @@
                 ShortcutMgr.ACTION_NAVIGATE_FORWARD);
         select.addSeparator();
 
-        JMenuItem selectInvert = select.add(
-                new SelectInvertAction(menuItemLocalize("Invert Selection")));
+        JMenuItem selectInvert = select.add(new ActionSelectInvert());
         setMnemonic(selectInvert, "Invert Selection");
         ShortcutMgr.assignAccelerator(selectInvert,
                 ShortcutMgr.ACTION_SELECT_INVERT);
@@ -509,12 +506,11 @@
         
         JMenu grid = (JMenu) view.add(new JMenu(menuLocalize("Adjust Grid")));
         setMnemonic(grid, "Grid");
-        List gridActions = ActionAdjustGrid.createAdjustGridActions(false);
+        List<Action> gridActions = 
+            ActionAdjustGrid.createAdjustGridActions(false);
         ButtonGroup groupGrid = new ButtonGroup();
         ActionAdjustGrid.setGroup(groupGrid);
-        Iterator i = gridActions.iterator();
-        while (i.hasNext()) {
-            Action cmdAG = (Action) i.next();
+        for ( Action cmdAG : gridActions) {
             JRadioButtonMenuItem mi = new JRadioButtonMenuItem(cmdAG);
             groupGrid.add(mi);
             JMenuItem adjustGrid = grid.add(mi);
@@ -525,12 +521,10 @@
 
         JMenu snap = (JMenu) view.add(new JMenu(menuLocalize("Adjust Snap")));
         setMnemonic(snap, "Snap");
-        List snapActions = ActionAdjustSnap.createAdjustSnapActions();
+        List<Action> snapActions = ActionAdjustSnap.createAdjustSnapActions();
         ButtonGroup groupSnap = new ButtonGroup();
         ActionAdjustSnap.setGroup(groupSnap);
-        i = snapActions.iterator();
-        while (i.hasNext()) {
-            Action cmdAS = (Action) i.next();
+        for ( Action cmdAS : snapActions) {
             JRadioButtonMenuItem mi = new JRadioButtonMenuItem(cmdAS);
             groupSnap.add(mi);
             JMenuItem adjustSnap = snap.add(mi);
@@ -539,7 +533,8 @@
                     ShortcutMgr.ACTION_ADJUST_GUIDE + cmdAS.getValue("ID"));
         }
 
-        JMenuItem adjustPageBreaks = view.add(new AdjustPageBreaksAction());
+        Action pba  = new ActionAdjustPageBreaks();
+        JMenuItem adjustPageBreaks = view.add(pba);
         setMnemonic(adjustPageBreaks, "Adjust Pagebreaks");
         ShortcutMgr.assignAccelerator(adjustPageBreaks,
                 ShortcutMgr.ACTION_ADJUST_PAGE_BREAKS);
@@ -589,7 +584,7 @@
         toolbarTools.add((new ActionSequenceDiagram()));
         ShortcutMgr.assignAccelerator(sequenzDiagram,
                 ShortcutMgr.ACTION_SEQUENCE_DIAGRAM);
-
+        
         JMenuItem collaborationDiagram =
             createDiagramMenu.add(new ActionCollaborationDiagram());
         setMnemonic(collaborationDiagram, "Collaboration Diagram");

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/SettingsTabShortcuts.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/SettingsTabShortcuts.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/SettingsTabShortcuts.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/SettingsTabShortcuts.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/SettingsTabShortcuts.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/SettingsTabShortcuts.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2006-2007 The Regents of the University of California. All
+// Copyright (c) 2006-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -43,6 +43,7 @@
 import javax.swing.JTable;
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
+import javax.swing.SwingConstants;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.AbstractTableModel;
@@ -95,9 +96,9 @@
 
     private JLabel warningLabel = new JLabel(" ");
 
-    private Action target;
+    private ActionWrapper target;
 
-    private Action[] actions = ShortcutMgr.getShortcuts();
+    private ActionWrapper[] actions = ShortcutMgr.getShortcuts();
 
     private int lastRowSelected = -1;
 
@@ -207,6 +208,19 @@
             panelConstraints.weighty = 1;
             add(selectedContainer, panelConstraints);
 
+            JLabel restart =
+                new JLabel(Translator.localize("label.restart-application"));
+            restart.setHorizontalAlignment(SwingConstants.CENTER);
+            restart.setVerticalAlignment(SwingConstants.CENTER);
+            restart.setBorder(BorderFactory.createEmptyBorder(10, 2, 10, 2));
+            
+            panelConstraints.gridy = 2;
+            panelConstraints.anchor = GridBagConstraints.CENTER;
+            panelConstraints.fill = GridBagConstraints.BOTH;
+            panelConstraints.weightx = 1;
+            panelConstraints.weighty = 0;
+            add(restart, panelConstraints);
+            
             this.enableFields(false);
         }
 
@@ -233,7 +247,7 @@
      *            the new target
      */
     private void setTarget(Object t) {
-        target = (Action) t;
+        target = (ActionWrapper) t;
         // let's enable the radiobuttons container
         enableFields(true);
         // updating the radiobuttons container's title
@@ -324,7 +338,7 @@
         // if a shortcut has been select then we have to check if the actual
         // action is in conflict with other ones
         if (!noneButton.isSelected()) {
-            Action oldAction = getActionAlreadyAssigned(ShortcutMgr
+            ActionWrapper oldAction = getActionAlreadyAssigned(ShortcutMgr
                     .decodeKeyStroke(shortcutField.getText()));
             if (oldAction != null) {
                 // this shortcut was already been assigned to another action;
@@ -367,7 +381,7 @@
      *            the KeyStroke to be checked
      * @return the Action that has already been assigned
      */
-    public Action getActionAlreadyAssigned(KeyStroke keyStroke) {
+    public ActionWrapper getActionAlreadyAssigned(KeyStroke keyStroke) {
         for (int i = 0; i < actions.length; i++) {
             if (actions[i].getCurrentShortcut() != null
                     && actions[i].getCurrentShortcut().equals(keyStroke)
@@ -459,7 +473,7 @@
      * @param newKeyStroke      the key stroke to be checked
      */
     private void checkShortcutAlreadyAssigned(KeyStroke newKeyStroke) {
-        Action oldAction = getActionAlreadyAssigned(newKeyStroke);
+        ActionWrapper oldAction = getActionAlreadyAssigned(newKeyStroke);
         if (oldAction != null) {
             // the shortcut has already been assigned to another action!
             this.shortcutField.setBackground(Color.YELLOW);
@@ -474,7 +488,7 @@
     }
 
     /**
-     * Table model for the table with modules.
+     * Table model for the table with actions and shortcuts.
      */
     class ShortcutTableModel extends AbstractTableModel {
 
@@ -485,7 +499,7 @@
             elements = new Object[actions.length][3];
 
             for (int i = 0; i < elements.length; i++) {
-                Action currentAction = actions[i];
+                ActionWrapper currentAction = actions[i];
                 elements[i][0] = currentAction.getActionName();
                 elements[i][1] = currentAction.getCurrentShortcut();
                 elements[i][2] = currentAction.getDefaultShortcut();
@@ -534,8 +548,8 @@
         @Override
         public void setValueAt(Object ob, int row, int col) {
             // if the given object is a KeyStroke instance, then we ca
-            if (ob instanceof Action) {
-                Action newValueAction = (Action) ob;
+            if (ob instanceof ActionWrapper) {
+                ActionWrapper newValueAction = (ActionWrapper) ob;
                 for (int i = 0; i < elements.length; i++) {
                     if (elements[i][0].equals(newValueAction.getActionName())) {
                         elements[i][1] = newValueAction.getCurrentShortcut();
@@ -560,7 +574,8 @@
         /*
          * @see javax.swing.table.TableModel#getColumnClass(int)
          */
-        public Class getColumnClass(int col) {
+        @Override
+        public Class<?> getColumnClass(int col) {
             switch (col) {
             case 0:
                 return String.class;
@@ -581,10 +596,6 @@
             return false;
         }
 
-        /**
-         * The UID.
-         */
-        private static final long serialVersionUID = -5970280716477119863L;
     }
 }
 
@@ -594,10 +605,6 @@
  * @author [email protected]
  */
 class KeyStrokeCellRenderer extends DefaultTableCellRenderer {
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -7086302679799095974L;
 
     /**
      * Construct a table cell rendered for key strokes.

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/cmd/ShortcutMgr.java	2008-07-07 12:54:30-0700
@@ -77,8 +77,6 @@
 import org.tigris.gef.base.AlignAction;
 import org.tigris.gef.base.DistributeAction;
 import org.tigris.gef.base.ReorderAction;
-import org.tigris.gef.base.SelectAllAction;
-import org.tigris.gef.base.SelectInvertAction;
 import org.tigris.gef.base.ZoomAction;
 
 /**
@@ -310,25 +308,27 @@
     private static final int SHIFTED_DEFAULT_MASK = Toolkit.getDefaultToolkit()
             .getMenuShortcutKeyMask() | KeyEvent.SHIFT_DOWN_MASK;
 
-    private static HashMap shortcutHash = new HashMap(90);
+    private static HashMap<String, ActionWrapper> shortcutHash = 
+        new HashMap<String, ActionWrapper>(90);
 
-    private static HashMap duplicate = new HashMap(10);
+    private static HashMap<KeyStroke, KeyStroke> duplicate = 
+        new HashMap<KeyStroke, KeyStroke>(10);
 
     /**
-     * Return the shortcuts as an Actions array
+     * Return the shortcuts as an ActionWrapper array
      * 
-     * @return an array of Actions
+     * @return an array of ActionWrappers
      */
-    public static Action[] getShortcuts() {
-        Action[] actions = (Action[]) shortcutHash.values().toArray(
-                new Action[shortcutHash.size()]);
-        Arrays.sort(actions, new Comparator() {
-            public int compare(Object o1, Object o2) {
-                String name1 = ((Action) o1).getActionName();
+    static ActionWrapper[] getShortcuts() {
+        ActionWrapper[] actions = shortcutHash.values().toArray(
+                new ActionWrapper[shortcutHash.size()]);
+        Arrays.sort(actions, new Comparator<ActionWrapper>() {
+            public int compare(ActionWrapper o1, ActionWrapper o2) {
+                String name1 = o1.getActionName();
                 if (name1 == null) {
                     name1 = "";
                 }
-                String name2 = ((Action) o2).getActionName();
+                String name2 = o2.getActionName();
                 if (name2 == null) {
                     name2 = "";
                 }
@@ -348,15 +348,14 @@
      */
     public static void assignAccelerator(JMenuItem menuItem, 
             String shortcutKey) {
-        Action shortcut = (Action) shortcutHash.get(shortcutKey);
+        ActionWrapper shortcut = shortcutHash.get(shortcutKey);
 
         if (shortcut != null) {
             KeyStroke keyStroke = shortcut.getCurrentShortcut();
             if (keyStroke != null) {
                 menuItem.setAccelerator(keyStroke);
             }
-            KeyStroke alternativeKeyStroke = (KeyStroke) duplicate
-                    .get(keyStroke);
+            KeyStroke alternativeKeyStroke = duplicate.get(keyStroke);
             if (alternativeKeyStroke != null) {
                 String actionName = (String) menuItem.getAction().getValue(
                         AbstractAction.NAME);
@@ -378,7 +377,7 @@
      */
     public static void assignAccelerator(JPanel panel, 
             String shortcutKey) {
-        Action shortcut = (Action) shortcutHash.get(shortcutKey);
+        ActionWrapper shortcut = shortcutHash.get(shortcutKey);
 
         if (shortcut != null) {
             KeyStroke keyStroke = shortcut.getCurrentShortcut();
@@ -386,8 +385,7 @@
                 panel.registerKeyboardAction(shortcut.getActionInstance(), 
                         keyStroke, JComponent.WHEN_FOCUSED);
             }
-            KeyStroke alternativeKeyStroke = (KeyStroke) duplicate
-                    .get(keyStroke);
+            KeyStroke alternativeKeyStroke = duplicate.get(keyStroke);
             if (alternativeKeyStroke != null) {
                 String actionName = (String) 
                     shortcut.getActionInstance().getValue(AbstractAction.NAME);
@@ -406,8 +404,8 @@
      * @param keyStroke         the KeyStroke to search for
      * @return                  the duplicate, or null if not present
      */
-    public static KeyStroke getDuplicate(KeyStroke keyStroke) {
-        return (KeyStroke) duplicate.get(keyStroke);
+    static KeyStroke getDuplicate(KeyStroke keyStroke) {
+        return duplicate.get(keyStroke);
     }
     
     /**
@@ -417,8 +415,8 @@
      *            the id of the action
      * @return the given action, or null if the action is not found
      */
-    public static Action getShortcut(String actionId) {
-        return (Action) shortcutHash.get(actionId);
+    public static ActionWrapper getShortcut(String actionId) {
+        return shortcutHash.get(actionId);
     }
 
     private static void putDefaultShortcut(String shortcutKey,
@@ -445,7 +443,8 @@
             currentKeyStroke = decodeKeyStroke(confCurrentShortcut);
         }
 
-        Action currentShortcut = new Action(shortcutKey, currentKeyStroke,
+        ActionWrapper currentShortcut = 
+            new ActionWrapper(shortcutKey, currentKeyStroke,
                 defaultKeyStroke, action, actionName);
         shortcutHash.put(shortcutKey, currentShortcut);
     }
@@ -486,9 +485,9 @@
      * @param newActions
      *            the actions array
      */
-    public static void saveShortcuts(Action[] newActions) {
+    static void saveShortcuts(ActionWrapper[] newActions) {
         for (int i = 0; i < newActions.length; i++) {
-            Action oldAction = (Action) shortcutHash
+            ActionWrapper oldAction = shortcutHash
                     .get(newActions[i].getKey());
             if (newActions[i].getCurrentShortcut() == null
                     && newActions[i].getDefaultShortcut() != null) {
@@ -581,7 +580,8 @@
 
         // edit menu
         putDefaultShortcut(ACTION_SELECT_ALL, KeyStroke.getKeyStroke(
-                KeyEvent.VK_A, DEFAULT_MASK), new SelectAllAction());
+                KeyEvent.VK_A, DEFAULT_MASK), 
+                new ActionSelectAll());
         putDefaultShortcut(ACTION_REDO, KeyStroke.getKeyStroke(KeyEvent.VK_Y,
                 DEFAULT_MASK), ProjectActions.getInstance().getRedoAction());
         putDefaultShortcut(ACTION_UNDO, KeyStroke.getKeyStroke(KeyEvent.VK_Z,
@@ -591,7 +591,7 @@
         putDefaultShortcut(ACTION_NAVIGATE_BACK, null,
                 new NavigateTargetBackAction());
         putDefaultShortcut(ACTION_SELECT_INVERT, null, 
-                new SelectInvertAction());
+                new ActionSelectInvert());
         putDefaultShortcut(ACTION_PERSPECTIVE_CONFIG, null,
                 new ActionPerspectiveConfig());
         putDefaultShortcut(ACTION_SETTINGS, null, new ActionSettings());
@@ -623,7 +623,7 @@
         }
 
         putDefaultShortcut(ACTION_ADJUST_PAGE_BREAKS, null,
-                new AdjustPageBreaksAction());
+                new ActionAdjustPageBreaks());
         putDefaultShortcut(ACTION_SHOW_XML_DUMP, null, new ActionShowXMLDump());
 
         putDefaultShortcut(ACTION_ZOOM_IN, KeyStroke.getKeyStroke(

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java	2008-07-07 12:54:30-0700
@@ -26,7 +26,6 @@
 
 import java.awt.event.ActionEvent;
 import java.awt.event.MouseEvent;
-import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -42,13 +41,15 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
+import org.argouml.kernel.ProfileConfiguration;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.IllegalModelElementConnectionException;
 import org.argouml.model.Model;
+import org.argouml.profile.Profile;
+import org.argouml.profile.ProfileException;
 import org.argouml.ui.ActionCreateContainedModelElement;
 import org.argouml.ui.ActionCreateEdgeModelElement;
-import org.argouml.ui.DisplayTextTree;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
@@ -60,9 +61,6 @@
 import org.argouml.uml.diagram.ui.ActionAddExistingNode;
 import org.argouml.uml.diagram.ui.ActionAddExistingNodes;
 import org.argouml.uml.diagram.ui.ActionSaveDiagramToClipboard;
-import org.argouml.profile.Profile;
-import org.argouml.kernel.ProfileConfiguration;
-import org.argouml.profile.ProfileException;
 import org.argouml.uml.ui.ActionActivityDiagram;
 import org.argouml.uml.ui.ActionClassDiagram;
 import org.argouml.uml.ui.ActionCollaborationDiagram;
@@ -73,7 +71,6 @@
 import org.argouml.uml.ui.ActionSetSourcePath;
 import org.argouml.uml.ui.ActionStateDiagram;
 import org.argouml.uml.ui.ActionUseCaseDiagram;
-import org.argouml.uml.ui.AbstractActionNewModelElement;
 import org.tigris.gef.base.Diagram;
 import org.tigris.gef.graph.MutableGraphModel;
 
@@ -262,6 +259,7 @@
                                 && !dataValueSelected
                                 && !sequenceDiagramActive)
                         || nAryAssociationSelected || commentSelected) {
+                    // TODO: Why can't we use ActionAddExistingNodes here? Bob.
                     Action action =
                         new ActionAddExistingNode(
                             menuLocalize("menu.popup.add-to-diagram"),
@@ -763,20 +761,26 @@
                 || selectedItem instanceof Profile
                 || selectedItem instanceof ArgoDiagram;
                 
-        if (!found) {
-            for (Profile profile : currentProject.getProfileConfiguration()
-                    .getProfiles()) {
-                Collection models;
-                try {
-                    models = profile.getProfilePackages();
-                    for (Object model : models) {
-                        if ((Model.getFacade().getRoot(selectedItem)
-                                .equals(model))) {
-                            found = true;
-                            break;
+        /* The next statement fixes an exception 
+         * when right-clicking on e.g. an AssociationsNode 
+         * from the class-centric perspective: */
+        if (Model.getFacade().isAUMLElement(selectedItem)) {
+            /* The next presumes we are dealing with a UML object: */
+            if (!found) {
+                for (Profile profile : currentProject.getProfileConfiguration()
+                        .getProfiles()) {
+                    Collection models;
+                    try {
+                        models = profile.getProfilePackages();
+                        for (Object model : models) {
+                            if ((Model.getFacade().getRoot(selectedItem)
+                                    .equals(model))) {
+                                found = true;
+                                break;
+                            }
                         }
+                    } catch (ProfileException e) {
                     }
-                } catch (ProfileException e) {
                 }
             }
         }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java	2008-07-07 12:54:30-0700
@@ -56,6 +56,8 @@
 */
 public final class DiagramFactory {
 
+    private final Map noStyleProperties = new HashMap();
+
     /**
      * Map from our public enum to our internal implementation classes.
      * This allows use to hide the implementation classes from users of
@@ -80,6 +82,9 @@
    
     private List<ArgoDiagram> diagrams = new ArrayList<ArgoDiagram>();
 
+    private Map<DiagramType, DiagramFactoryInterface> factories =
+        new EnumMap<DiagramType, DiagramFactoryInterface>(DiagramType.class);
+
     private DiagramFactory() {
         super();
         diagramClasses.put(DiagramType.Class, UMLClassDiagram.class);
@@ -101,6 +106,7 @@
 
     /**
      * @return the list of diagrams
+     * @deprecated in 0.26 By Bob Tarling
      */
     public List<ArgoDiagram> getDiagram() {
         // TODO: This list is currently unused in ArgoUML.  Since it's session
@@ -130,9 +136,22 @@
      *                         (only: statemachine - activitygraph)
      * @return the newly instantiated class diagram
      */
-    public ArgoDiagram createDiagram(DiagramType type, Object namespace,
-            Object machine) {
-        return createDiagram(diagramClasses.get(type), namespace, machine);
+    public ArgoDiagram createDiagram(
+            final DiagramType type, 
+            final Object namespace,
+            final Object machine) {
+        
+        DiagramFactoryInterface factory = factories.get(type);
+        if (factory != null) {
+            final ArgoDiagram diagram =
+                factory.createDiagram(namespace, machine);
+            //keep a reference on it in the case where we must add all the
+            //diagrams as project members (loading)
+            diagrams.add(diagram);
+            return diagram;
+        } else {
+            return createDiagram(diagramClasses.get(type), namespace, machine);
+        }
     }
     
     /**
@@ -182,6 +201,8 @@
         }
         
         if (Model.getDiagramInterchangeModel() != null) {
+            // TODO: This is never executed as Ludos DI work was never
+            // finished.
             diagram.getGraphModel().addGraphEventListener(
                  GraphChangeAdapter.getInstance());
             /*
@@ -235,8 +256,6 @@
 //    }
 
 
-    private final Map noStyleProperties = new HashMap();
-
     public Object createRenderingElement(Object diagram, Object model) {
         GraphNodeRenderer rend =
             ((Diagram) diagram).getLayer().getGraphNodeRenderer();
@@ -244,4 +263,16 @@
                 rend.getFigNodeFor(model, 0, 0, noStyleProperties);
         return renderingElement;
     }
+    
+    /**
+     * Register a specific factory class to create diagram instances for a
+     * specific diagram type
+     * @param type the diagram type
+     * @param factory the factory instance
+     */
+    public void registerDiagramFactory(
+            final DiagramType type,
+            final DiagramFactoryInterface factory) {
+        factories.put(type, factory);
+    }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigActionState.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -288,7 +288,8 @@
     @Override
     protected void updateNameText() {
         if (notationProvider != null) {
-            getNameFig().setText(notationProvider.toString(getOwner(), null));
+            getNameFig().setText(notationProvider.toString(getOwner(), 
+                    getNotationArguments()));
         }
     }
 
@@ -306,7 +307,8 @@
     @Override
     protected void textEdited(FigText ft) throws PropertyVetoException {
         notationProvider.parse(getOwner(), ft.getText());
-        ft.setText(notationProvider.toString(getOwner(), null));
+        ft.setText(notationProvider.toString(getOwner(), 
+                getNotationArguments()));
     }
 
     /*

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -288,7 +288,8 @@
         if (isReadyToEdit()) {
             if (notationProviderType != null) {
                 getNameFig().setText(
-                        notationProviderType.toString(getOwner(), null));
+                        notationProviderType.toString(getOwner(), 
+                                getNotationArguments()));
             }
         }
     }
@@ -298,7 +299,8 @@
      */
     private void updateStateText() {
         if (isReadyToEdit()) {
-            state.setText(notationProviderState.toString(getOwner(), null));
+            state.setText(notationProviderState.toString(getOwner(), 
+                    getNotationArguments()));
         }
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPartition.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPartition.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPartition.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPartition.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPartition.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPartition.java	2008-07-07 12:54:30-0700
@@ -98,7 +98,8 @@
      * @param gm ignored
      * @param node the UML element
      */
-    public FigPartition(GraphModel gm, Object node) {
+    public FigPartition(@SuppressWarnings("unused")
+            GraphModel gm, Object node) {
         this();
         setOwner(node);
     }
@@ -291,6 +292,7 @@
 	int width = getWidth();
 	FigPool figPool = getFigPool();
         if (figPool == null) { //Needed for project deletion
+            super.removeFromDiagramImpl();
             return;
         }
         
@@ -303,7 +305,13 @@
 	    next.translateWithContents(-width);
             next = next.nextPartition;
 	}
-	
+
+        if (nextPartition == null && previousPartition == null) {
+            /* We removed the last partition, so now remove the pool, too: */
+            figPool.removeFromDiagram();
+            return;
+        }
+
 	if (nextPartition != null) {
 	    nextPartition.setPreviousPartition(previousPartition);
 	}

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPool.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPool.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPool.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPool.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPool.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/activity/ui/FigPool.java	2008-07-07 12:54:30-0700
@@ -165,5 +165,6 @@
     public boolean isSelectable() {
 	return false;
     }
+
 }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -396,7 +396,8 @@
     protected void textEdited(FigText ft) throws PropertyVetoException {
         if (ft == getNameFig()) {
             notationProvider.parse(getOwner(), ft.getText());
-            ft.setText(notationProvider.toString(getOwner(), null));
+            ft.setText(notationProvider.toString(getOwner(), 
+                    getNotationArguments()));
         }
     }
 
@@ -418,7 +419,8 @@
     @Override
     protected void updateNameText() {
         if (notationProvider != null) {
-            getNameFig().setText(notationProvider.toString(getOwner(), null));
+            getNameFig().setText(notationProvider.toString(getOwner(), 
+                    getNotationArguments()));
         }
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/SequenceDiagramGraphModel.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -30,7 +30,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.log4j.Logger;
@@ -472,10 +471,7 @@
             if (clsfr == null) {
                 throw new IllegalStateException("Can not create a Classifier");
             }
-            Collection c = Model.getFacade().getOwnedElements(clsfr);
-            Iterator it = c.iterator();
-            while (it.hasNext()) {
-                Object child = it.next();
+            for (Object child : Model.getFacade().getOwnedElements(clsfr)) {
                 if (Model.getFacade().isAStateMachine(child)) {
                     defaultStateMachine = child;
                     break;
@@ -484,8 +480,6 @@
             if (defaultStateMachine == null) {
                 defaultStateMachine =
                     Model.getStateMachinesFactory().buildStateMachine(clsfr);
-                Model.getStateMachinesFactory()
-                    .buildCompositeStateOnStateMachine(defaultStateMachine);
             }
         }
         return defaultStateMachine;

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeChangeHeight.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeChangeHeight.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeChangeHeight.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeChangeHeight.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeChangeHeight.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/ModeChangeHeight.java	2008-07-07 12:54:30-0700
@@ -35,6 +35,11 @@
 
 import org.argouml.i18n.Translator;
 
+/**
+ * 
+ *
+ * @deprecated in 0.26 alpha3 Use ModeContract or ModeExpand
+ */
 public class ModeChangeHeight extends FigModifyingModeImpl {
 
     /**
@@ -82,34 +87,34 @@
             return;
 	}
 
-        SequenceDiagramLayer layout =
+        SequenceDiagramLayer layer =
 	    (SequenceDiagramLayer) Globals.curEditor().getLayerManager()
 	        .getActiveLayer();
         int endY = me.getY();
         if (isContract()) {
-            int startOffset = SequenceDiagramLayer.getNodeIndex(startY);
+            int startOffset = layer.getNodeIndex(startY);
             int endOffset;
             if (startY > endY) {
                 endOffset = startOffset;
-                startOffset = SequenceDiagramLayer.getNodeIndex(endY);
+                startOffset = layer.getNodeIndex(endY);
             } else {
-                endOffset = SequenceDiagramLayer.getNodeIndex(endY);
+                endOffset = layer.getNodeIndex(endY);
 	    }
             int diff = endOffset - startOffset;
             if (diff > 0) {
-                layout.contractDiagram(startOffset, diff);
+                layer.contractDiagram(startOffset, diff);
             }
         } else {
-            int startOffset = SequenceDiagramLayer.getNodeIndex(startY);
+            int startOffset = layer.getNodeIndex(startY);
             if (startOffset > 0 && endY < startY) {
                 startOffset--;
 	    }
-            int diff = SequenceDiagramLayer.getNodeIndex(endY) - startOffset;
+            int diff = layer.getNodeIndex(endY) - startOffset;
             if (diff < 0) {
                 diff = -diff;
 	    }
             if (diff > 0) {
-                layout.expandDiagram(startOffset, diff);
+                layer.expandDiagram(startOffset, diff);
 	    }
         }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramLayer.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramLayer.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramLayer.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramLayer.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramLayer.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramLayer.java	2008-07-07 12:54:30-0700
@@ -176,8 +176,19 @@
      * @param y The point.
      * @return The node index.
      */
-    public static int getNodeIndex(int y) {
-        y -= DIAGRAM_TOP_MARGIN + FigClassifierRole.MIN_HEAD_HEIGHT;
+    public int getNodeIndex(int y) {
+        FigClassifierRole figClassifierRole = null;
+        for (Object fig : getContentsNoEdges()) {
+            if (fig instanceof FigClassifierRole) {
+                figClassifierRole = (FigClassifierRole) fig;
+            }
+        }
+        if (figClassifierRole == null) {
+            return 0;
+        }
+        y -= figClassifierRole.getY() 
+            + figClassifierRole.getHeadFig().getHeight(); 
+        y += LINK_DISTANCE / 2;
         if (y < 0) {
             y = 0;
 	}

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java	2008-07-07 12:54:30-0700
@@ -140,13 +140,13 @@
 
             args.put("name", SEQUENCE_EXPAND_BUTTON);
             actions[5] =
-		new RadioAction(new ActionSetMode(ModeChangeHeight.class,
+		new RadioAction(new ActionSetMode(ModeExpand.class,
 					       args,
 					       SEQUENCE_EXPAND_BUTTON));
             args.clear();
             args.put("name", SEQUENCE_CONTRACT_BUTTON);
             actions[6] =
-		new RadioAction(new ActionSetMode(ModeChangeHeight.class,
+		new RadioAction(new ActionSetMode(ModeContract.class,
 					       args,
 					       SEQUENCE_CONTRACT_BUTTON));
         }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigCompositeState.java	2008-07-07 12:54:30-0700
@@ -31,6 +31,7 @@
 import java.beans.PropertyChangeEvent;
 import java.util.Iterator;
 import java.util.List;
+import java.util.TreeMap;
 import java.util.Vector;
 
 import org.argouml.model.Model;
@@ -159,7 +160,6 @@
         Dimension nameDim = getNameFig().getMinimumSize();
         List regionsList = getEnclosedFigs();
 
-
         /* If it is concurrent and contains concurrent regions,
         the bottom region has a minimum height*/
         if (getOwner() != null) {
@@ -167,8 +167,8 @@
                     && !regionsList.isEmpty()
                     && regionsList.get(regionsList.size() - 1)
                         instanceof FigConcurrentRegion) {
-                FigConcurrentRegion f = ((FigConcurrentRegion) regionsList
-                        .get(regionsList.size() - 1));
+                FigConcurrentRegion f = 
+                    ((FigConcurrentRegion) regionsList.get(regionsList.size() - 1));
                 Rectangle regionBounds = f.getBounds();
                 if ((h - oldBounds.height + regionBounds.height)
                         <= (f.getMinimumSize().height)) {
@@ -220,6 +220,19 @@
         }
 
     }
+    
+    @Override
+    public Vector<Fig> getEnclosedFigs() {
+        Vector<Fig> enclosedFigs = super.getEnclosedFigs();
+        
+        TreeMap<Integer, Fig> figsByY = new TreeMap<Integer, Fig>();
+        for (Fig fig : enclosedFigs) {
+            if (fig instanceof FigConcurrentRegion) {
+                figsByY.put(fig.getY(), fig);
+            }
+        }
+        return new Vector<Fig>(figsByY.values());
+    }
 
     /**
      * To resize only when a new concurrent region is added,

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigState.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigState.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigState.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigState.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/state/ui/FigState.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -160,7 +160,8 @@
             return;
         }
         if (notationProviderBody != null) {
-            internal.setText(notationProviderBody.toString(getOwner(), null));
+            internal.setText(notationProviderBody.toString(getOwner(), 
+                    getNotationArguments()));
         }
         super.renderingChanged();
         calcBounds();
@@ -224,7 +225,8 @@
                 return;
             }
             notationProviderBody.parse(getOwner(), ft.getText());
-            ft.setText(notationProviderBody.toString(getOwner(), null));
+            ft.setText(notationProviderBody.toString(getOwner(), 
+                    getNotationArguments()));
         }
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClass.java	2008-07-07 12:54:30-0700
@@ -24,30 +24,12 @@
 
 package org.argouml.uml.diagram.static_structure.ui;
 
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Rectangle;
-import java.beans.PropertyVetoException;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.swing.Action;
-
-import org.argouml.model.AddAssociationEvent;
-import org.argouml.model.AssociationChangeEvent;
-import org.argouml.model.AttributeChangeEvent;
 import org.argouml.model.Model;
-import org.argouml.model.RemoveAssociationEvent;
-import org.argouml.model.UmlChangeEvent;
-import org.argouml.ui.ArgoJMenu;
 import org.argouml.uml.diagram.AttributesCompartmentContainer;
-import org.argouml.uml.diagram.ui.CompartmentFigText;
-import org.argouml.uml.diagram.ui.FigAttributesCompartment;
-import org.argouml.uml.ui.foundation.core.ActionAddAttribute;
-import org.tigris.gef.base.Editor;
-import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.Selection;
 import org.tigris.gef.graph.GraphModel;
 import org.tigris.gef.presentation.Fig;
@@ -56,8 +38,11 @@
 
 /**
  * Class to display graphics for a UML Class in a diagram.<p>
+ * 
+ * A Class may show compartments for stereotypes,
+ * attributes and operations.
  */
-public class FigClass extends FigClassifierBox
+public class FigClass extends FigClassifierBoxWithAttributes
         implements AttributesCompartmentContainer {
 
     /**
@@ -65,8 +50,6 @@
      */
     //private static final Logger LOG = Logger.getLogger(FigClass.class);
 
-    private FigAttributesCompartment attributesFigCompartment;
-
     /**
      * Constructor for a {@link FigClass} during file load.<p>
      *
@@ -128,13 +111,11 @@
      */
     public FigClass(GraphModel gm, Object node) {
         super();
-        attributesFigCompartment =
-            new FigAttributesCompartment(10, 30, 60, ROWHEIGHT + 2);
         addFig(getBigPort());
         addFig(getStereotypeFig());
         addFig(getNameFig());
         addFig(getOperationsFig());
-        addFig(attributesFigCompartment);
+        addFig(getAttributesFig());
         addFig(borderFig);
         setOwner(node);
     }
@@ -156,10 +137,6 @@
         return figClone;
     }
 
-
-    ////////////////////////////////////////////////////////////////
-    // accessors
-
     /*
      * @see org.tigris.gef.presentation.Fig#makeSelection()
      */
@@ -167,82 +144,10 @@
         return new SelectionClass(this);
     }
 
-    /*
-     * Insert an Add Attribute entry before the default menu.
-     * 
-     * @see org.argouml.uml.diagram.static_structure.ui.FigClassifierBox#buildAddMenu()
-     */
-    protected ArgoJMenu buildAddMenu() {
-        ArgoJMenu addMenu = super.buildAddMenu();
-        Action addAttribute = new ActionAddAttribute();
-        addAttribute.setEnabled(isSingleTarget());
-        addMenu.insert(addAttribute, 0);
-        return addMenu;
-    }
-
     protected Object buildModifierPopUp() {
         return buildModifierPopUp(ABSTRACT | LEAF | ROOT | ACTIVE);
     }
 
-    /**
-     * @return The bounds of the attributes compartment.
-     */
-    public Rectangle getAttributesBounds() {
-        return attributesFigCompartment.getBounds();
-    }
-
-    /**
-     * @return The vector of graphics for operations (if any).
-     * First one is the rectangle for the entire operations box.
-     */
-    private FigAttributesCompartment getAttributesFig() {
-        return attributesFigCompartment;
-    }
-
-    /**
-     * Returns the status of the attribute field.
-     * @return true if the attributes are visible, false otherwise
-     *
-     * @see org.argouml.uml.diagram.AttributesCompartmentContainer#isAttributesVisible()
-     */
-    public boolean isAttributesVisible() {
-        return getAttributesFig().isVisible();
-    }
-
-    /**
-     * @param isVisible true if the attribute compartment is visible
-     *
-     * @see org.argouml.uml.diagram.AttributesCompartmentContainer#setAttributesVisible(boolean)
-     */
-    public void setAttributesVisible(boolean isVisible) {
-        Rectangle rect = getBounds();
-        if (getAttributesFig().isVisible()) {
-            if (!isVisible) {  // hide compartment
-                damage();
-                Iterator it = getAttributesFig().getFigs().iterator();
-                while (it.hasNext()) {
-                    ((Fig) (it.next())).setVisible(false);
-                }
-                getAttributesFig().setVisible(false);
-                Dimension aSize = this.getMinimumSize();
-                setBounds(rect.x, rect.y,
-			  (int) aSize.getWidth(), (int) aSize.getHeight());
-            }
-        } else {
-            if (isVisible) { // show compartement
-                Iterator it = getAttributesFig().getFigs().iterator();
-                while (it.hasNext()) {
-                    ((Fig) (it.next())).setVisible(true);
-                }
-                getAttributesFig().setVisible(true);
-                Dimension aSize = this.getMinimumSize();
-                setBounds(rect.x, rect.y,
-			  (int) aSize.getWidth(), (int) aSize.getHeight());
-                damage();
-            }
-        }
-    }
-
     /*
      * @see org.tigris.gef.presentation.Fig#setLineWidth(int)
      */
@@ -258,76 +163,6 @@
     }
 
     /**
-     * USED BY PGML.tee.
-     * @return the class name and bounds together with compartment
-     * visibility.
-     */
-    public String classNameAndBounds() {
-        return super.classNameAndBounds()
-            + "operationsVisible=" + isOperationsVisible() + ";"
-            + "attributesVisible=" + isAttributesVisible();
-    }
-
-    /**
-     * Gets the minimum size permitted for a class on the diagram.<p>
-     *
-     * Parts of this are hardcoded, notably the fact that the name
-     * compartment has a minimum height of 21 pixels.<p>
-     *
-     * @return  the size of the minimum bounding box.
-     */
-    public Dimension getMinimumSize() {
-        // Use "aSize" to build up the minimum size. Start with the size of the
-        // name compartment and build up.
-
-        Dimension aSize = getNameFig().getMinimumSize();
-
-        // If we have a stereotype displayed, then allow some space for that
-        // (width and height)
-
-        if (getStereotypeFig().isVisible()) {
-            Dimension stereoMin = getStereotypeFig().getMinimumSize();
-            aSize.width = Math.max(aSize.width, stereoMin.width);
-            aSize.height += stereoMin.height;
-        }
-
-        // Allow space for each of the attributes we have
-
-        if (getAttributesFig().isVisible()) {
-            Dimension attrMin = getAttributesFig().getMinimumSize();
-            aSize.width = Math.max(aSize.width, attrMin.width);
-            aSize.height += attrMin.height;
-        }
-
-        // Allow space for each of the operations we have
-
-        if (isOperationsVisible()) {
-            Dimension operMin = getOperationsFig().getMinimumSize();
-            aSize.width = Math.max(aSize.width, operMin.width);
-            aSize.height += operMin.height;
-        }
-
-        // we want to maintain a minimum width for the class
-        aSize.width = Math.max(60, aSize.width);
-
-        // And now aSize has the answer
-
-        return aSize;
-    }
-
-    /*
-     * @see org.tigris.gef.presentation.Fig#translate(int, int)
-     */
-    public void translate(int dx, int dy) {
-        super.translate(dx, dy);
-        Editor ce = Globals.curEditor();
-        Selection sel = ce.getSelectionManager().findSelectionFor(this);
-        if (sel instanceof SelectionClass) {
-            ((SelectionClass) sel).hideButtons();
-        }
-    }
-
-    /**
      * @param fgVec the FigGroup
      * @param ft    the Figtext
      * @param i     get the fig before fig i
@@ -396,89 +231,6 @@
         return ft2;
     }
 
-    /*
-     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#renderingChanged()
-     * TODO: Does this have to be public?
-     */
-    public void renderingChanged() {
-        if (getOwner() != null) {
-            updateAttributes();
-        }
-        super.renderingChanged();
-    }
-    
-    /*
-     * TODO: Based on my comments below, with that work done,
-     * this method can be removed - Bob.
-     */
-    protected void updateLayout(UmlChangeEvent event) {
-        super.updateLayout(event);
-
-        if (event instanceof AttributeChangeEvent) {
-            Object source = event.getSource();
-            if (Model.getFacade().isAAttribute(source)) {
-                // TODO: We just need to get someone to rerender a single line
-                // of text which represents the element here, but I'm not sure
-                // how to do that. - tfm
-        	// TODO: Bob replies - we shouldn't be interested in this event
-        	// here. The FigFeature (or its notation) should be listen for
-        	// change and the FigFeature should be update from that.
-                updateAttributes();
-            }
-        } else if (event instanceof AssociationChangeEvent 
-                && getOwner().equals(event.getSource())) {
-            Object o = null;
-            if (event instanceof AddAssociationEvent) {
-                o = event.getNewValue();
-            } else if (event instanceof RemoveAssociationEvent) {
-                o = event.getOldValue();
-            }
-            if (Model.getFacade().isAAttribute(o)) {
-        	// TODO: Bob says - we should not be listening here for
-        	// addition and removal of attributes. This should be done in
-        	// FigAttributesCompartment.
-                updateAttributes();
-            }
-        }
-    }
-
-    /*
-     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#updateStereotypeText()
-     * TODO: Refactor into FigClassifierBox
-     */
-    protected void updateStereotypeText() {
-
-        Rectangle rect = getBounds();
-
-        int stereotypeHeight = 0;
-        if (getStereotypeFig().isVisible()) {
-            stereotypeHeight = getStereotypeFig().getHeight();
-        }
-        int heightWithoutStereo = getHeight() - stereotypeHeight;
-
-        getStereotypeFig().setOwner(getOwner());
-
-        stereotypeHeight = 0;
-        if (getStereotypeFig().isVisible()) {
-            stereotypeHeight = getStereotypeFig().getHeight();
-        }
-
-        int minWidth = this.getMinimumSize().width;
-        if (minWidth > rect.width) {
-            rect.width = minWidth;
-        }
-
-        setBounds(
-                rect.x,
-                rect.y,
-                rect.width,
-                heightWithoutStereo + stereotypeHeight);
-        calcBounds();
-    }
-
-    /*
-     * @see org.tigris.gef.presentation.Fig#setEnclosingFig(org.tigris.gef.presentation.Fig)
-     */
     public void setEnclosingFig(Fig encloser) {
         if (encloser == getEncloser()) {
             return;
@@ -499,114 +251,6 @@
 
     }
 
-    /**
-     * Sets the bounds, but the size will be at least the one returned by
-     * {@link #getMinimumSize()}, unless checking of size is disabled.<p>
-     *
-     * If the required height is bigger, then the additional height is
-     * equally distributed among all figs (i.e. compartments), such that the
-     * cumulated height of all visible figs equals the demanded height<p>.
-     *
-     * Some of this has "magic numbers" hardcoded in. In particular there is
-     * a knowledge that the minimum height of a name compartment is 21
-     * pixels.<p>
-     *
-     * @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) {
-        Rectangle oldBounds = getBounds();
-
-        // set bounds of big box
-        getBigPort().setBounds(x, y, w, h);
-        borderFig.setBounds(x, y, w, h);
-
-        // Save our old boundaries (needed later), and get minimum size
-        // info. "whitespace" will be used to maintain a running calculation
-        // of our size at various points.
-
-        final int whitespace = h - getMinimumSize().height;
-
-        getNameFig().setLineWidth(0);
-        getNameFig().setLineColor(Color.red);
-        int currentHeight = 0;
-
-        if (getStereotypeFig().isVisible()) {
-            int stereotypeHeight = getStereotypeFig().getMinimumSize().height;
-            getStereotypeFig().setBounds(
-                    x,
-                    y,
-                    w,
-                    stereotypeHeight);
-            currentHeight = stereotypeHeight;
-        }
-
-        int nameHeight = getNameFig().getMinimumSize().height;
-        getNameFig().setBounds(x, y + currentHeight, w, nameHeight);
-        currentHeight += nameHeight;
-
-        if (isAttributesVisible()) {
-            int attributesHeight = getAttributesFig().getMinimumSize().height;
-            if (isOperationsVisible()) {
-                attributesHeight += whitespace / 2;
-            }
-            getAttributesFig().setBounds(
-                    x,
-                    y + currentHeight,
-                    w,
-                    attributesHeight);
-            currentHeight += attributesHeight;
-        }
-
-        if (isOperationsVisible()) {
-            int operationsY = y + currentHeight;
-            int operationsHeight = (h + y) - operationsY - 1;
-            if (operationsHeight < getOperationsFig().getMinimumSize().height) {
-                operationsHeight = getOperationsFig().getMinimumSize().height;
-            }
-            getOperationsFig().setBounds(
-                    x,
-                    operationsY,
-                    w,
-                    operationsHeight);
-        }
-
-        // Now force calculation of the bounds of the figure, update the edges
-        // and trigger anyone who's listening to see if the "bounds" property
-        // has changed.
-
-        calcBounds();
-        updateEdges();
-        firePropChange("bounds", oldBounds, getBounds());
-    }
-
-    /**
-     * Updates the attributes in the fig. Called from modelchanged if there is
-     * a modelevent effecting the attributes and from renderingChanged in all
-     * cases.
-     * TODO: Looks like this should be private - Bob.
-     */
-    protected void updateAttributes() {
-        if (!isAttributesVisible()) {
-            return;
-        }
-        attributesFigCompartment.populate();
-
-        Rectangle rect = getBounds();
-        // ouch ugly but that's for a next refactoring
-        // TODO: make setBounds, calcBounds and updateBounds consistent
-        setBounds(rect.x, rect.y, rect.width, rect.height);
-    }
-
-
     /*
      * @see org.argouml.uml.diagram.ui.FigNodeModelElement#updateNameText()
      */
@@ -616,43 +260,4 @@
         setBounds(getBounds());
     }
     
-    /*
-     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#updateListeners(java.lang.Object, java.lang.Object)
-     */
-    protected void updateListeners(Object oldOwner, Object newOwner) {
-        // Note: although this never removes listeners for features which have
-        // been deleted, they should get cleaned up as part of 
-        // the delete process.
-//        if (oldOwner != null) {
-//            removeAllElementListeners();
-//        }
-        if (newOwner != null) {
-            // add the listeners to the newOwner
-            addElementListener(newOwner);
-            // and its stereotypes
-            // TODO: Aren't stereotypes handled elsewhere?
-            Collection c = new ArrayList(
-                    Model.getFacade().getStereotypes(newOwner));
-            // and its features
-            for (Object feat : Model.getFacade().getFeatures(newOwner)) {
-                c.add(feat);
-                // and the stereotypes of its features
-                c.addAll(new ArrayList(Model.getFacade().getStereotypes(feat)));
-                // and the parameter of its operations
-                if (Model.getFacade().isAOperation(feat)) {
-                    c.addAll(Model.getFacade().getParameters(feat));
-                }
-            }
-            // And now add listeners to them all:
-            for (Object obj : c) {
-                addElementListener(obj);
-            }
-        }
-    }
-
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = 3415118710864626882L;
-
 } /* end class FigClass */

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java	2008-07-07 12:54:30-0700
@@ -36,7 +36,6 @@
 
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.AssociationChangeEvent;
-import org.argouml.model.DeleteInstanceEvent;
 import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
 import org.argouml.model.UmlChangeEvent;
@@ -308,6 +307,17 @@
         return addMenu;
     }
 
+    /**
+     * USED BY PGML.tee.
+     * @return the class name and bounds together with compartment
+     * visibility.
+     */
+    public String classNameAndBounds() {
+        return super.classNameAndBounds()
+            + "operationsVisible=" + isOperationsVisible() + ";";
+    }
+
+    
     protected Object buildModifierPopUp() {
         return buildModifierPopUp(ABSTRACT | LEAF | ROOT);
     }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigDataType.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigDataType.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigDataType.java	2008-07-07 12:54:30-0700
@@ -27,25 +27,25 @@
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Rectangle;
-import java.beans.PropertyVetoException;
 
 import org.apache.log4j.Logger;
 import org.argouml.model.Model;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.ui.CompartmentFigText;
 import org.argouml.uml.diagram.ui.FigStereotypesCompartment;
 import org.tigris.gef.base.Editor;
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.Selection;
 import org.tigris.gef.graph.GraphModel;
 import org.tigris.gef.presentation.Fig;
-import org.tigris.gef.presentation.FigText;
 
 /**
  * Class to display graphics for a UML DataType in a diagram.
  * (cloned from FigInterface - perhaps they should both specialize
- * a common supertype)
+ * a common supertype).
+ * <p>
+ * A Datatype may show compartments for stereotypes
+ * and operations. Attributes are not supported in ArgoUML.
  */
 public class FigDataType extends FigClassifierBox {
 
@@ -340,10 +340,4 @@
         firePropChange("bounds", oldBounds, getBounds());
     }
 
-
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -390783219580351197L;
-
 } /* end class FigInterface */

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigException.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigException.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigException.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigException.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigException.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigException.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -33,28 +33,25 @@
  * @author Tom Morris
  */
 public class FigException extends FigSignal {
-    
-    public FigException(GraphModel gm, Object node) {
-        super(gm, node);
+
+    /**
+     * Default constructor. 
+     */
+    public FigException() {
+        super();
     }
     
     /**
-     * Construct a FigSignal owned by the given Signal and with
-     * bounds specified.
-     *
-     * @param node The UML object being placed.
-     * @param x X coordinate
-     * @param y Y coordinate
-     * @param w width
-     * @param h height
+     * The Constructor.
+     * 
+     * @param gm the GraphModel
+     * @param node the UML object
      */
-    public FigException(Object node, int x, int y, int w, int h) {
-        super(node, x, y, w, h);
+    public FigException(GraphModel gm, Object node) {
+        super(gm, node);
     }
 
-    /*
-     * @see org.argouml.uml.diagram.static_structure.ui.FigDataType#makeSelection()
-     */
+    @Override
     public Selection makeSelection() {
         return new SelectionException(this);
     }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigInterface.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigInterface.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigInterface.java	2008-07-07 12:54:30-0700
@@ -27,7 +27,6 @@
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Rectangle;
-import java.beans.PropertyVetoException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -37,7 +36,6 @@
 import org.argouml.model.Model;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.ui.CompartmentFigText;
 import org.argouml.uml.diagram.ui.FigStereotypesCompartment;
 import org.tigris.gef.base.Editor;
 import org.tigris.gef.base.Globals;
@@ -48,6 +46,9 @@
 
 /**
  * Class to display graphics for a UML Interface in a diagram.
+ * <p>
+ * An Interface may show compartments for stereotypes
+ * and operations. Attributes are not supported in ArgoUML.
  */
 public class FigInterface extends FigClassifierBox {
 
@@ -456,9 +457,4 @@
         firePropChange("bounds", oldBounds, getBounds());
     }
 
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -390783219580351197L;
-
 } /* end class FigInterface */

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigOperation.java	2008-07-07 12:54:30-0700
@@ -40,6 +40,16 @@
  */
 public class FigOperation extends FigFeature {
 
+    /**
+     * Constructor.
+     * 
+     * @param x x
+     * @param y x
+     * @param w w
+     * @param h h
+     * @param aFig the fig
+     * @param np the notation provider for the text
+     */
     public FigOperation(int x, int y, int w, int h, Fig aFig, 
             NotationProvider np) {
         super(x, y, w, h, aFig, np);
@@ -76,7 +86,7 @@
         }
     }
 
-    /**
+    /*
      * If the Operation is abstract, then the text will be set to italics.
      */
     @Override

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigPackage.java	2008-07-07 12:54:30-0700
@@ -319,7 +319,7 @@
         } else {
             /* we got stereotype */
             getStereotypeFig().setOwner(getOwner());
-            ((FigStereotypesCompartment) getStereotypeFig()).populate();
+//            ((FigStereotypesCompartment) getStereotypeFig()).populate(); // included in previous line
             if (!stereotypeVisible) {
                 stereoLineBlinder.setVisible(false);
                 getStereotypeFig().setVisible(false);

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigSignal.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigSignal.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigSignal.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigSignal.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigSignal.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2007 The Regents of the University of California. All
+// Copyright (c) 2007-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -24,31 +24,28 @@
 
 package org.argouml.uml.diagram.static_structure.ui;
 
-import java.awt.Dimension;
-import java.awt.Rectangle;
 import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Vector;
 
 import org.argouml.model.AssociationChangeEvent;
 import org.argouml.model.AttributeChangeEvent;
-import org.argouml.model.Model;
-import org.argouml.uml.diagram.ui.FigAttributesCompartment;
 import org.argouml.uml.diagram.ui.FigStereotypesCompartment;
 import org.tigris.gef.base.Selection;
 import org.tigris.gef.graph.GraphModel;
-import org.tigris.gef.presentation.Fig;
 
 /**
  * Class to display graphics for a UML Signal in a diagram.
+ * <p>
+ * A Signal may have attributes - the UML standard document 
+ * contains an example diagram showing this.
+ * <p>
+ * A Signal may have operations.
  * 
  * @author Tom Morris
  */
-public class FigSignal extends FigClassifierBox {
+public class FigSignal extends FigClassifierBoxWithAttributes {
     
-    private FigAttributesCompartment attributesFigCompartment;
 
     /**
      * Default constructor for a {@link FigSignal}.
@@ -59,20 +56,16 @@
             (FigStereotypesCompartment) getStereotypeFig();
         fsc.setKeyword("signal");
 
-        enableSizeChecking(false);
-        setSuppressCalcBounds(true);
         addFig(getBigPort());
         addFig(getStereotypeFig());
         addFig(getNameFig());
+        addFig(getOperationsFig());
+        addFig(getAttributesFig());
         addFig(borderFig);
-        attributesFigCompartment =
-            new FigAttributesCompartment(10, 30, 60, ROWHEIGHT + 2);
-        addFig(attributesFigCompartment);
-        
+
+        // by default, do not show operations nor attributes:
         setOperationsVisible(false);
-        enableSizeChecking(true);
-        setSuppressCalcBounds(false);
-//        setBounds(getBounds());     
+        setAttributesVisible(false);
     }
 
     /**
@@ -83,73 +76,24 @@
      *
      * @param node The UML object being placed.
      */
-    public FigSignal(GraphModel gm, Object node) {
+    public FigSignal(@SuppressWarnings("unused")
+    GraphModel gm, Object node) {
         this();
-        enableSizeChecking(true);
         setOwner(node);
-        setBounds(getBounds());
     }
 
-    /**
-     * Construct a FigSignal owned by the given Signal and with
-     * bounds specified.
-     *
-     * @param node The UML object being placed.
-     * @param x X coordinate
-     * @param y Y coordinate
-     * @param w width
-     * @param h height
-     */
-    public FigSignal(Object node, int x, int y, int w, int h) {
-        this(null, node);
-        setBounds(x, y, w, h);
-    }
-    
     /*
      * @see org.argouml.uml.diagram.static_structure.ui.FigDataType#makeSelection()
      */
+    @Override
     public Selection makeSelection() {
         return new SelectionSignal(this);
     }
 
-
-    /*
-     * @see org.tigris.gef.presentation.Fig#getMinimumSize()
-     */
-    public Dimension getMinimumSize() {
-        Dimension aSize = getNameFig().getMinimumSize();
-        aSize.height += 4; // +2 padding above and below name
-        aSize.height = Math.max(21, aSize.height);
-
-        aSize = addChildDimensions(aSize, getStereotypeFig());
-        aSize = addChildDimensions(aSize, getOperationsFig());
-
-        aSize.width = Math.max(40, aSize.width);
-
-        return aSize;
-    }
-
-    /**
-     * Add size of a child component to overall size.  Width is maximized
-     * with child's width and child's height is added to the overall height.
-     * If the child figure is not visible, it's size is not added.
-     * 
-     * @param size current dimensions
-     * @param child child figure
-     * @return new Dimension with child size added
-     */
-    private Dimension addChildDimensions(Dimension size, Fig child) {
-        if (child.isVisible()) {
-            Dimension childSize = child.getMinimumSize();
-            size.width = Math.max(size.width, childSize.width);
-            size.height += childSize.height;
-        }
-        return size;
-    }
-
     /*
      * @see org.argouml.uml.diagram.static_structure.ui.FigClassifierBox#getPopUpActions(java.awt.event.MouseEvent)
      */
+    @Override
     public Vector getPopUpActions(MouseEvent me) {
         Vector popUpActions = super.getPopUpActions(me);
         
@@ -161,6 +105,7 @@
     /*
      * @see org.argouml.uml.diagram.ui.FigNodeModelElement#modelChanged(java.beans.PropertyChangeEvent)
      */
+    @Override
     protected void modelChanged(PropertyChangeEvent mee) {
         super.modelChanged(mee);
         if (mee instanceof AssociationChangeEvent 
@@ -169,67 +114,5 @@
             updateListeners(getOwner(), getOwner());
         }
     }
-    
-    /*
-     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#updateListeners(java.lang.Object)
-     */
-    protected void updateListeners(Object oldOwner, Object newOwner) {
-        if (oldOwner != null) {
-            removeAllElementListeners();
-        }
-        if (newOwner != null) {
-            // add the listeners to the newOwner
-            addElementListener(newOwner);
-            // and its stereotypes
-            Collection c = new ArrayList(
-                    Model.getFacade().getStereotypes(newOwner));
-            // And now add listeners to them all:
-            for (Object obj : c) {
-                addElementListener(obj);
-            }
-        }
-    }
-
-
-    /*
-     * @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) {
-
-        // Save our old boundaries so it can be used in property message later
-        Rectangle oldBounds = getBounds();
-
-        // set bounds of big box
-        getBigPort().setBounds(x, y, w, h);
-        borderFig.setBounds(x, y, w, h);
-
-        getNameFig().setLineWidth(0);
-
-        int currentHeight = 0;
-
-        if (getStereotypeFig().isVisible()) {
-            int stereotypeHeight = getStereotypeFig().getMinimumSize().height;
-            getStereotypeFig().setBounds(
-                    x,
-                    y,
-                    w,
-                    stereotypeHeight);
-            currentHeight += stereotypeHeight;
-        }
-
-        int nameHeight = getNameFig().getMinimumSize().height;
-        getNameFig().setBounds(x, y + currentHeight, w, nameHeight);
-        currentHeight += nameHeight;
-
-
-        // Now force calculation of the bounds of the figure, update the edges
-        // and trigger anyone who's listening to see if the "bounds" property
-        // has changed.
-
-        calcBounds();
-        updateEdges();
-        firePropChange("bounds", oldBounds, getBounds());
-    }
 
 } 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNode.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNode.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNode.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNode.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNode.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNode.java	2008-07-07 12:54:30-0700
@@ -27,9 +27,14 @@
 
 import java.awt.event.ActionEvent;
 
+import org.argouml.i18n.Translator;
 import org.argouml.kernel.ProjectManager;
+import org.argouml.model.Model;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
+import org.tigris.gef.base.Editor;
+import org.tigris.gef.base.Globals;
+import org.tigris.gef.graph.GraphModel;
 import org.tigris.gef.graph.MutableGraphModel;
 import org.tigris.gef.undo.UndoableAction;
 
@@ -38,6 +43,7 @@
 *
 * @author Eugenio Alvarez
 * Data Access Technologies.
+* TODO: Why do we have this class as well as ActionAddExistingNodes?
 */
 public class ActionAddExistingNode extends UndoableAction {
 
@@ -76,7 +82,27 @@
      */
     public void actionPerformed(ActionEvent ae) {
         super.actionPerformed(ae);
-        AddExistingNodeCommand cmd = new AddExistingNodeCommand(object);
-        cmd.execute();
+        Editor ce = Globals.curEditor();
+        GraphModel gm = ce.getGraphModel();
+        if (!(gm instanceof MutableGraphModel)) {
+            return;
+        }
+
+        String instructions = null;
+        if (object != null) {
+            instructions =
+                Translator.localize(
+                    "misc.message.click-on-diagram-to-add",
+                    new Object[] {
+                            Model.getFacade().toString(object),
+                    });
+            Globals.showStatus(instructions);
+        }
+        
+        final ModeAddToDiagram placeMode = new ModeAddToDiagram(
+                TargetManager.getInstance().getTargets(),
+                instructions);
+
+        Globals.mode(placeMode, false);
     }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNodes.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNodes.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNodes.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNodes.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNodes.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ActionAddExistingNodes.java	2008-07-07 12:54:30-0700
@@ -29,11 +29,14 @@
 import java.awt.event.ActionEvent;

 import java.util.Collection;

 

+import org.argouml.i18n.Translator;

 import org.argouml.kernel.ProjectManager;

 import org.argouml.model.Model;

 import org.argouml.ui.targetmanager.TargetManager;

 import org.argouml.uml.diagram.ArgoDiagram;

+import org.tigris.gef.base.Editor;

 import org.tigris.gef.base.Globals;

+import org.tigris.gef.graph.GraphModel;

 import org.tigris.gef.graph.MutableGraphModel;

 import org.tigris.gef.undo.UndoableAction;

 

@@ -82,11 +85,22 @@
     @Override

     public void actionPerformed(ActionEvent ae) {

         super.actionPerformed(ae);

-        if (!objects.isEmpty()) {

-            ArgoDiagram dia = ProjectManager.getManager().getCurrentProject()

-                    .getActiveDiagram();

-            addNodes(objects, null, dia);

+        Editor ce = Globals.curEditor();

+        GraphModel gm = ce.getGraphModel();

+        if (!(gm instanceof MutableGraphModel)) {

+            return;

         }

+

+        String instructions =

+            Translator.localize(

+                "misc.message.click-on-diagram-to-add");

+        Globals.showStatus(instructions);

+        

+        final ModeAddToDiagram placeMode = new ModeAddToDiagram(

+                objects,

+                instructions);

+

+        Globals.mode(placeMode, false);

     }

     

     /**


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/CompartmentFigText.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/CompartmentFigText.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/CompartmentFigText.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/CompartmentFigText.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/CompartmentFigText.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/CompartmentFigText.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -292,6 +292,6 @@
     public void textEdited() {
         setHighlighted(true);
         getNotationProvider().parse(getOwner(), getText());
-        setText(getNotationProvider().toString(getOwner(), null));
+        setText(getNotationProvider().toString(getOwner(), getNpArguments()));
     }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociation.java	2008-07-07 12:54:30-0700
@@ -620,6 +620,7 @@
     private static final long serialVersionUID = 5385230942216677015L;
 
     private NotationProvider notationProviderRole;
+    private HashMap<String, Object> npArguments = new HashMap<String, Object>();
 
     FigRole() {
         super(10, 10, 90, 20, false/*, 
@@ -648,6 +649,13 @@
                         NotationProviderFactory2.TYPE_ASSOCIATION_END_NAME, 
                         getOwner(),
                         this);
+            Project p = getProject();
+            if (p != null) {
+                npArguments.put("rightGuillemot", 
+                        p.getProjectSettings().getRightGuillemot());
+                npArguments.put("leftGuillemot", 
+                        p.getProjectSettings().getLeftGuillemot());
+            }
         }
     }
     
@@ -655,7 +663,7 @@
     protected void setText() {
         assert getOwner() != null;
         assert notationProviderRole != null;
-        setText(notationProviderRole.toString(getOwner(), null));
+        setText(notationProviderRole.toString(getOwner(), npArguments));
     }
 
     /**

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.java	2008-07-07 12:54:30-0700
@@ -162,8 +162,8 @@
             return new Rectangle(0, 0, 0, 0);
     }
 
-    /**
-     * Overrided in order to implement AttributesCompartmentContainer.
+    /*
+     * Overridden in order to implement AttributesCompartmentContainer.
      */
     public boolean isAttributesVisible() {
         if (getAssociationClass() != null)
@@ -172,8 +172,8 @@
             return true;
     }
 
-    /**
-     * Overrided in order to implement AttributesCompartmentContainer.
+    /*
+     * Overridden in order to implement AttributesCompartmentContainer.
      */
     public void setAttributesVisible(boolean visible) {
         if (getAssociationClass() != null) {
@@ -181,8 +181,8 @@
         }
     }
 
-    /**
-     * Overrided in order to implement PathCompartmentContainer.
+    /*
+     * Overridden in order to implement PathCompartmentContainer.
      */
     public boolean isPathVisible() {
         if (getAssociationClass() != null)
@@ -191,8 +191,8 @@
             return false;
     }
 
-    /**
-     * Overrided in order to implement PathCompartmentContainer.
+    /*
+     * Overridden in order to implement PathCompartmentContainer.
      */
     public void setPathVisible(boolean visible) {
         if (getAssociationClass() != null) {
@@ -200,8 +200,8 @@
         }
     }
 
-    /**
-     * Overrided in order to implement OperationsCompartmentContainer.
+    /*
+     * Overridden in order to implement OperationsCompartmentContainer.
      */
     public Rectangle getOperationsBounds() {
         if (getAssociationClass() != null) {
@@ -211,8 +211,8 @@
         }
     }
 
-    /**
-     * Overrided in order to implement OperationsCompartmentContainer.
+    /*
+     * Overridden in order to implement OperationsCompartmentContainer.
      */
     public boolean isOperationsVisible() {
         if (getAssociationClass() != null) {
@@ -222,8 +222,8 @@
         }
     }
 
-    /**
-     * Overrided in order to implement OperationsCompartmentContainer.
+    /*
+     * Overridden in order to implement OperationsCompartmentContainer.
      */
     public void setOperationsVisible(boolean visible) {
         if (getAssociationClass() != null) {
@@ -232,8 +232,9 @@
     }
 
     /**
-     * Overrided in order to set fill color of contained
-     * FigClassAssociationClass.
+     * Set fill color of contained FigClassAssociationClass.
+     * 
+     * @param color new fill color.
      */
     @Override
     public void setFillColor(Color color) {
@@ -243,8 +244,7 @@
     }
 
     /**
-     * Overrided in order to get fill color of contained
-     * FigClassAssociationClass.
+     * @return fill color of contained FigClassAssociationClass.
      */
     @Override
     public Color getFillColor() {
@@ -256,8 +256,9 @@
     }
 
     /**
-     * Overrided in order to set line color of contained
-     * FigClassAssociationClass.
+     * Set line color of contained FigClassAssociationClass.
+     * 
+     * @param arg0 new line color.
      */
     @Override
     public void setLineColor(Color arg0) {

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationEnd.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationEnd.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationEnd.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationEnd.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationEnd.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationEnd.java	2008-07-07 12:54:30-0700
@@ -146,6 +146,10 @@
                     .getShowSingularMultiplicitiesValue();
                 getNotationArguments().put("singularMultiplicityVisible", 
                         value);
+                getNotationArguments().put("rightGuillemot", 
+                        p.getProjectSettings().getRightGuillemot());
+                getNotationArguments().put("leftGuillemot", 
+                        p.getProjectSettings().getLeftGuillemot());
             }
         }
     }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	2008-07-07 12:54:30-0700
@@ -65,7 +65,6 @@
 import org.argouml.kernel.DelayedChangeNotify;
 import org.argouml.kernel.DelayedVChangeListener;
 import org.argouml.kernel.Project;
-import org.argouml.kernel.ProjectSettings;
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.AssociationChangeEvent;
 import org.argouml.model.AttributeChangeEvent;
@@ -879,11 +878,20 @@
         if (notationProviderName != null) {
             notationProviderName.cleanListener(this, own);
         }
-        // TODO: Should this be looking for a NamedElement? - tfm
+        /* This should NOT be looking for a NamedElement, 
+	 * since this is not always about the name of this 
+	 * modelelement alone.*/
         if (Model.getFacade().isAModelElement(own)) {
             notationProviderName =
                 NotationProviderFactory2.getInstance().getNotationProvider(
                         getNotationProviderType(), own, this);
+            Project p = getProject();
+            if (p != null) {
+                npArguments.put("rightGuillemot", 
+                        p.getProjectSettings().getRightGuillemot());
+                npArguments.put("leftGuillemot", 
+                        p.getProjectSettings().getLeftGuillemot());
+            }
         }
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEditableCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEditableCompartment.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEditableCompartment.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEditableCompartment.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEditableCompartment.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigEditableCompartment.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -45,7 +45,7 @@
  * 
  * This class is adds the possibility to 
  * make the whole compartment invisible, and
- * a NotationProvideer is used to handle (generate and parse) 
+ * a NotationProvider is used to handle (generate and parse) 
  * the texts shown in the compartment, i.e. 
  * the compartment texts are editable by the user.
  */
@@ -200,11 +200,11 @@
                     np.initialiseListener(comp, umlObject);
                 }
                 addFig(comp); // add it again (but now in the right sequence)
-                
+
                 // Now put the text in
                 // We must handle the case where the text is null
-                String ftText =
-                        comp.getNotationProvider().toString(umlObject, null);
+                String ftText = comp.getNotationProvider()
+                    .toString(umlObject, comp.getNpArguments());
                 if (ftText == null) {
                     ftText = "";
                 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2008-07-07 12:54:30-0700
@@ -282,7 +282,8 @@
 
     // TODO: A more strongly typed data structure could be used here.
     private Collection<Object[]> listeners = new ArrayList<Object[]>();
-    
+
+
     /**
      * The main constructor. <p>
      * 
@@ -590,16 +591,16 @@
 
         if ((items & ABSTRACT) > 0) {
             modifierMenu.addCheckItem(new ActionModifierAbstract(getOwner()));
-	}
+        }
         if ((items & LEAF) > 0) {
             modifierMenu.addCheckItem(new ActionModifierLeaf(getOwner()));
-	}
+        }
         if ((items & ROOT) > 0) {
             modifierMenu.addCheckItem(new ActionModifierRoot(getOwner()));
-	}
+        }
         if ((items & ACTIVE) > 0) {
             modifierMenu.addCheckItem(new ActionModifierActive(getOwner()));
-	}
+        }
 
         return modifierMenu;
     }
@@ -626,23 +627,23 @@
     public void setEnclosingFig(Fig newEncloser) {
         Fig oldEncloser = encloser;
         
-	LayerPerspective layer = (LayerPerspective) getLayer();
-	if (layer != null) {
+        LayerPerspective layer = (LayerPerspective) getLayer();
+        if (layer != null) {
             ArgoDiagram diagram = (ArgoDiagram) layer.getDiagram();
             diagram.encloserChanged(
                     this,
-        	    (FigNode) oldEncloser,
-        	    (FigNode) newEncloser);
-	}
-	
-	super.setEnclosingFig(newEncloser);
-	
-	if (layer != null && newEncloser != oldEncloser) {
+                    (FigNode) oldEncloser,
+                    (FigNode) newEncloser);
+        }
+        
+        super.setEnclosingFig(newEncloser);
+        
+        if (layer != null && newEncloser != oldEncloser) {
             Diagram diagram = layer.getDiagram();
             if (diagram instanceof ArgoDiagram) {
-        	ArgoDiagram umlDiagram = (ArgoDiagram) diagram;
-        	// Set the namespace of the enclosed model element to the
-        	// namespace of the encloser.
+                ArgoDiagram umlDiagram = (ArgoDiagram) diagram;
+                // Set the namespace of the enclosed model element to the
+                // namespace of the encloser.
                 Object namespace = null;
                 if (newEncloser == null) {
                     // The node's been placed on the diagram
@@ -657,13 +658,13 @@
                 }
             }
 
-	    if (encloser instanceof FigNodeModelElement) {
-		((FigNodeModelElement) encloser).removeEnclosedFig(this);
+            if (encloser instanceof FigNodeModelElement) {
+                ((FigNodeModelElement) encloser).removeEnclosedFig(this);
             }
-	    if (newEncloser instanceof FigNodeModelElement) {
-		((FigNodeModelElement) newEncloser).addEnclosedFig(this);
+            if (newEncloser instanceof FigNodeModelElement) {
+                ((FigNodeModelElement) newEncloser).addEnclosedFig(this);
             }
-	}
+        }
         encloser = newEncloser;
     }
 
@@ -891,8 +892,8 @@
             SwingUtilities.invokeLater(delayedNotify);
         } else {
             LOG.debug("FigNodeModelElement got vetoableChange"
-		      + " from non-owner:"
-		      + src);
+                      + " from non-owner:"
+                      + src);
         }
     }
 
@@ -998,19 +999,21 @@
                     && "stereotype".equals(event.getPropertyName())) {
                 stereotypeChanged(event);            
             }
-            
+
             Runnable doWorkRunnable = new Runnable() {
                 public void run() {
                     try {
                         updateLayout(event);
                     } catch (InvalidElementException e) {
-                        LOG.debug("event = " + event.getClass().getName());
-                        LOG.debug("source = " + event.getSource());
-                        LOG.debug("old = " + event.getOldValue());
-                        LOG.debug("name = " + event.getPropertyName());
-                        LOG.debug(
-                                "updateLayout method accessed deleted element ",
-                                e);
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("event = "
+                                    + event.getClass().getName());
+                            LOG.debug("source = " + event.getSource());
+                            LOG.debug("old = " + event.getOldValue());
+                            LOG.debug("name = " + event.getPropertyName());
+                            LOG.debug("updateLayout method accessed "
+                                    + "deleted element ", e);
+                        }
                     }
                 }  
             };
@@ -1399,6 +1402,13 @@
                 NotationProviderFactory2.getInstance().getNotationProvider(
                         getNotationProviderType(), own, this);
             npArguments.put("pathVisible", Boolean.valueOf(isPathVisible()));
+            Project p = getProject();
+            if (p != null) {
+                npArguments.put("rightGuillemot", 
+                        p.getProjectSettings().getRightGuillemot());
+                npArguments.put("leftGuillemot", 
+                        p.getProjectSettings().getLeftGuillemot());
+            }
         }
     }
 
@@ -1502,6 +1512,7 @@
             if (elementNs != null) {
                 boolean visible = elementNs != diagramNs; 
                 npArguments.put("pathVisible", Boolean.valueOf(visible));
+                pathVisible = visible;
                 renderingChanged();
                 damage();
             }
@@ -1611,7 +1622,8 @@
      * This is may be an expensive operation for subclasses which are complex,
      * so should be used sparingly. This functionality was originally the
      * functionality of modelChanged but modelChanged takes the event now into
-     * account.
+     * account. <p>
+     * TODO: Does this have to be public?
      */
     public void renderingChanged() {
         updateNameText();
@@ -1622,38 +1634,38 @@
     }
 
     protected void updateStereotypeIcon() {
-	if (getOwner() == null) {
-	    LOG.warn("Owner of [" + this.toString() + "/" + this.getClass()
-		    + "] is null.");
-	    LOG.warn("I return...");
-	    return;
-	}
-
-	if (stereotypeFigProfileIcon != null) {
-	    for (Object fig : getFigs()) {
-		((Fig) fig).setVisible(fig != stereotypeFigProfileIcon);
-	    }
-
-	    this.removeFig(stereotypeFigProfileIcon);
-	    stereotypeFigProfileIcon = null;
-	}
-	
-	if (originalNameFig != null) {
-	    this.setNameFig(originalNameFig);
-	    originalNameFig = null;
-	}
-	
-	for (Fig icon : floatingStereotypes) {
+        if (getOwner() == null) {
+            LOG.warn("Owner of [" + this.toString() + "/" + this.getClass()
+                    + "] is null.");
+            LOG.warn("I return...");
+            return;
+        }
+
+        if (stereotypeFigProfileIcon != null) {
+            for (Object fig : getFigs()) {
+                ((Fig) fig).setVisible(fig != stereotypeFigProfileIcon);
+            }
+
+            this.removeFig(stereotypeFigProfileIcon);
+            stereotypeFigProfileIcon = null;
+        }
+        
+        if (originalNameFig != null) {
+            this.setNameFig(originalNameFig);
+            originalNameFig = null;
+        }
+        
+        for (Fig icon : floatingStereotypes) {
             this.removeFig(icon);
         }
         floatingStereotypes.clear();
-	
-	
-	int practicalView = getPracticalView();
-	Object modelElement = getOwner();
-	Collection stereos = Model.getFacade().getStereotypes(modelElement);
-	 
-	Fig stereoFig = getStereotypeFig();
+        
+        
+        int practicalView = getPracticalView();
+        Object modelElement = getOwner();
+        Collection stereos = Model.getFacade().getStereotypes(modelElement);
+         
+        Fig stereoFig = getStereotypeFig();
         if (stereoFig instanceof FigStereotypesCompartment) {
             boolean hiding = 
                 practicalView == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON;
@@ -1697,8 +1709,8 @@
                 }
 
             }
-	} else if (practicalView
-	        == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) {
+        } else if (practicalView
+                == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) {
             int i = this.getX() + this.getWidth() - ICON_WIDTH - 2;
 
             for (Object stereo : stereos) {
@@ -1724,13 +1736,13 @@
         }
 
         // TODO: This is a redundant invocation
-	updateStereotypeText();
-	
+        updateStereotypeText();
+        
         damage();
-	calcBounds();
-	updateEdges();
-	updateBounds();
-	redraw();
+        calcBounds();
+        updateEdges();
+        updateBounds();
+        redraw();
     }
 
     /*
@@ -1792,6 +1804,10 @@
         return this;
     }
     
+    /**
+     * If you override this method, make sure to remove all listeners:
+     * If you don't, objects in a deleted project will still receive events.
+     */
     protected void removeFromDiagramImpl() {
         if (notationProviderName != null) { //This test needed for a FigPool
             notationProviderName.cleanListener(this, getOwner());
@@ -2073,6 +2089,10 @@
         listeners.clear();
     }
 
+    protected HashMap<String, Object> getNotationArguments() {
+        return npArguments;
+    }
+
     protected void putNotationArgument(String key, Object value) {
         if (notationProviderName != null) {
             npArguments.put(key, value);
@@ -2106,8 +2126,8 @@
      * @return true if this is the sole target.
      */
     protected boolean isSingleTarget() {
-	return TargetManager.getInstance().getSingleModelTarget()
-		== getOwner();
+        return TargetManager.getInstance().getSingleModelTarget()
+                == getOwner();
     }
 
     
@@ -2128,7 +2148,7 @@
      */
     private int getPracticalView() {
         // TODO assert modelElement != null???
-	int practicalView = getStereotypeView();
+        int practicalView = getStereotypeView();
         Object modelElement = getOwner();
 
         if (modelElement != null) {
@@ -2183,12 +2203,12 @@
                 // the stereotypeFigProfileIcon
             }
         } else {
-	    setStandardBounds(x, y, w, h);
-	    if (getStereotypeView()
-	            == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) {
-	        updateSmallIcons(w);
-	    }
-	}
+            setStandardBounds(x, y, w, h);
+            if (getStereotypeView()
+                    == DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON) {
+                updateSmallIcons(w);
+            }
+        }
     }
 
     private void updateSmallIcons(int wid) {
@@ -2252,8 +2272,8 @@
      * @return the font style for the nameFig.
      */
     protected int getNameFigFontStyle() {
-    	showBoldName = false;
-    	Project p = getProject();
+        showBoldName = false;
+        Project p = getProject();
 
         /**
          *  When and why p could be NULL?
@@ -2279,16 +2299,19 @@
      * @param fg the FigGroup to change the font of.
      */
     private void deepUpdateFont(FigGroup fg) {
+        boolean changed = false;
         List<Fig> figs = fg.getFigs();
         for (Fig f : figs) {
             if (f instanceof ArgoFigText) {
                 ((ArgoFigText) f).diagramFontChanged(null);
-                fg.calcBounds();
+                changed = true;
             }
             if (f instanceof FigGroup) {
                 deepUpdateFont((FigGroup) f);
-                f.calcBounds();
             }
         }
+        if (changed) {
+            fg.calcBounds();
+        }
     }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigSingleLineText.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigSingleLineText.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigSingleLineText.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigSingleLineText.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigSingleLineText.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigSingleLineText.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -30,9 +30,20 @@
 import java.awt.event.KeyEvent;
 import java.beans.PropertyChangeEvent;
 import java.util.Arrays;
+import java.util.HashMap;
 
+import javax.swing.SwingUtilities;
+
+import org.apache.log4j.Logger;
+import org.argouml.application.events.ArgoEventPump;
+import org.argouml.application.events.ArgoEventTypes;
+import org.argouml.application.events.ArgoNotationEvent;
+import org.argouml.application.events.ArgoNotationEventListener;
+import org.argouml.kernel.Project;
 import org.argouml.model.AttributeChangeEvent;
+import org.argouml.model.InvalidElementException;
 import org.argouml.model.Model;
+import org.argouml.model.UmlChangeEvent;
 import org.argouml.notation.NotationProvider;
 import org.tigris.gef.presentation.FigText;
 
@@ -50,12 +61,11 @@
  *
  * @author Bob Tarling
  */
-public class FigSingleLineText extends ArgoFigText {
+public class FigSingleLineText extends ArgoFigText
+    implements ArgoNotationEventListener  {
 
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -5611216741181499679L;
+    private static final Logger LOG =
+        Logger.getLogger(FigSingleLineText.class);
 
     /**
      * The properties of 'owner' that this is interested in
@@ -66,10 +76,16 @@
      * The notation provider for the text shown in this compartment.
      */
     private NotationProvider notationProvider;
+    private HashMap<String, Object> npArguments = new HashMap<String, Object>();
 
-    /*
-     * @see org.tigris.gef.presentation.FigText#FigText(
-     *         int, int, int, int, boolean)
+    /**
+     * The constructor.
+     *
+     * @param x the initial x position
+     * @param y the initial y position
+     * @param w the initial width
+     * @param h the initial height
+     * @param expandOnly true if this fig shall not shrink
      */
     public FigSingleLineText(int x, int y, int w, int h, boolean expandOnly) {
         super(x, y, w, h, expandOnly);
@@ -79,11 +95,20 @@
         setTabAction(FigText.END_EDITING);
         setReturnAction(FigText.END_EDITING);
         setLineWidth(0);
+
+        initNotationArguments();
+        ArgoEventPump.addListener(ArgoEventTypes.ANY_NOTATION_EVENT, this);
     }
 
-    /*
-     * @see org.tigris.gef.presentation.FigText#FigText(
-     *         int, int, int, int, boolean)
+    /**
+     * The constructor.
+     *
+     * @param x the initial x position
+     * @param y the initial y position
+     * @param w the initial width
+     * @param h the initial height
+     * @param expandOnly true if this fig shall not shrink
+     * @param property the property to listen to
      */
     public FigSingleLineText(int x, int y, int w, int h, boolean expandOnly, 
             String property) {
@@ -94,14 +119,22 @@
      * @see org.tigris.gef.presentation.FigText#FigText(
      *         int, int, int, int, boolean)
      */
+    /**
+     * The constructor.
+     *
+     * @param x the initial x position
+     * @param y the initial y position
+     * @param w the initial width
+     * @param h the initial height
+     * @param expandOnly true if this fig shall not shrink
+     * @param allProperties the properties to listen to
+     */
     public FigSingleLineText(int x, int y, int w, int h, boolean expandOnly, 
             String[] allProperties) {
         this(x, y, w, h, expandOnly);
         this.properties = allProperties;
     }
 
-
-
     @Override
     public Dimension getMinimumSize() {
         Dimension d = new Dimension();
@@ -129,7 +162,7 @@
     @Override
     protected boolean isStartEditingKey(KeyEvent ke) {
         if ((ke.getModifiers()
-	     & (KeyEvent.META_MASK | KeyEvent.ALT_MASK)) == 0) {
+             & (KeyEvent.META_MASK | KeyEvent.ALT_MASK)) == 0) {
             return super.isStartEditingKey(ke);
         } else {
             return false;
@@ -160,29 +193,73 @@
     
     @Override
     public void propertyChange(PropertyChangeEvent pce) {
-        if (getOwner() == pce.getSource()
+        if ("remove".equals(pce.getPropertyName()) 
+                && (pce.getSource() == getOwner())) {
+            deleteFromModel();
+        } else if (notationProvider != null) {
+            notationProvider.updateListener(this, getOwner(), pce);
+        }
+        
+        if (pce instanceof UmlChangeEvent) {
+            final UmlChangeEvent event = (UmlChangeEvent) pce;
+            Runnable doWorkRunnable = new Runnable() {
+                public void run() {
+                    try {
+                        updateLayout(event);
+                    } catch (InvalidElementException e) {
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug("event = "
+                                    + event.getClass().getName());
+                            LOG.debug("source = " + event.getSource());
+                            LOG.debug("old = " + event.getOldValue());
+                            LOG.debug("name = " + event.getPropertyName());
+                            LOG.debug("updateLayout method accessed "
+                                    + "deleted element ", e);
+                        }
+                    }
+                }  
+            };
+            SwingUtilities.invokeLater(doWorkRunnable);
+        }
+    }
+    
+    /**
+     * This is a template method called by the ArgoUML framework as the result
+     * of a change to a model element. Do not call this method directly
+     * yourself.
+     * <p>Override this in any subclasses in order to redisplay the Fig
+     * due to change of any model element that this Fig is listening to.</p>
+     * <p>This method is guaranteed by the framework to be running on the 
+     * Swing/AWT thread.</p>
+     *
+     * @param event the UmlChangeEvent that caused the change
+     */
+    protected void updateLayout(UmlChangeEvent event) {
+        assert event != null;
+        if (getOwner() == event.getSource()
                 && properties != null
-                && Arrays.asList(properties).contains(pce.getPropertyName())
-                && pce instanceof AttributeChangeEvent) {
+                && Arrays.asList(properties).contains(event.getPropertyName())
+                && event instanceof AttributeChangeEvent) {
             /* TODO: Why does it fail for changing 
              * the name of an associationend?
              *  Why should it pass? */
-            //assert Arrays.asList(properties).contains(pce.getPropertyName()) 
-            //  : pce.getPropertyName(); 
+            //assert Arrays.asList(properties).contains(event.getPropertyName()) 
+            //  : event.getPropertyName(); 
+            // TODO: Do we really always need to do this or only if
+            // notationProvider is null?
             setText();
         }
-//      super.propertyChange(pce); // Adding this gives loads of problems!!!
 
-        if ("remove".equals(pce.getPropertyName()) 
-                && (pce.getSource() == getOwner())) {
-            deleteFromModel();
-        } else if (notationProvider != null) {
-            notationProvider.updateListener(this, getOwner(), pce);
-            this.setText(notationProvider.toString(getOwner(), null));
+        if (notationProvider != null
+                && (!"remove".equals(event.getPropertyName())
+                        || event.getSource() != getOwner())) {
+            this.setText(notationProvider.toString(getOwner(), npArguments));
             damage();
         }
     }
 
+    
+    
     /**
      * This function without parameter shall
      * determine the text of the Fig taking values from the owner,
@@ -208,5 +285,45 @@
             notationProvider.cleanListener(this, getOwner());
         }
         this.notationProvider = np;
+        initNotationArguments();
+    }
+
+    /**
+     * @return Returns the Notation Provider Arguments.
+     */
+    public HashMap<String, Object> getNpArguments() {
+        return npArguments;
+    }
+
+    private void initNotationArguments() {
+        Project p = getProject();
+        if (p != null) {
+            npArguments.put("rightGuillemot", 
+                    p.getProjectSettings().getRightGuillemot());
+            npArguments.put("leftGuillemot", 
+                    p.getProjectSettings().getLeftGuillemot());
+        }
+    }
+    
+    public void notationAdded(ArgoNotationEvent e) {
+        // Do nothing
+    }
+
+    public void notationChanged(ArgoNotationEvent e) {
+        initNotationArguments();
+//        if (getOwner() == null) return;
+//        setText();
+    }
+
+    public void notationProviderAdded(ArgoNotationEvent e) {
+        // Do nothing
+    }
+
+    public void notationProviderRemoved(ArgoNotationEvent e) {
+        // Do nothing    
+    }
+
+    public void notationRemoved(ArgoNotationEvent e) {
+        // Do nothing        
     }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotype.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotype.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotype.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotype.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotype.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotype.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -27,11 +27,9 @@
 import java.awt.Color;
 import java.beans.PropertyChangeEvent;
 
-import org.argouml.kernel.Project;
-import org.argouml.kernel.ProjectManager;
-import org.argouml.kernel.ProjectSettings;
 import org.argouml.model.AttributeChangeEvent;
 import org.argouml.model.Model;
+import org.argouml.notation.providers.uml.NotationUtilityUml;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigText;
 
@@ -89,10 +87,8 @@
      * {@inheritDoc}
      */
     public void setText(String text) {
-        Project project = 
-            ProjectManager.getManager().getCurrentProject();
-        ProjectSettings ps = project.getProjectSettings();
-        super.setText(ps.getLeftGuillemot() + text + ps.getRightGuillemot());
+        super.setText(NotationUtilityUml.formatSingleStereotype(text,
+                getNpArguments()));
     }
     
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	2008-07-07 12:54:30-0700
@@ -384,7 +384,7 @@
         
         if (modelElement != null) {
             Collection stereos = Model.getFacade().getStereotypes(modelElement);
-            if (stereos.size() > 0) {
+            if (stereos.size() > 0 || keyword != null) {
                 dim = super.getMinimumSize();
             }
         }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java	2008-07-07 12:54:30-0700
@@ -24,25 +24,16 @@
 
 package org.argouml.uml.diagram.ui;
 
-import java.awt.Point;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
+import java.awt.Color;
 import java.util.Collection;
-import java.util.Iterator;
 
-import org.apache.log4j.Logger;
 import org.argouml.model.IllegalModelElementConnectionException;
 import org.argouml.model.Model;
-import org.argouml.uml.diagram.static_structure.ui.FigClassifierBox;
 import org.tigris.gef.base.Layer;
-import org.tigris.gef.base.ModeCreatePolyEdge;
-import org.tigris.gef.graph.GraphModel;
-import org.tigris.gef.graph.GraphNodeRenderer;
 import org.tigris.gef.graph.MutableGraphModel;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigEdge;
 import org.tigris.gef.presentation.FigNode;
-import org.tigris.gef.presentation.FigPoly;
 
 /**
  * A Mode to interpret user input while creating an association end.
@@ -54,274 +45,119 @@
  * transformed into a n-ary association.
  * TODO: Investigate if this can extend ModeCreateGraphEdge
  *
- * @author [email protected]
+ * @author Bob Tarling
  */
-public class ModeCreateAssociationEnd extends ModeCreatePolyEdge {
+public class ModeCreateAssociationEnd extends ModeCreateGraphEdge {
 
     /**
      * The UID.
      */
     private static final long serialVersionUID = -7249069222789301797L;
     
-    private static final Logger LOG =
-	Logger.getLogger(ModeCreateAssociationEnd.class);
+    public Object getMetaType() {
+        return Model.getMetaTypes().getAssociationEnd();
+    }
     
-    private FigNode newFigNodeAssociation;
-    private Object association;
-    private Collection associationEnds;
-
-    /*
-     * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
-     */
-    public void mousePressed(MouseEvent me) {
-        int x = me.getX(), y = me.getY();
-        Fig underMouse = editor.hit(x, y);
-        if (underMouse == null) {
-            underMouse = editor.hit(x - 16, y - 16, 32, 32);
-        }
-
-        if (underMouse == null && _npoints == 0) {
-            done();
-            me.consume();
-            return;
-        }
-
-        if (_npoints > 0) {
-            me.consume();
-            return;
-        }
-
-        Object modelElement = underMouse.getOwner();
+    /**
+     * Create an edge of the given type and connect it to the
+     * given nodes.
+     *
+     * @param graphModel     the graph model in which to create the connection
+     *                       element
+     * @param edgeType       the UML object type of the connection
+     * @param sourceFig      the FigNode for the source element
+     * @param destFig        the FigNode for the destination element
+     * @return The FigEdge representing the newly created model element
+     */
+    @Override
+    protected FigEdge buildConnection(
+            MutableGraphModel graphModel,
+            Object edgeType,
+            Fig sourceFig,
+            Fig destFig) {
+        try {
+            Object associationEnd = 
+                Model.getUmlFactory().buildConnection(
+                    edgeType,
+                    sourceFig.getOwner(),
+                    null,
+                    destFig.getOwner(),
+                    null,
+                    null,
+                    null);
+            
+            final FigNode sourceFigNode = convertToFigNode(sourceFig);
+            final FigNode destFigNode = convertToFigNode(destFig);
+            
+            graphModel.addEdge(associationEnd);
+            
+            setNewEdge(associationEnd);
 
-        if (!Model.getFacade().isAAssociationClass(modelElement)) {
-            if (Model.getFacade().isAAssociation(underMouse.getOwner())) {
-                association = underMouse.getOwner();
-            }
-            if (underMouse instanceof FigAssociation) {
-                associationEnds =
-                    Model.getFacade().getConnections(association);
-                newFigNodeAssociation = placeTempNode(me);
-                underMouse = newFigNodeAssociation;
-                setSourceFigNode(newFigNodeAssociation);
-                setStartPort(newFigNodeAssociation.getOwner());
-                setStartPortFig(newFigNodeAssociation);
-            } else if (underMouse instanceof FigNodeAssociation
-                    || underMouse instanceof FigClassifierBox) {
-                if (getSourceFigNode() == null) {
-                    setSourceFigNode((FigNode) underMouse);
-                    setStartPort(getSourceFigNode().deepHitPort(x, y));
-                }
-                if (getStartPort() == null) {
-                    done();
-                    me.consume();
-                    return;
-                }
-                setStartPortFig(
-                        getSourceFigNode().getPortFig(getStartPort()));
+            // Calling connect() will add the edge to the GraphModel and
+            // any LayerPersectives on that GraphModel will get a
+            // edgeAdded event and will add an appropriate FigEdge
+            // (determined by the GraphEdgeRenderer).
+
+            if (getNewEdge() != null) {
+                sourceFigNode.damage();
+                destFigNode.damage();
+                Layer lay = editor.getLayerManager().getActiveLayer();
+                FigEdge fe = (FigEdge) lay.presentationFor(getNewEdge());
+                _newItem.setLineColor(Color.black);
+                fe.setFig(_newItem);
+                fe.setSourcePortFig(sourceFigNode);
+                fe.setSourceFigNode(sourceFigNode);
+                fe.setDestPortFig(destFigNode);
+                fe.setDestFigNode(destFigNode);
+                return fe;
             } else {
-                done();
-                me.consume();
-                return;
+                return null;
             }
+        } catch (IllegalModelElementConnectionException e) {
+            // We have already confirmed the connection is valid
+            return null;
         }
-
-        createFig(me);
-        me.consume();
     }
     
-    /*
-     * @see org.tigris.gef.base.ModeCreatePolyEdge#mouseReleased(java.awt.event.MouseEvent)
-     */
-    public void mouseReleased(final MouseEvent me) {
-        if (me.isConsumed()) {
-            return;
-        }
-        if (getSourceFigNode() == null) {
-            done();
-            me.consume();
-            return;
-        }
-        final int x = me.getX();
-        final int y = me.getY();
-        Fig destFig = editor.hit(x, y);
-        if (destFig == null) {
-            destFig = editor.hit(x - 16, y - 16, 32, 32);
-        }
-        
-        if (destFig != null) {
-            Object source = getSourceFigNode().getOwner();
-            Object dest = destFig.getOwner();
-            
-            if (Model.getFacade().isAAssociationClass(source)
-            	|| Model.getFacade().isAAssociationClass(dest)) {
-                // TODO: http://argouml.tigris.org/issues/show_bug.cgi?id=2991
-            } else if ((Model.getFacade().isAAssociation(source)
-                || Model.getFacade().isAClassifier(dest))
-                && !Model.getFacade().isAClassifier(source)) {
-                mouseReleasedOnClassifier(me, destFig);
-                return;
-            } else if ((Model.getFacade().isAClassifier(dest)
-                || Model.getFacade().isAAssociation(dest))
-                && !Model.getFacade().isAClassifier(source)) {
-                mouseReleasedOnAssociation(me, destFig);
-                return;
-            }
-        }
-        
-        if (!nearLast(x, y)) {
-            editor.damageAll();
-            Point snapPt = new Point(x, y);
-            editor.snap(snapPt);
-            ((FigPoly) _newItem).addPoint(snapPt.x, snapPt.y);
-            _npoints++;
-            editor.damageAll();
-        }
-        _lastX = x;
-        _lastY = y;
-        me.consume();
-    }
-
-    /*
-     * @see org.tigris.gef.base.ModeCreatePolyEdge#mouseReleased(java.awt.event.MouseEvent)
-     */
-    private void mouseReleasedOnClassifier(
-	    final MouseEvent me,
-	    final Fig destFig) {
-        MutableGraphModel graphModel =
-            (MutableGraphModel) editor.getGraphModel();
-
-        // Order here is very important!
-        // 1. Remove the old association FigEdge first
-        graphModel.removeEdge(association);
-        
-        try {
-	    Model.getUmlFactory().buildConnection(
-	    	Model.getMetaTypes().getAssociationEnd(),
-	    	getSourceFigNode().getOwner(), 
-	    	null, 
-	    	destFig.getOwner(), 
-	    	null, 
-	    	null, 
-	    	null);
-	} catch (IllegalModelElementConnectionException e) {
-	    LOG.error("Exception", e);
-	}
-	
-        // 3. Make sure the association is a node in the graph model
-        graphModel.addNode(association);
-        
-        associationEnds =
-            Model.getFacade().getConnections(association);
-        
-        endAttached(null);
-        me.consume();
-    }
-
-
-    /*
-     * @see org.tigris.gef.base.ModeCreatePolyEdge#mouseReleased(java.awt.event.MouseEvent)
-     */
-    private void mouseReleasedOnAssociation(
-	    final MouseEvent me,
-	    final Fig destFig) {
-        int x = me.getX();
-        int y = me.getY();
+    /**
+     * If the selected Fig is a FigAssociation (an edge) then
+     * convert it to a FigNodeAssociation.
+     * @param fig the select end Fig
+     * @return the fig converted to a FigNode
+     */
+    private FigNode convertToFigNode(Fig fig) {
+        if (fig instanceof FigEdgePort) {
+            fig = fig.getGroup();
+        }
+        if (!(fig instanceof FigAssociation)) {
+            return (FigNode) fig;
+        }
+        final FigAssociation figAssociation = (FigAssociation) fig;
+        final int x = figAssociation.getEdgePort().getX();
+        final int y = figAssociation.getEdgePort().getY();
+        final Object association = fig.getOwner();
+        figAssociation.removeFromDiagram();
         
-        MutableGraphModel graphModel =
+        final MutableGraphModel gm =
             (MutableGraphModel) editor.getGraphModel();
-
-        Object destAssociation = destFig.getOwner();
-        
-        // Order here is very important!
-        // 1. Remove the old association FigEdge first
-        graphModel.removeEdge(destAssociation);
-        destFig.removeFromDiagram();
-        
-        // 2. Add a new association end to the association
-        graphModel.connect(
-                getStartPort(),
-                destAssociation,
-                Model.getMetaTypes().getAssociationEnd());
+        gm.addNode(association);
+        final Layer lay = editor.getLayerManager().getActiveLayer();
+        final FigNode figNode = (FigNode) lay.presentationFor(association);
         
-        // 3. Create a new FigNode representing the n-ary assoc
-        graphModel.addNode(destAssociation);
-        
-        // 4. Create a new FigNode representing the n-ary assoc
-        Layer lay = editor.getLayerManager().getActiveLayer();
-        FigNode figNode = (FigNode) lay.presentationFor(destAssociation);
         figNode.setLocation(
                 x - figNode.getWidth() / 2,
                 y - figNode.getHeight() / 2);
-        editor.add(figNode);
-        
-        associationEnds =
-            Model.getFacade().getConnections(destAssociation);
-        
-        endAttached(null);
-        me.consume();
-    }
-
-    /**
-     * This will be called when the edge is successfully connected.
-     * This method is extended to make sure that all edges are in the
-     * graph model
-     * @param fe the FigEdge drawn
-     */
-    protected void endAttached(FigEdge fe) {
-        MutableGraphModel graphModel =
-            (MutableGraphModel) editor.getGraphModel();
-        for (Iterator it = associationEnds.iterator(); it.hasNext(); ) {
-            graphModel.addEdge(it.next());
-        }
-        super.endAttached(fe);
-        done();
-    }
-
-    private FigNode placeTempNode(MouseEvent me) {
-        FigNode figNode = null;
-        GraphModel gm = editor.getGraphModel();
-
-        GraphNodeRenderer renderer = editor.getGraphNodeRenderer();
-        Layer lay = editor.getLayerManager().getActiveLayer();
-        figNode = renderer.getFigNodeFor(gm, lay, association, null);
-        figNode.setLocation(
-                me.getX() - figNode.getWidth() / 2,
-                me.getY() - figNode.getHeight() / 2);
         //figNode.setVisible(false);
         editor.add(figNode);
         editor.getSelectionManager().deselectAll();
+        Collection<Object> associationEnds =
+            Model.getFacade().getConnections(association);
+        for (Object associationEnd : associationEnds) {
+            gm.addEdge(associationEnd);
+        }
+        figNode.updateEdges();
 
         return figNode;
     }
     
-    public void keyTyped(KeyEvent ke) {
-        if (ke.getKeyChar() == KeyEvent.VK_ESCAPE) {
-            LOG.debug("Esc pressed");
-            abort();
-            done();
-            ke.consume();
-        }
-    }
-
-    /**
-     * This method must be called if the edge drawing is aborted for
-     * any reason.
-     * It removes any FigNodeAssociation that may have been created
-     * when drawing started from a FigAssociation edge.
-     */
-    private void abort() {
-	LOG.info("Drawing association end aborted");
-        if (newFigNodeAssociation != null) {
-            editor.remove(newFigNodeAssociation);
-            newFigNodeAssociation.removeFromDiagram();
-        }
-    }
-
-    /*
-     * @see org.tigris.gef.base.ModeImpl#leave()
-     */
-    public void leave() {
-        abort();
-        super.leave();
-    }
 } /* end class ModeCreateAssociation */

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateGraphEdge.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateGraphEdge.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateGraphEdge.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateGraphEdge.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateGraphEdge.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateGraphEdge.java	2008-07-07 12:54:30-0700
@@ -30,6 +30,7 @@
 import java.awt.event.MouseListener;
 
 import org.apache.log4j.Logger;
+import org.argouml.model.IllegalModelElementConnectionException;
 import org.argouml.model.Model;
 import org.argouml.uml.diagram.static_structure.ui.FigEdgeNote;
 import org.tigris.gef.base.Layer;
@@ -54,6 +55,11 @@
      * The Fig from which drawing starts, either a FigNode or a FigEdge
      */
     private Fig sourceFig;
+    
+    /**
+     * The port where the edge was dropped.
+     */
+    private Fig endPort;
 
     /*
      * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
@@ -141,7 +147,7 @@
         } else {
             LOG.info("Connection valid");
         }
-
+        
         if (destFig instanceof FigEdgeModelElement
                 && !(destFig instanceof FigEdgeNote)) {
             FigEdgeModelElement destEdge = (FigEdgeModelElement) destFig;
@@ -170,49 +176,25 @@
                 p.setComplete(true);
                 
                 LOG.info("Connecting");
-                Object modelElement = graphModel.connect(
-                        getStartPort(), 
-                        foundPort, 
-                        getMetaType());
-                setNewEdge(modelElement);
-
-                // Calling connect() will add the edge to the GraphModel and
-                // any LayerPersectives on that GraphModel will get a
-                // edgeAdded event and will add an appropriate FigEdge
-                // (determined by the GraphEdgeRenderer).
-
-                if (getNewEdge() != null) {
-                    getSourceFigNode().damage();
-                    destFigNode.damage();
-                    Layer lay = editor.getLayerManager().getActiveLayer();
-                    FigEdge fe = (FigEdge) lay.presentationFor(getNewEdge());
-                    _newItem.setLineColor(Color.black);
-                    fe.setFig(_newItem);
-                    fe.setSourcePortFig(getStartPortFig());
-                    fe.setSourceFigNode(getSourceFigNode());
-                    fe.setDestPortFig(destPortFig);
-                    fe.setDestFigNode(destFigNode);
-
-                    if (fe != null) {
-                        editor.getSelectionManager().select(fe);
-                    }
-                    editor.damageAll();
-
-                    // if the new edge implements the MouseListener
-                    // interface it has to receive the mouseReleased() event
-                    if (fe instanceof MouseListener) {
-                        ((MouseListener) fe).mouseReleased(me);
-                    }
-
-                    // set the new edge in place
-                    if (getSourceFigNode() != null) {
-                        getSourceFigNode().updateEdges();
-                    }
-                    if (destFigNode != null) {
-                        destFigNode.updateEdges();
-                    }
-                    endAttached(fe);
+                FigEdge fe = buildConnection(
+                        graphModel,
+                        getMetaType(),
+                        sourceFig, 
+                        destFig);
+                
+                if (fe != null) {
+                    editor.getSelectionManager().select(fe);
                 }
+                editor.damageAll();
+
+                // if the new edge implements the MouseListener
+                // interface it has to receive the mouseReleased() event
+                if (fe instanceof MouseListener) {
+                    ((MouseListener) fe).mouseReleased(me);
+                }
+                
+                endAttached(fe);
+                
                 done();
                 me.consume();
                 return;
@@ -233,8 +215,8 @@
     
     /**
      * Return the meta type of the element that this mode is designed to
-     * create. In the case the dependency metatype.
-     * @return the dependency meta type.
+     * create.
+     * @return the meta type of the connection required.
      */
     protected abstract Object getMetaType();
     
@@ -254,4 +236,48 @@
 		dest.getOwner(),
                 true);
     }
+    
+    /**
+     * Create an edge of the given type and connect it to the
+     * given nodes.
+     *
+     * @param edgeType       the UML object type of the connection
+     * @param fromElement    the UML object for the "from" element
+     * @param toElement      the UML object for the "to" element
+     */
+    protected FigEdge buildConnection(
+            MutableGraphModel graphModel,
+            Object edgeType,
+            Fig fromElement,
+            Fig destFigNode) {
+        Object modelElement = graphModel.connect(
+                fromElement.getOwner(), 
+                destFigNode.getOwner(), 
+                edgeType);
+        
+        setNewEdge(modelElement);
+
+        // Calling connect() will add the edge to the GraphModel and
+        // any LayerPersectives on that GraphModel will get a
+        // edgeAdded event and will add an appropriate FigEdge
+        // (determined by the GraphEdgeRenderer).
+
+        if (getNewEdge() != null) {
+            getSourceFigNode().damage();
+            destFigNode.damage();
+            Layer lay = editor.getLayerManager().getActiveLayer();
+            FigEdge fe = (FigEdge) lay.presentationFor(getNewEdge());
+            _newItem.setLineColor(Color.black);
+            fe.setFig(_newItem);
+            fe.setSourcePortFig(getStartPortFig());
+            fe.setSourceFigNode(getSourceFigNode());
+            fe.setDestPortFig(destFigNode);
+            fe.setDestFigNode((FigNode) destFigNode);
+            return fe;
+
+        } else {
+            return null;
+        }
+        
+    }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java	2008-07-07 12:54:30-0700
@@ -31,7 +31,6 @@
 import java.awt.event.InputEvent;
 import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
-import java.beans.PropertyVetoException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
@@ -75,23 +74,23 @@
  * Implements all interfaces through its superclasses.<p>
  *
  * There is some coordinate geometry to be done to fit rectangular
- * text boxes inside an elipse. The rectangular text box contains the
+ * text boxes inside an ellipse. The rectangular text box contains the
  * name and any extension points if shown, and is deemed to be of
  * height <em>2h</em> and width <em>2w</em>. We allow a margin of
  * <em>p</em> above the top and below the bottom of the box, so we
- * know the height of the elipse, <em>2b</em> = <em>2h</em> +
+ * know the height of the ellipse, <em>2b</em> = <em>2h</em> +
  * <em>2p</em>.<p>
  *
- * The formula for an elipse of width <em>2a</em> and height
+ * The formula for an ellipse of width <em>2a</em> and height
  * <em>2b</em>, centred on the origin, is<p>
  *
  * <em>x</em>^2/<em>a</em>^2 + <em>y</em>^2/<em>b</em>^2 = 1.<p>
  *
  * We know that a corner of the rectangle is at coordinate
- * (<em>w</em>,<em>h</em>), since the rectangle must also be centred
- * on the origin to fit within the elipse. Subsituting these values
+ * (<em>w</em>,<em>h</em>), since the rectangle must also be centered
+ * on the origin to fit within the ellipse. Substituting these values
  * for <em>x</em> and <em>y</em> in the formula above, we can compute
- * <em>a</em>, half the width of the elipse, since we know
+ * <em>a</em>, half the width of the ellipse, since we know
  * <em>b</em>.<p>
  *
  * <em>a</em> = <em>wb</em>/sqrt(<em>b</em>^2 - <em>h</em>^2).<p>
@@ -129,13 +128,17 @@
      * the use case name and extension points to the top of the use
      * case oval itself.<p>
      */
-    protected static final int MIN_VERT_PADDING = 4;
+    private static final int MIN_VERT_PADDING = 4;
+    
+    // Space between ellipse and stereotype underneath
+    private static final int STEREOTYPE_PADDING = 0;
+    
 
     /**
      * Space above and below the line separating name from extension
      * points. The line takes a further 1 pixel.<p>
      */
-    protected static final int SPACER = 2;
+    private static final int SPACER = 2;
 
     ///////////////////////////////////////////////////////////////////////////
     //
@@ -270,7 +273,7 @@
 
         // The separator. We cheat here. Since the name and extension points
         // rectangles are the same size at this stage, this must be at the
-        // midpoint of the elipse.
+        // midpoint of the ellipse.
 
         epSep.setShape(0,
 			ellipse.height / 2,
@@ -613,6 +616,8 @@
 
         int newW = (minSize.width > w) ? minSize.width : w;
         int newH = (minSize.height > h) ? minSize.height : h;
+        
+        newH = newH - (getStereotypeFig().getHeight() + STEREOTYPE_PADDING);
 
         // Work out the size of the name and extension point rectangle, and
         // hence the vertical padding
@@ -667,7 +672,7 @@
         _x = x;
         _y = y;
         _w = newW;
-        _h = newH;
+        _h = newH + getStereotypeFig().getHeight() + STEREOTYPE_PADDING;
         
         positionStereotypes();
 
@@ -865,13 +870,13 @@
         }
 
         /**
-         * Compute the border point of the elipse that is on the edge
+         * Compute the border point of the ellipse that is on the edge
          *   between the stored upper left corner and the given parameter.<p>
          *
          * @param anotherPt  The remote point to which an edge is drawn.
          *
          * @return           The connection point on the boundary of the
-         *                   elipse.
+         *                   ellipse.
          */
         @Override
         public Point connectionPoint(Point anotherPt) {
@@ -1180,7 +1185,8 @@
 
                 // Now put the text in
                 // We must handle the case where the text is null
-                String epText = epFig.getNotationProvider().toString(ep, null);
+                String epText = epFig.getNotationProvider().toString(ep, 
+                        getNotationArguments());
                 if (epText == null) {
                     epText = "";
                 }
@@ -1218,7 +1224,7 @@
     }
 
     /*
-     * Makes sure that the edges stick to the elipse fig of the usecase. <p>
+     * Makes sure that the edges stick to the ellipse fig of the usecase. <p>
      * 
      * TODO: This function is called way too many times - I count 6x when
      * simply clicking on this usecase, and 20x when clicking on the button
@@ -1268,14 +1274,13 @@
             getStereotypeFig().setBounds(
         	    (getX() + getWidth() / 2
         		    - getStereotypeFig().getWidth() / 2),
-        	    (getY() + bigPort.getHeight() + MIN_VERT_PADDING),
+        	    (getY() + bigPort.getHeight() + STEREOTYPE_PADDING),
                     getStereotypeFig().getWidth(),
                     getStereotypeFig().getHeight());
         } else {
             getStereotypeFig().setBounds(0, 0, 0, 0);
         }
     }
-    
 
     /**
      * Get a list of the extension point Figs <em>without</em> the first fig
@@ -1289,10 +1294,4 @@
         l.remove(0);
         return l;
     }
-
-
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -4018623737124023696L;
 }

Removed: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ExtendedImportInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ExtendedImportInterface.java?view=auto&rev=15193

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java	2008-07-07 12:54:30-0700
@@ -93,7 +93,7 @@
 

 	while (!toDoDirectories.isEmpty()) {

             if (monitor != null && monitor.isCanceled()) {

-                return results;

+                return Collections.emptyList();

             }

 	    File curDir = toDoDirectories.remove(0);

 

@@ -145,10 +145,9 @@
         if (!(file instanceof File)) {

             return false;

         }

-        String fileName = ((File) file).getName();

 	if (filters != null) {

 	    for (int i = 0; i < filters.length; i++) {

-		if (fileName.endsWith(filters[i].getSuffix())) {

+		if (filters[i].accept((File) file)) {

 		    return true;

 		}

 	    }


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Import.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Import.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Import.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Import.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Import.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Import.java	2008-07-07 12:54:30-0700
@@ -25,49 +25,60 @@
 package org.argouml.uml.reveng;
 
 import java.awt.BorderLayout;
-import java.awt.Dimension;
 import java.awt.Frame;
-import java.awt.GridLayout;
-import java.awt.Toolkit;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
 import java.io.File;
-import java.net.URL;
+import java.nio.charset.Charset;
+import java.util.List;
 import java.util.StringTokenizer;
 
 import javax.swing.ButtonGroup;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JComponent;
 import javax.swing.JDialog;
 import javax.swing.JFileChooser;
 import javax.swing.JLabel;
-import javax.swing.JList;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
-import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
-import javax.swing.JTextArea;
 import javax.swing.JTextField;
 import javax.swing.filechooser.FileSystemView;
 
-import org.apache.log4j.Logger;
 import org.argouml.application.api.Argo;
 import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
 import org.argouml.moduleloader.ModuleInterface;
-import org.argouml.uml.reveng.java.JavaImport;
+import org.argouml.uml.reveng.SettingsTypes.BooleanSelection2;
+import org.argouml.uml.reveng.SettingsTypes.PathListSelection;
+import org.argouml.uml.reveng.SettingsTypes.PathSelection;
+import org.argouml.uml.reveng.SettingsTypes.Setting;
+import org.argouml.uml.reveng.SettingsTypes.UniqueSelection2;
+import org.argouml.uml.reveng.SettingsTypes.UserString2;
+import org.argouml.uml.reveng.ui.ImportClasspathDialog;
 import org.argouml.uml.reveng.ui.ImportStatusScreen;
 import org.argouml.util.SuffixFilter;
 import org.argouml.util.UIUtils;
 import org.tigris.gef.base.Globals;
 import org.tigris.swidgets.GridLayout2;
 
+
+
 /**
- * This is the main class for all import classes.
+ * This is the main class for the Swing importer framework.  It extends 
+ * ImportCommon which contains all the GUI independent pieces of the import
+ * framework.  
  * <p>
+ * The Service Providers Interface (SPI) to the individual language importers
+ * is defined in such a way that they can be completely GUI independent as
+ * well, receiving lists of source files and settings for the import and 
+ * reporting progress via progress monitor API.
  * 
  * It provides JPanels for tailoring the import run in the FileChooser.
  * <p>
@@ -75,10 +86,11 @@
  * The Import run is started by calling doFile(Project, File)
  * <p>
  * 
- * Supports recursive search in folder for all .java classes.
+ * Supports recursive search in folder for source files with matching 
+ * extensions.
  * <p>
  * 
- * There are now 3 levels of detail for import:
+ * There are three levels of detail for import:
  * <p>
  * 
  * <ol>
@@ -88,6 +100,7 @@
  * </ol>
  * 
  * @author Andreas Rueckert [email protected]
+ * @author Tom Morris <[email protected]>
  */
 public class Import extends ImportCommon implements ImportSettings {
 
@@ -112,11 +125,8 @@
     // level 2 import detail
     private JRadioButton fullImport;
 
-    // import detail level var:
-    // private int importLevel;
-
-    private JTextField inputSourceEncoding;
-
+    private JComboBox sourceEncoding;
+    
     private JDialog dialog;
 
     private ImportStatusScreen iss;
@@ -124,13 +134,6 @@
     private Frame myFrame;
 
     /**
-     * The default extended configuration panel. TODO: This used to be provided
-     * by the abstract class FileImportSupport and it can be merged with our
-     * main configuration panel here.
-     */
-    private ConfigPanelExtension importConfigPanel;
-
-    /**
      * Creates dialog window with chooser and configuration panel.
      * 
      * @param frame the ui frame to display dialogs on
@@ -140,11 +143,12 @@
         myFrame = frame;
 
         JComponent chooser = getChooser();
-        dialog = new JDialog(frame, Translator
-                .localize("action.import-sources"), true);
+        dialog =
+            new JDialog(frame,
+                    Translator.localize("action.import-sources"), true);
 
         dialog.getContentPane().add(chooser, BorderLayout.CENTER);
-        dialog.getContentPane().add(getConfigPanel(this), BorderLayout.EAST);
+        dialog.getContentPane().add(getConfigPanel(), BorderLayout.EAST);
         dialog.pack();
         int x = (frame.getSize().width - dialog.getSize().width) / 2;
         int y = (frame.getSize().height - dialog.getSize().height) / 2;
@@ -159,25 +163,23 @@
      * @see org.argouml.uml.reveng.ImportSettings#getInputSourceEncoding()
      */
     public String getInputSourceEncoding() {
-        return inputSourceEncoding.getText();
+        return (String) sourceEncoding.getSelectedItem();
     }
 
     /*
      * @see org.argouml.uml.reveng.ImportSettings#isAttributeSelected()
      */
+    @Deprecated
     public boolean isAttributeSelected() {
-        // This is only valid for new style importers, but they're also
-        // the only ones invoking this method
-        return importConfigPanel.getAttribute().isSelected();
+        return false;
     }
 
     /*
      * @see org.argouml.uml.reveng.ImportSettings#isDatatypeSelected()
      */
+    @Deprecated
     public boolean isDatatypeSelected() {
-        // This is only valid for new style importers, but they're also
-        // the only ones invoking this method
-        return importConfigPanel.getDatatype().isSelected();
+        return false;
     }
 
     /**
@@ -196,9 +198,6 @@
                 .valueOf(getImportLevel()));
         Configuration.setString(Argo.KEY_INPUT_SOURCE_ENCODING,
                 getInputSourceEncoding());
-        if (importConfigPanel != null) {
-            importConfigPanel.disposeDialog();
-        }
         dialog.setVisible(false);
         dialog.dispose();
     }
@@ -210,140 +209,29 @@
      * @return the panel This is an internal method. Use the accessors in
      *         {@link ImportSettings} to determine the current settings.
      */
-    private JComponent getConfigPanel(final Import importInstance) {
+    private JComponent getConfigPanel() {
 
         final JTabbedPane tab = new JTabbedPane();
 
         // build the configPanel:
         if (configPanel == null) {
             JPanel general = new JPanel();
-            general.setLayout(new GridLayout2(13, 1, 0, 0, GridLayout2.NONE));
+            general.setLayout(new GridLayout2(20, 1, 0, 0, GridLayout2.NONE));
 
             general.add(new JLabel(Translator
                     .localize("action.import-select-lang")));
 
             JComboBox selectedLanguage = new JComboBox(getModules().keySet()
                     .toArray());
-            selectedLanguage.addActionListener(new SelectedLanguageListener(
-                    importInstance, tab));
+            selectedLanguage
+                    .addActionListener(new SelectedLanguageListener(tab));
             general.add(selectedLanguage);
 
-            boolean desc = true;
-            boolean chan = true;
-            boolean crea = true;
-            boolean mini = true;
-            boolean layo = true;
-            String flags = Configuration
-                    .getString(Argo.KEY_IMPORT_GENERAL_SETTINGS_FLAGS);
-            if (flags != null && flags.length() > 0) {
-                StringTokenizer st = new StringTokenizer(flags, ",");
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    desc = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    chan = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    crea = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    mini = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    layo = false;
-                }
-            }
+            addConfigCheckboxes(general);
 
-            descend = new JCheckBox(Translator
-                    .localize("action.import-option-descend-dir-recur"), desc);
-            general.add(descend);
-
-            changedOnly = new JCheckBox(Translator
-                    .localize("action.import-option-changed_new"), chan);
-            general.add(changedOnly);
-
-            createDiagrams = new JCheckBox(Translator
-                    .localize("action.import-option-create-diagram"), crea);
-            general.add(createDiagrams);
-
-            minimiseFigs = new JCheckBox(Translator
-                    .localize("action.import-option-min-class-icon"), mini);
-            general.add(minimiseFigs);
-
-            layoutDiagrams = new JCheckBox(
-                    Translator
-                            .localize("action.import-option-perform-auto-diagram-layout"),
-                    layo);
-            general.add(layoutDiagrams);
-
-            // de-selects the fig minimising & layout
-            // if we are not creating diagrams
-            createDiagrams.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent actionEvent) {
-                    if (!createDiagrams.isSelected()) {
-                        minimiseFigs.setSelected(false);
-                        layoutDiagrams.setSelected(false);
-                    }
-                }
-            });
+            addDetailLevelButtons(general);
 
-            // select the level of import
-            // 0 - classifiers only
-            // 1 - classifiers plus feature specifications
-            // 2 - full import, feature detail
-
-            JLabel importDetailLabel = new JLabel(Translator
-                    .localize("action.import-level-of-import-detail"));
-            ButtonGroup detailButtonGroup = new ButtonGroup();
-
-            classOnly = new JRadioButton(Translator
-                    .localize("action.import-option-classifiers"));
-            detailButtonGroup.add(classOnly);
-
-            classAndFeatures = new JRadioButton(Translator
-                    .localize("action.import-option-classifiers-plus-specs"));
-            detailButtonGroup.add(classAndFeatures);
-
-            fullImport = new JRadioButton(Translator
-                    .localize("action.import-option-full-import"));
-            String detaillevel = Configuration
-                    .getString(Argo.KEY_IMPORT_GENERAL_DETAIL_LEVEL);
-            if ("0".equals(detaillevel)) {
-                classOnly.setSelected(true);
-            } else if ("1".equals(detaillevel)) {
-                classAndFeatures.setSelected(true);
-            } else {
-                fullImport.setSelected(true);
-            }
-            detailButtonGroup.add(fullImport);
-
-            general.add(importDetailLabel);
-            general.add(classOnly);
-            general.add(classAndFeatures);
-            general.add(fullImport);
-
-            general.add(new JLabel(Translator
-                    .localize("action.import-file-encoding")));
-            String enc = Configuration
-                    .getString(Argo.KEY_INPUT_SOURCE_ENCODING);
-            if (enc == null || enc.trim().equals("")) {
-                inputSourceEncoding = new JTextField(System
-                        .getProperty("file.encoding"));
-            } else {
-                inputSourceEncoding = new JTextField(enc);
-
-            }
-            general.add(inputSourceEncoding);
-
-            // TODO: Encoding needs to be validated against set of
-            // available encodings using {@link Charset.isSupported(String)}
-            // -- or use a menu with the contents of
-            // {@link Charset.availableCharsets()}
-            // JComboBox encoding =
-            // new JComboBox(Charset.availableCharsets().keySet()
-            // .toArray());
-            // encoding.setSelectedItem(inputSourceEncoding.getText());
-            // general.add(encoding);
+            addSourceEncoding(general);
 
             tab.add(general, Translator.localize("action.import-general"));
             tab.add(getConfigPanelExtension(),
@@ -354,26 +242,137 @@
 
     }
 
+
+    private void addConfigCheckboxes(JPanel panel) {
+        boolean desc = true;
+        boolean chan = true;
+        boolean crea = true;
+        boolean mini = true;
+        boolean layo = true;
+        String flags = Configuration
+                .getString(Argo.KEY_IMPORT_GENERAL_SETTINGS_FLAGS);
+        if (flags != null && flags.length() > 0) {
+            StringTokenizer st = new StringTokenizer(flags, ",");
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                desc = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                chan = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                crea = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                mini = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                layo = false;
+            }
+        }
+
+        descend = new JCheckBox(Translator
+                .localize("action.import-option-descend-dir-recur"), desc);
+        panel.add(descend);
+
+        changedOnly = new JCheckBox(Translator
+                .localize("action.import-option-changed_new"), chan);
+        panel.add(changedOnly);
+
+        createDiagrams = new JCheckBox(Translator
+                .localize("action.import-option-create-diagram"), crea);
+        panel.add(createDiagrams);
+
+        minimiseFigs = new JCheckBox(Translator
+                .localize("action.import-option-min-class-icon"), mini);
+        panel.add(minimiseFigs);
+
+        layoutDiagrams = new JCheckBox(Translator.localize(
+                "action.import-option-perform-auto-diagram-layout"),
+                layo);
+        panel.add(layoutDiagrams);
+
+        // de-selects the fig minimising & layout
+        // if we are not creating diagrams
+        createDiagrams.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent actionEvent) {
+                if (!createDiagrams.isSelected()) {
+                    minimiseFigs.setSelected(false);
+                    layoutDiagrams.setSelected(false);
+                }
+            }
+        });
+    }
+
+
+    private void addDetailLevelButtons(JPanel panel) {
+        // select the level of import
+        // 0 - classifiers only
+        // 1 - classifiers plus feature specifications
+        // 2 - full import, feature detail
+
+        JLabel importDetailLabel = new JLabel(Translator
+                .localize("action.import-level-of-import-detail"));
+        ButtonGroup detailButtonGroup = new ButtonGroup();
+
+        classOnly = new JRadioButton(Translator
+                .localize("action.import-option-classifiers"));
+        detailButtonGroup.add(classOnly);
+
+        classAndFeatures = new JRadioButton(Translator
+                .localize("action.import-option-classifiers-plus-specs"));
+        detailButtonGroup.add(classAndFeatures);
+
+        fullImport = new JRadioButton(Translator
+                .localize("action.import-option-full-import"));
+        String detaillevel = Configuration
+                .getString(Argo.KEY_IMPORT_GENERAL_DETAIL_LEVEL);
+        if ("0".equals(detaillevel)) {
+            classOnly.setSelected(true);
+        } else if ("1".equals(detaillevel)) {
+            classAndFeatures.setSelected(true);
+        } else {
+            fullImport.setSelected(true);
+        }
+        detailButtonGroup.add(fullImport);
+
+        panel.add(importDetailLabel);
+        panel.add(classOnly);
+        panel.add(classAndFeatures);
+        panel.add(fullImport);
+    }
+    
+    
+    private void addSourceEncoding(JPanel panel) {
+        panel.add(new JLabel(
+                Translator.localize("action.import-file-encoding")));
+        String enc =
+            Configuration.getString(Argo.KEY_INPUT_SOURCE_ENCODING);
+        if (enc == null || enc.trim().equals("")) {
+            enc = System.getProperty("file.encoding");
+        }
+        // cp1252 is often the default, but windows-1252 is the name listed
+        // by Charset.availableCharsets
+        if (enc.startsWith("cp")) {
+            enc = "windows-" + enc.substring(2);
+        }
+
+        sourceEncoding = new JComboBox(Charset
+                .availableCharsets().keySet().toArray());
+        sourceEncoding.setSelectedItem(enc);
+        panel.add(sourceEncoding);
+    }
+    
     /*
      * Get the extension panel for the configuration settings.
      */
     private JComponent getConfigPanelExtension() {
-        // New style importers don't provide a config panel
-        // TODO: This needs review for the new style importers - tfm - 20070527
-        if (importConfigPanel == null) {
-            importConfigPanel = new ConfigPanelExtension();
-        }
-        return importConfigPanel;
+        List<Setting> settings = getCurrentModule().getImportSettings();
+        return  new ConfigPanelExtension(settings);
     }
 
     private class SelectedLanguageListener implements ActionListener {
 
         /**
-         * The current import.
-         */
-        private Import importInstance;
-
-        /**
          * The pane.
          */
         private JTabbedPane tab;
@@ -384,8 +383,7 @@
          * @param i The current import.
          * @param t The pane.
          */
-        SelectedLanguageListener(Import i, JTabbedPane t) {
-            importInstance = i;
+        SelectedLanguageListener(JTabbedPane t) {
             tab = t;
         }
 
@@ -400,11 +398,18 @@
             updateFilters((JFileChooser) dialog.getContentPane()
                     .getComponent(0), oldModule.getSuffixFilters(),
                     getCurrentModule().getSuffixFilters());
-            // TODO: Update configPanelExtension with extension settings
-            // for new language
-
+            updateTabbedPane();
+        }
+        
+        private void updateTabbedPane() {
+            String name = ((ModuleInterface) getCurrentModule()).getName();
+            if (tab.indexOfTab(name) < 0) {
+                tab.add(getConfigPanelExtension(), name);
+            }
         }
     }
+    
+
 
     /**
      * Parse all selected files. It calls the actual parser methods depending on
@@ -515,6 +520,9 @@
             for (int i = 0; i < newFilters.length; i++) {
                 chooser.addChoosableFileFilter(newFilters[i]);
             }
+            if (newFilters.length > 0) {
+                chooser.setFileFilter(newFilters[0]);
+            }
         }
     }
 
@@ -590,7 +598,7 @@
             File[] files = getSelectedFiles();
             File dir = getCurrentDirectory();
             if (files.length == 0) {
-                files = new File[] { dir };
+                files = new File[] {dir};
             }
             if (files.length == 1) {
                 File file = files[0];
@@ -604,14 +612,7 @@
             Globals.setLastDirectory(dir.getPath());
             theImport.disposeDialog();
 
-            if (theImport.getCurrentModule() instanceof ExtendedImportInterface) {
-                ExtendedImportInterface eii = (ExtendedImportInterface) theImport
-                        .getCurrentModule();
-                eii.invokeImport(theImport.getFrame(), new ImportCommand(
-                        theImport));
-            } else {
-                theImport.doFile();
-            }
+            theImport.doFile();
         }
 
         /*
@@ -625,9 +626,142 @@
     }
 
     /**
-     * @return Returns the Frame.
+     * Extended configuration panel for file import.  Built based on settings
+     * requested by the specific language importer.
      */
-    public Frame getFrame() {
-        return myFrame;
+    class ConfigPanelExtension extends JPanel {
+
+
+        /**
+         * Construct the configuration extension panel.
+         * @param settings A list of settings requested by the language importer
+         */
+        public ConfigPanelExtension(final List<Setting> settings) {
+
+            setLayout(new GridBagLayout());
+            
+            if (settings == null || settings.size() == 0) {
+                JLabel label = new JLabel("No settings for this importer");
+                add(label, createGridBagConstraints(true, false, false));
+                add(new JPanel(), createGridBagConstraintsFinal()); 
+                return;
+            }
+
+            for (Setting setting : settings) {
+                if (setting instanceof UniqueSelection2) {
+                    JLabel label = new JLabel(setting.getLabel());
+                    add(label, createGridBagConstraints(true, false, false));
+
+                    final UniqueSelection2 us = (UniqueSelection2) setting;
+                    ButtonGroup group = new ButtonGroup();
+                    int count = 0;
+                    for (String option : us.getOptions()) {
+                        JRadioButton button = new JRadioButton(option);
+                        final int index = count++;
+                        if (us.getDefaultSelection() == index) {
+                            button.setSelected(true);
+                        }
+                        group.add(button);
+                        button.addActionListener(new ActionListener() {
+                            public void actionPerformed(ActionEvent e) {
+                                us.setSelection(index);
+                            }
+                        });
+                        add(button, createGridBagConstraints(false, false,
+                                false));
+                    }
+                } else if (setting instanceof UserString2) {
+                    JLabel label = new JLabel(setting.getLabel());
+                    add(label, createGridBagConstraints(true, false, false));
+                    final UserString2 us = (UserString2) setting;
+                    final JTextField text = 
+                        new JTextField(us.getDefaultString());
+                    text.addFocusListener(new FocusListener() {
+                        public void focusGained(FocusEvent e) { } 
+                        public void focusLost(FocusEvent e) {
+                            us.setUserString(text.getText());           
+                        }
+                        
+                    });
+                    add(text, createGridBagConstraints(true, false, false));
+                } else if (setting instanceof BooleanSelection2) {
+                    final BooleanSelection2 bs = (BooleanSelection2) setting;
+                    final JCheckBox button = new JCheckBox(setting.getLabel());
+                    button.setEnabled(bs.isSelected());
+                    button.addActionListener(new ActionListener() {
+                        public void actionPerformed(ActionEvent e) {
+                            bs.setSelected(button.isSelected());
+                        }
+                    });
+                    add(button, createGridBagConstraints(true, false, false));
+                } else if (setting instanceof PathSelection) {
+                    JLabel label = new JLabel(setting.getLabel());
+                    add(label, createGridBagConstraints(true, false, false));
+                    PathSelection ps = (PathSelection) setting;
+                    // TODO: Need to add FileChooser 
+                    JTextField text = new JTextField(ps.getDefaultPath());
+                    add(text, createGridBagConstraints(true, false, false));
+                    // TODO: Update setting
+                } else if (setting instanceof PathListSelection) {
+                    PathListSelection pls = (PathListSelection) setting;
+                    add(new ImportClasspathDialog(pls),
+                            createGridBagConstraints(true, false, false));
+                } else {
+                    throw new RuntimeException("Unknown setting type requested "
+                            + setting);
+                }
+            }
+            add(new JPanel(), createGridBagConstraintsFinal()); 
+        }
+
+
+        /**
+         * Create a GridBagConstraints object to use with the layout.
+         * 
+         * @param topInset true to use a top inset 
+         * @param bottomInset true to use a bottom inset
+         * @param fill true to fill (horizontally)
+         * @return the grid bag constraints
+         */
+        private GridBagConstraints createGridBagConstraints(boolean topInset,
+                boolean bottomInset, boolean fill) {
+            GridBagConstraints gbc = new GridBagConstraints();
+            gbc.gridx = GridBagConstraints.RELATIVE;
+            gbc.gridy = GridBagConstraints.RELATIVE;
+            gbc.gridwidth = GridBagConstraints.REMAINDER;
+            gbc.gridheight = 1;
+            gbc.weightx = 1.0;
+            gbc.weighty = 0.0;
+            gbc.anchor = GridBagConstraints.NORTHWEST;
+            gbc.fill = fill ? GridBagConstraints.HORIZONTAL
+                    : GridBagConstraints.NONE;
+            gbc.insets = 
+                new Insets(
+                        topInset ? 5 : 0, 
+                                5, 
+                                bottomInset ? 5 : 0, 
+                                        5);
+            gbc.ipadx = 0;
+            gbc.ipady = 0;
+            return gbc;
+        }
+
+        /**
+         * A GridBagConstraints for the last item to take up the rest of the
+         * space.
+         * 
+         * @return the GridBagConstraints object
+         */
+        private GridBagConstraints createGridBagConstraintsFinal() {
+            GridBagConstraints gbc = createGridBagConstraints(false, true,
+                    false);
+            gbc.gridheight = GridBagConstraints.REMAINDER;
+            gbc.weighty = 1.0;
+            return gbc;
+        }
+
     }
+
+
+
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java	2008-07-07 12:54:30-0700
@@ -124,7 +124,7 @@
     /**
      * There is no default constructor for URLClassloader, so we should provide
      * urls when creating the instance.
-     * We crate a new instance in this method.
+     * We create a new instance in this method.
      *
      * @param urls the URLs
      * @return the instance of this class

Removed: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommand.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommand.java?view=auto&rev=15193

Removed: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommandInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommandInterface.java?view=auto&rev=15193

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java	2008-07-07 12:54:30-0700
@@ -49,7 +49,6 @@
 import org.argouml.uml.diagram.ArgoDiagram;

 import org.argouml.uml.diagram.static_structure.ClassDiagramGraphModel;

 import org.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter;

-import org.argouml.uml.reveng.ImportInterface.ImportException;

 import org.tigris.gef.base.Globals;

 

 /**

@@ -124,13 +123,6 @@
     public abstract int getImportLevel();

 

 

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#getDiagramInterface()

-     */

-    public DiagramInterface getDiagramInterface() {

-        return diagramInterface;

-    }

-

     /**

      * Compute and cache the current diagram interface.

      */

@@ -158,22 +150,6 @@
      */

     public abstract String getInputSourceEncoding();

 

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#isAttributeSelected()

-     */

-    public abstract boolean isAttributeSelected();

-

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#isDatatypeSelected()

-     */

-    public abstract boolean isDatatypeSelected();

-

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#getImportSession()

-     */

-    public ImportCommon getImportSession() {

-        return this;

-    }

 

     /**

      * Get the files.  We generate it based on their specified

@@ -448,7 +424,10 @@
     /**

      * Gets the import classpaths. This should be asked by the GUI for

      * initialization.

+     * 

      * @return a list with Strings representing the classpaths

+     * @deprecated for 0.25.7 by tfmorris. This is a Java importer specific

+     *             method.

      */

     public List<String> getImportClasspath() {

         List<String> list = new ArrayList<String>();

@@ -471,15 +450,13 @@
      */

     public void layoutDiagrams(ProgressMonitor monitor, int startingProgress) {

 

-        // ArgoEclipse implementation

-        DiagramInterface di = getDiagramInterface();

-        if (di == null) {

+        if (diagramInterface == null) {

             return;

         }

 //        if (monitor != null) {

 //            monitor.updateSubTask(ImportsMessages.layoutingAction);

 //        }

-        List<ArgoDiagram> diagrams = di.getModifiedDiagramList();

+        List<ArgoDiagram> diagrams = diagramInterface.getModifiedDiagramList();

         int total = startingProgress + diagrams.size()

                 / 10;

         for (int i = 0; i < diagrams.size(); i++) {

@@ -542,7 +519,6 @@
      * @param filesLeft the files to parse

      * @param monitor the progress meter

      * @param progress the actual progress until now

-     * @throws ImportException exception thrown my import module

      */

     private void doImportInternal(List<File> filesLeft,

             final ProgressMonitor monitor, int progress) {


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java	2008-07-07 12:54:30-0700
@@ -36,6 +36,9 @@
 /**

  * An interface which identifies an ArgoUML plug-in which imports 

  * source language modules and creates UML model elements in our model.

+ * <p>

+ * This interface is GUI independent and must not have any dependency on

+ * Swing/AWT or SWT.

  * 

  * @author Tom Morris

  * @since 0.23.2


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$

-// Copyright (c) 2006 The Regents of the University of California. All

+// Copyright (c) 2006-2008 The Regents of the University of California. All

 // Rights Reserved. Permission to use, copy, modify, and distribute this

 // software and its documentation without fee, and without a written

 // agreement is hereby granted, provided that the above copyright notice

@@ -58,33 +58,52 @@
      */

     public String getInputSourceEncoding();

 

-    // TODO: Change attribute and datatype to return a literal/enum

-    // instead? - tfm

-

     /**

-     * @return true if associations should be modeled as attributes

+     * @return always returns false.

+     * @deprecated for 0.25.6 by tfmorris.  This is a Java-specific setting

+     * that was inadvertantly included in the interface for 0.24.  Not 

+     * intended for public use.  Instead use the Settings interface to

+     * importer-specific settings.

      */

+    @Deprecated

     public boolean isAttributeSelected();

 

     /**

-     * @return true if arrays should be modeled as UML Datatypes

+     * @return always returns false.

+     * @deprecated for 0.25.6 by tfmorris.  This is a Java-specific setting

+     * that was inadvertantly included in the interface for 0.24.  Not 

+     * intended for public use.  Instead use the Settings interface to

+     * importer-specific settings.

      */

+    @Deprecated

     public boolean isDatatypeSelected();

 

     /**

-     * TODO: This should be removed when diagram updating removed from the 

-     * importers (as it should be). - tfm 20061129

      * @return true if the user has request diagrams to be created for packages

      *         contained in the imported source code.

+     * @deprecated for 0.25.6 by tfmorris. This is handled by the import

+     *             framework so specific importers don't need to worry about it.

+     */

+    /*

+     * NOTE: When this is removed from here, it should NOT be removed from

+     * ImportSettingsInternal to guarantee that GUI implementations are forced

+     * to implement it.

      */

+    @Deprecated

     public boolean isCreateDiagramsSelected();

     

     /**

-     * TODO: This should be removed when diagram updating removed from the 

-     * importers (as it should be). - tfm 20061129

      * @return true, if user has requested that new figures placed in diagrams

      *         should be minimized so they don't show internal compartments.

+     * @deprecated for 0.25.6 by tfmorris. This is handled by the import

+     *             framework so specific importers don't need to worry about it.

+     */

+    /*

+     * NOTE: When this is removed from here, it should NOT be removed from

+     * ImportSettingsInternal to guarantee that GUI implementations are forced

+     * to implement it.

      */

+    @Deprecated

     public boolean isMinimizeFigsSelected();

 

 


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$

-// Copyright (c) 2006 The Regents of the University of California. All

+// Copyright (c) 2006-2008 The Regents of the University of California. All

 // Rights Reserved. Permission to use, copy, modify, and distribute this

 // software and its documentation without fee, and without a written

 // agreement is hereby granted, provided that the above copyright notice

@@ -54,22 +54,16 @@
     public boolean isDiagramLayoutSelected();

 

     /**

-     * TODO: This should be moved from the superclass when diagram updating

-     * removed from the importers (as it should be). - tfm 20061129

-     * 

      * @return true if the user has request diagrams to be created for packages

      *         contained in the imported source code.

      */

-//    public boolean isCreateDiagramsSelected();

+    public boolean isCreateDiagramsSelected();

     

     /**

-     * TODO: This should be moved from the superclass when diagram updating

-     * removed from the importers (as it should be). - tfm 20061129

-     * 

      * @return true, if user has requested that new figures placed in diagrams

      *         should be minimized so they don't show internal compartments.

      */

-//    public boolean isMinimizeFigsSelected();

+    public boolean isMinimizeFigsSelected();

 

 

 }


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Setting.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Setting.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Setting.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Setting.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Setting.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/Setting.java	2008-07-07 12:54:30-0700
@@ -24,6 +24,7 @@
 

 package org.argouml.uml.reveng;

 

+import java.util.Collections;

 import java.util.List;

 

 

@@ -75,7 +76,7 @@
      * would be labeled checkbox.

      */

     public static class BooleanSelection extends Setting

-        implements SettingsTypes.BooleanSelection {

+        implements SettingsTypes.BooleanSelection2 {

 

         private boolean defaultValue;

         private boolean value;

@@ -106,36 +107,117 @@
         public final boolean getDefaultValue() {

             return defaultValue;

         }

+        

+        public final void setSelected(boolean selected) {

+            this.value = selected;

+        }

     }

     

+    /**

+     * A setting that allows a single selection from a list of choices.

+     * 

+     * @see SettingsTypes.UniqueSelection2

+     * @author Bogdan Pistol

+     * 

+     */

     public static class UniqueSelection extends Setting implements

-            SettingsTypes.UniqueSelection {

+            SettingsTypes.UniqueSelection2 {

 

+        /**

+         * The list of String options

+         */

         private List<String> options;

+        

+        /**

+         * Default selection is UNDEFINED

+         */

+        private int defaultSelection = UNDEFINED_SELECTION;

+        

+        /**

+         * The selection is UNDEFINED

+         */

+        private int selection = UNDEFINED_SELECTION;

+        

+        /**

+         * Constructor

+         * 

+         * @param label the user visible string to associate with this setting

+         * @param variants

+         *            the list of String options

+         * @param defaultVariant

+         *            the default selection or UNDEFINED_SELECTION

+         */

+        public UniqueSelection(String label, List<String> variants,

+                int defaultVariant) {

+            super(label);

+            options = variants;

+            if (isOption(defaultVariant)) {

+                defaultSelection = defaultVariant;

+            }

+        }

 

-        private int selection;

-

-        public UniqueSelection(String labelText, List<String> optionLabels,

-                int defaultSelection) {

-            super(labelText);

-            options = optionLabels;

-            this.selection = selection;

+        /**

+         * Tests if this is a valid option.

+         * 

+         * @param opt

+         *            the option to test

+         * @return true if it's OK and false otherwise

+         */

+        private boolean isOption(int opt) {

+            if (options == null) {

+                return false;

+            }

+            return opt >= 0 && opt < options.size() ? true : false;        

         }

 

+        /*

+         * @see org.argouml.uml.reveng.ImportSettingTypes.UniqueSelection#getDefaultSelection()

+         */

         public int getDefaultSelection() {

-            return selection;

+            return defaultSelection;

         }

 

+        /*

+         * We return a new List with the options instead of the options themself

+         * because we don't want the user to be able to change the options.

+         * 

+         * @see org.argouml.uml.reveng.SettingsTypes.UniqueSelection#getOptions()

+         */

         public List<String> getOptions() {

-            return options;

+            return Collections.unmodifiableList(options);

         }

 

-        public boolean setSelection(int selection) {

-            this.selection = selection;

-            return true;

+        /*

+         * @see org.argouml.uml.reveng.ImportSettingTypes.UniqueSelection#setSelection(int)

+         */

+        public boolean setSelection(int sel) {

+            if (isOption(sel)) {

+                selection = sel;

+                return true;

+            } else {

+                return false;

+            }

         }

+        

+        /**

+         * This method (package access) determines the selected option.

+         * 

+         * @return the 0-based index of the selected option or the default

+         *         option if no other option was selected

+         */

+        public int getSelection() {

+            if (selection == UNDEFINED_SELECTION) {

+                return defaultSelection;

+            } else {

+                return selection;

+            }

+        }

+

     }

 

+    /**

+     * A selection for a single path (e.g. file system path or directory).

+     */

     public static class PathSelection extends Setting implements

             SettingsTypes.PathSelection {

 

@@ -143,11 +225,19 @@
 

         private String defaultPath;

 

+        /**

+         * Construct a PathSelection with the given attributes.

+         * 

+         * @param labelText string to use for the label of the path list

+         * @param descriptionText longer description of the purpose of this

+         *                pathlist (appropriate for a tooltip)

+         * @param defaultValue initial value of the path 

+         */

         public PathSelection(String labelText, String descriptionText,

-                String defaultPath) {

+                String defaultValue) {

             super(labelText, descriptionText);

-            this.defaultPath = defaultPath;

-            path = defaultPath;

+            defaultPath = defaultValue;

+            path = defaultValue;

         }

 

         public String getDefaultPath() {

@@ -169,6 +259,9 @@
 

     }

 

+    /**

+     * An implementation of the PathListSelection.

+     */

     public static class PathListSelection extends Setting implements

             SettingsTypes.PathListSelection {

 

@@ -176,11 +269,19 @@
 

         private List<String> pathList;

 

+        /**

+         * Construct a new PathListSelection with the given attributes.

+         * 

+         * @param labelText string to use for the label of the path list

+         * @param descriptionText longer description of the purpose of this

+         *                pathlist (appropriate for a tooltip)

+         * @param defaultList inital values of the path list

+         */

         public PathListSelection(String labelText, String descriptionText,

-                List<String> defaultPathList) {

+                List<String> defaultList) {

             super(labelText, descriptionText);

-            this.defaultPathList = defaultPathList;

-            pathList = defaultPathList;

+            defaultPathList = defaultList;

+            pathList = defaultList;

         }

 

         public List<String> getDefaultPathList() {

@@ -191,6 +292,10 @@
             return pathList;

         }

 

+        public void setPathList(List<String> newPathList) {

+            pathList = newPathList;

+        }

+

     }

 

 }
\ No newline at end of file

Removed: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingUniqueSelection.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingUniqueSelection.java?view=auto&rev=15193

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java	2008-07-07 12:54:30-0700
@@ -105,6 +105,18 @@
          *         bounds

          */

         boolean setSelection(int selection);

+        

+        /**

+         * @return the current selection

+         */

+        int getSelection();

+    }

+    

+    /**

+     * A UniqueSelection which includes a description.

+     * @see UniqueSelection

+     */

+    interface UniqueSelection2 extends UniqueSelection, Setting2 {

     }

     

     /**

@@ -115,10 +127,27 @@
          * @return the initial string to display, if any.  May be null.

          */

         String getDefaultString();

+        

         /**

          * @return the user entered string

          */

         String getUserString();

+        

+        /**

+         * Set user string to new value.

+         * 

+         * @param userString new user string

+         */

+        void setUserString(String userString);

+        

+    }

+    

+    /**

+     * A UserString which includes a description.

+     * @see UserString

+     */

+    interface UserString2 extends UserString, Setting2 {

+        

     }

     

     /**

@@ -133,6 +162,20 @@
          * @return the user selected value

          */

         boolean isSelected();

+        

+        /**

+         * Set the selection value.

+         * @param selected boolean indicating new state of selection

+         */

+        void setSelected(boolean selected);

+    }

+    

+    /**

+     * A BooleanSelection which includes a description.

+     * @see BooleanSelection

+     */

+    interface BooleanSelection2 extends BooleanSelection, Setting2 {

+        

     }

     

     /**

@@ -149,6 +192,12 @@
          * @return the user selected path

          */

         String getPath();

+        

+        /**

+         * Set the path to the given value

+         * @param path new value of the path

+         */

+        void setPath(String path);

     }

     

     /**

@@ -166,6 +215,13 @@
          * @return the user selected ordered list of file system paths

          */

         List<String> getPathList();

+        

+        /**

+         * Set the path list to the new values.

+         * 

+         * @param pathList new list of paths

+         */

+        void setPathList(List<String> pathList);

     }

 

 }


Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -24,7 +24,6 @@
 
 package org.argouml.uml.reveng.java;
 
-import java.awt.Component;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
@@ -33,21 +32,27 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.argouml.application.api.Argo;
+import org.argouml.configuration.Configuration;
+import org.argouml.configuration.ConfigurationKey;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
 import org.argouml.taskmgmt.ProgressMonitor;
-import org.argouml.uml.reveng.ExtendedImportInterface;
 import org.argouml.uml.reveng.FileImportUtils;
-import org.argouml.uml.reveng.ImportCommandInterface;
+import org.argouml.uml.reveng.ImportClassLoader;
+import org.argouml.uml.reveng.ImportInterface;
 import org.argouml.uml.reveng.ImportSettings;
 import org.argouml.uml.reveng.ImporterManager;
-import org.argouml.uml.reveng.ui.ImportClasspathDialog;
+import org.argouml.uml.reveng.Setting;
+import org.argouml.uml.reveng.SettingsTypes;
 import org.argouml.util.FileFilters;
 import org.argouml.util.SuffixFilter;
 
@@ -55,30 +60,93 @@
  * This is the main class for Java reverse engineering. It's based
  * on the Antlr Java example.
  *
- * @author Andreas Rueckert, Thomas Neustupny
+ * @author Andreas Rueckert
+ * @author Thomas Neustupny
  */
-public class JavaImport implements ExtendedImportInterface {
+public class JavaImport implements ImportInterface {
 
     /** logger */
     private static final Logger LOG = Logger.getLogger(JavaImport.class);
+
+    
+    /**
+     * Key for RE extended settings: model attributes as:
+     * 0: attributes
+     * 1: associations
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_MODEL_ATTR =
+        Configuration
+            .makeKey("import", "extended", "java", "model", "attributes");
+
+    /**
+     * Key for RE extended settings: model arrays as:
+     * 0: datatype
+     * 1: associations
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_MODEL_ARRAYS =
+        Configuration.makeKey("import", "extended", "java", "model", "arrays");
+
+    /**
+     * Key for RE extended settings: flag for modeling of listed collections,
+     * if to model them as associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_COLLECTIONS_FLAG =
+        Configuration
+            .makeKey("import", "extended", "java", "collections", "flag");
+
+    /**
+     * Key for RE extended settings: list of collections, that will be modelled
+     * as associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_COLLECTIONS_LIST =
+        Configuration
+            .makeKey("import", "extended", "java", "collections", "list");
+
+    /**
+     * Key for RE extended settings: flag for modelling of listed collections,
+     * if to model them as ordered associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_ORDEREDCOLLS_FLAG =
+        Configuration
+            .makeKey("import", "extended", "java", "orderedcolls", "flag");
+
+    /**
+     * Key for RE extended settings: list of collections, that will be modelled
+     * as ordered associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_ORDEREDCOLLS_LIST =
+        Configuration
+            .makeKey("import", "extended", "java", "orderedcolls", "list");
     
     /**
      * New model elements that were added
      */
     private Collection newElements;
-    
+
+    private List<SettingsTypes.Setting> settingsList;
+
+    private SettingsTypes.UniqueSelection2 attributeSetting;
+
+    private SettingsTypes.UniqueSelection2 datatypeSetting;
+
+    private SettingsTypes.PathListSelection pathlistSetting;    
+
     /*
      * @see org.argouml.uml.reveng.ImportInterface#parseFiles(org.argouml.kernel.Project, java.util.Collection, org.argouml.uml.reveng.ImportSettings, org.argouml.application.api.ProgressMonitor)
      */
-    public Collection parseFiles(Project p, Collection files,
+    public Collection parseFiles(Project p, Collection<File> files,
             ImportSettings settings, ProgressMonitor monitor)
         throws ImportException {
 
+        saveSettings();
+        updateImportClassloader();
         newElements = new HashSet();
         monitor.updateMainTask(Translator.localize("dialog.import.pass1"));
         try {
-            if (settings.getImportLevel() == ImportSettings.DETAIL_CLASSIFIER_FEATURE
-                    || settings.getImportLevel() == ImportSettings.DETAIL_FULL) {
+            if (settings.getImportLevel() 
+                        == ImportSettings.DETAIL_CLASSIFIER_FEATURE
+                    || settings.getImportLevel() 
+                        == ImportSettings.DETAIL_FULL) {
                 monitor.setMaximumProgress(files.size() * 2);
                 doImportPass(p, files, settings, monitor, 0, 0);
                 if (!monitor.isCanceled()) {
@@ -96,43 +164,45 @@
         return newElements;
     }
 
+    private void saveSettings() {
+        Configuration.setString(KEY_IMPORT_EXTENDED_MODEL_ATTR, String
+                .valueOf(attributeSetting.getSelection()));
+        Configuration.setString(KEY_IMPORT_EXTENDED_MODEL_ARRAYS, String
+                .valueOf(datatypeSetting.getSelection()));
+    }
 
-    private void doImportPass(Project p, Collection files,
+    private void doImportPass(Project p, Collection<File> files,
             ImportSettings settings, ProgressMonitor monitor, int startCount,
-            int pass) throws ImportException {
+            int pass) {
         
         int count = startCount;
-        for (Iterator it = files.iterator(); it.hasNext();) {
+        for (File file : files) {
             if (monitor.isCanceled()) {
                 monitor.updateSubTask(
                         Translator.localize("dialog.import.cancelled"));
                 return;
             }
-            Object file = it.next();
-            if (file instanceof File) {
-                try {
-                    parseFile(p, (File) file, settings, pass);
-                } catch (Exception e) {
-                    StringWriter sw = new StringWriter();
-                    PrintWriter pw = new java.io.PrintWriter(sw);
-                    e.printStackTrace(pw);
-                    monitor.notifyMessage(
+            try {
+                parseFile(p, file, settings, pass);
+            } catch (Exception e) {
+                StringWriter sw = new StringWriter();
+                PrintWriter pw = new java.io.PrintWriter(sw);
+                e.printStackTrace(pw);
+                monitor.notifyMessage(
+                    Translator.localize(
+                        "dialog.title.import-problems"), //$NON-NLS-1$
                         Translator.localize(
-                            "dialog.title.import-problems"), //$NON-NLS-1$
-                            Translator.localize(
-                            "label.import-problems"),        //$NON-NLS-1$
-                            sw.toString());
-                    if (monitor.isCanceled()) {
-                        break;
-                    }
+                        "label.import-problems"),        //$NON-NLS-1$
+                        sw.toString());
+                if (monitor.isCanceled()) {
+                    break;
                 }
-                monitor.updateProgress(count++);
-                monitor.updateSubTask(Translator.localize(
-                        "dialog.import.parsingAction",
-                        new Object[] {((File) file).getAbsolutePath()}));
-            } else {
-                throw new ImportException("Object isn't a file " + file);
             }
+            monitor.updateProgress(count++);
+            monitor.updateSubTask(Translator.localize(
+                    "dialog.import.parsingAction",
+                    new Object[] {file.getAbsolutePath()}));
+
         }
 
         return;
@@ -188,7 +258,7 @@
 
             // Create a modeller for the parser
             Modeller modeller = new Modeller(p.getModel(),
-                    settings,
+                    isAttributeSelected(), isDatatypeSelected(),
                     f.getName());
 
             // Print the name of the current file, so we can associate
@@ -226,22 +296,17 @@
     }
 
 
-    /**
+    /*
      * @see org.argouml.uml.reveng.ImportInterface#getSuffixFilters()
      */
     public SuffixFilter[] getSuffixFilters() {
-	SuffixFilter[] result = {FileFilters.JAVA_FILE_FILTER};
+        SuffixFilter[] result = {
+            new SuffixFilter("java", 
+                    Translator.localize("combobox.filefilter.java")),
+        };
 	return result;
     }
 
-    /**
-     * @see org.argouml.uml.reveng.ExtendedImportInterface#invokeImport(java.awt.Component, org.argouml.uml.reveng.ImportCommandInterface)
-     */
-    public void invokeImport(Component component,
-            ImportCommandInterface importCmd) {
-        new ImportClasspathDialog(component, importCmd);
-    }
-
     /*
      * @see org.argouml.uml.reveng.ImportInterface#isParseable(java.io.File)
      */
@@ -284,22 +349,106 @@
      * @see org.argouml.moduleloader.ModuleInterface#enable()
      */
     public boolean enable() {
-        init();
+        ImporterManager.getInstance().addImporter(this);
         return true;
     }
 
-    /**
-     * Enable the importer.
-     */
-    public void init() {
-	ImporterManager.getInstance().addImporter(this);
-    }
     
     /*
      * @see org.argouml.uml.reveng.ImportInterface#getImportSettings()
      */
-    public List getImportSettings() {
-        return null;
+    public List<SettingsTypes.Setting> getImportSettings() {
+        
+        settingsList = new ArrayList<SettingsTypes.Setting>();
+
+        // Settings from ConfigPanelExtension
+
+        // TODO: These properties should move out of the core into someplace
+        // specific to the Java importer
+        List<String> options = new ArrayList<String>();
+        options.add(Translator.localize("action.import-java-UML-attr"));
+        options.add(Translator.localize("action.import-java-UML-assoc"));
+
+        int selected;
+        String modelattr = Configuration
+                .getString(KEY_IMPORT_EXTENDED_MODEL_ATTR, "0");
+        selected = Integer.parseInt(modelattr);
+
+        attributeSetting = new Setting.UniqueSelection(Translator
+                .localize("action.import-java-attr-model"), options,
+                selected);
+        settingsList.add(attributeSetting);
+
+        options.clear();
+        options.add(Translator
+                .localize("action.import-java-array-model-datatype"));
+        options.add(Translator
+                .localize("action.import-java-array-model-multi"));
+
+        String modelarrays = Configuration
+                .getString(KEY_IMPORT_EXTENDED_MODEL_ARRAYS, "0");
+        selected = Integer.parseInt(modelarrays);
+
+        datatypeSetting = new Setting.UniqueSelection(Translator
+                .localize("action.import-java-array-model"), options,
+                selected);
+        settingsList.add(datatypeSetting);
+
+        List<String> paths = new ArrayList<String>();
+        URL[] urls = ImportClassLoader.getURLs(Configuration.getString(
+                Argo.KEY_USER_IMPORT_CLASSPATH, ""));
+
+        for (URL url : urls) {
+            paths.add(url.getFile());
+        }
+        pathlistSetting = new Setting.PathListSelection(Translator
+                .localize("dialog.import.classpath.title"), Translator
+                .localize("dialog.import.classpath.text"), paths);
+        settingsList.add(pathlistSetting);
+
+        
+        return settingsList;
+    }
+    
+
+    private void updateImportClassloader() {
+        List<String> pathList = pathlistSetting.getPathList();
+        URL[] urls = new URL[pathList.size()];
+
+        int i = 0;
+        for (String path : pathlistSetting.getPathList()) {
+            try {
+                urls[i++] = new File(path).toURI().toURL();
+            } catch (MalformedURLException e) {
+                LOG.error("Bad path in classpath " + path);
+            }
+        }
+
+        try {
+            ImportClassLoader.getInstance(urls);
+            ImportClassLoader.getInstance().saveUserPath();
+        } catch (MalformedURLException e) {
+
+        }
     }
 
+    /**
+     * Only intended for use in the Java classfile importer.
+     * 
+     * @return true if references should be modeled as UML Attributes instead of
+     *         UML Associations.
+     */
+    public boolean isAttributeSelected() {        
+        return attributeSetting.getSelection() == 0;
+    }
+    
+    /**
+     * Only intended for use in the Java classfile importer
+     * 
+     * @return true if arrays should be modeled as datatypes instead of using
+     *         UML's multiplicities.
+     */
+    public boolean isDatatypeSelected() {
+        return datatypeSetting.getSelection() == 0;
+    }
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java	2008-07-07 12:54:30-0700
@@ -43,7 +43,6 @@
 import org.argouml.ocl.OCLUtil;
 import org.argouml.uml.reveng.ImportCommon;
 import org.argouml.uml.reveng.ImportInterface;
-import org.argouml.uml.reveng.ImportSettings;
 
 /**
  * Modeller maps Java source code(parsed/recognised by ANTLR) to UML model
@@ -139,7 +138,6 @@
      */
     private boolean generateNames = true;
     
-
     /**
      * Create a new modeller.
      *
@@ -147,11 +145,12 @@
      * @param settings the settings to use for this import
      * @param theFileName the current file name
      */
-    public Modeller(Object theModel, ImportSettings settings, 
+    public Modeller(Object theModel, boolean attributeSelected,
+            boolean datatypeSelected,
             String theFileName) {
         model = theModel;
-        noAssociations = settings.isAttributeSelected();
-        arraysAsDatatype = settings.isDatatypeSelected();
+        noAssociations = attributeSelected;
+        arraysAsDatatype = datatypeSelected;
         currentPackage = this.model;
         newElements = new HashSet<Object>();
         parseState = new ParseState(this.model, getPackage(JAVA_PACKAGE));
@@ -794,6 +793,7 @@
                          short modifiers,
                          String javadoc,
                          boolean forceIt) {
+        // TODO: Not implemented
         logError( "Java 5 annotation definitions not supported", "@" + name);
     }
     
@@ -803,6 +803,7 @@
      * @param name identifier for annotation.
      */
     void addAnnotation(String name) {
+        // TODO: Not implemented
         logError( "Java 5 annotations not supported", "@" + name);
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java	2008-07-07 12:54:30-0700
@@ -1,165 +1,125 @@
+// $Id$
+// Copyright (c) 1996-2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
 package org.argouml.uml.reveng.ui;
 
 import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
+import java.awt.Frame;
 import java.awt.GridLayout;
-import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.File;
-import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.DefaultListModel;
 import javax.swing.JButton;
-import javax.swing.JDialog;
 import javax.swing.JFileChooser;
+import javax.swing.JLabel;
 import javax.swing.JList;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 
-import org.apache.log4j.Logger;
-import org.argouml.application.api.Argo;
-import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
-import org.argouml.uml.reveng.ImportClassLoader;
-import org.argouml.uml.reveng.ImportCommandInterface;
+import org.argouml.uml.reveng.SettingsTypes.PathListSelection;
 import org.tigris.gef.base.Globals;
 
 /**
- * dialog to setup the import classpath.
+ * Panel to collect a list of paths for an importer. <em>NOTE:</em> Although
+ * this class is public it is <em>only</em> intended for use by the package
+ * org.argouml.reveng.
+ * <p>
+ * This was originally included in Import.java and was called
+ * ImportClasspathDialog.
  */
-public class ImportClasspathDialog extends JDialog {
+public class ImportClasspathDialog extends JPanel {
 
-    /**
-     * Logger.
-     */
-    private static final Logger LOG =
-        Logger.getLogger(ImportClasspathDialog.class);
-
-    private JDialog importClasspathDialog;
     private JList paths;
+
     private DefaultListModel pathsModel;
 
-    private JButton addFile;
+    private JButton addButton;
 
-    private JButton removeFile;
+    private JButton removeButton;
 
-    private JButton ok;
+    private JFileChooser chooser;
     
-    private Component parent;
+    private PathListSelection setting;
 
-    private ImportCommandInterface importCmd;
 
     /**
-     * Construct a dialog to allow the user to set up the classpath for the
-     * import.
+     * Construct a panel which provides controls for populating a list of 
+     * paths.  This can be used for a Java classpath, C++ include path, etc.
+     * 
+     * @param pathListSetting the settings object for this pathlist
      */
-    public ImportClasspathDialog(Component comp,
-            ImportCommandInterface impCmd) {
-
+    public ImportClasspathDialog(PathListSelection pathListSetting) {
         super();
-        importClasspathDialog = this;
-        setTitle(Translator.localize("dialog.import.classpath.title"));
-        parent = comp;
-        importCmd = impCmd;
-
-        Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
-        getContentPane().setLayout(new BorderLayout(0, 0));
-
-        // Explanatory text
-        JTextArea ta =
-                new JTextArea(Translator
-                        .localize("dialog.import.classpath.text"));
-        ta.setLineWrap(true);
-        ta.setWrapStyleWord(true);
-        ta.setFocusable(false);
-        getContentPane().add(ta, BorderLayout.NORTH);
+        setting = pathListSetting;
+        setToolTipText(setting.getDescription());
+        
+        setLayout(new BorderLayout(0, 0));
+
+        JLabel label = new JLabel(setting.getLabel());
+        add(label, BorderLayout.NORTH);
 
-        // paths list
         pathsModel = new DefaultListModel();
+        for (String path : setting.getDefaultPathList()) {
+            pathsModel.addElement(path);
+        }
+        
         paths = new JList(pathsModel);
         paths.setVisibleRowCount(5);
+        paths.setToolTipText(setting.getDescription());
         JScrollPane listScroller = new JScrollPane(paths);
-        listScroller.setPreferredSize(new Dimension(300, 100));
-        getContentPane().add(listScroller, BorderLayout.CENTER);
-
-        initList();
+        add(listScroller, BorderLayout.CENTER);
 
-        // controls
+        // panel for controls
         JPanel controlsPanel = new JPanel();
-        controlsPanel.setLayout(new GridLayout(0, 3));
-        addFile = new JButton(Translator.localize("button.add"));
-        removeFile = new JButton(Translator.localize("button.remove"));
-        ok = new JButton(Translator.localize("button.ok"));
-        controlsPanel.add(addFile);
-        controlsPanel.add(removeFile);
-        controlsPanel.add(ok);
-        getContentPane().add(controlsPanel, BorderLayout.SOUTH);
-
-        addFile.addActionListener(new AddListener());
-        removeFile.addActionListener(new RemoveListener());
-        ok.addActionListener(new OkListener());
-
-        //Display the window.
-        Dimension contentPaneSize = getContentPane().getPreferredSize();
-        setLocation(scrSize.width / 2 - contentPaneSize.width / 2,
-            scrSize.height / 2 - contentPaneSize.height / 2);
-        pack();
-        ok.requestFocusInWindow();
-        setVisible(true);
-        this.setModal(true);        //MVW   Issue 2539.
+        controlsPanel.setLayout(new GridLayout(0, 2, 50, 0));
+        
+        addButton = new JButton(Translator.localize("button.add"));
+        controlsPanel.add(addButton);
+        addButton.addActionListener(new AddListener());
+        
+        removeButton = new JButton(Translator.localize("button.remove"));
+        controlsPanel.add(removeButton);
+        removeButton.addActionListener(new RemoveListener());
+        
+        // TODO: Add Up/Down buttons to control the ordering of items
+        
+        add(controlsPanel, BorderLayout.SOUTH);
     }
 
-    private void initList() {
 
-        URL[] urls =
-            ImportClassLoader.getURLs(Configuration.getString(
-                Argo.KEY_USER_IMPORT_CLASSPATH, ""));
-
-        for (int i = 0; i < urls.length; i++) {
-            pathsModel.addElement(urls[i].getFile());
-        }
-
-        paths.setSelectedIndex(0);
-    }
-
-
-    class OkListener implements ActionListener {
-        /*
-         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-         */
-        public void actionPerformed(ActionEvent e) {
-            try {
-                URL[] urls = new URL[pathsModel.size()];
-                for (int i = 0; i < urls.length; i++) {
-                    try {
-                        urls[i] = new File((String) pathsModel.get(i)).toURI()
-                                .toURL();
-                    } catch (Exception e1) {
-                        LOG.warn("could not do ok: could not make"
-                                + "url " + pathsModel.get(i) + ", " + e1,
-                                e1);
-                    }
-                }
-
-                try {
-                    ImportClassLoader.getInstance(urls);
-                    ImportClassLoader.getInstance().saveUserPath();
-                } catch (Exception e1) {
-                    LOG.warn("could not do ok", e1);
-                }
-                setVisible(false);
-                setModal(false);
-                dispose();
-                importCmd.execute();
-            } finally {
-                setVisible(false);
-                setModal(false);
-                dispose();
-            }
+    private void updatePathList() {
+        List<String> pathList = new ArrayList<String>();
+        for (int i = 0; i < pathsModel.size(); i++) {
+            String path = (String) pathsModel.getElementAt(i);
+            pathList.add(path);
         }
+        setting.setPathList(pathList);
     }
 
     class RemoveListener implements ActionListener {
@@ -171,12 +131,16 @@
             //there's a valid selection
             //so go ahead and remove whatever's selected.
             int index = paths.getSelectedIndex();
+            if (index < 0) {
+                return;
+            }
             pathsModel.remove(index);
+            updatePathList();
 
             int size = pathsModel.getSize();
 
             if (size == 0) { //nothings left, disable firing.
-                removeFile.setEnabled(false);
+                removeButton.setEnabled(false);
 
             } else { //Select an index.
                 if (index == pathsModel.getSize()) {
@@ -188,6 +152,7 @@
                 paths.ensureIndexIsVisible(index);
             }
         }
+
     }
 
 
@@ -197,39 +162,37 @@
          */
         public void actionPerformed(ActionEvent e) {
 
-            String directory = Globals.getLastDirectory();
-            JFileChooser ch = new JFileChooser(directory);
-            if (ch == null) {
-                ch = new JFileChooser();
-            }
-
-            final JFileChooser chooser = ch;
-
-            chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+            if (chooser == null ) {
+                chooser = new JFileChooser(Globals.getLastDirectory()); 
+                if (chooser == null) {
+                    chooser = new JFileChooser();
+                }
 
-            chooser.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent e1) {
-                    if (e1.getActionCommand().equals(
-                            JFileChooser.APPROVE_SELECTION)) {
-                        File theFile = chooser.getSelectedFile();
-                        if (theFile != null) {
-                            pathsModel.addElement(theFile.toString());
+                chooser.setFileSelectionMode(
+                        JFileChooser.FILES_AND_DIRECTORIES);
+                chooser.setMultiSelectionEnabled(true);
+                chooser.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e1) {
+                        if (e1.getActionCommand().equals(
+                                JFileChooser.APPROVE_SELECTION)) {
+                            File[] files = chooser.getSelectedFiles();
+                            for (File theFile : files) {
+                                if (theFile != null) {
+                                    pathsModel.addElement(theFile.toString());
+                                }
+                            }
+                            updatePathList();
+                        } else if (e1.getActionCommand().equals(
+                                JFileChooser.CANCEL_SELECTION)) {
+                            // Just quit
                         }
-                    } else if (e1.getActionCommand().equals(
-                            JFileChooser.CANCEL_SELECTION)) {
-                        // TODO: What shall we do here?
+
                     }
-                    // bring the import classpath dialog to the front
-                    importClasspathDialog.setVisible(true);
-                }
-            });
+                });
+            }
 
-            chooser.showOpenDialog(parent);
+            chooser.showOpenDialog(new Frame());
         }
     }
 
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -8684620532717336574L;
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java	2008-07-07 12:54:30-0700
@@ -56,14 +56,12 @@
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
-import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.ui.CheckboxTableModel;
 import org.argouml.ui.explorer.ExplorerEventAdaptor;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.diagram.DiagramFactory;
-import org.argouml.uml.diagram.UMLMutableGraphSupport;
 import org.argouml.uml.diagram.DiagramFactory.DiagramType;
 import org.argouml.uml.diagram.sequence.MessageNode;
 import org.argouml.uml.diagram.sequence.SequenceDiagramGraphModel;
@@ -80,6 +78,7 @@
 import org.tigris.gef.base.Editor;
 import org.tigris.gef.base.Globals;
 import org.tigris.gef.base.Mode;
+import org.tigris.gef.graph.MutableGraphModel;
 import org.tigris.gef.presentation.Fig;
 
 /**
@@ -92,6 +91,7 @@
  * At the very least split dialog from processing and remove knowledge
  * of sequence diagram implementation<p>
  * TODO: work with import modules instead of the internal Java import<p>
+ * TODO: use java5 style for loops
  * TODO: i18n<p>
  */
 public class RESequenceDiagramDialog
@@ -102,11 +102,24 @@
      */
     private static final Logger LOG =
         Logger.getLogger(RESequenceDiagramDialog.class);
+    
+    /**
+     * The UID.
+     */
+    private static final long serialVersionUID = -8595714827064181907L;
 
     private static final int X_OFFSET = 10;
 
+    /**
+     * The project this dialog is operating within
+     */
+    private final Project project;
+    
     private final Object model;
+    
+    // TODO: Why is this not final?
     private Modeller modeller;
+    
     private final Object classifier;
     private final Object operation;
     
@@ -118,11 +131,7 @@
     private final List<String> calldata = new ArrayList<String>();
     private final Hashtable types = new Hashtable();
     
-    // TODO: We possibly have more state than we need here. Can we have diagram
-    // only? graphModel and collaboration can be deduced from that.
-    private ArgoDiagram diagram;
-    private UMLMutableGraphSupport graphModel;
-    private Object collaboration;
+    private final ArgoDiagram diagram;
     
     private CheckboxTableModel callTable;
     private JComboBox modeChoice;
@@ -142,8 +151,8 @@
      *
      * @param oper The operation that should be reverse engineered.
      */
-    public RESequenceDiagramDialog(Object oper) {
-        this(oper, null);
+    public RESequenceDiagramDialog(Project project, Object oper) {
+        this(project, oper, null, null);
     }
 
     /**
@@ -151,10 +160,16 @@
      * the actual diagram is a sequence diagram, so no new one is created and
      * the work happens in the actual sequence diagram.
      *
+     * @param project The project this dialog is acting within
      * @param oper The operation that should be reverse engineered.
      * @param figMessage the message figure where the result will be drawn to
+     * @param diagram the diagram to draw to or null is a new diagram required
      */
-    public RESequenceDiagramDialog(Object oper, FigMessage figMessage) {
+    public RESequenceDiagramDialog(
+            final Project project,
+            final Object oper, 
+            final FigMessage figMessage,
+            final ArgoDiagram diagram) {
         // TODO: don't depend on a Fig (but it is needed to extend an existing
         // sequence diagram, i.e. to perform an action on a FigMessage!) 
         super(
@@ -167,59 +182,51 @@
                 ArgoDialog.OK_CANCEL_OPTION,
                 true);
         setResizable(false);
+        this.project = project;
+        
+        SequenceDiagramLayer layer = (SequenceDiagramLayer) diagram.getLayer();
 
         operation = oper;
-        model = ProjectManager.getManager().getCurrentProject().getModel();
+        model = project.getModel();
         try {
             // TODO: must not depend on the Java modeller, but the needed one
             // must be either derived from the method's notation, or chosen by
             // the user from a list of available language importers
-            modeller = new Modeller(model, new DummySettings(), null);
+            modeller = new Modeller(model, true, true, null);
         } catch (Exception ex) { 
             // the only chance we have is to finish the current operation
             LOG.warn("Modeller not ready, so no more generation of calls", ex);
+            // TODO: Why do we continue here as if nothing has gone wrong?
+            // Can we really continue correctly without a modeller?
         }
 
         classifier = Model.getFacade().getOwner(operation);
         if (figMessage != null) {
+            this.diagram = diagram;
             isNewSequenceDiagram = false;
-            SequenceDiagramGraphModel sequenceDiagramGraphModel = 
-                (SequenceDiagramGraphModel) Globals.curEditor().getGraphModel();
-            graphModel = sequenceDiagramGraphModel;
-            collaboration = sequenceDiagramGraphModel.getCollaboration();
-            // TODO: implement an easier way than this to find
-            // the current diagram:
-            Project p = ProjectManager.getManager().getCurrentProject();
-            Iterator<ArgoDiagram> iter = p.getDiagramList().iterator();
-            while (iter.hasNext()) {
-                diagram = iter.next();
-                if (graphModel == diagram.getGraphModel()) {
-                    break;
-                }
-            }
-            figClassifierRole = getClassifierRole(classifier, "obj");
+            figClassifierRole = getFigClassifierRole(classifier, "obj");
             // TODO: There is only a single port on new implementation of SD
             // so how do we resolve this?
             portCnt =
-                SequenceDiagramLayer.getNodeIndex(
+                layer.getNodeIndex(
                     figMessage.getDestMessageNode().getFigMessagePort().getY());
             Iterator<Fig> it = diagram.getFigIterator();
             while (it.hasNext()) {
                 Fig f = it.next();
-                // TODO: Test fig owner type rather than Fig class type
-                if (f instanceof FigClassifierRole) {
+                Object modelElement = f.getOwner();
+                
+                if (Model.getFacade().isAClassifierRole(modelElement)) {
                     int x = f.getX();
                     if (maxXPos < x) {
                         maxXPos = x;
                     }
-                    if (Model.getFacade().getName(f.getOwner())
+                    if (Model.getFacade().getName(modelElement)
                             .startsWith("anon")) {
                         anonCnt++;
                     }
-                    // TODO: Test fig owner type rather than Fig class type
-                } else if (f instanceof FigMessage) {
+                } else if (Model.getFacade().isAMessage(modelElement)) {
                     int port =
-                        SequenceDiagramLayer.getNodeIndex(
+                        layer.getNodeIndex(
                             ((FigMessage) f).getDestMessageNode()
                                 .getFigMessagePort().getY());
                     if (maxPort < port) {
@@ -229,8 +236,8 @@
             }
         } else {
             isNewSequenceDiagram = true;
-            diagram = buildSequenceDiagram(classifier);
-            figClassifierRole = getClassifierRole(classifier, "obj");
+            this.diagram = buildSequenceDiagram(classifier);
+            figClassifierRole = getFigClassifierRole(classifier, "obj");
             maxXPos = figClassifierRole.getX();
         }
         parseBody();
@@ -248,26 +255,29 @@
         if (e.getSource() == getOkButton()) {
             for (int i = 0; i < callTable.getRowCount(); i++) {
                 if (Boolean.TRUE.equals(callTable.getValueAt(i, 1))) {
-                    buildAction((String) callTable.getValueAt(i, 0));
+                    buildAction(
+                            (String) callTable.getValueAt(i, 0), 
+                            figClassifierRole, 
+                            figClassifierRole);
                 }
             }
         } else if (e.getSource() == getCancelButton()
                 && isNewSequenceDiagram) {
             // remove SD and clean up everything
-            Project p = ProjectManager.getManager().getCurrentProject();
             Object newTarget = null;
             if (ActionDeleteModelElements.sureRemove(diagram)) {
+                Object collaboration = diagram.getNamespace();
                 // remove from the model
                 newTarget = getNewTarget(diagram);
-                p.moveToTrash(diagram);
-                p.moveToTrash(collaboration);
+                project.moveToTrash(diagram);
+                project.moveToTrash(collaboration);
             }
             if (newTarget != null) {
                 TargetManager.getInstance().setTarget(newTarget);
             }
         }
     }
-
+    
     /*
      * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
      */
@@ -291,7 +301,6 @@
      * @return The object.
      */
     private Object getNewTarget(Object target) {
-        Project p = ProjectManager.getManager().getCurrentProject();
         Object newTarget = null;
         if (target instanceof Fig) {
             // TODO: common method for getting the model element of a fig
@@ -301,18 +310,18 @@
                 && Model.getFacade().getNamespace(target) != null) {
             newTarget = Model.getFacade().getNamespace(target);
         } else if (target instanceof Diagram) {
-            Diagram firstDiagram = (Diagram) p.getDiagramList().get(0);
+            Diagram firstDiagram = (Diagram) project.getDiagramList().get(0);
             if (target != firstDiagram) {
                 newTarget = firstDiagram;
             } else {
-                if (p.getDiagramList().size() > 1) {
-                    newTarget = p.getDiagramList().get(1);
+                if (project.getDiagramList().size() > 1) {
+                    newTarget = project.getDiagramList().get(1);
                 } else {
-                    newTarget = p.getRoot();
+                    newTarget = project.getRoot();
                 }
             }
         } else {
-            newTarget = p.getRoot();
+            newTarget = project.getRoot();
         }
         return newTarget;
     }
@@ -494,21 +503,18 @@
      * TODO: find a better place for a similar method.
      */
     private ArgoDiagram buildSequenceDiagram(Object theClassifier) {
-        Project p = ProjectManager.getManager().getCurrentProject();
-
-        collaboration =
+        Object collaboration =
             Model.getCollaborationsFactory().buildCollaboration(
                 Model.getFacade().getNamespace(theClassifier),
                 theClassifier);
-        final ArgoDiagram diagram =
+        final ArgoDiagram newDiagram =
             DiagramFactory.getInstance().createDiagram(
                 DiagramType.Sequence,
                 collaboration,
                 null);
-        graphModel = (SequenceDiagramGraphModel) diagram.getGraphModel();
-        p.addMember(diagram);
-        TargetManager.getInstance().setTarget(diagram);
-        return diagram;
+        project.addMember(newDiagram);
+        TargetManager.getInstance().setTarget(newDiagram);
+        return newDiagram;
     }
 
     /**
@@ -517,8 +523,9 @@
      * TODO: Hide this method elsewhere and use it in the implementation of a
      * to be defined method (see usage of this method in this class)
      */
-    private FigClassifierRole getClassifierRole(
-            Object theClassifier, String objName) {
+    private FigClassifierRole getFigClassifierRole(
+            Object theClassifier,
+            String objName) {
         FigClassifierRole crFig = null;
         // first check if the fig of the classifier role already exists
         Collection coll = diagram.getLayer().getContents();
@@ -527,38 +534,47 @@
             Object fig = iter.next();
             if (fig instanceof FigClassifierRole) {
                 Object elem = ((FigClassifierRole) fig).getOwner();
-                Collection bases = Model.getFacade().getBases(elem);
-                if (Model.getFacade().isAClassifierRole(elem)
-                     && Model.getFacade().getName(elem).equals(objName)
-                     && bases != null && bases.contains(theClassifier)) {
-                    // yes found, so this will be returned
-                    crFig = (FigClassifierRole) fig;
-                    break;
+                // TODO: Do we really need to test for name here if we know we
+                // have the right classifier role?
+                if (Model.getFacade().getName(elem).equals(objName)) {
+                    final Collection bases = Model.getFacade().getBases(elem);
+                    // TODO: Do we really have to test for null here? I suspect
+                    // not, I'd expect an empty collection.
+                    if (bases != null && bases.contains(theClassifier)) {
+                        // yes found, so this will be returned
+                        crFig = (FigClassifierRole) fig;
+                        break;
+                    }
                 }
             }
         }
         if (crFig == null) {
             // classifier role does not exists, so create a new one
-            Object node =
+            Object newClassifierRole =
                 Model.getCollaborationsFactory()
-                    .buildClassifierRole(collaboration);
+                    .buildClassifierRole(diagram.getNamespace());
             if (objName != null) {
-                Model.getCoreHelper().setName(node, objName);
+                Model.getCoreHelper().setName(newClassifierRole, objName);
             } else {
-                Model.getCoreHelper().setName(node, "anon" + (++anonCnt));
+                // TODO: I don't think it's normal to generate model element
+                // names
+                Model.getCoreHelper().setName(newClassifierRole, "anon" + (++anonCnt));
             }
             coll = new ArrayList();
             coll.add(theClassifier);
-            Model.getCollaborationsHelper().setBases(node, coll);
-            crFig = new FigClassifierRole(node);
+            Model.getCollaborationsHelper().setBases(newClassifierRole, coll);
+            crFig = new FigClassifierRole(newClassifierRole);
 
             // location must be set for correct automatic layouting (how funny)
             // otherwise, the new classifier role is not the rightmost
             maxXPos += X_OFFSET;
             crFig.setLocation(maxXPos, 0);
 
+            // TODO: Do we need to do both of these?
             diagram.add(crFig);
-            graphModel.addNode(node);
+            ((MutableGraphModel)
+                    (diagram.getGraphModel())).addNode(newClassifierRole);
+            
             // TODO: Send event instead of calling event adapter directly
             ExplorerEventAdaptor.getInstance().modelElementChanged(
                 Model.getFacade().getNamespace(classifier));
@@ -629,7 +645,10 @@
      * classifier role (if not existing).
      * TODO: Put a similar method in a to be defined interface.
      */
-    private void buildAction(String call) {
+    private void buildAction(
+            String call, 
+            FigClassifierRole startFig, 
+            FigClassifierRole endFig) {
         StringBuffer sb = new StringBuffer(call);
         int findpos = sb.lastIndexOf(".");
         int createPos = sb.indexOf("new ");
@@ -638,14 +657,14 @@
             && (createPos == 0 || sb.charAt(createPos - 1) == '=');
         if (!isCreate && findpos == -1) {
             // call of a method of the class
-            buildEdge(call, figClassifierRole, figClassifierRole,
+            buildEdge(call, startFig, endFig,
                     Model.getMetaTypes().getCallAction());
         } else if (!isCreate
                 && findpos <= 5
                 && (call.startsWith("super.") || call.startsWith("this."))) {
             // also call of a method of the class,
             // but prefixed with "super." or "this."
-            buildEdge(call, figClassifierRole, figClassifierRole,
+            buildEdge(call, startFig, endFig,
                     Model.getMetaTypes().getCallAction());
         } else {
             String type = null;
@@ -655,20 +674,20 @@
                 String objName =
                     createPos >= 2 ? sb.substring(0, createPos - 1) : null;
                 Object cls = getClassifierFromModel(type, objName);
-                FigClassifierRole endFig = getClassifierRole(cls, objName);
                 buildEdge(
                         sb.substring(createPos),
-                        figClassifierRole,
-                        endFig,
+                        startFig,
+                        getFigClassifierRole(cls, objName),
                         Model.getMetaTypes().getCreateAction());
             } else {
                 String teststring = call.substring(0, findpos);
                 type = (String) types.get(teststring);
                 if (type != null) {
                     Object cls = getClassifierFromModel(type, teststring);
-                    FigClassifierRole endFig =
-                        getClassifierRole(cls, teststring);
-                    buildEdge(call, figClassifierRole, endFig,
+                    buildEdge(
+                            call, 
+                            startFig, 
+                            getFigClassifierRole(cls, teststring),
                             Model.getMetaTypes().getCallAction());
                 }
             }
@@ -717,6 +736,8 @@
         Mode mode = ce.getModeManager().top();
         mode.setArgs(args);
         
+        SequenceDiagramGraphModel graphModel =
+            (SequenceDiagramGraphModel) diagram.getGraphModel();
         Object newEdge = graphModel.connect(startPort, foundPort, messageType);
         if (null != newEdge) {
             Model.getCoreHelper().setName(newEdge, call);
@@ -741,7 +762,9 @@
      * interface.
      * TODO: objName is not used. Are there plans for this?
      */
-    private Object getClassifierFromModel(String type, String objName) {
+    private Object getClassifierFromModel(
+            final String type,
+            final String objName) {
         Object theClassifier = null;
         int pos = type.lastIndexOf(".");
         if (pos != -1) {
@@ -853,11 +876,15 @@
         Object theClassifier = null;
         // TODO: This could use the new CoreHelper.getPackageImports()
         Collection cdeps = Model.getFacade().getClientDependencies(comp);
+        // TODO: Do we really need to test for null here?
+        // We should get empty collections.
         Iterator iter1 = cdeps != null ? cdeps.iterator() : null;
         while (theClassifier == null && iter1 != null && iter1.hasNext()) {
             Object perm = iter1.next();
             if (Model.getFacade().isAPermission(perm)) {
                 Collection suppliers = Model.getFacade().getSuppliers(perm);
+                // TODO: Do we really need to test for null here?
+                // We should get empty collections.
                 Iterator iter2 =
                     suppliers != null ? suppliers.iterator() : null;
                 while (theClassifier == null
@@ -879,39 +906,4 @@
         return theClassifier;
     }
 
-    /**
-     * Fixed import settings class for our use.
-     */
-    private class DummySettings implements ImportSettings {
-
-        public int getImportLevel() {
-            return ImportSettings.DETAIL_CLASSIFIER;
-        }
-
-        public String getInputSourceEncoding() {
-            return null;
-        }
-
-        public boolean isAttributeSelected() {
-            return true;
-        }
-
-        public boolean isCreateDiagramsSelected() {
-            return false;
-        }
-
-        public boolean isDatatypeSelected() {
-            return true;
-        }
-
-        public boolean isMinimizeFigsSelected() {
-            return false;
-        }
-        
-    }
-    
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -8595714827064181907L;
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -55,22 +55,14 @@
      * @return the newly created and initialized diagram
      */
     protected ArgoDiagram createDiagram(Object namespace) {
-        Object target = TargetManager.getInstance().getModelTarget();
-        Object graph = null;
-
-        if (Model.getActivityGraphsHelper().isAddingActivityGraphAllowed(
-                target)) {
-            /* The target is a valid context */
-            graph = Model.getActivityGraphsFactory().buildActivityGraph(target);
-        } else {
-            graph = Model.getActivityGraphsFactory().createActivityGraph();
-            if (Model.getFacade().isANamespace(target)) {
-                namespace = target;
-            }
-            Model.getCoreHelper().setNamespace(graph, namespace);
-            Model.getStateMachinesFactory()
-                .buildCompositeStateOnStateMachine(graph);
-        }
+        Object context = TargetManager.getInstance().getModelTarget();
+        
+        if (!Model.getActivityGraphsHelper().isAddingActivityGraphAllowed(
+                context)) {
+            context = namespace;
+        } 
+        Object graph = 
+            Model.getActivityGraphsFactory().buildActivityGraph(context);
 
         return DiagramFactory.getInstance().createDiagram(
                 DiagramFactory.DiagramType.Activity,

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionRESequenceDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionRESequenceDiagram.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionRESequenceDiagram.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionRESequenceDiagram.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionRESequenceDiagram.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionRESequenceDiagram.java	2008-07-07 12:54:30-0700
@@ -31,10 +31,15 @@
 import javax.swing.AbstractAction;
 
 import org.argouml.i18n.Translator;
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.sequence.SequenceDiagramGraphModel;
 import org.argouml.uml.diagram.sequence.ui.FigMessage;
 import org.argouml.uml.reveng.ui.RESequenceDiagramDialog;
+import org.tigris.gef.base.Globals;
 
 /**
  * Action to reverse engineer a sequence diagram from the operation bodies.
@@ -42,6 +47,11 @@
 public class ActionRESequenceDiagram extends AbstractAction {
 
     /**
+     * The UID.
+     */
+    private static final long serialVersionUID = 2915509413708666273L;
+
+    /**
      * The constructor. If a figure is given, then it is invoked inside of a
      * sequence diagram, so it will work with this diagram. If figure is null,
      * then this causes the creation of a new sequence diagram.
@@ -64,38 +74,52 @@
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
      */
     public void actionPerformed(ActionEvent e) {
-        Object obj = TargetManager.getInstance().getTarget();
-        if (Model.getFacade().isAOperation(obj)) {
-            RESequenceDiagramDialog dialog = new RESequenceDiagramDialog(obj);
+        Project project = ProjectManager.getManager().getCurrentProject();
+        final Object target = TargetManager.getInstance().getTarget();
+        if (Model.getFacade().isAOperation(target)) {
+            RESequenceDiagramDialog dialog =
+                new RESequenceDiagramDialog(project, target);
             dialog.setVisible(true);
-        } else if (Model.getFacade().isAMessage(obj) && messageFig != null) {
-            Object ac = Model.getFacade().getAction(obj);
-            Object op =
-                Model.getFacade().isACallAction(ac)
-                ? Model.getFacade().getOperation(ac)
-                        : null;
-            if (op != null) {
+        } else if (Model.getFacade().isAMessage(target) && messageFig != null) {
+            final Object action = Model.getFacade().getAction(target);
+            final SequenceDiagramGraphModel sequenceDiagramGraphModel = 
+                (SequenceDiagramGraphModel) Globals.curEditor().getGraphModel();
+            ArgoDiagram diagram = null;
+            Iterator<ArgoDiagram> iter = project.getDiagramList().iterator();
+            while (iter.hasNext()) {
+                diagram = iter.next();
+                if (sequenceDiagramGraphModel == diagram.getGraphModel()) {
+                    break;
+                }
+            }
+            if (Model.getFacade().isACallAction(action)) {
+                final Object operation = Model.getFacade().getOperation(action);
                 // it is highly desirable that the message action
                 // already knows it's operation
-                RESequenceDiagramDialog dialog =
-                    // TODO: There is a cyclic dependency between 
-                    // ActionRESequenceDiagram and FigMessage
-                    new RESequenceDiagramDialog(op, (FigMessage) messageFig);
+                // TODO: There is a cyclic dependency between 
+                // ActionRESequenceDiagram and FigMessage
+                RESequenceDiagramDialog dialog = new RESequenceDiagramDialog(
+                        project,
+                        operation, 
+                        (FigMessage) messageFig, 
+                        diagram);
                 dialog.setVisible(true);
             } else {
                 // the hard way: try to determine the operation
                 // from the message name
-                Object receiver = Model.getFacade().getReceiver(obj);
-                Collection c =
+                final Object receiver = Model.getFacade().getReceiver(target);
+                // TODO: Do we really need to test for null here? I would
+                // expect an empty array which is safe.
+                final Collection c =
                     receiver != null
                     ? Model.getFacade().getBases(receiver)
                             : null;
-                Object cls =
+                final Object cls =
                     c != null && !c.isEmpty() ? c.iterator().next() : null;
                 if (cls != null && Model.getFacade().isAClassifier(cls)) {
                     // too primitive (just gets the first method
                     // with matching name)
-                    String opName = Model.getFacade().getName(obj);
+                    String opName = Model.getFacade().getName(target);
                     int pos1 = opName.lastIndexOf(".");
                     int pos2 = opName.lastIndexOf("(");
                     if (pos1 == -1) {
@@ -106,16 +130,18 @@
                     }
                     pos2 = pos2 != -1 ? pos2 : opName.length();
                     opName = opName.substring(pos1, pos2);
-                    c = Model.getCoreHelper().getOperationsInh(cls);
-                    Iterator iter = c != null ? c.iterator() : null;
-                    while (iter != null && iter.hasNext()) {
-                        op = iter.next();
-                        if (opName.equals(Model.getFacade().getName(op))) {
+                    
+                    for (Object operation : Model.getCoreHelper().getOperationsInh(cls)) {
+                        if (opName.equals(
+                                Model.getFacade().getName(operation))) {
                             // TODO: There is a cyclic dependency between 
                             // ActionRESequenceDiagram and FigMessage
                             RESequenceDiagramDialog dialog =
-                                new RESequenceDiagramDialog(op,
-                                        (FigMessage) messageFig);
+                                new RESequenceDiagramDialog(
+                                        project,
+                                        operation,
+                                        (FigMessage) messageFig,
+                                        diagram);
                             dialog.setVisible(true);
                             break;
                         }
@@ -135,10 +161,6 @@
             || Model.getFacade().isAMessage(target);
     }
 
+    // TODO: We later cast this to FigMessage so why define as Object here?
     private Object messageFig;
-
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = 2915509413708666273L;
 } 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java	2008-07-07 12:54:30-0700
@@ -36,17 +36,19 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.application.api.CommandLineInterface;
+import org.argouml.application.events.ArgoEventPump;
+import org.argouml.application.events.ArgoEventTypes;
+import org.argouml.application.events.ArgoStatusEvent;
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.ui.ExceptionDialog;
-import org.argouml.ui.ProjectBrowser;
 import org.argouml.util.ArgoFrame;
 import org.argouml.util.SuffixFilter;
-import org.tigris.gef.base.SaveGraphicsAction;
 import org.tigris.gef.base.Diagram;
+import org.tigris.gef.base.SaveGraphicsAction;
 import org.tigris.gef.util.Util;
 
 
@@ -177,8 +179,9 @@
         }
 
         if (useUI) {
-            ProjectBrowser.getInstance().showStatus(
-                            "Writing " + theFile + "...");
+            updateStatus(Translator.localize(
+                    "statusmsg.bar.save-graphics-status-writing",
+                    new Object[] {theFile}));
         }
 	if (theFile.exists() && useUI) {
 	    int response = JOptionPane.showConfirmDialog(
@@ -201,10 +204,18 @@
             fo.close();
         }
         if (useUI) {
-            ProjectBrowser.getInstance().showStatus("Wrote " + theFile);
+            updateStatus(Translator.localize(
+                    "statusmsg.bar.save-graphics-status-wrote", 
+                    new Object[] {theFile}));
         }
 	return true;
     }
+    
+    private void updateStatus(String status) {
+        ArgoEventPump.fireEvent(
+                new ArgoStatusEvent(ArgoEventTypes.STATUS_TEXT,
+                this, status));
+    }
 
 
     /**

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ElementPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ElementPropPanelFactory.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ElementPropPanelFactory.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ElementPropPanelFactory.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ElementPropPanelFactory.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/ElementPropPanelFactory.java	2008-07-07 12:54:30-0700
@@ -89,7 +89,6 @@
 import org.argouml.uml.ui.foundation.core.PropPanelConstraint;
 import org.argouml.uml.ui.foundation.core.PropPanelDataType;
 import org.argouml.uml.ui.foundation.core.PropPanelDependency;
-import org.argouml.uml.ui.foundation.core.PropPanelElementResidence;
 import org.argouml.uml.ui.foundation.core.PropPanelEnumeration;
 import org.argouml.uml.ui.foundation.core.PropPanelEnumerationLiteral;
 import org.argouml.uml.ui.foundation.core.PropPanelFlow;
@@ -105,7 +104,6 @@
 import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelStereotype;
 import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelTagDefinition;
 import org.argouml.uml.ui.foundation.extension_mechanisms.PropPanelTaggedValue;
-import org.argouml.uml.ui.model_management.PropPanelElementImport;
 import org.argouml.uml.ui.model_management.PropPanelModel;
 import org.argouml.uml.ui.model_management.PropPanelPackage;
 import org.argouml.uml.ui.model_management.PropPanelSubsystem;
@@ -162,10 +160,6 @@
                 return new PropPanelConstraint();
             } else if (Model.getFacade().isAEnumerationLiteral(element)) {
                 return new PropPanelEnumerationLiteral();
-            } else if (Model.getFacade().isAElementImport(element)) {
-                return new PropPanelElementImport();
-            } else if (Model.getFacade().isAElementResidence(element)) {
-                return new PropPanelElementResidence();
             } else if (Model.getFacade().isAExtensionPoint(element)) {
                 return new PropPanelExtensionPoint();
             } else if (Model.getFacade().isAGuard(element)) {
@@ -312,10 +306,10 @@
     
     private PropPanelStateVertex getStateVertexPropPanel(Object element) {
         if (Model.getFacade().isAState(element)) {
-            if (Model.getFacade().isAActionState(element)) {
-                return new PropPanelActionState();
-            } else if (Model.getFacade().isACallState(element)) {
+            if (Model.getFacade().isACallState(element)) {
                 return new PropPanelCallState();
+            } else if (Model.getFacade().isAActionState(element)) {
+                return new PropPanelActionState();
             } else if (Model.getFacade().isACompositeState(element)) {
                 if (Model.getFacade().isASubmachineState(element)) {
                     if (Model.getFacade().isASubactivityState(element)) {

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/InitUmlUI.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/InitUmlUI.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/InitUmlUI.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/InitUmlUI.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/InitUmlUI.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/InitUmlUI.java	2008-07-07 12:54:30-0700
@@ -43,6 +43,10 @@
         /* Set up the property panels for UML elements: */
         PropPanelFactory elementFactory = new ElementPropPanelFactory();
         PropPanelFactoryManager.addPropPanelFactory(elementFactory);
+
+        /* Set up the property panels for other UML objects: */
+        PropPanelFactory umlObjectFactory = new UmlObjectPropPanelFactory();
+        PropPanelFactoryManager.addPropPanelFactory(umlObjectFactory);
     }
 
     public List<AbstractArgoJPanel> getDetailsTabs() {

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/PropPanelFactoryManager.java	2008-07-07 12:54:30-0700
@@ -26,6 +26,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 /**
  * Manager of factories registered in ArgoUML. <p>
@@ -37,14 +38,14 @@
  * @author Michiel
  */
 public class PropPanelFactoryManager {
-    private static Collection<PropPanelFactory> ppfactories = 
+    private static List<PropPanelFactory> ppfactories = 
         new ArrayList<PropPanelFactory>();
     
     /**
      * @param factory add the given factory
      */
     public static void addPropPanelFactory(PropPanelFactory factory) {
-        ppfactories.add(factory);
+        ppfactories.add(0, factory);
     }
     
     /**

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabDocumentation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabDocumentation.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabDocumentation.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabDocumentation.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabDocumentation.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabDocumentation.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -28,6 +28,7 @@
 
 import javax.swing.ImageIcon;
 import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
 import javax.swing.UIManager;
 
 import org.argouml.application.api.Argo;
@@ -37,7 +38,6 @@
 import org.argouml.swingext.UpArrowIcon;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.swidgets.Horizontal;
-import org.tigris.swidgets.LabelledLayout;
 import org.tigris.swidgets.Vertical;
 
 /**
@@ -108,7 +108,7 @@
         addField(Translator.localize("label.see"), spSee);
 
         //make new column with LabelledLayout
-        add(LabelledLayout.getSeperator());
+        add(LabelledLayout.getSeparator());
 
         UMLTextArea2 doc = new UMLTextArea2(
                 new UMLModelElementTaggedValueDocument(Argo.DOCUMENTATION_TAG));
@@ -122,15 +122,7 @@
         // Comment.name text field - editing disabled
         UMLTextArea2 comment = new UMLTextArea2(
                 new UMLModelElementCommentDocument(false));
-        comment.setRows(2);
-        comment.setLineWrap(true);
-        comment.setWrapStyleWord(true);
-        comment.setEnabled(false);
-        comment.setDisabledTextColor(comment.getForeground());
-        // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4919687
-        Color c = new Color(
-                UIManager.getColor("TextField.inactiveBackground").getRGB());
-        comment.setBackground(c);
+        disableTextArea(comment);
         JScrollPane spComment = new JScrollPane();
         spComment.getViewport().add(comment);
         addField(Translator.localize("label.comment.name"), spComment);
@@ -138,12 +130,7 @@
         // Comment.body text field - editing disabled
         UMLTextArea2 commentBody = new UMLTextArea2(
                 new UMLModelElementCommentDocument(true));
-        commentBody.setRows(2);
-        commentBody.setLineWrap(true);
-        commentBody.setWrapStyleWord(true);
-        commentBody.setEnabled(false);
-        commentBody.setDisabledTextColor(comment.getForeground());
-        commentBody.setBackground(c);
+        disableTextArea(commentBody);
         JScrollPane spCommentBody = new JScrollPane();
         spCommentBody.getViewport().add(commentBody);
         addField(Translator.localize("label.comment.body"), spCommentBody);
@@ -153,6 +140,22 @@
          * title would not be aligned right. */
         setButtonPanelSize(18);
     }
+    
+    private void disableTextArea(final JTextArea textArea) {
+        textArea.setRows(2);
+        textArea.setLineWrap(true);
+        textArea.setWrapStyleWord(true);
+        textArea.setEnabled(false);
+        textArea.setDisabledTextColor(textArea.getForeground());
+        // Only change the background colour if it is supplied by the LAF.
+        // Otherwise leave look and feel to handle this itself.
+        final Color inactiveColor =
+            UIManager.getColor("TextField.inactiveBackground");
+        if (inactiveColor != null) {
+            // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4919687
+            textArea.setBackground(new Color(inactiveColor.getRGB()));
+        }
+    }
 
     /**
      * Checks if the tab should be enabled. Returns true if the target

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabProps.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabProps.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabProps.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabProps.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabProps.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/TabProps.java	2008-07-07 12:54:30-0700
@@ -68,7 +68,6 @@
      */
     private static final Logger LOG = Logger.getLogger(TabProps.class);
 
-    private boolean shouldBeEnabled = false;
     private JPanel blankPanel = new JPanel();
     private Hashtable<Class, TabModelTarget> panels = 
         new Hashtable<Class, TabModelTarget>();
@@ -166,12 +165,16 @@
     @Deprecated
     public void setTarget(Object target) {
         // targets ought to be UML objects or diagrams
+        LOG.info("setTarget: there are "
+                + TargetManager.getInstance().getTargets().size()
+                + " targets");
+
         target = (target instanceof Fig) ? ((Fig) target).getOwner() : target;
         if (!(target == null || Model.getFacade().isAUMLElement(target) 
                 || target instanceof ArgoDiagram)) {
             return;
         }
-
+        
         if (lastPanel != null) {
             remove(lastPanel);
             if (lastPanel instanceof TargetListener) {
@@ -187,10 +190,10 @@
         this.target = target;
         if (target == null) {
             add(blankPanel, BorderLayout.CENTER);
-            shouldBeEnabled = false;
+            validate();
+            repaint();
             lastPanel = blankPanel;
         } else {
-            shouldBeEnabled = true;
             TabModelTarget newPanel = null;
             newPanel = findPanelFor(target);
             if (newPanel != null) {
@@ -198,14 +201,13 @@
             }
             if (newPanel instanceof JPanel) {
                 add((JPanel) newPanel, BorderLayout.CENTER);
-                shouldBeEnabled = true;
                 lastPanel = (JPanel) newPanel;
             } else {
                 add(blankPanel, BorderLayout.CENTER);
-                shouldBeEnabled = false;
+                validate();
+                repaint();
                 lastPanel = blankPanel;
             }
-
         }
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLComboBoxModel2.java	2008-07-07 12:54:30-0700
@@ -342,7 +342,11 @@
      * 
      * @param theNewTarget the target
      */
-    protected void setTarget(Object theNewTarget) {
+    public void setTarget(Object theNewTarget) {
+        if (theNewTarget != null && theNewTarget.equals(comboBoxTarget)) {
+            LOG.debug("Ignoring duplicate setTarget request " + theNewTarget);
+            return;
+        }
         LOG.debug("setTarget target :  " + theNewTarget);
         theNewTarget = theNewTarget instanceof Fig 
             ? ((Fig) theNewTarget).getOwner() : theNewTarget;
@@ -465,6 +469,7 @@
      * @param o the element to be added
      */
     public void addElement(Object o) {
+        // TODO: For large lists, this is doing a linear search of literally thousands of elements
         if (!objects.contains(o)) {
             objects.add(o);
             fireIntervalAdded(this, objects.size() - 1, objects.size() - 1);

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLExpressionBodyField.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLExpressionBodyField.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLExpressionBodyField.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLExpressionBodyField.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLExpressionBodyField.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/UMLExpressionBodyField.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -68,7 +68,7 @@
         getDocument().addDocumentListener(this);
         setToolTipText(Translator.localize("label.body.tooltip"));
         setFont(LookAndFeelMgr.getInstance().getStandardFont());
-        setRows(2); // make it strech vertically
+        setRows(2); // make it stretch vertically
     }
 
     /*

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/collaborations/UMLMessageActivatorComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/collaborations/UMLMessageActivatorComboBoxModel.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/collaborations/UMLMessageActivatorComboBoxModel.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/collaborations/UMLMessageActivatorComboBoxModel.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/collaborations/UMLMessageActivatorComboBoxModel.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/collaborations/UMLMessageActivatorComboBoxModel.java	2008-07-07 12:54:30-0700
@@ -80,7 +80,7 @@
     /*
      * @see org.argouml.uml.ui.UMLComboBoxModel2#setTarget(java.lang.Object)
      */
-    protected void setTarget(Object target) {
+    public void setTarget(Object target) {
         if (Model.getFacade().isAMessage(getTarget())) {
             if (interaction != null) {
                 Model.getPump().removeModelEventListener(

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/state_machines/UMLChangeExpressionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/state_machines/UMLChangeExpressionModel.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/state_machines/UMLChangeExpressionModel.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/state_machines/UMLChangeExpressionModel.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/state_machines/UMLChangeExpressionModel.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/behavior/state_machines/UMLChangeExpressionModel.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2006 The Regents of the University of California. All
+// Copyright (c) 2006-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -28,7 +28,6 @@
 import org.argouml.model.Model;
 import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.ui.UMLExpressionModel2;
-import org.argouml.uml.ui.UMLTimeExpressionModel;
 import org.argouml.uml.ui.UMLUserInterfaceContainer;
 
 /**
@@ -39,7 +38,7 @@
 class UMLChangeExpressionModel extends UMLExpressionModel2 {
 
     private static final Logger LOG =
-        Logger.getLogger(UMLTimeExpressionModel.class);
+        Logger.getLogger(UMLChangeExpressionModel.class);
 
     /**
      * The constructor.

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/ActionSetModelElementNamespace.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/ActionSetModelElementNamespace.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/ActionSetModelElementNamespace.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/ActionSetModelElementNamespace.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/ActionSetModelElementNamespace.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/ActionSetModelElementNamespace.java	2008-07-07 12:54:30-0700
@@ -40,7 +40,7 @@
     /**
      * Constructor for ActionSetModelElementNamespace.
      */
-    protected ActionSetModelElementNamespace() {
+    public ActionSetModelElementNamespace() {
         super();
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelMethod.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelMethod.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelMethod.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelMethod.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelMethod.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelMethod.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -30,19 +30,20 @@
 import javax.swing.Action;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 
+import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
 import org.argouml.model.AttributeChangeEvent;
 import org.argouml.model.Model;
-import org.argouml.ui.LookAndFeelMgr;
+import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.ui.ActionNavigateOwner;
 import org.argouml.uml.ui.UMLComboBox2;
 import org.argouml.uml.ui.UMLComboBoxModel2;
 import org.argouml.uml.ui.UMLComboBoxNavigator;
-import org.argouml.uml.ui.UMLPlainTextDocument;
-import org.argouml.uml.ui.UMLTextArea2;
-import org.argouml.uml.ui.UMLTextField2;
+import org.argouml.uml.ui.UMLExpressionBodyField;
+import org.argouml.uml.ui.UMLExpressionLanguageField;
+import org.argouml.uml.ui.UMLExpressionModel2;
+import org.argouml.uml.ui.UMLUserInterfaceContainer;
 import org.tigris.gef.undo.UndoableAction;
 
 /**
@@ -52,19 +53,15 @@
  */
 public class PropPanelMethod extends PropPanelFeature {
 
-    private JTextField languageTextField;
     private UMLComboBox2 specificationComboBox;
     private static UMLMethodSpecificationComboBoxModel 
     specificationComboBoxModel;
-    private UMLModelElementLanguageDocument languageDocument =
-        new UMLModelElementLanguageDocument();
 
     /**
      * Construct a property panel for UML Method elements.
      */
     public PropPanelMethod() {
         super("label.method", lookupIcon("Method"));
-        UMLPlainTextDocument uptd = new UMLMethodBodyDocument();
 
         addField(Translator.localize("label.name"),
                 getNameTextField());
@@ -89,31 +86,22 @@
 
         addSeparator();
 
+        UMLExpressionModel2 procedureModel = 
+            new UMLMethodProcedureExpressionModel(
+                this, "");
         addField(Translator.localize("label.language"),
-                getLanguageTextField());
-
-        UMLTextArea2 bodyArea = new UMLTextArea2(uptd);
-        bodyArea.setLineWrap(true);
-        bodyArea.setRows(5);
-        bodyArea.setFont(LookAndFeelMgr.getInstance().getStandardFont());
-        JScrollPane pane = new JScrollPane(bodyArea);
-        addField(Translator.localize("label.body"), pane);
+                new UMLExpressionLanguageField(procedureModel,
+                false));
+        JScrollPane bodyPane = new JScrollPane(
+                new UMLExpressionBodyField(
+                        procedureModel, true));
+        addField(Translator.localize("label.body"), bodyPane);
 
         addAction(new ActionNavigateOwner());
         addAction(getDeleteAction());
     }
 
     /**
-     * @return a textfield for the name
-     */
-    protected JTextField getLanguageTextField() {
-        if (languageTextField == null) {
-            languageTextField = new UMLTextField2(languageDocument);
-        }
-        return languageTextField;
-    }
-
-    /**
      * @return the Specification ComboBox
      */
     public UMLComboBox2 getSpecificationComboBox() {
@@ -185,10 +173,6 @@
             }
         }
 
-        /**
-         * The UID.
-         */
-        private static final long serialVersionUID = -7439424794380015022L;
     }
 
     private static class ActionSetMethodSpecification extends UndoableAction {
@@ -231,105 +215,63 @@
         }
     }
 
-    private static class UMLModelElementLanguageDocument
-        extends UMLPlainTextDocument {
-        /**
-         * Constructor for UMLModelElementNameDocument.
-         */
-        public UMLModelElementLanguageDocument() {
-             super("language");
-        }
+}
 
-        /*
-         * @see org.argouml.uml.ui.UMLPlainTextDocument#setProperty(java.lang.String)
-         */
-        protected void setProperty(String text) {
-            Object meth = getTarget();
-            if (Model.getFacade().isAMethod(meth)) {
-                Object expr = Model.getFacade().getBody(meth);
-                if (expr != null) {
-                    Model.getDataTypesHelper().setLanguage(expr, text);
-                } else {
-                    Model.getCoreHelper().setBody(meth,
-                            Model.getDataTypesFactory()
-                            .createProcedureExpression(text, null));
-                }
-            }
-        }
+/**
+ * The model for the procedure expression of a Method.
+ * 
+ * @author Michiel
+ */
+class UMLMethodProcedureExpressionModel extends UMLExpressionModel2 {
 
-        /*
-         * @see org.argouml.uml.ui.UMLPlainTextDocument#getProperty()
-         */
-        protected String getProperty() {
-            Object expr = Model.getFacade().getBody(getTarget());
-            if (expr == null) {
-                return null;
-            } else {
-                return Model.getDataTypesHelper().getLanguage(expr);
-            }
-        }
+    private static final Logger LOG =
+        Logger.getLogger(UMLMethodProcedureExpressionModel.class);
 
-        /**
-         * The UID.
-         */
-        private static final long serialVersionUID = -2004931253036454061L;
+    /**
+     * The constructor.
+     *
+     * @param container the container of UML user interface components
+     * @param propertyName the name of the property
+     */
+    public UMLMethodProcedureExpressionModel(
+            UMLUserInterfaceContainer container,
+            String propertyName) {
+        super(container, propertyName);
     }
 
-    private static class UMLMethodBodyDocument extends UMLPlainTextDocument {
-        /**
-         * Constructor for UMLMethodBodyDocument.
-         */
-        public UMLMethodBodyDocument() {
-            super("body");
-            /*
-             * TODO: This is probably not the right location
-             * for switching off the "filterNewlines".
-             * The setting gets lost after selecting a different
-             * ModelElement in the diagram.
-             * BTW, see how it is used in
-             * javax.swing.text.PlainDocument.
-             * See issue 1812.
-             */
-            putProperty("filterNewlines", Boolean.FALSE);
-        }
+    /**
+     * This returns a ProcedureExpression.
+     * @see org.argouml.uml.ui.UMLExpressionModel2#getExpression()
+     */
+    public Object getExpression() {
+        return Model.getFacade().getBody(
+                TargetManager.getInstance().getTarget());
+    }
 
-        /*
-         * @see org.argouml.uml.ui.UMLPlainTextDocument#setProperty(java.lang.String)
-         */
-        protected void setProperty(String text) {
-            Object meth = getTarget();
-            if (Model.getFacade().isAMethod(meth)) {
-                Object expr = Model.getFacade().getBody(meth);
-                if (expr != null) {
-                    Model.getDataTypesHelper().setBody(expr, text);
-                } else {
-                    Model.getCoreHelper().setBody(meth,
-                            Model.getDataTypesFactory()
-                            .createProcedureExpression(null, text));
-                }
-            }
-        }
+    /**
+     * Sets the "Body" of the target (which is a Method).
+     * The Body is the ProcedureExpression, which consists 
+     * of a body and language.
+     * 
+     * @param expression a ProcedureExpression
+     * @see org.argouml.uml.ui.UMLExpressionModel2#setExpression(java.lang.Object)
+     */
+    public void setExpression(Object expression) {
+        Object target = TargetManager.getInstance().getTarget();
 
-        /*
-         * @see org.argouml.uml.ui.UMLPlainTextDocument#getProperty()
-         */
-        protected String getProperty() {
-            Object expr = Model.getFacade().getBody(getTarget());
-            if (expr == null) {
-                return null;
-            } else {
-                return (String) Model.getFacade().getBody(expr);
-            }
+        if (target == null) {
+            throw new IllegalStateException("There is no target for "
+                    + getContainer());
         }
-
-        /**
-         * The UID.
-         */
-        private static final long serialVersionUID = -4797010104885972301L;
+        Model.getCoreHelper().setBody(target, expression);
     }
 
-    /**
-     * The UID.
+    /*
+     * @see org.argouml.uml.ui.UMLExpressionModel2#newExpression()
      */
-    private static final long serialVersionUID = -6443549338375514393L;
+    public Object newExpression() {
+        LOG.debug("new empty procedure expression");
+        return Model.getDataTypesFactory().createProcedureExpression("", "");
+    }
+
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelModelElement.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelModelElement.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelModelElement.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelModelElement.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelModelElement.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -39,7 +39,6 @@
 import org.argouml.uml.ui.ScrollList;
 import org.argouml.uml.ui.UMLComboBoxNavigator;
 import org.argouml.uml.ui.UMLDerivedCheckBox;
-import org.argouml.uml.ui.UMLLinkedList;
 import org.argouml.uml.ui.UMLMutableLinkedList;
 import org.argouml.uml.ui.UMLPlainTextDocument;
 import org.argouml.uml.ui.UMLSearchableComboBox;
@@ -52,8 +51,6 @@
  */
 public abstract class PropPanelModelElement extends PropPanel {
 
-    private JScrollPane namespaceScroll;
-
     private JComboBox namespaceSelector;
 
     private JScrollPane supplierDependencyScroll;
@@ -66,7 +63,7 @@
 
     private JScrollPane constraintScroll;
 
-    private JPanel namespaceVisibilityPanel;
+    private JPanel visibilityPanel;
 
     private JScrollPane elementResidenceScroll;
 
@@ -135,7 +132,7 @@
      * The constructor.
      *
      * @param name the name of the properties panel
-     * @param icon the ico
+     * @param icon the icon
      */
     public PropPanelModelElement(String name, ImageIcon icon) {
         super(name, icon);
@@ -269,20 +266,26 @@
     }
 
     /**
-     * TODO: This should better be named "getVisibilityPanel", 
-     * since it is not restricted to a namespace.
-     * 
      * @return a panel for the visibility
      */
-    protected JComponent getNamespaceVisibilityPanel() {
-        if (namespaceVisibilityPanel == null) {
-            namespaceVisibilityPanel =
+    protected JComponent getVisibilityPanel() {
+        if (visibilityPanel == null) {
+            visibilityPanel =
 		new UMLModelElementVisibilityRadioButtonPanel(
                     Translator.localize("label.visibility"), true);
         }
-        return namespaceVisibilityPanel;
+        return visibilityPanel;
     }
-
+    
+    /**
+     * @deprecated for 0.26 by penyaskito. Use
+     *             {@link #getVisibilityPanel()} instead.
+     * @return a panel for the visibility
+     */
+    protected JComponent getNamespaceVisibilityPanel() {        
+        return getVisibilityPanel();
+    }
+    
     /**
      * @return a scrollpane for residence
      */

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/UMLModelElementNamespaceComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/UMLModelElementNamespaceComboBoxModel.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/UMLModelElementNamespaceComboBoxModel.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/UMLModelElementNamespaceComboBoxModel.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/UMLModelElementNamespaceComboBoxModel.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/core/UMLModelElementNamespaceComboBoxModel.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -113,7 +113,7 @@
                 && evt.getNewValue() != null) {
 //            setTarget(t); // this fixes issue 3780, but causes issue 3832.
             buildModelList();
-            /* In some cases (se issue 3780) the list remains the same, but
+            /* In some cases (see issue 3780) the list remains the same, but
              * the selected item differs. Without the next step,
              * the combo would not be refreshed.
              */

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelTagDefinition.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelTagDefinition.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelTagDefinition.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelTagDefinition.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelTagDefinition.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelTagDefinition.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2005-2007 The Regents of the University of California. All
+// Copyright (c) 2005-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -37,6 +37,7 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 
+import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.AssociationChangeEvent;
@@ -192,9 +193,10 @@
     extends UMLModelElementNamespaceComboBoxModel {
 
     /**
-     * 
+     * Logger.
      */
-    private static final long serialVersionUID = -7055212587563120811L;
+    private static final Logger LOG =
+        Logger.getLogger(UMLTagDefinitionNamespaceComboBoxModel.class);
 
     /*
      * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)
@@ -217,6 +219,21 @@
             c.add(root);
             c.addAll(Model.getModelManagementHelper().getAllNamespaces(root));
         }
+
+        Object target = getTarget();
+        /* These next lines for the case that the current namespace
+         * is not a valid one... Which of course should not happen,
+         * but it does - in this case for TDs from profiles.
+         */
+        /* TODO: Enhance so that this never happens.
+         */
+        if (target != null) {
+            Object namespace = Model.getFacade().getNamespace(target);
+            if (namespace != null) {
+                c.add(namespace);
+                LOG.warn("The current TD namespace is not a valid one!");
+            }
+        }
         setElements(c);
     }
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/FileFilters.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/FileFilters.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/FileFilters.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/FileFilters.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/FileFilters.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/FileFilters.java	2008-07-07 12:54:30-0700
@@ -37,9 +37,6 @@
  */
 public class FileFilters {
 
-    ////////////////////////////////////////////////////////////////
-    // constants
-
     /**
      * This is a filter for uncompressed project format.
      */
@@ -86,18 +83,16 @@
     public static final SuffixFilter LOG_FILTER = new
         SuffixFilter("log", "Argo usage log");
 
-    /** Java Source File Filter */
+    /**
+     * Java Source File Filter
+     * 
+     * @deprecated for 0.26 by tfmorris. This will be removed from the core when
+     *             the Java importer is moved to a separate module.
+     */
+    @Deprecated
     public static final SuffixFilter JAVA_FILE_FILTER = new
         SuffixFilter("java", Translator.localize("combobox.filefilter.java"));
 
-    /** Java Class File Filter */
-    public static final SuffixFilter JAVA_CLASS_FILTER = new
-        SuffixFilter("class", "Java Class File");
-
-    /** Java JAR File Filter */
-    public static final SuffixFilter JAVA_JAR_FILTER = new
-        SuffixFilter("jar", "Java JAR File");
-
     /** 
      * This writes the GIF file.
      */
@@ -145,10 +140,6 @@
     public static final SuffixFilter SVG_FILTER = new
         SuffixFilter("svg", Translator.localize("combobox.filefilter.svg"));
 
-    /** Filter for IDL files */
-    public static final SuffixFilter IDL_FILTER = new
-		SuffixFilter("idl", "Interface Definition Language file");
-
     /**
      * Returns the suffix for which a FileFilter filters.
      * @param filter The FileFilter from which we want to know the suffix
@@ -162,4 +153,4 @@
         return null;
     }
 
-} /* end class FileFilters */
+} 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/SuffixFilter.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/SuffixFilter.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/SuffixFilter.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/SuffixFilter.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/SuffixFilter.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/org/argouml/util/SuffixFilter.java	2008-07-07 12:54:30-0700
@@ -25,6 +25,7 @@
 package org.argouml.util;
 
 import java.io.File;
+
 import javax.swing.filechooser.FileFilter;
 
 /**
@@ -33,29 +34,32 @@
  */
 public class SuffixFilter extends FileFilter {
 
-    ////////////////////////////////////////////////////////////////
-    // instance varaibles
-
-    private final String suffix;
+    private final String[] suffixes;
     private final String desc;
 
-    ////////////////////////////////////////////////////////////////
-    // constructor
-
     /**
-     * The constructor.
+     * Construct a file filter files with the given suffix and description.
      *
-     * @param s the suffix string
+     * @param suffix the suffix string
      * @param d the file type description
      */
-    public SuffixFilter(String s, String d) {
-	suffix = s;
+    public SuffixFilter(String suffix, String d) {
+        suffixes = new String[] {suffix};
 	desc = d;
     }
 
-    ////////////////////////////////////////////////////////////////
-    // FileFilter API
-
+    /**
+     * Construct a filter for an array of suffixes
+     *
+     * @param s the suffixes string
+     * @param d the file type description
+     */
+    public SuffixFilter(String[] s, String d) {
+        suffixes = new String[s.length];
+        System.arraycopy(s, 0, suffixes, 0, s.length);
+        desc = d;
+    }
+    
     /*
      * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
      */
@@ -67,8 +71,10 @@
             return true;
         }
 	String extension = getExtension(f);
-	if (suffix.equalsIgnoreCase(extension)) {
-            return true;
+        for (String suffix : suffixes) {
+            if (suffix.equalsIgnoreCase(extension)) {
+                return true;
+            }
         }
 	return false;
     }
@@ -100,17 +106,29 @@
      * @see javax.swing.filechooser.FileFilter#getDescription()
      */
     public String getDescription() {
-	return desc + " (*." + suffix + ")";
+        String result = desc + " (";
+        for (int i = 0; i < suffixes.length - 1; i++) {
+            result = result + "." + suffixes[i] + ", ";
+        }
+        result = result + suffixes[suffixes.length - 1] + ")";
+        return result;
     }
 
     /**
-     * @return Returns the _suffix.
+     * @return Returns the default or preferred suffix for this type of file.
      */
     public String getSuffix() {
-        return suffix;
+        return suffixes[0];
     }
 
     /**
+     * @return Returns the list of all acceptable suffixes.
+     */
+    public String[] getSuffixes() {
+        return suffixes;
+    }
+    
+    /**
      * Adding this function enables easy selection of suffixfilters
      * e.g. in a combobox.
      *
@@ -120,4 +138,4 @@
         return getDescription();
     }
 
-} /* end class SuffixFilter */
+}
\ No newline at end of file

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/templates/ArgoVersion.template
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/templates/ArgoVersion.template?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/templates/ArgoVersion.template&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/templates/ArgoVersion.template&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/templates/ArgoVersion.template	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/src/templates/ArgoVersion.template	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -44,12 +44,13 @@
      * Version number.
      */
     private static final String VERSION = "@ARGO_RELEASE_VERSION@";
+    private static final String STABLE_VERSION = "0.26";
 
     /**
      * Make the version of ArgoUML public. 
      */
     static void init() {
-        ApplicationVersion.init(VERSION);
+        ApplicationVersion.init(VERSION, STABLE_VERSION);
     }
 
     /**

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/AllTests.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/AllTests.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/AllTests.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/AllTests.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/AllTests.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/AllTests.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2006-2007 The Regents of the University of California. All
+// Copyright (c) 2006-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -37,13 +37,12 @@
     public static Test suite() {
         TestSuite suite = new TestSuite("Test for org.argouml.model");
         //$JUnit-BEGIN$
-//        suite.addTestSuite(TestAGHelperWithMock.class);
         suite.addTestSuite(TestExtensionMechanismsFactory.class);
         suite.addTestSuite(TestModel2.class);
         suite.addTestSuite(TestUmlGeneralization.class);
+        suite.addTestSuite(TestDataTypesFactory.class);
         suite.addTestSuite(TestCommonBehaviorHelper.class);
         suite.addTestSuite(TestModelManagementFactory.class);
-        suite.addTestSuite(TestDataTypesFactory.class);
         suite.addTestSuite(TestModelEventPump.class);
         suite.addTestSuite(TestStateMachinesFactory.class);
         suite.addTestSuite(TestModelManagementHelper.class);
@@ -68,6 +67,7 @@
         suite.addTestSuite(TestActivityGraphsHelper.class);
         suite.addTestSuite(TestUmlModel.class);
         suite.addTestSuite(TestUmlActor.class);
+        suite.addTestSuite(TestUmlFactory.class);
         suite.addTest(TestModelFacade3.suite());
         suite.addTestSuite(TestUseCasesFactory.class);
         //$JUnit-END$

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/TestCoreFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/TestCoreFactory.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/TestCoreFactory.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/TestCoreFactory.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/TestCoreFactory.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/model/TestCoreFactory.java	2008-07-07 12:54:30-0700
@@ -597,5 +597,40 @@
         
     }
 
+    /**
+     * Test buildRealization and buildAbstraction
+     */
+    public void testBuildRealization() {
+        Object model = Model.getModelManagementFactory().createModel();
+        Object client = Model.getCoreFactory().buildClass("ClassA", model);
+        Object supplier = Model.getCoreFactory().buildInterface("InterfaceB",
+                model);
+        Object realization = Model.getCoreFactory().buildRealization(client,
+                supplier, model);
+
+        assertTrue(Model.getFacade().isAAbstraction(realization));
+        assertTrue(Model.getExtensionMechanismsHelper().hasStereotype(
+                realization, "realize"));
+
+        try {
+            Model.getCoreFactory().buildRealization(supplier, supplier, model);
+            fail("buildRealization to self didn't throw exception");
+        } catch (Exception e) {
+            // success
+        }
+
+        Object abstraction = Model.getCoreFactory().buildAbstraction("foo", 
+                supplier, client);
+        assertTrue(Model.getFacade().isAAbstraction(abstraction));
+
+        try {
+            Model.getCoreFactory().buildAbstraction("foo2", supplier, supplier);
+            fail("buildAbstraction to self didn't throw exception");
+        } catch (Exception e) {
+            // success
+        }
+        
+    }
+
 
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java	2008-07-07 12:54:30-0700
@@ -59,9 +59,11 @@
      * @see junit.framework.TestCase#setUp()
      */
     protected void setUp() {
+        InitializeModel.initializeDefault();
+        assertTrue("Model subsystem init failed.", Model.isInitiated());
+        new InitProfileSubsystem().init();
         Object model =
             Model.getModelManagementFactory().createModel();
-        new InitProfileSubsystem().init();
         Project p = ProjectManager.getManager().getCurrentProject();
         aClass = Model.getCoreFactory().buildClass(model);
         Object returnType = p.getDefaultReturnType();
@@ -170,7 +172,7 @@
     /**
      * Check if the elements are generated or not.
      *
-     * @param st          the parent state in which a substate is to be created
+     * @param st          the parent state in which a sub-state is to be created
      * @param text        the text to be parsed
      * @param entryAction true if an entry action is expected to be created
      * @param exitAction  true if an exit action is expected to be created

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java	2008-07-07 12:54:30-0700
@@ -83,7 +83,7 @@
         new InitProfileSubsystem().init();
 
         Modeller modeller =
-            new Modeller(parsedModel, new DummyImportSettings(),
+            new Modeller(parsedModel, false, false,
                 "TestClass.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java	2008-07-07 12:54:30-0700
@@ -82,7 +82,7 @@
         new InitProfileSubsystem().init();
 
         Modeller modeller = new Modeller(parsedModel,
-                new DummyImportSettings(), "TestClass.java");
+                false, false, "TestClass.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
 
         try {

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java	2008-07-07 12:54:30-0700
@@ -84,7 +84,7 @@
         new InitProfileSubsystem().init();
 
         Modeller modeller =
-                new Modeller(parsedModel, new DummyImportSettings(),
+                new Modeller(parsedModel, false, false,
                     "TestInterface.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java	2008-07-07 12:54:30-0700
@@ -93,7 +93,7 @@
                 parsedModel);
 
         Modeller modeller =
-            new Modeller(parsedModel, new DummyImportSettings(),
+            new Modeller(parsedModel, false, false,
                 "TestClass.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
 

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/behavior/collaborations/TestUMLAssociationRoleBaseComboBoxModel.java	2008-07-07 12:54:30-0700
@@ -48,6 +48,8 @@
      * The element that we work on.
      */
     private Object elem;
+    
+    private Object dummy;
 
     /**
      * The model that we work on.
@@ -101,6 +103,8 @@
         Model.getCoreHelper().setNamespace(role2, col);
         elem =
 	    Model.getCollaborationsFactory().buildAssociationRole(role1, role2);
+        dummy =
+            Model.getCollaborationsFactory().buildAssociationRole(role1, role2);
         model.targetSet(new TargetEvent(this,
 					TargetEvent.TARGET_SET,
 					new Object[0],
@@ -182,16 +186,18 @@
         // One can only delete a assoc by changing target,
         // so let's simulate that:
         /* TODO: Get rid of this! */
-        model.targetSet(new TargetEvent(this,
-                TargetEvent.TARGET_SET,
-                new Object[0],
-                new Object[] {
-                    elem,
-                }));
+        changeTarget();
         // there is one extra element since removal of the base is allowed.
         Model.getPump().flushModelEvents();
         assertEquals(NO_ELEMENTS_IN_TEST + 1 - 1, model.getSize());
         assertTrue(!model.contains(bases[NO_ELEMENTS_IN_TEST - 1]));
     }
+    
+    private void changeTarget() {
+        model.targetSet(new TargetEvent(this, TargetEvent.TARGET_SET,
+                new Object[] {elem}, new Object[] {dummy}));
+        model.targetSet(new TargetEvent(this, TargetEvent.TARGET_SET,
+                new Object[] {dummy}, new Object[] {elem}));
+    }
 
 }

Modified: branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java?view=diff&rev=15194&p1=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java&p2=branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java&r1=15193&r2=15194
==============================================================================
--- branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java	(original)
+++ branches/gsoc2008/work_argoeclipse1_hudsonb/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLStructuralFeatureTypeComboBoxModel.java	2008-07-07 12:54:30-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -57,6 +57,8 @@
      * The element.
      */
     private Object elem;
+    
+    private Object dummy;
 
     /**
      * Constructor for TestUMLStructuralFeatureTypeComboBoxModel.
@@ -78,6 +80,7 @@
         Model.getCoreHelper().setName(mmodel, "untitledModel");
         Model.getModelManagementFactory().setRootModel(mmodel);
         elem = Model.getCoreFactory().createAttribute();
+        dummy = Model.getCoreFactory().createAttribute();
         model = new UMLStructuralFeatureTypeComboBoxModel();
         model.targetSet(new TargetEvent(this, "set", new Object[0],
                 new Object[] {elem}));
@@ -114,31 +117,27 @@
         Model.getPump().flushModelEvents();
         // One can only do this by changing target,
         // so let's simulate that:
-        model.targetSet(new TargetEvent(this,
-                TargetEvent.TARGET_SET,
-                new Object[0],
-                new Object[] {
-                    elem,
-                }));
+        changeTarget();
         assertTrue(model.contains(types[NO_OF_ELEMENTS / 2]));
         assertTrue(model.contains(types[0]));
         assertTrue(model.contains(types[NO_OF_ELEMENTS - 1]));
     }
 
+    
+    private void changeTarget() {
+        model.targetSet(new TargetEvent(this, TargetEvent.TARGET_SET,
+                new Object[] {elem}, new Object[] {dummy}));
+        model.targetSet(new TargetEvent(this, TargetEvent.TARGET_SET,
+                new Object[] {dummy}, new Object[] {elem}));
+    }
+
     /**
      * Test the setType function.
      */
     public void testSetType() {
         Model.getCoreHelper().setType(elem, types[0]);
         Model.getPump().flushModelEvents();
-        // One can only do this by changing target,
-        // so let's simulate that:
-        model.targetSet(new TargetEvent(this,
-                TargetEvent.TARGET_SET,
-                new Object[0],
-                new Object[] {
-                    elem,
-                }));
+        changeTarget();
         assertTrue(model.getSelectedItem() == types[0]);
     }
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.