svn commit: r19906 - trunk: modules/dev/src/org/argouml/dev src/argouml-app/lib src/argouml-app/src/org/argouml/application src/argouml-app/src/org/argouml/i18n src/argouml-app/src/org/argouml/kernel src/argouml-app/src/org/argouml/notation src/argouml-app/src/org/argouml/notation/providers src/argouml-app/src/org/argouml/uml/diagram/state/ui src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui src/argouml-app/src/org/argouml/uml/diagram/ui src/argouml-app/src/org/argouml/uml/ui src/argouml-core-diagrams-activity2 src/argouml-core-diagrams-activity2/src/org/argouml/activity2 src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram src/argouml-core-diagrams-class2 src/argouml-core-diagrams-deployment2 src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2 src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram src

[email protected] Fri, 28 Dec 2012 10:30:46 -0800 (PST)
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2012-12-28 10:30:46-0800
New Revision: 19906

Modified:
   trunk/modules/dev/src/org/argouml/dev/ModeInspectorPanel.java   (contents, props changed)
   trunk/src/argouml-app/lib/batik.LICENSE.txt   (props changed)
   trunk/src/argouml-app/src/org/argouml/application/ArgoVersion.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/i18n/wfr.properties   (props changed)
   trunk/src/argouml-app/src/org/argouml/kernel/ActionList.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/kernel/Owned.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/notation/NotationRenderer.java   (props changed)
   trunk/src/argouml-app/src/org/argouml/notation/providers/NotationUtilityProviders.java   (props changed)
   trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigRegion.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigVertex.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionVertex.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionCompartmentText.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionClassifierBox.java   (contents, props changed)
   trunk/src/argouml-app/src/org/argouml/uml/ui/UMLStereotypeListModel.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/build.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramPropPanelFactory.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramGraphModel.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/BaseDiagram.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/CreateDiagramElementAction.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElement.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElementBuilder.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramNode.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigAcceptEventPoly.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigActivityEdge.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseEdge.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigGravityPoly.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNameCompartment.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedConcavePentagon.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedPentagon.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRRect.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRect.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNotation.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ModePlaceDiagramElement.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/NameDisplayer.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/StereotypeDisplayer.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/UMLActivityDiagram.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-class2/build.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-class2/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/build.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramModule.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramPropPanelFactory.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramFactory.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramGraphModel.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigNode.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigPort.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/UMLDeploymentDiagram.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/build.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramModule.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramPropPanelFactory.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigCircleState.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigEntryPoint.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigExitPoint.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigRegion.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramFactory.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramGraphModel.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/UMLStateDiagram.java   (contents, props changed)
   trunk/src/argouml-core-diagrams-structure2/build.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-structure2/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-uml2/build.properties   (contents, props changed)
   trunk/src/argouml-core-diagrams-uml2/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-model-euml/lib/eUML required plugins.txt   (contents, props changed)
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java   (contents, props changed)
   trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java   (contents, props changed)
   trunk/src/argouml-core-model/src/org/argouml/model/AssociationChangeListener.java   (contents, props changed)
   trunk/src/argouml-core-model/src/org/argouml/model/Defaults.java   (contents, props changed)
   trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java   (contents, props changed)
   trunk/src/argouml-core-model/src/org/argouml/model/UmlChangeListener.java   (contents, props changed)
   trunk/src/argouml-core-model/src/org/argouml/model/UmlFactoryDefaults.java   (contents, props changed)
   trunk/src/argouml-core-notation/build.properties   (contents, props changed)
   trunk/src/argouml-core-notation/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NotatedItem.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationLanguage.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationModule.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationText.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationTextEvent.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationType.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/StereotypeUmlNotation.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java   (contents, props changed)
   trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationTextEvent.java   (contents, props changed)
   trunk/src/argouml-core-transformer/build.properties   (contents, props changed)
   trunk/src/argouml-core-transformer/plugin.properties   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/build.properties   (props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/CheckBoxData.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/ControlData.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/IconIdentifiable.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/Named.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/PanelData.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/AbstractActionAddModelElement.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/Expandable.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateNextAction.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigatePreviousAction.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateSiblingAction.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateUpAction.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSpecificationDocument.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationModel.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanel.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanelOptional.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueField.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralBoolean.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralString.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpression.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpressionDialog.java   (contents, props changed)
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java   (contents, props changed)
   trunk/tools/cruisecontrol/emailmap.properties   (contents, props changed)
   trunk/tools/test-i18n-properties/src/org/argouml/i18n/CheckKey.java   (props changed)
   trunk/tools/test-with-model/src/org/argouml/model/InitializeModel.java   (contents, props changed)
   trunk/tools/test-with-model/src/org/argouml/model/MockModelImplementation.java   (contents, props changed)
   trunk/www/docs/allegrini_dissertation/tesi_en.pdf   (props changed)
   trunk/www/docs/mmicallef/ProjectReport.pdf   (props changed)
   trunk/www/docs/pichiliani_paper_2006/ArtigoWIE-REVISADO.pdf   (props changed)
   trunk/www/docs/robbins_dissertation/diss.pdf   (props changed)
   trunk/www/docs/robbins_dissertation/frontmatter.pdf   (props changed)

Log:
Fixed the svn properties on some files.

Modified: trunk/modules/dev/src/org/argouml/dev/ModeInspectorPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/modules/dev/src/org/argouml/dev/ModeInspectorPanel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/modules/dev/src/org/argouml/dev/ModeInspectorPanel.java	(original)
+++ trunk/modules/dev/src/org/argouml/dev/ModeInspectorPanel.java	2012-12-28 10:30:46-0800
@@ -1,115 +1,115 @@
-/* $Id: EventPumpInspectorPanel.java 17807 2010-01-12 18:29:32Z linus $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    tfmorris

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

-// 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.dev;

-

-import java.awt.BorderLayout;

-import java.util.List;

-

-import javax.swing.JPanel;

-import javax.swing.JScrollPane;

-import javax.swing.JTree;

-import javax.swing.tree.DefaultMutableTreeNode;

-import javax.swing.tree.TreeNode;

-

-import org.tigris.gef.event.ModeChangeEvent;

-import org.tigris.gef.event.ModeChangeListener;

-

-/**

- * The event pump inspector displays the contents of the event

- * pump. There is no event mechanism to refresh this panel. The

- * user must press the refresh button to see the latest state.

- * @author Bob Tarling

- */

-public final class ModeInspectorPanel extends JPanel implements ModeChangeListener {

-

-    /**

-     * The instance.

-     */

-    private static final ModeInspectorPanel INSTANCE =

-        new ModeInspectorPanel();

-

-    /**

-     * @return The instance.

-     */

-    public static ModeInspectorPanel getInstance() {

-        return INSTANCE;

-    }

-

-    private JScrollPane scroller;

-    

-    /**

-     * Constructor.

-     */

-    private ModeInspectorPanel() {

-        setLayout(new BorderLayout());

-    }

-    

-    /**

-     * Getter provided for the dev module. This supplies a tree

-     * model of registered listeners.

-     * @return a root tree node

-     */

-    TreeNode getTree(List modes) {

-        DefaultMutableTreeNode root =

-            new DefaultMutableTreeNode("Mode List");

-        addSubtree(root, modes);

-        return root;

-    }

-    

-    private void addSubtree(DefaultMutableTreeNode root, List list) {

-        DefaultMutableTreeNode node = null;

-        for (Object o : list) {

-            node = new DefaultMutableTreeNode(o.toString());

-            root.add(node);

-        }

-    }

-

-    public void modeChange(ModeChangeEvent mce) {

-        JTree tree = new JTree(getTree(mce.getModes()));

-        tree.expandRow(0);

-        if (scroller != null) {

-            remove(scroller);

-        }

-        scroller = new JScrollPane(tree);

-        add(scroller);

-        invalidate();

-        validate();

-    }

-

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    tfmorris
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+// 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.dev;
+
+import java.awt.BorderLayout;
+import java.util.List;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreeNode;
+
+import org.tigris.gef.event.ModeChangeEvent;
+import org.tigris.gef.event.ModeChangeListener;
+
+/**
+ * The event pump inspector displays the contents of the event
+ * pump. There is no event mechanism to refresh this panel. The
+ * user must press the refresh button to see the latest state.
+ * @author Bob Tarling
+ */
+public final class ModeInspectorPanel extends JPanel implements ModeChangeListener {
+
+    /**
+     * The instance.
+     */
+    private static final ModeInspectorPanel INSTANCE =
+        new ModeInspectorPanel();
+
+    /**
+     * @return The instance.
+     */
+    public static ModeInspectorPanel getInstance() {
+        return INSTANCE;
+    }
+
+    private JScrollPane scroller;
+    
+    /**
+     * Constructor.
+     */
+    private ModeInspectorPanel() {
+        setLayout(new BorderLayout());
+    }
+    
+    /**
+     * Getter provided for the dev module. This supplies a tree
+     * model of registered listeners.
+     * @return a root tree node
+     */
+    TreeNode getTree(List modes) {
+        DefaultMutableTreeNode root =
+            new DefaultMutableTreeNode("Mode List");
+        addSubtree(root, modes);
+        return root;
+    }
+    
+    private void addSubtree(DefaultMutableTreeNode root, List list) {
+        DefaultMutableTreeNode node = null;
+        for (Object o : list) {
+            node = new DefaultMutableTreeNode(o.toString());
+            root.add(node);
+        }
+    }
+
+    public void modeChange(ModeChangeEvent mce) {
+        JTree tree = new JTree(getTree(mce.getModes()));
+        tree.expandRow(0);
+        if (scroller != null) {
+            remove(scroller);
+        }
+        scroller = new JScrollPane(tree);
+        add(scroller);
+        invalidate();
+        validate();
+    }
+
+}

Modified: trunk/src/argouml-app/src/org/argouml/application/ArgoVersion.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/application/ArgoVersion.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/application/ArgoVersion.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/application/ArgoVersion.java	2012-12-28 10:30:46-0800
@@ -1,75 +1,75 @@
-/* $Id: ArgoVersion.template 18387 2010-05-09 20:34:01Z linus $

- *******************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Tom Morris

- *******************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

- 

-// 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.application;

-

-import org.argouml.application.helpers.ApplicationVersion;

-

-/**

- * This class <strong>only</strong> encapsulates the ArgoUML version string.<p>

- *

- * It should <strong>not</strong> be edited manually because it is

- * build from the file ArgoVersion.template when necessary.<p>

- * 

- * Since this class resides in the top-level package, 

- * none of its functionality should be used

- * outside this package.

- *

- * @author Thierry Lach

- * @since  Argo0.11.1

- */

-final class ArgoVersion {

-    /**

-     * Version number.

-     */

-    private static final String VERSION = "PRE-0.35.1";

-    private static final String STABLE_VERSION = "0.32";

-

-    /**

-     * Make the version of ArgoUML public. 

-     */

-    static void init() {

-        ApplicationVersion.init(VERSION, STABLE_VERSION);

-    }

-

-    /**

-     * Don't allow instantiation.

-     */

-    private ArgoVersion() {

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Tom Morris
+ *******************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+ 
+// 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.application;
+
+import org.argouml.application.helpers.ApplicationVersion;
+
+/**
+ * This class <strong>only</strong> encapsulates the ArgoUML version string.<p>
+ *
+ * It should <strong>not</strong> be edited manually because it is
+ * build from the file ArgoVersion.template when necessary.<p>
+ * 
+ * Since this class resides in the top-level package, 
+ * none of its functionality should be used
+ * outside this package.
+ *
+ * @author Thierry Lach
+ * @since  Argo0.11.1
+ */
+final class ArgoVersion {
+    /**
+     * Version number.
+     */
+    private static final String VERSION = "PRE-0.35.1";
+    private static final String STABLE_VERSION = "0.32";
+
+    /**
+     * Make the version of ArgoUML public. 
+     */
+    static void init() {
+        ApplicationVersion.init(VERSION, STABLE_VERSION);
+    }
+
+    /**
+     * Don't allow instantiation.
+     */
+    private ArgoVersion() {
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/kernel/ActionList.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/kernel/ActionList.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/kernel/ActionList.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/kernel/ActionList.java	2012-12-28 10:30:46-0800
@@ -1,87 +1,87 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.kernel;

-

-import java.awt.event.ActionEvent;

-import java.beans.PropertyChangeListener;

-import java.util.ArrayList;

-

-import javax.swing.AbstractAction;

-import javax.swing.Action;

-import javax.swing.Icon;

-

-/**

- * This class is both a List and an Action although it purpose is not to serve

- * as a true executable Action.

- * Its purpose is to allow menu items, toolbars and toolbuttons etc to be built

- * from a model mode up of Actions where each Action is either an executable

- * action to be shown as a menu item or toolbutton. However should an Action

- * be of this specific class it provides the name and icon only for building

- * a submenu node or dropdown toolbutton and contains a list of further

- * Actions to be contained in that subnode.

- *

- * @author Bob Tarling

- */

-public class ActionList extends ArrayList<Action> implements Action {

-

-    private Action dummyAction;

-    

-    public ActionList(String name) {

-        dummyAction = new DummyAction(name);

-    }

-    

-    public ActionList(String name, Icon icon) {

-        dummyAction = new DummyAction(name, icon);

-    }

-    

-    public void addPropertyChangeListener(PropertyChangeListener arg0) {

-        dummyAction.addPropertyChangeListener(arg0);

-    }

-

-    public Object getValue(String arg0) {

-        return dummyAction.getValue(arg0);

-    }

-

-    public boolean isEnabled() {

-        return dummyAction.isEnabled();

-    }

-

-    public void putValue(String key, Object value) {

-        dummyAction.putValue(key, value);

-    }

-

-    public void removePropertyChangeListener(PropertyChangeListener arg0) {

-        dummyAction.removePropertyChangeListener(arg0);

-    }

-

-    public void setEnabled(boolean b) {

-        dummyAction.setEnabled(b);

-    }

-

-    public void actionPerformed(ActionEvent e) {

-        dummyAction.actionPerformed(e);

-    }

-

-    private static class DummyAction extends AbstractAction {

-        DummyAction(String name) {

-            super(name);

-        }

-        DummyAction(String name, Icon icon) {

-            super(name, icon);

-        }

-        public void actionPerformed(ActionEvent e) {

-            // Do nothing

-        }

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.kernel;
+
+import java.awt.event.ActionEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.Icon;
+
+/**
+ * This class is both a List and an Action although it purpose is not to serve
+ * as a true executable Action.
+ * Its purpose is to allow menu items, toolbars and toolbuttons etc to be built
+ * from a model mode up of Actions where each Action is either an executable
+ * action to be shown as a menu item or toolbutton. However should an Action
+ * be of this specific class it provides the name and icon only for building
+ * a submenu node or dropdown toolbutton and contains a list of further
+ * Actions to be contained in that subnode.
+ *
+ * @author Bob Tarling
+ */
+public class ActionList extends ArrayList<Action> implements Action {
+
+    private Action dummyAction;
+    
+    public ActionList(String name) {
+        dummyAction = new DummyAction(name);
+    }
+    
+    public ActionList(String name, Icon icon) {
+        dummyAction = new DummyAction(name, icon);
+    }
+    
+    public void addPropertyChangeListener(PropertyChangeListener arg0) {
+        dummyAction.addPropertyChangeListener(arg0);
+    }
+
+    public Object getValue(String arg0) {
+        return dummyAction.getValue(arg0);
+    }
+
+    public boolean isEnabled() {
+        return dummyAction.isEnabled();
+    }
+
+    public void putValue(String key, Object value) {
+        dummyAction.putValue(key, value);
+    }
+
+    public void removePropertyChangeListener(PropertyChangeListener arg0) {
+        dummyAction.removePropertyChangeListener(arg0);
+    }
+
+    public void setEnabled(boolean b) {
+        dummyAction.setEnabled(b);
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        dummyAction.actionPerformed(e);
+    }
+
+    private static class DummyAction extends AbstractAction {
+        DummyAction(String name) {
+            super(name);
+        }
+        DummyAction(String name, Icon icon) {
+            super(name, icon);
+        }
+        public void actionPerformed(ActionEvent e) {
+            // Do nothing
+        }
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/kernel/Owned.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/kernel/Owned.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/kernel/Owned.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/kernel/Owned.java	2012-12-28 10:30:46-0800
@@ -1,27 +1,27 @@
-/* $Id:$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.kernel;

-

-/**

- * To be implemented by classes that are "owned" by some model element.

- * e.g. a FigClass is owned by a class, a UMLClassDiagram is owned by a

- * namespace.

- * The owner is typically immutable and set by the constructor. Hence not

- * setter is provided as part of this interface.

- *

- * @author Bob Tarling

- */

-public interface Owned {

-    Object getOwner();

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.kernel;
+
+/**
+ * To be implemented by classes that are "owned" by some model element.
+ * e.g. a FigClass is owned by a class, a UMLClassDiagram is owned by a
+ * namespace.
+ * The owner is typically immutable and set by the constructor. Hence not
+ * setter is provided as part of this interface.
+ *
+ * @author Bob Tarling
+ */
+public interface Owned {
+    Object getOwner();
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigRegion.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigRegion.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigRegion.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigRegion.java	2012-12-28 10:30:46-0800
@@ -1,43 +1,43 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.uml.diagram.state.ui;

-

-import java.awt.Dimension;

-import org.tigris.gef.presentation.FigRect;

-

-/**

- * Displays a region within a composite state

- */

-public class FigRegion extends FigRect {

-

-    /**

-     * Construct a fig representing a region.

-     * 

-     * @param region owning UML element

-     */

-    public FigRegion(

-            final Object region) {

-        super(0, 0, 0, 0);

-        setLineWidth(0);

-        setOwner(region);

-    }

-    

-    /*

-     * @see org.tigris.gef.presentation.Fig#getMinimumSize()

-     */

-    @Override

-    public Dimension getMinimumSize() {

-        return new Dimension(180, 80);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.uml.diagram.state.ui;
+
+import java.awt.Dimension;
+import org.tigris.gef.presentation.FigRect;
+
+/**
+ * Displays a region within a composite state
+ */
+public class FigRegion extends FigRect {
+
+    /**
+     * Construct a fig representing a region.
+     * 
+     * @param region owning UML element
+     */
+    public FigRegion(
+            final Object region) {
+        super(0, 0, 0, 0);
+        setLineWidth(0);
+        setOwner(region);
+    }
+    
+    /*
+     * @see org.tigris.gef.presentation.Fig#getMinimumSize()
+     */
+    @Override
+    public Dimension getMinimumSize() {
+        return new Dimension(180, 80);
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigVertex.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigVertex.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigVertex.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigVertex.java	2012-12-28 10:30:46-0800
@@ -1,513 +1,513 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.uml.diagram.state.ui;

-

-import java.awt.Dimension;

-import java.awt.Font;

-import java.awt.Graphics;

-import java.awt.Rectangle;

-import java.awt.event.MouseEvent;

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyVetoException;

-import java.util.ArrayList;

-import java.util.Iterator;

-import java.util.List;

-import java.util.Vector;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.AddAssociationEvent;

-import org.argouml.model.Model;

-import org.argouml.model.RemoveAssociationEvent;

-import org.argouml.notation.Notation;

-import org.argouml.notation.NotationName;

-import org.argouml.notation.NotationProvider;

-import org.argouml.notation.NotationProviderFactory2;

-import org.argouml.notation.NotationSettings;

-import org.argouml.ui.ActionCreateContainedModelElement;

-import org.argouml.ui.targetmanager.TargetManager;

-import org.argouml.uml.diagram.ArgoDiagram;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

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

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

-import org.tigris.gef.di.DiagramElement;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.FigGroup;

-import org.tigris.gef.presentation.FigRRect;

-import org.tigris.gef.presentation.FigText;

-

-/**

- * A Fig that can represent a UML2 vertex. The current implementation

- * is limited to just handling States. Other vertices are currently handled

- * by different Figs but they will most likely all be handled here in future.

- */

-public class FigVertex extends FigNodeModelElement {

-

-    private static final Logger LOG = Logger.getLogger(FigVertex.class);

-    

-    private static final int MARGIN = 2;

-

-    private NotationProvider notationProviderBody;

-

-    /**

-     * The body for entry/exit/do actions

-     */

-    private FigBody bodyText;

-    

-    private FigGroup regionCompartment;

-

-    /**

-     * Create a new instance of FigVertex

-     * @param owner the vertex that own this dagram element

-     * @param bounds the bounds of the diagram element

-     * @param settings the display settings for this diagram element

-     */

-    public FigVertex(Object owner, Rectangle bounds, DiagramSettings settings) {

-        super(owner, bounds, settings);

-        this.allowRemoveFromDiagram(false);

-

-        initialize();

-

-        NotationName notation = Notation.findNotation(getNotationSettings()

-                .getNotationLanguage());

-        notationProviderBody = NotationProviderFactory2.getInstance()

-                .getNotationProvider(NotationProviderFactory2.TYPE_STATEBODY,

-                        getOwner(), this, notation);

-        updateNameText();

-        

-        LOG.info("Registering as listener");

-        Model.getPump().addModelEventListener(this, getOwner(), "region");

-    }

-

-    @Override

-    public void setEnclosingFig(Fig encloser) {

-        LayerPerspective lp = (LayerPerspective) getLayer();

-        if (lp == null) {

-            return;

-        }

-        

-        super.setEnclosingFig(encloser);

-

-        Object region = null;

-        if (encloser != null) {

-            // Get the region as the first Region in the State.

-            // If there is no region in the StateMachine then create one.

-            List regions = Model.getStateMachinesHelper().getRegions(

-                    encloser.getOwner());

-            if (regions.isEmpty()) {

-                // There are no regions so create one and 

-                // place the vertex there.

-                region = Model.getUmlFactory().buildNode(

-                        Model.getMetaTypes().getRegion(), encloser.getOwner());

-            } else {

-                // There are one or more regions so find the one that the

-                //vertex was dropped in

-                FigVertex compositeState = (FigVertex) encloser;

-                for (DiagramElement de : 

-                        compositeState.regionCompartment.getDiagramElements()) {

-                    if (((Fig) de).getBounds().contains(getBounds())) {

-                        region = de.getOwner();

-                        break;

-                    }

-                }

-            }

-        } else {

-            // The vertex was dropped onto the diagram.

-            // Get the region as the first Region in the StateMachine.

-            // If there is no region in the StateMachine then create one.

-            ArgoDiagram diagram = (ArgoDiagram) lp.getDiagram();

-            Object stateMachine = diagram.getOwner();

-            List regions = 

-                Model.getStateMachinesHelper().getRegions(stateMachine);

-            if (regions.isEmpty()) {

-                region = Model.getUmlFactory().buildNode(

-                        Model.getMetaTypes().getRegion(), stateMachine);

-            } else {

-                region = regions.get(0);

-            }

-        }

-        if (region != null

-                && Model.getFacade().getContainer(getOwner()) != region) {

-            Model.getStateMachinesHelper().setContainer(getOwner(), region);

-        }

-    }

-

-    @Override

-    public Selection makeSelection() {

-        return new SelectionVertex(this);

-    }

-    

-    @Override

-    protected Fig createBigPortFig() {

-        return new FigRRect(0, 0, 0, 0, LINE_COLOR, FILL_COLOR);

-    }

-

-    private void initialize() {

-        getNameFig().setLineWidth(0);

-        getNameFig().setFilled(false);

-

-        bodyText = new FigBody(0, 0, 0, 0);

-        regionCompartment = new FigRegionCompartment(0, 0, 0, 0);

-        

-        addFig(getBigPort());

-        addFig(getNameFig());

-        addFig(getBodyText());

-        addFig(regionCompartment);

-

-        setBounds(getBounds());

-    }

-

-    /*

-     * @see

-     * org.argouml.uml.diagram.state.ui.FigStateVertex#initNotationProviders

-     * (java.lang.Object)

-     */

-    @Override

-    protected void initNotationProviders(Object own) {

-        if (notationProviderBody != null) {

-            notationProviderBody.cleanListener();

-        }

-        super.initNotationProviders(own);

-        NotationName notation = Notation.findNotation(getNotationSettings()

-                .getNotationLanguage());

-        if (Model.getFacade().isAState(own)) {

-            notationProviderBody = NotationProviderFactory2.getInstance()

-                    .getNotationProvider(

-                            NotationProviderFactory2.TYPE_STATEBODY, own, this,

-                            notation);

-        }

-    }

-

-    // Temporary start

-//    private static final Color[] COLOR_ARRAY = {

-//        Color.RED, Color.BLUE, Color.CYAN, Color.YELLOW, Color.GREEN}; 

-//    private int nextColor = 0;

-    // Temporary end

-    

-    @Override

-    protected void modelChanged(PropertyChangeEvent mee) {

-        super.modelChanged(mee);

-        

-        assert (mee.getPropertyName().equals("region"));

-        

-        if (mee instanceof AddAssociationEvent) {

-            // TODO: Before adding a new region make the last region

-            // its minimum size (smallest size that will still

-            // contain all enclosed)

-            

-            Object newRegion = mee.getNewValue();

-            FigRegion rg = new FigRegion(newRegion);

-            rg.setBounds(

-                    regionCompartment.getX(), regionCompartment.getY(),

-                    rg.getMinimumSize().width, rg.getMinimumSize().height);

-            

-            // Temporary start - colour the regions so that we can 

-            // see them for now

-//            rg.setFillColor(COLOR_ARRAY[nextColor++]);

-//            if (nextColor >= COLOR_ARRAY.length) {

-//                nextColor = 0;

-//            }

-            // Temporary end

-            

-            regionCompartment.addFig(rg);

-            setSize(getMinimumSize());

-        }

-        if (mee instanceof RemoveAssociationEvent) {

-            Object oldRegion = mee.getNewValue();

-            for (DiagramElement de : regionCompartment.getDiagramElements()) {

-                if (de.getOwner() == oldRegion) {

-                    regionCompartment.removeFig((Fig) de);

-                    // TODO: After removing a region reset the overall

-                    // size of the node.

-                    renderingChanged();

-                    damage();

-                }

-            }

-            LOG.debug("Removing region " + oldRegion);

-        }

-    }

-

-    /*

-     * @see

-     * org.argouml.uml.diagram.ui.FigNodeModelElement#removeFromDiagramImpl()

-     */

-    @Override

-    public void removeFromDiagramImpl() {

-        if (notationProviderBody != null) {

-            notationProviderBody.cleanListener();

-        }

-        super.removeFromDiagramImpl();

-    }

-

-    /*

-     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#renderingChanged()

-     */

-    @Override

-    public void renderingChanged() {

-        super.renderingChanged();

-        if (notationProviderBody != null) {

-            bodyText.setText(notationProviderBody.toString(getOwner(),

-                    getNotationSettings()));

-        }

-        calcBounds();

-        setBounds(getBounds());

-    }

-

-    private FigText getBodyText() {

-        return bodyText;

-    }

-

-    @Override

-    protected void textEditStarted(FigText ft) {

-        super.textEditStarted(ft);

-        if (ft == bodyText) {

-            showHelp(notationProviderBody.getParsingHelp());

-        }

-    }

-

-    @Override

-    public void textEdited(FigText ft) throws PropertyVetoException {

-        super.textEdited(ft);

-        if (ft == getBodyText()) {

-            notationProviderBody.parse(getOwner(), ft.getText());

-            ft.setText(notationProviderBody.toString(getOwner(),

-                    getNotationSettings()));

-        }

-    }

-

-    public void notationRenderingChanged(

-            NotationProvider np, 

-            String rendering) {

-        super.notationRenderingChanged(np, rendering);

-        if (notationProviderBody == np) {

-            bodyText.setText(rendering);

-            updateBounds();

-            damage();

-        }

-    }

-

-    public NotationSettings getNotationSettings(NotationProvider np) {

-        return getNotationSettings();

-    }

-

-    public Object getOwner(NotationProvider np) {

-        return getOwner();

-    }

-

-    public Dimension getMinimumSize() {

-        final Dimension nameSize = getNameFig().getMinimumSize();

-        final Dimension bodySize = getBodyText().getMinimumSize();

-

-        int h = getTopMargin()

-            + nameSize.height

-            + getBottomMargin();

-

-        h += regionCompartment.getMinimumSize().height;

-        

-        if (getBodyText().getText().length() > 0) {

-            h += bodySize.height;

-        }

-        

-        int w = getLeftMargin()

-            + Math.max(nameSize.width, bodySize.width)

-            + getRightMargin();

-        

-        if (Model.getFacade().isACompositeState(getOwner())) {

-            w = Math.max(180, w);

-            h = Math.max(150, h);

-        } else {

-            w = Math.max(80, w);

-            h = Math.max(40, h);

-        }

-        

-        return new Dimension(w, h);

-    }

-

-    public boolean getUseTrapRect() {

-        return true;

-    }

-

-    public List<Rectangle> getTrapRects() {

-        List regions = Model.getStateMachinesHelper().getRegions(getOwner());

-        

-        ArrayList<Rectangle> rects = new ArrayList<Rectangle>(regions.size());

-        if (regions.isEmpty()) {

-            rects.add(regionCompartment.getBounds());

-        } else {

-            for (DiagramElement f : regionCompartment.getDiagramElements()) {

-                rects.add(((Fig) f).getBounds());

-            }

-        }

-        return rects;

-    }

-    

-    protected void setStandardBounds(int x, int y, int w, int h) {

-        Dimension nameSize = getNameFig().getMinimumSize();

-        Dimension bodySize = getBodyText().getMinimumSize();

-

-        getNameFig().setBounds(

-                x + getLeftMargin(), y + getTopMargin(),

-                w - getLeftMargin() - getRightMargin(), nameSize.height);

-

-

-        

-        if (getBodyText().getText().length() > 0) {

-            getBodyText().setBounds(

-                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,

-                    bodySize.width,

-                    bodySize.height);

-        } else {

-            getBodyText().setBounds(

-                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,

-                    bodySize.width,

-                    1);

-        }

-        

-        regionCompartment.setBounds(

-                x + getLeftMargin(),

-                getBodyText().getY() + getBodyText().getHeight(),

-                w - getLeftMargin() - getRightMargin(),

-                h - getTopMargin() - getBottomMargin()

-                    - getNameFig().getHeight() - getBodyText().getHeight());

-

-        getBigPort().setBounds(x, y, w, h);

-        

-        calcBounds(); // _x = x; _y = y; _w = w; _h = h;

-    }

-    

-    

-    

-    int getRightMargin() {

-        return MARGIN;

-    }

-

-    int getLeftMargin() {

-        return MARGIN;

-    }

-    

-    int getTopMargin() {

-        return MARGIN;

-    }

-    

-    int getBottomMargin() {

-        return MARGIN;

-    }

-    

-    /*

-     * @see org.tigris.gef.ui.PopupGenerator#getPopUpActions(java.awt.event.MouseEvent)

-     */

-    public Vector getPopUpActions(MouseEvent me) {

-        Vector popUpActions = super.getPopUpActions(me);

-        if (TargetManager.getInstance().getTargets().size() == 1) {

-            popUpActions.add(

-                    popUpActions.size() - getPopupAddOffset(),

-                    new ActionCreateContainedModelElement(

-                            Model.getMetaTypes().getRegion(), getOwner()));

-        }

-        return popUpActions;

-    }

-    

-    /**

-     * The text Fig that displays the body of the actions on the state

-     *

-     * @author Bob Tarling

-     */

-    private class FigBody extends FigText {

-        public FigBody(int x, int y, int width, int height) {

-            super (x, y, width, height);

-            setFont(getSettings().getFont(Font.PLAIN));

-            setTextColor(TEXT_COLOR);

-            setLineWidth(0);

-            setFilled(false);

-            setExpandOnly(true);

-            setReturnAction(FigText.INSERT);

-            setJustification(FigText.JUSTIFY_LEFT);

-        }

-    }

-    

-    /**

-     * The text Fig that displays the body of the actions on the state

-     *

-     * @author Bob Tarling

-     */

-    private class FigRegionCompartment extends FigGroup {

-        public FigRegionCompartment(int x, int y, int width, int height) {

-            super();

-        }

-        

-        @Override

-        protected void setBoundsImpl(

-                final int x,

-                int y,

-                final int w,

-                int h) {

-

-            _x = x;

-            _y = y;

-            _w = w;

-            _h = h;

-            

-            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {

-                Fig fig = (Fig) it.next();

-                if (it.hasNext()) {

-                    fig.setBounds(x, y, w, fig.getMinimumSize().height);

-                    h -= fig.getMinimumSize().height;

-                } else {

-                    fig.setBounds(x, y, w, h);

-                }

-                y += fig.getHeight();

-            }

-        }

-        

-        

-        @Override

-        public Dimension getMinimumSize() {

-            int minWidth = 0;

-            int minHeight = 0;

-            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {

-                Fig fig = (Fig) it.next();

-                minWidth = Math.max(fig.getMinimumSize().width, minWidth);

-                if (it.hasNext()) {

-                    minHeight += fig.getHeight();

-                } else {

-                    minHeight += fig.getMinimumSize().height;

-                }

-            }

-

-            return new Dimension(minWidth, minHeight);

-        }

-        

-        public void paint(Graphics g) {

-            super.paint(g);

-            

-            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {

-                Fig fig = (Fig) it.next();

-                if (it.hasNext()) {

-                    g.setColor(getLineColor());

-                    

-                    drawDashedLine(

-                            g, 1, 

-                            fig.getX(), 

-                            fig.getY() + fig.getHeight(),

-                            fig.getX() + fig.getWidth(),

-                            fig.getY() + fig.getHeight(),

-                            0, new float [] {

-                                5.0f, 5.0f },

-                            10);            

-                }

-            }

-            

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.uml.diagram.state.ui;
+
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.AddAssociationEvent;
+import org.argouml.model.Model;
+import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.notation.Notation;
+import org.argouml.notation.NotationName;
+import org.argouml.notation.NotationProvider;
+import org.argouml.notation.NotationProviderFactory2;
+import org.argouml.notation.NotationSettings;
+import org.argouml.ui.ActionCreateContainedModelElement;
+import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.base.Selection;
+import org.tigris.gef.di.DiagramElement;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigGroup;
+import org.tigris.gef.presentation.FigRRect;
+import org.tigris.gef.presentation.FigText;
+
+/**
+ * A Fig that can represent a UML2 vertex. The current implementation
+ * is limited to just handling States. Other vertices are currently handled
+ * by different Figs but they will most likely all be handled here in future.
+ */
+public class FigVertex extends FigNodeModelElement {
+
+    private static final Logger LOG = Logger.getLogger(FigVertex.class);
+    
+    private static final int MARGIN = 2;
+
+    private NotationProvider notationProviderBody;
+
+    /**
+     * The body for entry/exit/do actions
+     */
+    private FigBody bodyText;
+    
+    private FigGroup regionCompartment;
+
+    /**
+     * Create a new instance of FigVertex
+     * @param owner the vertex that own this dagram element
+     * @param bounds the bounds of the diagram element
+     * @param settings the display settings for this diagram element
+     */
+    public FigVertex(Object owner, Rectangle bounds, DiagramSettings settings) {
+        super(owner, bounds, settings);
+        this.allowRemoveFromDiagram(false);
+
+        initialize();
+
+        NotationName notation = Notation.findNotation(getNotationSettings()
+                .getNotationLanguage());
+        notationProviderBody = NotationProviderFactory2.getInstance()
+                .getNotationProvider(NotationProviderFactory2.TYPE_STATEBODY,
+                        getOwner(), this, notation);
+        updateNameText();
+        
+        LOG.info("Registering as listener");
+        Model.getPump().addModelEventListener(this, getOwner(), "region");
+    }
+
+    @Override
+    public void setEnclosingFig(Fig encloser) {
+        LayerPerspective lp = (LayerPerspective) getLayer();
+        if (lp == null) {
+            return;
+        }
+        
+        super.setEnclosingFig(encloser);
+
+        Object region = null;
+        if (encloser != null) {
+            // Get the region as the first Region in the State.
+            // If there is no region in the StateMachine then create one.
+            List regions = Model.getStateMachinesHelper().getRegions(
+                    encloser.getOwner());
+            if (regions.isEmpty()) {
+                // There are no regions so create one and 
+                // place the vertex there.
+                region = Model.getUmlFactory().buildNode(
+                        Model.getMetaTypes().getRegion(), encloser.getOwner());
+            } else {
+                // There are one or more regions so find the one that the
+                //vertex was dropped in
+                FigVertex compositeState = (FigVertex) encloser;
+                for (DiagramElement de : 
+                        compositeState.regionCompartment.getDiagramElements()) {
+                    if (((Fig) de).getBounds().contains(getBounds())) {
+                        region = de.getOwner();
+                        break;
+                    }
+                }
+            }
+        } else {
+            // The vertex was dropped onto the diagram.
+            // Get the region as the first Region in the StateMachine.
+            // If there is no region in the StateMachine then create one.
+            ArgoDiagram diagram = (ArgoDiagram) lp.getDiagram();
+            Object stateMachine = diagram.getOwner();
+            List regions = 
+                Model.getStateMachinesHelper().getRegions(stateMachine);
+            if (regions.isEmpty()) {
+                region = Model.getUmlFactory().buildNode(
+                        Model.getMetaTypes().getRegion(), stateMachine);
+            } else {
+                region = regions.get(0);
+            }
+        }
+        if (region != null
+                && Model.getFacade().getContainer(getOwner()) != region) {
+            Model.getStateMachinesHelper().setContainer(getOwner(), region);
+        }
+    }
+
+    @Override
+    public Selection makeSelection() {
+        return new SelectionVertex(this);
+    }
+    
+    @Override
+    protected Fig createBigPortFig() {
+        return new FigRRect(0, 0, 0, 0, LINE_COLOR, FILL_COLOR);
+    }
+
+    private void initialize() {
+        getNameFig().setLineWidth(0);
+        getNameFig().setFilled(false);
+
+        bodyText = new FigBody(0, 0, 0, 0);
+        regionCompartment = new FigRegionCompartment(0, 0, 0, 0);
+        
+        addFig(getBigPort());
+        addFig(getNameFig());
+        addFig(getBodyText());
+        addFig(regionCompartment);
+
+        setBounds(getBounds());
+    }
+
+    /*
+     * @see
+     * org.argouml.uml.diagram.state.ui.FigStateVertex#initNotationProviders
+     * (java.lang.Object)
+     */
+    @Override
+    protected void initNotationProviders(Object own) {
+        if (notationProviderBody != null) {
+            notationProviderBody.cleanListener();
+        }
+        super.initNotationProviders(own);
+        NotationName notation = Notation.findNotation(getNotationSettings()
+                .getNotationLanguage());
+        if (Model.getFacade().isAState(own)) {
+            notationProviderBody = NotationProviderFactory2.getInstance()
+                    .getNotationProvider(
+                            NotationProviderFactory2.TYPE_STATEBODY, own, this,
+                            notation);
+        }
+    }
+
+    // Temporary start
+//    private static final Color[] COLOR_ARRAY = {
+//        Color.RED, Color.BLUE, Color.CYAN, Color.YELLOW, Color.GREEN}; 
+//    private int nextColor = 0;
+    // Temporary end
+    
+    @Override
+    protected void modelChanged(PropertyChangeEvent mee) {
+        super.modelChanged(mee);
+        
+        assert (mee.getPropertyName().equals("region"));
+        
+        if (mee instanceof AddAssociationEvent) {
+            // TODO: Before adding a new region make the last region
+            // its minimum size (smallest size that will still
+            // contain all enclosed)
+            
+            Object newRegion = mee.getNewValue();
+            FigRegion rg = new FigRegion(newRegion);
+            rg.setBounds(
+                    regionCompartment.getX(), regionCompartment.getY(),
+                    rg.getMinimumSize().width, rg.getMinimumSize().height);
+            
+            // Temporary start - colour the regions so that we can 
+            // see them for now
+//            rg.setFillColor(COLOR_ARRAY[nextColor++]);
+//            if (nextColor >= COLOR_ARRAY.length) {
+//                nextColor = 0;
+//            }
+            // Temporary end
+            
+            regionCompartment.addFig(rg);
+            setSize(getMinimumSize());
+        }
+        if (mee instanceof RemoveAssociationEvent) {
+            Object oldRegion = mee.getNewValue();
+            for (DiagramElement de : regionCompartment.getDiagramElements()) {
+                if (de.getOwner() == oldRegion) {
+                    regionCompartment.removeFig((Fig) de);
+                    // TODO: After removing a region reset the overall
+                    // size of the node.
+                    renderingChanged();
+                    damage();
+                }
+            }
+            LOG.debug("Removing region " + oldRegion);
+        }
+    }
+
+    /*
+     * @see
+     * org.argouml.uml.diagram.ui.FigNodeModelElement#removeFromDiagramImpl()
+     */
+    @Override
+    public void removeFromDiagramImpl() {
+        if (notationProviderBody != null) {
+            notationProviderBody.cleanListener();
+        }
+        super.removeFromDiagramImpl();
+    }
+
+    /*
+     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#renderingChanged()
+     */
+    @Override
+    public void renderingChanged() {
+        super.renderingChanged();
+        if (notationProviderBody != null) {
+            bodyText.setText(notationProviderBody.toString(getOwner(),
+                    getNotationSettings()));
+        }
+        calcBounds();
+        setBounds(getBounds());
+    }
+
+    private FigText getBodyText() {
+        return bodyText;
+    }
+
+    @Override
+    protected void textEditStarted(FigText ft) {
+        super.textEditStarted(ft);
+        if (ft == bodyText) {
+            showHelp(notationProviderBody.getParsingHelp());
+        }
+    }
+
+    @Override
+    public void textEdited(FigText ft) throws PropertyVetoException {
+        super.textEdited(ft);
+        if (ft == getBodyText()) {
+            notationProviderBody.parse(getOwner(), ft.getText());
+            ft.setText(notationProviderBody.toString(getOwner(),
+                    getNotationSettings()));
+        }
+    }
+
+    public void notationRenderingChanged(
+            NotationProvider np, 
+            String rendering) {
+        super.notationRenderingChanged(np, rendering);
+        if (notationProviderBody == np) {
+            bodyText.setText(rendering);
+            updateBounds();
+            damage();
+        }
+    }
+
+    public NotationSettings getNotationSettings(NotationProvider np) {
+        return getNotationSettings();
+    }
+
+    public Object getOwner(NotationProvider np) {
+        return getOwner();
+    }
+
+    public Dimension getMinimumSize() {
+        final Dimension nameSize = getNameFig().getMinimumSize();
+        final Dimension bodySize = getBodyText().getMinimumSize();
+
+        int h = getTopMargin()
+            + nameSize.height
+            + getBottomMargin();
+
+        h += regionCompartment.getMinimumSize().height;
+        
+        if (getBodyText().getText().length() > 0) {
+            h += bodySize.height;
+        }
+        
+        int w = getLeftMargin()
+            + Math.max(nameSize.width, bodySize.width)
+            + getRightMargin();
+        
+        if (Model.getFacade().isACompositeState(getOwner())) {
+            w = Math.max(180, w);
+            h = Math.max(150, h);
+        } else {
+            w = Math.max(80, w);
+            h = Math.max(40, h);
+        }
+        
+        return new Dimension(w, h);
+    }
+
+    public boolean getUseTrapRect() {
+        return true;
+    }
+
+    public List<Rectangle> getTrapRects() {
+        List regions = Model.getStateMachinesHelper().getRegions(getOwner());
+        
+        ArrayList<Rectangle> rects = new ArrayList<Rectangle>(regions.size());
+        if (regions.isEmpty()) {
+            rects.add(regionCompartment.getBounds());
+        } else {
+            for (DiagramElement f : regionCompartment.getDiagramElements()) {
+                rects.add(((Fig) f).getBounds());
+            }
+        }
+        return rects;
+    }
+    
+    protected void setStandardBounds(int x, int y, int w, int h) {
+        Dimension nameSize = getNameFig().getMinimumSize();
+        Dimension bodySize = getBodyText().getMinimumSize();
+
+        getNameFig().setBounds(
+                x + getLeftMargin(), y + getTopMargin(),
+                w - getLeftMargin() - getRightMargin(), nameSize.height);
+
+
+        
+        if (getBodyText().getText().length() > 0) {
+            getBodyText().setBounds(
+                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,
+                    bodySize.width,
+                    bodySize.height);
+        } else {
+            getBodyText().setBounds(
+                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,
+                    bodySize.width,
+                    1);
+        }
+        
+        regionCompartment.setBounds(
+                x + getLeftMargin(),
+                getBodyText().getY() + getBodyText().getHeight(),
+                w - getLeftMargin() - getRightMargin(),
+                h - getTopMargin() - getBottomMargin()
+                    - getNameFig().getHeight() - getBodyText().getHeight());
+
+        getBigPort().setBounds(x, y, w, h);
+        
+        calcBounds(); // _x = x; _y = y; _w = w; _h = h;
+    }
+    
+    
+    
+    int getRightMargin() {
+        return MARGIN;
+    }
+
+    int getLeftMargin() {
+        return MARGIN;
+    }
+    
+    int getTopMargin() {
+        return MARGIN;
+    }
+    
+    int getBottomMargin() {
+        return MARGIN;
+    }
+    
+    /*
+     * @see org.tigris.gef.ui.PopupGenerator#getPopUpActions(java.awt.event.MouseEvent)
+     */
+    public Vector getPopUpActions(MouseEvent me) {
+        Vector popUpActions = super.getPopUpActions(me);
+        if (TargetManager.getInstance().getTargets().size() == 1) {
+            popUpActions.add(
+                    popUpActions.size() - getPopupAddOffset(),
+                    new ActionCreateContainedModelElement(
+                            Model.getMetaTypes().getRegion(), getOwner()));
+        }
+        return popUpActions;
+    }
+    
+    /**
+     * The text Fig that displays the body of the actions on the state
+     *
+     * @author Bob Tarling
+     */
+    private class FigBody extends FigText {
+        public FigBody(int x, int y, int width, int height) {
+            super (x, y, width, height);
+            setFont(getSettings().getFont(Font.PLAIN));
+            setTextColor(TEXT_COLOR);
+            setLineWidth(0);
+            setFilled(false);
+            setExpandOnly(true);
+            setReturnAction(FigText.INSERT);
+            setJustification(FigText.JUSTIFY_LEFT);
+        }
+    }
+    
+    /**
+     * The text Fig that displays the body of the actions on the state
+     *
+     * @author Bob Tarling
+     */
+    private class FigRegionCompartment extends FigGroup {
+        public FigRegionCompartment(int x, int y, int width, int height) {
+            super();
+        }
+        
+        @Override
+        protected void setBoundsImpl(
+                final int x,
+                int y,
+                final int w,
+                int h) {
+
+            _x = x;
+            _y = y;
+            _w = w;
+            _h = h;
+            
+            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
+                Fig fig = (Fig) it.next();
+                if (it.hasNext()) {
+                    fig.setBounds(x, y, w, fig.getMinimumSize().height);
+                    h -= fig.getMinimumSize().height;
+                } else {
+                    fig.setBounds(x, y, w, h);
+                }
+                y += fig.getHeight();
+            }
+        }
+        
+        
+        @Override
+        public Dimension getMinimumSize() {
+            int minWidth = 0;
+            int minHeight = 0;
+            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
+                Fig fig = (Fig) it.next();
+                minWidth = Math.max(fig.getMinimumSize().width, minWidth);
+                if (it.hasNext()) {
+                    minHeight += fig.getHeight();
+                } else {
+                    minHeight += fig.getMinimumSize().height;
+                }
+            }
+
+            return new Dimension(minWidth, minHeight);
+        }
+        
+        public void paint(Graphics g) {
+            super.paint(g);
+            
+            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
+                Fig fig = (Fig) it.next();
+                if (it.hasNext()) {
+                    g.setColor(getLineColor());
+                    
+                    drawDashedLine(
+                            g, 1, 
+                            fig.getX(), 
+                            fig.getY() + fig.getHeight(),
+                            fig.getX() + fig.getWidth(),
+                            fig.getY() + fig.getHeight(),
+                            0, new float [] {
+                                5.0f, 5.0f },
+                            10);            
+                }
+            }
+            
+        }
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionVertex.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionVertex.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionVertex.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/SelectionVertex.java	2012-12-28 10:30:46-0800
@@ -1,43 +1,43 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.uml.diagram.state.ui;

-

-import java.awt.Graphics;

-

-import org.tigris.gef.presentation.Fig;

-

-/**

- * A selection for a vertex (which can be an orthogonal state).

- * This acts the same as its superclass unless the vertex is in fact an

- * orthogonal state in which case extra handles are painted for moving

- * the region separators.

- *

- * @author Bob Tarling

- */

-public class SelectionVertex extends SelectionState {

-

-    /**

-     * Construct a new SelectionState for the given Fig.

-     *

-     * @param f The given Fig.

-     */

-    public SelectionVertex(Fig f) {

-	super(f);

-    }

-

-    @Override

-    public void paint(Graphics g) {

-        super.paint(g);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.uml.diagram.state.ui;
+
+import java.awt.Graphics;
+
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * A selection for a vertex (which can be an orthogonal state).
+ * This acts the same as its superclass unless the vertex is in fact an
+ * orthogonal state in which case extra handles are painted for moving
+ * the region separators.
+ *
+ * @author Bob Tarling
+ */
+public class SelectionVertex extends SelectionState {
+
+    /**
+     * Construct a new SelectionState for the given Fig.
+     *
+     * @param f The given Fig.
+     */
+    public SelectionVertex(Fig f) {
+	super(f);
+    }
+
+    @Override
+    public void paint(Graphics g) {
+        super.paint(g);
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionCompartmentText.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionCompartmentText.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionCompartmentText.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/SelectionCompartmentText.java	2012-12-28 10:30:46-0800
@@ -1,59 +1,59 @@
-/* $Id: SelectionCompartmentText.java 19205 2011-04-10 21:31:56Z bobtarling $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.uml.diagram.static_structure.ui;

-

-import javax.swing.Icon;

-

-import org.tigris.gef.presentation.Fig;

-import org.argouml.uml.diagram.ui.SelectionNodeClarifiers2;

-

-/**

- * @author Bob Tarling

- */

-public class SelectionCompartmentText extends SelectionNodeClarifiers2 {

-

-    /**

-     * Construct a new SelectionClass for the given Fig.

-     *

-     * @param f The given Fig.

-     */

-    public SelectionCompartmentText(Fig f) { 

-        super(f);

-    }

-

-    @Override

-    protected Icon[] getIcons() {

-        return null;

-    }

-    

-    @Override

-    protected String getInstructions(int index) {

-        return "";

-    }

-

-    @Override

-    protected Object getNewNodeType(int i) {

-        return null;

-    }

-

-    @Override

-    protected Object getNewEdgeType(int i) {

-        return null;

-    }

-

-    @Override

-    protected boolean isDraggableHandle(int index) {

-        return false;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.uml.diagram.static_structure.ui;
+
+import javax.swing.Icon;
+
+import org.tigris.gef.presentation.Fig;
+import org.argouml.uml.diagram.ui.SelectionNodeClarifiers2;
+
+/**
+ * @author Bob Tarling
+ */
+public class SelectionCompartmentText extends SelectionNodeClarifiers2 {
+
+    /**
+     * Construct a new SelectionClass for the given Fig.
+     *
+     * @param f The given Fig.
+     */
+    public SelectionCompartmentText(Fig f) { 
+        super(f);
+    }
+
+    @Override
+    protected Icon[] getIcons() {
+        return null;
+    }
+    
+    @Override
+    protected String getInstructions(int index) {
+        return "";
+    }
+
+    @Override
+    protected Object getNewNodeType(int i) {
+        return null;
+    }
+
+    @Override
+    protected Object getNewEdgeType(int i) {
+        return null;
+    }
+
+    @Override
+    protected boolean isDraggableHandle(int index) {
+        return false;
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionClassifierBox.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionClassifierBox.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionClassifierBox.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionClassifierBox.java	2012-12-28 10:30:46-0800
@@ -1,162 +1,162 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Katharina Fahnenbruck

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.uml.diagram.ui;

-

-import java.awt.Graphics;

-import java.awt.Rectangle;

-import java.awt.event.MouseEvent;

-import java.util.ArrayList;

-

-import javax.swing.Icon;

-

-import org.argouml.application.helpers.ResourceLoaderWrapper;

-import org.argouml.uml.diagram.static_structure.ui.FigClassifierBox;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.Handle;

-

-/**

- * This class adds two buttons to the class-element. They are shown when the

- * mouse is over the selected element. The upper button is for adding new

- * attributes. The lower button is for adding new operations.

- * 

- * @author Katharina Fahnenbruck

- */

-public abstract class SelectionClassifierBox extends

-        SelectionNodeClarifiers2 {

-

-    /** Upper right corner Handle */

-    private static final int UPPER_RIGHT = 2;

-

-    /** Lower right corner Handle */

-    private static final int LOWER_RIGHT = 7;

-

-    private static int[] buttonIds = {UPPER_RIGHT, LOWER_RIGHT};

-    

-    private static Icon addIcon = 

-        ResourceLoaderWrapper.lookupIconResource("Add");

-

-    private class Button {

-        int handle;

-        Icon icon;

-        Fig fig;

-        Object metaType;

-        

-        public Button(

-                int handle, 

-                Icon icon, 

-                Fig fig,

-                Object metaType) {

-            this.handle = handle;

-            this.fig = fig;

-            this.icon = icon;

-            this.metaType = metaType;

-        }

-    }

-    

-    private ArrayList<Button> buttons = new ArrayList<Button>(2);

-    

-    /**

-     * @param f

-     *            the given Fig

-     */

-    public SelectionClassifierBox(Fig f) {

-       

-        super(f);

-        

-        FigClassifierBox fcb = (FigClassifierBox) getContent();

-        int i=0;

-        for (FigCompartment compartment : fcb.getCompartments()) {

-            buttons.add(new Button(buttonIds[i++], addIcon, compartment, compartment.getCompartmentType()));

-        }

-    }

-

-    /**

-     * Handle h: handle in which to return selected Handle information (output

-     * parameter). A handle index of -1 indicates that the cursor is not over

-     * any GEF handle. If the mouse is over the new buttons nevertheless the

-     * index is -1. There the hitHandle() is overridden (see above)

-     */

-    @Override

-    public void hitHandle(

-            Rectangle cursor, Handle h) {

-        super.hitHandle(cursor, h);

-

-        int cx = getContent().getX();

-        int cy = getContent().getY();

-        int cw = getContent().getWidth();

-        int ch = getContent().getHeight();

-

-        // super returns -1 if any of GEFs buttons was hit

-        // (but maybe one of the not-GEF-buttons)

-        if (h.index == -1) {

-            if (hitBelow(

-                    cx + cw - (addIcon.getIconWidth() / 2), cy + 25,

-                    addIcon.getIconWidth() + 5, addIcon.getIconHeight() + 3,

-                    cursor)) {

-                h.index = UPPER_RIGHT;

-            } else if (hitAbove(cx + cw - (addIcon.getIconWidth() / 2),

-                    cy + ch, addIcon.getIconWidth() + 3,

-                    addIcon.getIconHeight() + 5,

-                    cursor)) {

-                h.index = LOWER_RIGHT;

-            }

-        }

-    }

-

-    @Override

-    public void mouseReleased(MouseEvent me) {

-        for (Button button : buttons) {

-            int cx = button.fig.getX() + button.fig.getWidth() - button.icon.getIconWidth();

-            int cy = button.fig.getY();

-            int cw = button.icon.getIconWidth();

-            int ch = button.icon.getIconHeight();

-            Rectangle rect = new Rectangle(cx, cy, cw, ch);

-            if (rect.contains(me.getX(), me.getY())) {

-                onButtonClicked(button.metaType);

-                me.consume();

-                return;

-            }

-        }

-        

-        super.mouseReleased(me);

-    }

-    

-    /**

-     * Adds new element to the class

-     */

-    private void onButtonClicked(Object metaType) {

-        FigClassifierBox fcb = (FigClassifierBox) getContent();

-        FigCompartment fc = fcb.getCompartment(metaType);

-        fc.setEditOnRedraw(true);

-        fc.createModelElement();

-    }

-

-    /*

-     * @see org.tigris.gef.base.SelectionButtons#paintButtons(Graphics)

-     */

-    @Override

-    public void paintButtons(Graphics g) {

-

-        super.paintButtons(g);

-

-        for (Button button : buttons) {

-            if (button.fig.isVisible()) {

-                int cx = button.fig.getX() + button.fig.getWidth() - button.icon.getIconWidth();

-                int cy = button.fig.getY();

-                paintButton(button.icon, g, cx, cy, button.handle);

-            }

-        }

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Katharina Fahnenbruck
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.uml.diagram.ui;
+
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+
+import javax.swing.Icon;
+
+import org.argouml.application.helpers.ResourceLoaderWrapper;
+import org.argouml.uml.diagram.static_structure.ui.FigClassifierBox;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.Handle;
+
+/**
+ * This class adds two buttons to the class-element. They are shown when the
+ * mouse is over the selected element. The upper button is for adding new
+ * attributes. The lower button is for adding new operations.
+ * 
+ * @author Katharina Fahnenbruck
+ */
+public abstract class SelectionClassifierBox extends
+        SelectionNodeClarifiers2 {
+
+    /** Upper right corner Handle */
+    private static final int UPPER_RIGHT = 2;
+
+    /** Lower right corner Handle */
+    private static final int LOWER_RIGHT = 7;
+
+    private static int[] buttonIds = {UPPER_RIGHT, LOWER_RIGHT};
+    
+    private static Icon addIcon = 
+        ResourceLoaderWrapper.lookupIconResource("Add");
+
+    private class Button {
+        int handle;
+        Icon icon;
+        Fig fig;
+        Object metaType;
+        
+        public Button(
+                int handle, 
+                Icon icon, 
+                Fig fig,
+                Object metaType) {
+            this.handle = handle;
+            this.fig = fig;
+            this.icon = icon;
+            this.metaType = metaType;
+        }
+    }
+    
+    private ArrayList<Button> buttons = new ArrayList<Button>(2);
+    
+    /**
+     * @param f
+     *            the given Fig
+     */
+    public SelectionClassifierBox(Fig f) {
+       
+        super(f);
+        
+        FigClassifierBox fcb = (FigClassifierBox) getContent();
+        int i=0;
+        for (FigCompartment compartment : fcb.getCompartments()) {
+            buttons.add(new Button(buttonIds[i++], addIcon, compartment, compartment.getCompartmentType()));
+        }
+    }
+
+    /**
+     * Handle h: handle in which to return selected Handle information (output
+     * parameter). A handle index of -1 indicates that the cursor is not over
+     * any GEF handle. If the mouse is over the new buttons nevertheless the
+     * index is -1. There the hitHandle() is overridden (see above)
+     */
+    @Override
+    public void hitHandle(
+            Rectangle cursor, Handle h) {
+        super.hitHandle(cursor, h);
+
+        int cx = getContent().getX();
+        int cy = getContent().getY();
+        int cw = getContent().getWidth();
+        int ch = getContent().getHeight();
+
+        // super returns -1 if any of GEFs buttons was hit
+        // (but maybe one of the not-GEF-buttons)
+        if (h.index == -1) {
+            if (hitBelow(
+                    cx + cw - (addIcon.getIconWidth() / 2), cy + 25,
+                    addIcon.getIconWidth() + 5, addIcon.getIconHeight() + 3,
+                    cursor)) {
+                h.index = UPPER_RIGHT;
+            } else if (hitAbove(cx + cw - (addIcon.getIconWidth() / 2),
+                    cy + ch, addIcon.getIconWidth() + 3,
+                    addIcon.getIconHeight() + 5,
+                    cursor)) {
+                h.index = LOWER_RIGHT;
+            }
+        }
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent me) {
+        for (Button button : buttons) {
+            int cx = button.fig.getX() + button.fig.getWidth() - button.icon.getIconWidth();
+            int cy = button.fig.getY();
+            int cw = button.icon.getIconWidth();
+            int ch = button.icon.getIconHeight();
+            Rectangle rect = new Rectangle(cx, cy, cw, ch);
+            if (rect.contains(me.getX(), me.getY())) {
+                onButtonClicked(button.metaType);
+                me.consume();
+                return;
+            }
+        }
+        
+        super.mouseReleased(me);
+    }
+    
+    /**
+     * Adds new element to the class
+     */
+    private void onButtonClicked(Object metaType) {
+        FigClassifierBox fcb = (FigClassifierBox) getContent();
+        FigCompartment fc = fcb.getCompartment(metaType);
+        fc.setEditOnRedraw(true);
+        fc.createModelElement();
+    }
+
+    /*
+     * @see org.tigris.gef.base.SelectionButtons#paintButtons(Graphics)
+     */
+    @Override
+    public void paintButtons(Graphics g) {
+
+        super.paintButtons(g);
+
+        for (Button button : buttons) {
+            if (button.fig.isVisible()) {
+                int cx = button.fig.getX() + button.fig.getWidth() - button.icon.getIconWidth();
+                int cy = button.fig.getY();
+                paintButton(button.icon, g, cx, cy, button.handle);
+            }
+        }
+    }
+}

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/UMLStereotypeListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/UMLStereotypeListModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/UMLStereotypeListModel.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/UMLStereotypeListModel.java	2012-12-28 10:30:46-0800
@@ -1,563 +1,563 @@
-/* $Id: UMLStereotypeListModel.java 18588 2010-07-28 21:30:25Z bobtarling $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    mvw

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

-// Copyright (c) 2002-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.ui;

-

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyChangeListener;

-import java.util.ArrayList;

-import java.util.Collection;

-import java.util.Iterator;

-

-import javax.swing.DefaultListModel;

-import javax.swing.JPopupMenu;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.AddAssociationEvent;

-import org.argouml.model.AssociationChangeEvent;

-import org.argouml.model.AttributeChangeEvent;

-import org.argouml.model.InvalidElementException;

-import org.argouml.model.Model;

-import org.argouml.model.RemoveAssociationEvent;

-import org.argouml.ui.targetmanager.TargetEvent;

-import org.argouml.ui.targetmanager.TargetListener;

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

-import org.tigris.gef.presentation.Fig;

-

-/**

- * The model for a list that contains ModelElements. The state of the Element is

- * still kept in the model subsystem itself. This list is only to be used as the

- * model for some GUI element like UMLLinkedList.

- *

- * @since Oct 2, 2002

- * @author [email protected]

- */

-abstract class UMLStereotypeListModel extends DefaultListModel

-        implements TargetListener, PropertyChangeListener {

-

-    private static final Logger LOG = 

-        Logger.getLogger(UMLStereotypeListModel.class);

-    

-    private String eventName = null;

-    private Object listTarget = null;

-

-    /**

-     * Flag to indicate wether list events should be fired

-     */

-    private boolean fireListEvents = true;

-

-    /**

-     * Flag to indicate wether the model is being build

-     */

-    private boolean buildingModel = false;

-

-    /**

-     * The type of model elements this list model is designed to hold.

-     */

-    private Object metaType;

-    

-    /**

-     * Indicates that drops onto this list should connect in the opposite

-     * way to standard.

-     */

-    private boolean reverseDropConnection;

-

-    /**

-     * Constructor to be used if the subclass does not depend on the

-     * MELementListener methods and setTarget method implemented in this

-     * class.

-     */

-    public UMLStereotypeListModel() {

-        super();

-    }

-

-    /**

-     * Constructor for UMLModelElementListModel2.

-     *

-     * @param name the name of the event to listen to, which triggers us

-     *             to update the list model from the UML data

-     */

-    public UMLStereotypeListModel(String name) {

-        super();

-        eventName = name;

-    }

-    

-    /**

-     * Constructor for UMLModelElementListModel2.

-     *

-     * @param name the name of the event to listen to, which triggers us

-     *             to update the list model from the UML data

-     * @param theMetaType the type of model element that the list model

-     *                 is designed to contain.

-     */

-    public UMLStereotypeListModel(String name, Object theMetaType) {

-        super();

-        this.metaType = theMetaType;

-        eventName = name;

-    }

-    

-    /**

-     * Constructor for UMLModelElementListModel2.

-     *

-     * @param name the name of the event to listen to, which triggers us

-     *             to update the list model from the UML data

-     * @param theMetaType the type of model element that the list model

-     *                 is designed to contain.

-     * @param reverseTheDropConnection tells the JList to reverse the

-     *              connection made and drop during dnd.

-     */

-    public UMLStereotypeListModel(

-	    String name, 

-	    Object theMetaType, 

-	    boolean reverseTheDropConnection) {

-        super();

-        this.metaType = theMetaType;

-        eventName = name;

-        this.reverseDropConnection = reverseTheDropConnection;

-    }

-    

-    /**

-     * Get the type of objects that this list model is designed to contain.

-     * @return metaType the meta type.

-     */

-    public Object getMetaType() {

-	return metaType;

-    }

-    

-    public boolean isReverseDropConnection() {

-	return reverseDropConnection;

-    }

-

-    /**

-     * @param building The buildingModel to set.

-     */

-    protected void setBuildingModel(boolean building) {

-        this.buildingModel = building;

-    }

-

-    /**

-     * @param t the list target to set

-     */

-    protected void setListTarget(Object t) {

-        this.listTarget = t;

-    }

-

-    /*

-     * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)

-     * 

-     * TODO: This should be reviewed to see if it can be improved with a view

-     * towards removing some of the overrriding methods used as workarounds for 

-     * differences between NSUML and MDR - tfm - 20060302

-     */

-    public void propertyChange(PropertyChangeEvent e) {

-        if (e instanceof AttributeChangeEvent) {

-            try {

-                if (isValidEvent(e)) {

-                    rebuildModelList();

-                }

-            } catch (InvalidElementException iee) {

-                return;

-            }

-        } else if (e instanceof AddAssociationEvent) {

-            if (isValidEvent(e)) {

-                Object o = getChangedElement(e);

-                if (o instanceof Collection) {

-                    ArrayList tempList = new ArrayList((Collection) o);

-                    Iterator it = tempList.iterator();

-                    while (it.hasNext()) {

-                        Object o2 = it.next();

-                        addElement(o2);

-                    }

-                } else {

-                    /* TODO: If this is an ordered list, then you have to 

-                        add in the right location! */

-                    addElement(o); 

-                }

-            }

-        } else if (e instanceof RemoveAssociationEvent) {

-            boolean valid = false;

-            if (!(getChangedElement(e) instanceof Collection)) {

-                valid = contains(getChangedElement(e));

-            } else {

-                Collection col = (Collection) getChangedElement(e);

-                Iterator it = col.iterator();

-                valid = true;

-                while (it.hasNext()) {

-                    Object o = it.next();

-                    if (!contains(o)) {

-                        valid = false;

-                        break;

-                    }

-                }

-            }

-            if (valid) {

-                Object o = getChangedElement(e);

-                if (o instanceof Collection) {

-                    Iterator it = ((Collection) o).iterator();

-                    while (it.hasNext()) {

-                        Object o3 = it.next();

-                        removeElement(o3);

-                    }

-                } else {

-                    removeElement(o);

-                }

-            }

-        }

-    }

-

-    /**

-     * Delete and rebuild the model list from scratch.

-     */

-    private void rebuildModelList() {

-        removeAllElements();

-        buildingModel = true;

-        try {

-            buildModelList();

-        } catch (InvalidElementException exception) {

-            /*

-             * This can throw an exception if the target has been

-             * deleted. We don't want to try locking the repository

-             * because this is called from the event delivery thread and

-             * could cause a deadlock. Instead catch the exception and

-             * leave the model empty.

-             */

-            LOG.debug("buildModelList threw exception for target " 

-                    + getTarget() + ": "

-                    + exception);

-        } finally {

-            buildingModel = false;

-        }

-        if (getSize() > 0) {

-            fireIntervalAdded(this, 0, getSize() - 1);

-        }

-    }

-

-    /**

-     * Builds the list of elements. Called from targetChanged every time the

-     * target of the proppanel is changed. Usually the method setAllElements is

-     * called with the result.

-     */

-    protected abstract void buildModelList();

-

-    /**

-     * Utility method to set the elements of this list to the contents of the

-     * given collection.

-     * @param col the given collection

-     */

-    protected void setAllElements(Collection col) {

-        if (!isEmpty()) {

-            removeAllElements();

-        }

-        addAll(col);

-    }

-

-    /**

-     * Utility method to add a collection of elements to the model

-     * @param col the given collection

-     */

-    protected void addAll(Collection col) {

-        if (col.size() == 0) {

-            return;

-        }

-        Iterator it = col.iterator();

-        fireListEvents = false;

-        int intervalStart = getSize() == 0 ? 0 : getSize() - 1;

-        while (it.hasNext()) {

-            Object o = it.next();

-            addElement(o);

-        }

-        fireListEvents = true;

-        fireIntervalAdded(this, intervalStart, getSize() - 1);

-    }

-

-    /**

-     * Utility method to get the target. Sets the target if the target is null

-     * via the method setTarget().

-     * @return MModelElement

-     */

-    public Object getTarget() {

-        return listTarget;

-    }

-

-    /**

-     * Utility method to get the changed element from some event e

-     * @param e the event

-     * @return Object the changed element

-     */

-    protected Object getChangedElement(PropertyChangeEvent e) {

-        if (e instanceof AssociationChangeEvent) {

-            return ((AssociationChangeEvent) e).getChangedValue();

-        }

-        if (e instanceof AttributeChangeEvent) {

-            return ((AttributeChangeEvent) e).getSource();

-        }

-        return e.getNewValue();

-    }

-

-    /*

-     * @see javax.swing.DefaultListModel#contains(java.lang.Object)

-     */

-    public boolean contains(Object elem) {

-        if (super.contains(elem)) {

-            return true;

-        }

-        if (elem instanceof Collection) {

-            Iterator it = ((Collection) elem).iterator();

-            while (it.hasNext()) {

-                if (!super.contains(it.next())) {

-                    return false;

-                }

-            }

-            return true;

-        }

-        return false;

-    }

-

-    /**

-     * Sets the target. If the old target is a ModelElement, it also removes

-     * the model from the element listener list of the target. If the new target

-     * is instanceof ModelElement, the model is added as element listener to the

-     * new target. <p>

-     *      

-     * This function is called when the user changes the target. 

-     * Hence, this shall not result in any UML model changes.

-     * Hence, we block firing list events completely by setting 

-     * buildingModel to true for the duration of this function. <p>

-     * 

-     * This function looks a lot like the one in UMLComboBoxModel2.

-     * 

-     * @param theNewTarget the new target

-     */

-    public void setTarget(Object theNewTarget) {

-        theNewTarget = theNewTarget instanceof Fig

-            ? ((Fig) theNewTarget).getOwner() : theNewTarget;

-        if (Model.getFacade().isAUMLElement(theNewTarget)

-                || theNewTarget instanceof Diagram) {

-            if (Model.getFacade().isAUMLElement(listTarget)) {

-                Model.getPump().removeModelEventListener(this, listTarget,

-                        eventName);

-                // Allow listening to other elements:

-                removeOtherModelEventListeners(listTarget);

-            }

-

-            if (Model.getFacade().isAUMLElement(theNewTarget)) {

-                listTarget = theNewTarget;

-                Model.getPump().addModelEventListener(this, listTarget,

-                        eventName);

-                // Allow listening to other elements:

-                addOtherModelEventListeners(listTarget);

-

-                rebuildModelList();

-

-            } else {

-                listTarget = null;

-                removeAllElements();

-            }

-        }

-    }

-

-    /**

-     * This function allows subclasses to listen to more modelelements.

-     * The given target is guaranteed to be a UML modelelement.

-     * 

-     * @param oldTarget the UML modelelement

-     */

-    protected void removeOtherModelEventListeners(Object oldTarget) {

-        /* Do nothing by default. */

-    }

-

-    /**

-     * This function allows subclasses to listen to more modelelements.

-     * The given target is guaranteed to be a UML modelelement.

-     * 

-     * @param newTarget the UML modelelement

-     */

-    protected void addOtherModelEventListeners(Object newTarget) {

-        /* Do nothing by default. */

-    }

-

-    /**

-     * Returns true if the given element is valid, i.e. it may be added to the

-     * list of elements.

-     *

-     * @param element the element to be tested

-     * @return true if valid

-     */

-    protected abstract boolean isValidElement(Object element);

-

-    /**

-     * Returns true if some event is valid. An event is valid if the

-     * element changed in the event is valid. This is determined via a

-     * call to isValidElement.  This method can be overriden by

-     * subclasses if they cannot determine if it is a valid event just

-     * by checking the changed element.

-     *

-     * @param e the event

-     * @return boolean true if valid

-     */

-    protected boolean isValidEvent(PropertyChangeEvent e) {

-        boolean valid = false;

-        if (!(getChangedElement(e) instanceof Collection)) {

-            // TODO: Considering all delete events to be valid like below

-            // is going to cause lots of unecessary work and some problems

-            if ((e.getNewValue() == null && e.getOldValue() != null)

-                    // Don't test changed element if it was deleted

-                    || isValidElement(getChangedElement(e))) {

-                valid = true; // we tried to remove a value

-            }

-        } else {

-            Collection col = (Collection) getChangedElement(e);

-            Iterator it = col.iterator();

-            if (!col.isEmpty()) {

-                valid = true;

-                while (it.hasNext()) {

-                    Object o = it.next();

-                    if (!isValidElement(o)) {

-                        valid = false;

-                        break;

-                    }

-                }

-            } else {

-                if (e.getOldValue() instanceof Collection

-                    && !((Collection) e.getOldValue()).isEmpty()) {

-                    valid = true;

-                }

-            }

-        }

-        return valid;

-    }

-

-    /*

-     * @see javax.swing.DefaultListModel#addElement(java.lang.Object)

-     */

-    public void addElement(Object obj) {

-        if (obj != null && !contains(obj)) {

-            super.addElement(obj);

-        }

-    }

-

-    /**

-     * Returns the eventName. This method is only here for testing goals.

-     * @return String

-     */

-    String getEventName() {

-        return eventName;

-    }

-

-    /**

-     * Sets the eventName. The eventName is the name of the

-     * MElementEvent to which the list should listen. The list is

-     * registred with UMLModelEventPump and only gets events that have

-     * a name like eventName.  This method should be called in the

-     * constructor of every subclass.

-     *

-     * @param theEventName The eventName to set

-     */

-    protected void setEventName(String theEventName) {

-        eventName = theEventName;

-    }

-

-    /*

-     * @see TargetListener#targetAdded(TargetEvent)

-     */

-    public void targetAdded(TargetEvent e) {

-        setTarget(e.getNewTarget());

-    }

-

-    /*

-     * @see TargetListener#targetRemoved(TargetEvent)

-     */

-    public void targetRemoved(TargetEvent e) {

-        setTarget(e.getNewTarget());

-    }

-

-    /*

-     * @see TargetListener#targetSet(TargetEvent)

-     */

-    public void targetSet(TargetEvent e) {

-        setTarget(e.getNewTarget());

-    }

-

-    /*

-     * @see javax.swing.AbstractListModel#fireContentsChanged(

-     *          Object, int, int)

-     */

-    protected void fireContentsChanged(Object source, int index0, int index1) {

-        if (fireListEvents && !buildingModel) {

-            super.fireContentsChanged(source, index0, index1);

-        }

-    }

-

-    /*

-     * @see javax.swing.AbstractListModel#fireIntervalAdded(

-     *          Object, int, int)

-     */

-    protected void fireIntervalAdded(Object source, int index0, int index1) {

-        if (fireListEvents && !buildingModel) {

-            super.fireIntervalAdded(source, index0, index1);

-        }

-    }

-

-    /*

-     * @see javax.swing.AbstractListModel#fireIntervalRemoved(

-     *          Object, int, int)

-     */

-    protected void fireIntervalRemoved(Object source, int index0, int index1) {

-        if (fireListEvents && !buildingModel) {

-            super.fireIntervalRemoved(source, index0, index1);

-        }

-    }

-

-    /**

-     * Override this if you want a popup menu.

-     * See for an example UMLModelElementOrderedListModel2.

-     *

-     * @param popup the popup menu

-     * @param index the selected item in the list at the moment

-     *              the mouse was clicked

-     * @return true if a popup menu is created, and needs to be shown

-     */

-    public boolean buildPopup(JPopupMenu popup, int index) {

-        return false;

-    }

-    

-    protected boolean hasPopup() {

-        return false;

-    }

-

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    mvw
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+// Copyright (c) 2002-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.ui;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JPopupMenu;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.AddAssociationEvent;
+import org.argouml.model.AssociationChangeEvent;
+import org.argouml.model.AttributeChangeEvent;
+import org.argouml.model.InvalidElementException;
+import org.argouml.model.Model;
+import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetListener;
+import org.tigris.gef.base.Diagram;
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * The model for a list that contains ModelElements. The state of the Element is
+ * still kept in the model subsystem itself. This list is only to be used as the
+ * model for some GUI element like UMLLinkedList.
+ *
+ * @since Oct 2, 2002
+ * @author [email protected]
+ */
+abstract class UMLStereotypeListModel extends DefaultListModel
+        implements TargetListener, PropertyChangeListener {
+
+    private static final Logger LOG = 
+        Logger.getLogger(UMLStereotypeListModel.class);
+    
+    private String eventName = null;
+    private Object listTarget = null;
+
+    /**
+     * Flag to indicate wether list events should be fired
+     */
+    private boolean fireListEvents = true;
+
+    /**
+     * Flag to indicate wether the model is being build
+     */
+    private boolean buildingModel = false;
+
+    /**
+     * The type of model elements this list model is designed to hold.
+     */
+    private Object metaType;
+    
+    /**
+     * Indicates that drops onto this list should connect in the opposite
+     * way to standard.
+     */
+    private boolean reverseDropConnection;
+
+    /**
+     * Constructor to be used if the subclass does not depend on the
+     * MELementListener methods and setTarget method implemented in this
+     * class.
+     */
+    public UMLStereotypeListModel() {
+        super();
+    }
+
+    /**
+     * Constructor for UMLModelElementListModel2.
+     *
+     * @param name the name of the event to listen to, which triggers us
+     *             to update the list model from the UML data
+     */
+    public UMLStereotypeListModel(String name) {
+        super();
+        eventName = name;
+    }
+    
+    /**
+     * Constructor for UMLModelElementListModel2.
+     *
+     * @param name the name of the event to listen to, which triggers us
+     *             to update the list model from the UML data
+     * @param theMetaType the type of model element that the list model
+     *                 is designed to contain.
+     */
+    public UMLStereotypeListModel(String name, Object theMetaType) {
+        super();
+        this.metaType = theMetaType;
+        eventName = name;
+    }
+    
+    /**
+     * Constructor for UMLModelElementListModel2.
+     *
+     * @param name the name of the event to listen to, which triggers us
+     *             to update the list model from the UML data
+     * @param theMetaType the type of model element that the list model
+     *                 is designed to contain.
+     * @param reverseTheDropConnection tells the JList to reverse the
+     *              connection made and drop during dnd.
+     */
+    public UMLStereotypeListModel(
+	    String name, 
+	    Object theMetaType, 
+	    boolean reverseTheDropConnection) {
+        super();
+        this.metaType = theMetaType;
+        eventName = name;
+        this.reverseDropConnection = reverseTheDropConnection;
+    }
+    
+    /**
+     * Get the type of objects that this list model is designed to contain.
+     * @return metaType the meta type.
+     */
+    public Object getMetaType() {
+	return metaType;
+    }
+    
+    public boolean isReverseDropConnection() {
+	return reverseDropConnection;
+    }
+
+    /**
+     * @param building The buildingModel to set.
+     */
+    protected void setBuildingModel(boolean building) {
+        this.buildingModel = building;
+    }
+
+    /**
+     * @param t the list target to set
+     */
+    protected void setListTarget(Object t) {
+        this.listTarget = t;
+    }
+
+    /*
+     * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+     * 
+     * TODO: This should be reviewed to see if it can be improved with a view
+     * towards removing some of the overrriding methods used as workarounds for 
+     * differences between NSUML and MDR - tfm - 20060302
+     */
+    public void propertyChange(PropertyChangeEvent e) {
+        if (e instanceof AttributeChangeEvent) {
+            try {
+                if (isValidEvent(e)) {
+                    rebuildModelList();
+                }
+            } catch (InvalidElementException iee) {
+                return;
+            }
+        } else if (e instanceof AddAssociationEvent) {
+            if (isValidEvent(e)) {
+                Object o = getChangedElement(e);
+                if (o instanceof Collection) {
+                    ArrayList tempList = new ArrayList((Collection) o);
+                    Iterator it = tempList.iterator();
+                    while (it.hasNext()) {
+                        Object o2 = it.next();
+                        addElement(o2);
+                    }
+                } else {
+                    /* TODO: If this is an ordered list, then you have to 
+                        add in the right location! */
+                    addElement(o); 
+                }
+            }
+        } else if (e instanceof RemoveAssociationEvent) {
+            boolean valid = false;
+            if (!(getChangedElement(e) instanceof Collection)) {
+                valid = contains(getChangedElement(e));
+            } else {
+                Collection col = (Collection) getChangedElement(e);
+                Iterator it = col.iterator();
+                valid = true;
+                while (it.hasNext()) {
+                    Object o = it.next();
+                    if (!contains(o)) {
+                        valid = false;
+                        break;
+                    }
+                }
+            }
+            if (valid) {
+                Object o = getChangedElement(e);
+                if (o instanceof Collection) {
+                    Iterator it = ((Collection) o).iterator();
+                    while (it.hasNext()) {
+                        Object o3 = it.next();
+                        removeElement(o3);
+                    }
+                } else {
+                    removeElement(o);
+                }
+            }
+        }
+    }
+
+    /**
+     * Delete and rebuild the model list from scratch.
+     */
+    private void rebuildModelList() {
+        removeAllElements();
+        buildingModel = true;
+        try {
+            buildModelList();
+        } catch (InvalidElementException exception) {
+            /*
+             * This can throw an exception if the target has been
+             * deleted. We don't want to try locking the repository
+             * because this is called from the event delivery thread and
+             * could cause a deadlock. Instead catch the exception and
+             * leave the model empty.
+             */
+            LOG.debug("buildModelList threw exception for target " 
+                    + getTarget() + ": "
+                    + exception);
+        } finally {
+            buildingModel = false;
+        }
+        if (getSize() > 0) {
+            fireIntervalAdded(this, 0, getSize() - 1);
+        }
+    }
+
+    /**
+     * Builds the list of elements. Called from targetChanged every time the
+     * target of the proppanel is changed. Usually the method setAllElements is
+     * called with the result.
+     */
+    protected abstract void buildModelList();
+
+    /**
+     * Utility method to set the elements of this list to the contents of the
+     * given collection.
+     * @param col the given collection
+     */
+    protected void setAllElements(Collection col) {
+        if (!isEmpty()) {
+            removeAllElements();
+        }
+        addAll(col);
+    }
+
+    /**
+     * Utility method to add a collection of elements to the model
+     * @param col the given collection
+     */
+    protected void addAll(Collection col) {
+        if (col.size() == 0) {
+            return;
+        }
+        Iterator it = col.iterator();
+        fireListEvents = false;
+        int intervalStart = getSize() == 0 ? 0 : getSize() - 1;
+        while (it.hasNext()) {
+            Object o = it.next();
+            addElement(o);
+        }
+        fireListEvents = true;
+        fireIntervalAdded(this, intervalStart, getSize() - 1);
+    }
+
+    /**
+     * Utility method to get the target. Sets the target if the target is null
+     * via the method setTarget().
+     * @return MModelElement
+     */
+    public Object getTarget() {
+        return listTarget;
+    }
+
+    /**
+     * Utility method to get the changed element from some event e
+     * @param e the event
+     * @return Object the changed element
+     */
+    protected Object getChangedElement(PropertyChangeEvent e) {
+        if (e instanceof AssociationChangeEvent) {
+            return ((AssociationChangeEvent) e).getChangedValue();
+        }
+        if (e instanceof AttributeChangeEvent) {
+            return ((AttributeChangeEvent) e).getSource();
+        }
+        return e.getNewValue();
+    }
+
+    /*
+     * @see javax.swing.DefaultListModel#contains(java.lang.Object)
+     */
+    public boolean contains(Object elem) {
+        if (super.contains(elem)) {
+            return true;
+        }
+        if (elem instanceof Collection) {
+            Iterator it = ((Collection) elem).iterator();
+            while (it.hasNext()) {
+                if (!super.contains(it.next())) {
+                    return false;
+                }
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Sets the target. If the old target is a ModelElement, it also removes
+     * the model from the element listener list of the target. If the new target
+     * is instanceof ModelElement, the model is added as element listener to the
+     * new target. <p>
+     *      
+     * This function is called when the user changes the target. 
+     * Hence, this shall not result in any UML model changes.
+     * Hence, we block firing list events completely by setting 
+     * buildingModel to true for the duration of this function. <p>
+     * 
+     * This function looks a lot like the one in UMLComboBoxModel2.
+     * 
+     * @param theNewTarget the new target
+     */
+    public void setTarget(Object theNewTarget) {
+        theNewTarget = theNewTarget instanceof Fig
+            ? ((Fig) theNewTarget).getOwner() : theNewTarget;
+        if (Model.getFacade().isAUMLElement(theNewTarget)
+                || theNewTarget instanceof Diagram) {
+            if (Model.getFacade().isAUMLElement(listTarget)) {
+                Model.getPump().removeModelEventListener(this, listTarget,
+                        eventName);
+                // Allow listening to other elements:
+                removeOtherModelEventListeners(listTarget);
+            }
+
+            if (Model.getFacade().isAUMLElement(theNewTarget)) {
+                listTarget = theNewTarget;
+                Model.getPump().addModelEventListener(this, listTarget,
+                        eventName);
+                // Allow listening to other elements:
+                addOtherModelEventListeners(listTarget);
+
+                rebuildModelList();
+
+            } else {
+                listTarget = null;
+                removeAllElements();
+            }
+        }
+    }
+
+    /**
+     * This function allows subclasses to listen to more modelelements.
+     * The given target is guaranteed to be a UML modelelement.
+     * 
+     * @param oldTarget the UML modelelement
+     */
+    protected void removeOtherModelEventListeners(Object oldTarget) {
+        /* Do nothing by default. */
+    }
+
+    /**
+     * This function allows subclasses to listen to more modelelements.
+     * The given target is guaranteed to be a UML modelelement.
+     * 
+     * @param newTarget the UML modelelement
+     */
+    protected void addOtherModelEventListeners(Object newTarget) {
+        /* Do nothing by default. */
+    }
+
+    /**
+     * Returns true if the given element is valid, i.e. it may be added to the
+     * list of elements.
+     *
+     * @param element the element to be tested
+     * @return true if valid
+     */
+    protected abstract boolean isValidElement(Object element);
+
+    /**
+     * Returns true if some event is valid. An event is valid if the
+     * element changed in the event is valid. This is determined via a
+     * call to isValidElement.  This method can be overriden by
+     * subclasses if they cannot determine if it is a valid event just
+     * by checking the changed element.
+     *
+     * @param e the event
+     * @return boolean true if valid
+     */
+    protected boolean isValidEvent(PropertyChangeEvent e) {
+        boolean valid = false;
+        if (!(getChangedElement(e) instanceof Collection)) {
+            // TODO: Considering all delete events to be valid like below
+            // is going to cause lots of unecessary work and some problems
+            if ((e.getNewValue() == null && e.getOldValue() != null)
+                    // Don't test changed element if it was deleted
+                    || isValidElement(getChangedElement(e))) {
+                valid = true; // we tried to remove a value
+            }
+        } else {
+            Collection col = (Collection) getChangedElement(e);
+            Iterator it = col.iterator();
+            if (!col.isEmpty()) {
+                valid = true;
+                while (it.hasNext()) {
+                    Object o = it.next();
+                    if (!isValidElement(o)) {
+                        valid = false;
+                        break;
+                    }
+                }
+            } else {
+                if (e.getOldValue() instanceof Collection
+                    && !((Collection) e.getOldValue()).isEmpty()) {
+                    valid = true;
+                }
+            }
+        }
+        return valid;
+    }
+
+    /*
+     * @see javax.swing.DefaultListModel#addElement(java.lang.Object)
+     */
+    public void addElement(Object obj) {
+        if (obj != null && !contains(obj)) {
+            super.addElement(obj);
+        }
+    }
+
+    /**
+     * Returns the eventName. This method is only here for testing goals.
+     * @return String
+     */
+    String getEventName() {
+        return eventName;
+    }
+
+    /**
+     * Sets the eventName. The eventName is the name of the
+     * MElementEvent to which the list should listen. The list is
+     * registred with UMLModelEventPump and only gets events that have
+     * a name like eventName.  This method should be called in the
+     * constructor of every subclass.
+     *
+     * @param theEventName The eventName to set
+     */
+    protected void setEventName(String theEventName) {
+        eventName = theEventName;
+    }
+
+    /*
+     * @see TargetListener#targetAdded(TargetEvent)
+     */
+    public void targetAdded(TargetEvent e) {
+        setTarget(e.getNewTarget());
+    }
+
+    /*
+     * @see TargetListener#targetRemoved(TargetEvent)
+     */
+    public void targetRemoved(TargetEvent e) {
+        setTarget(e.getNewTarget());
+    }
+
+    /*
+     * @see TargetListener#targetSet(TargetEvent)
+     */
+    public void targetSet(TargetEvent e) {
+        setTarget(e.getNewTarget());
+    }
+
+    /*
+     * @see javax.swing.AbstractListModel#fireContentsChanged(
+     *          Object, int, int)
+     */
+    protected void fireContentsChanged(Object source, int index0, int index1) {
+        if (fireListEvents && !buildingModel) {
+            super.fireContentsChanged(source, index0, index1);
+        }
+    }
+
+    /*
+     * @see javax.swing.AbstractListModel#fireIntervalAdded(
+     *          Object, int, int)
+     */
+    protected void fireIntervalAdded(Object source, int index0, int index1) {
+        if (fireListEvents && !buildingModel) {
+            super.fireIntervalAdded(source, index0, index1);
+        }
+    }
+
+    /*
+     * @see javax.swing.AbstractListModel#fireIntervalRemoved(
+     *          Object, int, int)
+     */
+    protected void fireIntervalRemoved(Object source, int index0, int index1) {
+        if (fireListEvents && !buildingModel) {
+            super.fireIntervalRemoved(source, index0, index1);
+        }
+    }
+
+    /**
+     * Override this if you want a popup menu.
+     * See for an example UMLModelElementOrderedListModel2.
+     *
+     * @param popup the popup menu
+     * @param index the selected item in the list at the moment
+     *              the mouse was clicked
+     * @return true if a popup menu is created, and needs to be shown
+     */
+    public boolean buildPopup(JPopupMenu popup, int index) {
+        return false;
+    }
+    
+    protected boolean hasPopup() {
+        return false;
+    }
+
+}

Modified: trunk/src/argouml-core-diagrams-activity2/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/build.properties	(original)
+++ trunk/src/argouml-core-diagrams-activity2/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-diagrams-activity2/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/plugin.properties	(original)
+++ trunk/src/argouml-core-diagrams-activity2/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-diagrams-activity2

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-diagrams-activity2
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML Activity2 Diagram Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramPropPanelFactory.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramPropPanelFactory.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/ActivityDiagramPropPanelFactory.java	2012-12-28 10:30:46-0800
@@ -1,39 +1,39 @@
-/* $Id: ActivityDiagramPropPanelFactory.java bobtarling $

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2;

-

-import org.argouml.activity2.diagram.UMLActivityDiagram;

-import org.argouml.i18n.Translator;

-import org.argouml.uml.diagram.ui.PropPanelDiagram;

-import org.argouml.uml.ui.PropPanel;

-import org.argouml.uml.ui.PropPanelFactory;

-

-class ActivityDiagramPropPanelFactory implements PropPanelFactory {

-

-    public PropPanel createPropPanel(Object object) {

-        if (object instanceof UMLActivityDiagram) {

-            return new PropPanelUMLActivityDiagram();

-        }

-        return null;

-    }

-

-    class PropPanelUMLActivityDiagram extends PropPanelDiagram {

-

-        public PropPanelUMLActivityDiagram() {

-            super(Translator.localize("label.activity-diagram"),

-                    lookupIcon("ActivityDiagram"));

-        }

-

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2;
+
+import org.argouml.activity2.diagram.UMLActivityDiagram;
+import org.argouml.i18n.Translator;
+import org.argouml.uml.diagram.ui.PropPanelDiagram;
+import org.argouml.uml.ui.PropPanel;
+import org.argouml.uml.ui.PropPanelFactory;
+
+class ActivityDiagramPropPanelFactory implements PropPanelFactory {
+
+    public PropPanel createPropPanel(Object object) {
+        if (object instanceof UMLActivityDiagram) {
+            return new PropPanelUMLActivityDiagram();
+        }
+        return null;
+    }
+
+    class PropPanelUMLActivityDiagram extends PropPanelDiagram {
+
+        public PropPanelUMLActivityDiagram() {
+            super(Translator.localize("label.activity-diagram"),
+                    lookupIcon("ActivityDiagram"));
+        }
+
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramGraphModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramGraphModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramGraphModel.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramGraphModel.java	2012-12-28 10:30:46-0800
@@ -1,58 +1,58 @@
-/* $Id: ActivityDiagramGraphModel.java bobtarling $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

-package org.argouml.activity2.diagram;

-

-import java.util.ArrayList;

-import java.util.List;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.Model;

-import org.argouml.uml.diagram.UMLMutableGraphSupport;

-

-class ActivityDiagramGraphModel extends UMLMutableGraphSupport {

-

-    /**

-     * Logger.

-     */

-    private static final Logger LOG = Logger

-            .getLogger(ActivityDiagramGraphModel.class);

-

-    ActivityDiagramGraphModel() {

-        super();

-    }

-

-    /*

-     * @see org.tigris.gef.graph.GraphModel#getPorts(java.lang.Object)

-     */

-    public List getPorts(Object nodeOrEdge) {

-        List res = new ArrayList();

-        return res;

-    }

-

-    public List getInEdges(Object port) {

-        // TODO: Auto-generated method stub

-        return null;

-    }

-

-    public List getOutEdges(Object port) {

-        // TODO: Auto-generated method stub

-        return null;

-    }

-

-    public Object getOwner(Object port) {

-        return port;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.UMLMutableGraphSupport;
+
+class ActivityDiagramGraphModel extends UMLMutableGraphSupport {
+
+    /**
+     * Logger.
+     */
+    private static final Logger LOG = Logger
+            .getLogger(ActivityDiagramGraphModel.class);
+
+    ActivityDiagramGraphModel() {
+        super();
+    }
+
+    /*
+     * @see org.tigris.gef.graph.GraphModel#getPorts(java.lang.Object)
+     */
+    public List getPorts(Object nodeOrEdge) {
+        List res = new ArrayList();
+        return res;
+    }
+
+    public List getInEdges(Object port) {
+        // TODO: Auto-generated method stub
+        return null;
+    }
+
+    public List getOutEdges(Object port) {
+        // TODO: Auto-generated method stub
+        return null;
+    }
+
+    public Object getOwner(Object port) {
+        return port;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ActivityDiagramRenderer.java	2012-12-28 10:30:46-0800
@@ -1,74 +1,74 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.util.Map;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.Model;

-import org.argouml.uml.CommentEdge;

-import org.argouml.uml.diagram.ArgoDiagram;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.UmlDiagramRenderer;

-import org.argouml.uml.diagram.static_structure.ui.FigEdgeNote;

-import org.argouml.uml.diagram.ui.UMLDiagram;

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

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

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

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

-import org.tigris.gef.presentation.FigEdge;

-import org.tigris.gef.presentation.FigNode;

-

-class ActivityDiagramRenderer extends UmlDiagramRenderer {

-    

-    private static final Logger LOG =

-        Logger.getLogger(ActivityDiagramRenderer.class);

-

-    public FigNode getFigNodeFor(GraphModel gm, Layer lay, Object node,

-                                 Map styleAttributes) {

-        FigNode result = null;

-        // Although not generally true for GEF, for Argo we know that the layer

-        // is a LayerPerspective which knows the associated diagram

-        Diagram diag = ((LayerPerspective) lay).getDiagram(); 

-        if (diag instanceof UMLDiagram

-                && ((UMLDiagram) diag).doesAccept(node)) {

-            result = (FigNode) ((UMLDiagram) diag).drop(node, null);

-        } else {

-            LOG.warn("ActivityDiagramRenderer getFigNodeFor unexpected node " 

-                    + node);

-            return null;

-        }

-        LOG.debug("ActivityDiagramRenderer getFigNodeFor " + result);

-        lay.add(result);

-        return result;       

-    }

-

-    public FigEdge getFigEdgeFor(GraphModel gm, Layer lay, Object edge,

-            Map styleAttributes) {

-        assert edge != null;

-        assert lay instanceof LayerPerspective;

-

-        ArgoDiagram diag = (ArgoDiagram) ((LayerPerspective) lay).getDiagram();

-        DiagramSettings settings = diag.getDiagramSettings();

-        FigEdge newEdge = null;

-

-        if (Model.getFacade().isAActivityEdge(edge)) {

-            newEdge = new FigActivityEdge(edge, settings);

-        } else if (edge instanceof CommentEdge) {

-            newEdge = new FigEdgeNote(edge, settings);

-        } 

-        addEdge(lay, newEdge, edge);

-        return newEdge;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.Model;
+import org.argouml.uml.CommentEdge;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.UmlDiagramRenderer;
+import org.argouml.uml.diagram.static_structure.ui.FigEdgeNote;
+import org.argouml.uml.diagram.ui.UMLDiagram;
+import org.tigris.gef.base.Diagram;
+import org.tigris.gef.base.Layer;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.graph.GraphModel;
+import org.tigris.gef.presentation.FigEdge;
+import org.tigris.gef.presentation.FigNode;
+
+class ActivityDiagramRenderer extends UmlDiagramRenderer {
+    
+    private static final Logger LOG =
+        Logger.getLogger(ActivityDiagramRenderer.class);
+
+    public FigNode getFigNodeFor(GraphModel gm, Layer lay, Object node,
+                                 Map styleAttributes) {
+        FigNode result = null;
+        // Although not generally true for GEF, for Argo we know that the layer
+        // is a LayerPerspective which knows the associated diagram
+        Diagram diag = ((LayerPerspective) lay).getDiagram(); 
+        if (diag instanceof UMLDiagram
+                && ((UMLDiagram) diag).doesAccept(node)) {
+            result = (FigNode) ((UMLDiagram) diag).drop(node, null);
+        } else {
+            LOG.warn("ActivityDiagramRenderer getFigNodeFor unexpected node " 
+                    + node);
+            return null;
+        }
+        LOG.debug("ActivityDiagramRenderer getFigNodeFor " + result);
+        lay.add(result);
+        return result;       
+    }
+
+    public FigEdge getFigEdgeFor(GraphModel gm, Layer lay, Object edge,
+            Map styleAttributes) {
+        assert edge != null;
+        assert lay instanceof LayerPerspective;
+
+        ArgoDiagram diag = (ArgoDiagram) ((LayerPerspective) lay).getDiagram();
+        DiagramSettings settings = diag.getDiagramSettings();
+        FigEdge newEdge = null;
+
+        if (Model.getFacade().isAActivityEdge(edge)) {
+            newEdge = new FigActivityEdge(edge, settings);
+        } else if (edge instanceof CommentEdge) {
+            newEdge = new FigEdgeNote(edge, settings);
+        } 
+        addEdge(lay, newEdge, edge);
+        return newEdge;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/BaseDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/BaseDiagram.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/BaseDiagram.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/BaseDiagram.java	2012-12-28 10:30:46-0800
@@ -1,233 +1,233 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.io.IOException;

-import java.io.InputStream;

-import java.util.ArrayList;

-import java.util.Collection;

-import java.util.Collections;

-import java.util.HashMap;

-import java.util.List;

-import java.util.Map;

-

-import javax.swing.Action;

-import javax.xml.parsers.DocumentBuilder;

-import javax.xml.parsers.DocumentBuilderFactory;

-import javax.xml.parsers.ParserConfigurationException;

-

-import org.apache.log4j.Logger;

-import org.argouml.kernel.Owned;

-import org.argouml.model.Model;

-import org.argouml.uml.diagram.UMLMutableGraphSupport;

-import org.argouml.uml.diagram.UmlDiagramRenderer;

-import org.argouml.uml.diagram.ui.ActionSetMode;

-import org.argouml.uml.diagram.ui.RadioAction;

-import org.argouml.uml.diagram.ui.UMLDiagram;

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

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

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

-import org.tigris.gef.graph.MutableGraphModel;

-import org.w3c.dom.DOMException;

-import org.w3c.dom.Document;

-import org.w3c.dom.Element;

-import org.w3c.dom.Node;

-import org.w3c.dom.NodeList;

-import org.xml.sax.InputSource;

-import org.xml.sax.SAXException;

-

-abstract class BaseDiagram extends UMLDiagram implements Owned {

-    

-    private static final Logger LOG = Logger

-        .getLogger(BaseDiagram.class);

-    

-    final Object owner;

-    

-    BaseDiagram(Object owner) {

-        super();

-        this.owner = owner;

-        MutableGraphModel gm = createGraphModel();

-        setGraphModel(gm);

-        

-        // Create the layer

-        LayerPerspective lay = new

-            LayerPerspectiveMutable(this.getName(), gm);

-        setLayer(lay);

-        

-        // Create the renderer

-        UmlDiagramRenderer renderer = createDiagramRenderer();

-        lay.setGraphNodeRenderer(renderer);

-        lay.setGraphEdgeRenderer(renderer);

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Constructing diagram for " + owner);

-        }

-    }

-    

-    public Object getOwner() {

-        return owner;

-    }

-    

-    abstract UmlDiagramRenderer createDiagramRenderer();

-    abstract UMLMutableGraphSupport createGraphModel();

-    

-    private Map<String, Class<?>> metaTypeByName;

-    private Map<Class<?>, String> nameByMetaType;

-    

-    protected Object[] getUmlActions() {

-        try {

-            final Document doc = getDocument();

-            final Element element =

-                getElement(doc.getDocumentElement(), "classes");

-            final int size = element.getChildNodes().getLength();

-            nameByMetaType = new HashMap<Class<?>, String>(size);

-            metaTypeByName = new HashMap<String, Class<?>>(size);

-            populateClassMaps(element, nameByMetaType, metaTypeByName);

-            

-            final Element toolbarElement =

-                getElement(doc.getDocumentElement(), "toolbar");

-            return getToolbarActions(toolbarElement);

-        } catch (DOMException e) {

-            LOG.error("", e);

-        } catch (IOException e) {

-            LOG.error("", e);

-        } catch (ParserConfigurationException e) {

-            LOG.error("", e);

-        } catch (SAXException e) {

-            LOG.error("", e);

-        }

-        return null;

-    }

-    

-    /**

-     * Get the single (or first) child Element of the given element

-     * that has the given tag name.

-     * @param element

-     * @param tagName

-     * @return the child element

-     */

-    private Element getElement(Element element, String tagName) {

-        final NodeList nl = element.getElementsByTagName(tagName);

-        if (nl.getLength() == 0) {

-            return null;

-        }

-        return (Element) nl.item(0);

-    }

-    

-    private Object[] getToolbarActions(Element toolbarNode) {

-        

-        final NodeList nl = toolbarNode.getChildNodes();

-

-        List<Element> elements = new ArrayList<Element>();

-        for (int i = 0; i < nl.getLength(); ++i) {

-            final Node n = nl.item(i);

-            if (n instanceof Element) {

-                elements.add((Element) n);

-            }

-        }

-

-        final Object[] toolbarActions = new Object[elements.size()];

-        

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

-            final Element itemNode = elements.get(i);

-            Object o;

-            String style = itemNode.getNodeName();

-            if (style.equals("dropdown")) {

-                o = getToolbarActions(itemNode);

-            } else if (style.equals("poly-edge")) {

-                final String type = itemNode.getAttribute("type");

-                final Class<?> metaType = metaTypeByName.get(type);

-                o = getCreateEdgeAction(metaType);

-            } else {

-                final String type = itemNode.getAttribute("type");

-                final Class<?> metaType = metaTypeByName.get(type);

-                o = new CreateDiagramElementAction(

-                        metaType, 

-                        style, 

-                        Model.getMetaTypes().getName(metaType),

-                        this);

-            }

-            toolbarActions[i] = o;

-        }

-        return toolbarActions;

-    }

-    

-    // TODO: This is currently duplicated from MetaDataCache - must find a

-    // common place in model facade

-    private void populateClassMaps(

-            final Element classesNode,

-            final Map<Class<?>, String> nameByMetaType,

-            final Map<String, Class<?>> metaTypeByName) {

-        final NodeList nl = classesNode.getElementsByTagName("class");

-        for (int i = 0; i < nl.getLength(); ++i) {

-            Element classNode = (Element) nl.item(i);

-            String className = classNode.getTextContent();

-            try {

-                final String name = 

-                    classNode.getAttribute("name");

-                Class<?> clazz = Class.forName(className);

-                metaTypeByName.put(name, clazz);

-                nameByMetaType.put(clazz, name);

-            } catch (ClassNotFoundException e) {

-                LOG.error("Class not found " + className, e);

-            }

-        }

-    }

-    

-    /**

-     * Get the diagram definition XML document

-     * @return

-     * @throws IOException

-     * @throws DOMException

-     * @throws ParserConfigurationException

-     * @throws SAXException

-     */

-    private Document getDocument()

-        throws IOException, DOMException,

-            ParserConfigurationException, SAXException {

-        final String filename = getDiagramXmlFile();

-        InputStream inputStream = 

-            this.getClass().getClassLoader().getResourceAsStream(filename);

-        InputSource inputSource = new InputSource(inputStream);

-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

-        DocumentBuilder db = dbf.newDocumentBuilder();

-        return db.parse(inputSource);

-    }

-    

-    protected abstract String getDiagramXmlFile();

-    

-    protected Action getCreateEdgeAction(Object metaType) {

-        String label = Model.getMetaTypes().getName(metaType);

-        return new RadioAction(

-                new ActionSetMode(

-                        ModeCreatePolyEdge.class,

-                        "edgeClass",

-                        metaType,

-                        label));

-    }    

-    

-    /*

-     * @see org.argouml.uml.diagram.ui.UMLDiagram#isRelocationAllowed(java.lang.Object)

-     */

-    public boolean isRelocationAllowed(Object base)  {

-        return false;

-    }

-    

-    public Collection getRelocationCandidates(Object root) {

-        return Collections.EMPTY_LIST;

-    }

-    

-    public boolean relocate(Object base) {

-        return false;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.Action;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.log4j.Logger;
+import org.argouml.kernel.Owned;
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.UMLMutableGraphSupport;
+import org.argouml.uml.diagram.UmlDiagramRenderer;
+import org.argouml.uml.diagram.ui.ActionSetMode;
+import org.argouml.uml.diagram.ui.RadioAction;
+import org.argouml.uml.diagram.ui.UMLDiagram;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.base.LayerPerspectiveMutable;
+import org.tigris.gef.base.ModeCreatePolyEdge;
+import org.tigris.gef.graph.MutableGraphModel;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+abstract class BaseDiagram extends UMLDiagram implements Owned {
+    
+    private static final Logger LOG = Logger
+        .getLogger(BaseDiagram.class);
+    
+    final Object owner;
+    
+    BaseDiagram(Object owner) {
+        super();
+        this.owner = owner;
+        MutableGraphModel gm = createGraphModel();
+        setGraphModel(gm);
+        
+        // Create the layer
+        LayerPerspective lay = new
+            LayerPerspectiveMutable(this.getName(), gm);
+        setLayer(lay);
+        
+        // Create the renderer
+        UmlDiagramRenderer renderer = createDiagramRenderer();
+        lay.setGraphNodeRenderer(renderer);
+        lay.setGraphEdgeRenderer(renderer);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Constructing diagram for " + owner);
+        }
+    }
+    
+    public Object getOwner() {
+        return owner;
+    }
+    
+    abstract UmlDiagramRenderer createDiagramRenderer();
+    abstract UMLMutableGraphSupport createGraphModel();
+    
+    private Map<String, Class<?>> metaTypeByName;
+    private Map<Class<?>, String> nameByMetaType;
+    
+    protected Object[] getUmlActions() {
+        try {
+            final Document doc = getDocument();
+            final Element element =
+                getElement(doc.getDocumentElement(), "classes");
+            final int size = element.getChildNodes().getLength();
+            nameByMetaType = new HashMap<Class<?>, String>(size);
+            metaTypeByName = new HashMap<String, Class<?>>(size);
+            populateClassMaps(element, nameByMetaType, metaTypeByName);
+            
+            final Element toolbarElement =
+                getElement(doc.getDocumentElement(), "toolbar");
+            return getToolbarActions(toolbarElement);
+        } catch (DOMException e) {
+            LOG.error("", e);
+        } catch (IOException e) {
+            LOG.error("", e);
+        } catch (ParserConfigurationException e) {
+            LOG.error("", e);
+        } catch (SAXException e) {
+            LOG.error("", e);
+        }
+        return null;
+    }
+    
+    /**
+     * Get the single (or first) child Element of the given element
+     * that has the given tag name.
+     * @param element
+     * @param tagName
+     * @return the child element
+     */
+    private Element getElement(Element element, String tagName) {
+        final NodeList nl = element.getElementsByTagName(tagName);
+        if (nl.getLength() == 0) {
+            return null;
+        }
+        return (Element) nl.item(0);
+    }
+    
+    private Object[] getToolbarActions(Element toolbarNode) {
+        
+        final NodeList nl = toolbarNode.getChildNodes();
+
+        List<Element> elements = new ArrayList<Element>();
+        for (int i = 0; i < nl.getLength(); ++i) {
+            final Node n = nl.item(i);
+            if (n instanceof Element) {
+                elements.add((Element) n);
+            }
+        }
+
+        final Object[] toolbarActions = new Object[elements.size()];
+        
+        for (int i = 0; i < elements.size(); ++i) {
+            final Element itemNode = elements.get(i);
+            Object o;
+            String style = itemNode.getNodeName();
+            if (style.equals("dropdown")) {
+                o = getToolbarActions(itemNode);
+            } else if (style.equals("poly-edge")) {
+                final String type = itemNode.getAttribute("type");
+                final Class<?> metaType = metaTypeByName.get(type);
+                o = getCreateEdgeAction(metaType);
+            } else {
+                final String type = itemNode.getAttribute("type");
+                final Class<?> metaType = metaTypeByName.get(type);
+                o = new CreateDiagramElementAction(
+                        metaType, 
+                        style, 
+                        Model.getMetaTypes().getName(metaType),
+                        this);
+            }
+            toolbarActions[i] = o;
+        }
+        return toolbarActions;
+    }
+    
+    // TODO: This is currently duplicated from MetaDataCache - must find a
+    // common place in model facade
+    private void populateClassMaps(
+            final Element classesNode,
+            final Map<Class<?>, String> nameByMetaType,
+            final Map<String, Class<?>> metaTypeByName) {
+        final NodeList nl = classesNode.getElementsByTagName("class");
+        for (int i = 0; i < nl.getLength(); ++i) {
+            Element classNode = (Element) nl.item(i);
+            String className = classNode.getTextContent();
+            try {
+                final String name = 
+                    classNode.getAttribute("name");
+                Class<?> clazz = Class.forName(className);
+                metaTypeByName.put(name, clazz);
+                nameByMetaType.put(clazz, name);
+            } catch (ClassNotFoundException e) {
+                LOG.error("Class not found " + className, e);
+            }
+        }
+    }
+    
+    /**
+     * Get the diagram definition XML document
+     * @return
+     * @throws IOException
+     * @throws DOMException
+     * @throws ParserConfigurationException
+     * @throws SAXException
+     */
+    private Document getDocument()
+        throws IOException, DOMException,
+            ParserConfigurationException, SAXException {
+        final String filename = getDiagramXmlFile();
+        InputStream inputStream = 
+            this.getClass().getClassLoader().getResourceAsStream(filename);
+        InputSource inputSource = new InputSource(inputStream);
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        return db.parse(inputSource);
+    }
+    
+    protected abstract String getDiagramXmlFile();
+    
+    protected Action getCreateEdgeAction(Object metaType) {
+        String label = Model.getMetaTypes().getName(metaType);
+        return new RadioAction(
+                new ActionSetMode(
+                        ModeCreatePolyEdge.class,
+                        "edgeClass",
+                        metaType,
+                        label));
+    }    
+    
+    /*
+     * @see org.argouml.uml.diagram.ui.UMLDiagram#isRelocationAllowed(java.lang.Object)
+     */
+    public boolean isRelocationAllowed(Object base)  {
+        return false;
+    }
+    
+    public Collection getRelocationCandidates(Object root) {
+        return Collections.EMPTY_LIST;
+    }
+    
+    public boolean relocate(Object base) {
+        return false;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/CreateDiagramElementAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/CreateDiagramElementAction.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/CreateDiagramElementAction.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/CreateDiagramElementAction.java	2012-12-28 10:30:46-0800
@@ -1,47 +1,47 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.event.ActionEvent;

-import org.argouml.application.helpers.ResourceLoaderWrapper;

-import org.argouml.ui.UndoableAction;

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

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

-

-class CreateDiagramElementAction extends UndoableAction {

-    

-    final Object metaType;

-    final String style;

-    final BaseDiagram diagram;

-

-    CreateDiagramElementAction(

-            final Object metaType,

-            final String style,

-            final String name,

-            final BaseDiagram diagram) {

-        super(name, ResourceLoaderWrapper.lookupIconResource(

-                ResourceLoaderWrapper.getImageBinding(name)));

-        this.diagram = diagram;

-        this.metaType = metaType;

-        this.style = style;

-    }

-    

-    public void actionPerformed(ActionEvent e) {

-        super.actionPerformed(e);

-

-        Mode placeMode = new ModePlaceDiagramElement(

-                diagram, metaType, style, "Click to place diagram element");

-        Globals.mode(placeMode, false);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.event.ActionEvent;
+import org.argouml.application.helpers.ResourceLoaderWrapper;
+import org.argouml.ui.UndoableAction;
+import org.tigris.gef.base.Globals;
+import org.tigris.gef.base.Mode;
+
+class CreateDiagramElementAction extends UndoableAction {
+    
+    final Object metaType;
+    final String style;
+    final BaseDiagram diagram;
+
+    CreateDiagramElementAction(
+            final Object metaType,
+            final String style,
+            final String name,
+            final BaseDiagram diagram) {
+        super(name, ResourceLoaderWrapper.lookupIconResource(
+                ResourceLoaderWrapper.getImageBinding(name)));
+        this.diagram = diagram;
+        this.metaType = metaType;
+        this.style = style;
+    }
+    
+    public void actionPerformed(ActionEvent e) {
+        super.actionPerformed(e);
+
+        Mode placeMode = new ModePlaceDiagramElement(
+                diagram, metaType, style, "Click to place diagram element");
+        Globals.mode(placeMode, false);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElement.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElement.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElement.java	2012-12-28 10:30:46-0800
@@ -1,12 +1,12 @@
-package org.argouml.activity2.diagram;

-

-import java.awt.Dimension;

-import java.awt.Rectangle;

-

-interface DiagramElement extends org.argouml.uml.diagram.DiagramElement {

-

-    Dimension getMinimumSize();

-    Rectangle getBounds();

-    void setBounds(Rectangle rect);

-    void setLocation(int x, int y);

-}

+package org.argouml.activity2.diagram;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+
+interface DiagramElement extends org.argouml.uml.diagram.DiagramElement {
+
+    Dimension getMinimumSize();
+    Rectangle getBounds();
+    void setBounds(Rectangle rect);
+    void setLocation(int x, int y);
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElementBuilder.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElementBuilder.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElementBuilder.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramElementBuilder.java	2012-12-28 10:30:46-0800
@@ -1,75 +1,75 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Rectangle;

-

-import org.argouml.uml.diagram.DiagramSettings;

-

-class DiagramElementBuilder {

-

-    private static final int WIDTH = 90;

-    private static final int HEIGHT = 25;

-    

-    static void buildDiagramElement(

-            final FigBaseNode fig,

-            final String style,

-            final Object owner,

-            final DiagramSettings settings) {

-        

-        final Rectangle bounds =

-            new Rectangle(fig.getX(), fig.getX(), WIDTH, HEIGHT);

-        

-        if (style.equals("compartmentbox")) {

-            // For classifiers

-        } else if (style.equals("rect")) {

-            fig.setDisplayState(

-                    new FigNamedRect(

-                            owner, 

-                            bounds, 

-                            fig.getLineColor(), 

-                            fig.getFillColor(),

-                            owner,

-                            settings));

-        } else if (style.equals("rrect")) {

-            fig.setDisplayState(

-                    new FigNamedRRect(

-                            owner, 

-                            bounds, 

-                            fig.getLineColor(), 

-                            fig.getFillColor(),

-                            owner,

-                            settings));

-        } else if (style.equals("pentagon")) {

-            fig.setDisplayState(

-                    new FigNamedPentagon(

-                            owner, 

-                            bounds, 

-                            fig.getLineColor(), 

-                            fig.getFillColor(),

-                            owner,

-                            settings));

-        } else if (style.equals("concave-pentagon")) {

-            fig.setDisplayState(

-                    new FigNamedConcavePentagon(

-                            owner, 

-                            bounds, 

-                            fig.getLineColor(), 

-                            fig.getFillColor(),

-                            owner,

-                            settings));

-        }

-    }

-

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+
+class DiagramElementBuilder {
+
+    private static final int WIDTH = 90;
+    private static final int HEIGHT = 25;
+    
+    static void buildDiagramElement(
+            final FigBaseNode fig,
+            final String style,
+            final Object owner,
+            final DiagramSettings settings) {
+        
+        final Rectangle bounds =
+            new Rectangle(fig.getX(), fig.getX(), WIDTH, HEIGHT);
+        
+        if (style.equals("compartmentbox")) {
+            // For classifiers
+        } else if (style.equals("rect")) {
+            fig.setDisplayState(
+                    new FigNamedRect(
+                            owner, 
+                            bounds, 
+                            fig.getLineColor(), 
+                            fig.getFillColor(),
+                            owner,
+                            settings));
+        } else if (style.equals("rrect")) {
+            fig.setDisplayState(
+                    new FigNamedRRect(
+                            owner, 
+                            bounds, 
+                            fig.getLineColor(), 
+                            fig.getFillColor(),
+                            owner,
+                            settings));
+        } else if (style.equals("pentagon")) {
+            fig.setDisplayState(
+                    new FigNamedPentagon(
+                            owner, 
+                            bounds, 
+                            fig.getLineColor(), 
+                            fig.getFillColor(),
+                            owner,
+                            settings));
+        } else if (style.equals("concave-pentagon")) {
+            fig.setDisplayState(
+                    new FigNamedConcavePentagon(
+                            owner, 
+                            bounds, 
+                            fig.getLineColor(), 
+                            fig.getFillColor(),
+                            owner,
+                            settings));
+        }
+    }
+
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramNode.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramNode.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/DiagramNode.java	2012-12-28 10:30:46-0800
@@ -1,14 +1,14 @@
-package org.argouml.activity2.diagram;

-

-import java.awt.Rectangle;

-

-/**

- * This is the interface for all visual nodes. When mature the intention is to

- * move to the diagrams module

- * @author Bob Tarling

- */

-interface DiagramNode extends DiagramElement {

-

-    Rectangle getBounds();

-    void setNameDiagramElement(DiagramElement name);

-}

+package org.argouml.activity2.diagram;
+
+import java.awt.Rectangle;
+
+/**
+ * This is the interface for all visual nodes. When mature the intention is to
+ * move to the diagrams module
+ * @author Bob Tarling
+ */
+interface DiagramNode extends DiagramElement {
+
+    Rectangle getBounds();
+    void setNameDiagramElement(DiagramElement name);
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigAcceptEventPoly.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigAcceptEventPoly.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigAcceptEventPoly.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigAcceptEventPoly.java	2012-12-28 10:30:46-0800
@@ -1,72 +1,72 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2009-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Color;

-import java.awt.Point;

-import java.awt.Polygon;

-import java.util.List;

-

-/**

- * A FigPoly to which edges gravitate to the perimeter instead of the points

- * @author Bob Tarling

- *

- */

-class FigAcceptEventPoly extends FigGravityPoly {

-    

-    FigAcceptEventPoly(int x, int y, int w, int h, Color lineColor, Color fillColor) {

-        super();

-        final int[] xs = new int[6];

-        final int[] ys = new int[6];

-        xs[0] = x;         ys[0] = y;

-        xs[1] = x + w;     ys[1] = y;

-        xs[2] = x + w;     ys[2] = y + h;

-        xs[3] = x;         ys[3] = y + h;

-        xs[4] = x + h / 2; ys[4] = y + h / 2;

-        xs[5] = x;         ys[5] = y;

-        final Polygon p = new Polygon(xs, ys, 6);

-        setPolygon(p);

-    }

-    

-    FigAcceptEventPoly(Polygon p) {

-        super(p);

-    }

-

-    /**

-     * This overrides the behaviour of FigGravityPoly in that the closest point 

-     * on the left of the fig is where a horizontal line from anotherPt would

-     * intersect this Fig. This prevents an edge from attaching to a point

-     * on a convex polygon where it would look better connecting to the edge.

-     */

-    @Override

-    public Point getClosestPoint(Point anotherPt) {

-        if (anotherPt.x < getX()

-                && anotherPt.y >= getY()

-                && anotherPt.y < getY() + getHeight()) {

-            final int x;

-            if (anotherPt.y < getY() + getHeight() / 2) {

-                x = getX() + (anotherPt.y - getY());

-            } else {

-                x = getX() + ((getY() + getHeight()) - anotherPt.y);

-            }

-            return new Point(x, anotherPt.y); 

-        } else {

-            return super.getClosestPoint(anotherPt);

-        }

-    }

-

-    public List getGravityPoints() {

-        return null;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Color;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.util.List;
+
+/**
+ * A FigPoly to which edges gravitate to the perimeter instead of the points
+ * @author Bob Tarling
+ *
+ */
+class FigAcceptEventPoly extends FigGravityPoly {
+    
+    FigAcceptEventPoly(int x, int y, int w, int h, Color lineColor, Color fillColor) {
+        super();
+        final int[] xs = new int[6];
+        final int[] ys = new int[6];
+        xs[0] = x;         ys[0] = y;
+        xs[1] = x + w;     ys[1] = y;
+        xs[2] = x + w;     ys[2] = y + h;
+        xs[3] = x;         ys[3] = y + h;
+        xs[4] = x + h / 2; ys[4] = y + h / 2;
+        xs[5] = x;         ys[5] = y;
+        final Polygon p = new Polygon(xs, ys, 6);
+        setPolygon(p);
+    }
+    
+    FigAcceptEventPoly(Polygon p) {
+        super(p);
+    }
+
+    /**
+     * This overrides the behaviour of FigGravityPoly in that the closest point 
+     * on the left of the fig is where a horizontal line from anotherPt would
+     * intersect this Fig. This prevents an edge from attaching to a point
+     * on a convex polygon where it would look better connecting to the edge.
+     */
+    @Override
+    public Point getClosestPoint(Point anotherPt) {
+        if (anotherPt.x < getX()
+                && anotherPt.y >= getY()
+                && anotherPt.y < getY() + getHeight()) {
+            final int x;
+            if (anotherPt.y < getY() + getHeight() / 2) {
+                x = getX() + (anotherPt.y - getY());
+            } else {
+                x = getX() + ((getY() + getHeight()) - anotherPt.y);
+            }
+            return new Point(x, anotherPt.y); 
+        } else {
+            return super.getClosestPoint(anotherPt);
+        }
+    }
+
+    public List getGravityPoints() {
+        return null;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigActivityEdge.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigActivityEdge.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigActivityEdge.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigActivityEdge.java	2012-12-28 10:30:46-0800
@@ -1,28 +1,28 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2009-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.ArrowHeadGreater;

-

-class FigActivityEdge extends FigBaseEdge {

-

-    private ArrowHeadGreater endArrow = new ArrowHeadGreater();

-

-    FigActivityEdge(Object owner, DiagramSettings settings) {

-        super(owner, settings);

-        

-        setDestArrowHead(endArrow);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.ArrowHeadGreater;
+
+class FigActivityEdge extends FigBaseEdge {
+
+    private ArrowHeadGreater endArrow = new ArrowHeadGreater();
+
+    FigActivityEdge(Object owner, DiagramSettings settings) {
+        super(owner, settings);
+        
+        setDestArrowHead(endArrow);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseEdge.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseEdge.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseEdge.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseEdge.java	2012-12-28 10:30:46-0800
@@ -1,50 +1,50 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Color;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.ui.PathItemPlacement;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.FigEdgePoly;

-

-/**

- * The Fig for all edge diagram elements. All specialist edge diagram elements

- * decorate this to get specialist behaviour 

- * @author Bob Tarling

- */

-class FigBaseEdge extends FigEdgePoly {

-

-    private final DiagramSettings settings;

-    private DiagramElement nameDiagramElement;

-    

-    FigBaseEdge(Object owner, DiagramSettings settings) {

-        super();

-        _useNearest = true;

-        setOwner(owner);

-        this.settings = settings;

-        if (nameDiagramElement != null) {

-            addPathItem((Fig) nameDiagramElement,

-                    new PathItemPlacement(this, (Fig) nameDiagramElement, 50, 10));

-        }

-        getFig().setLineColor(Color.black);

-    }

-    

-

-    public DiagramElement getNameDiagramElement() {

-        return nameDiagramElement;

-    }

-    

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Color;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.PathItemPlacement;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigEdgePoly;
+
+/**
+ * The Fig for all edge diagram elements. All specialist edge diagram elements
+ * decorate this to get specialist behaviour 
+ * @author Bob Tarling
+ */
+class FigBaseEdge extends FigEdgePoly {
+
+    private final DiagramSettings settings;
+    private DiagramElement nameDiagramElement;
+    
+    FigBaseEdge(Object owner, DiagramSettings settings) {
+        super();
+        _useNearest = true;
+        setOwner(owner);
+        this.settings = settings;
+        if (nameDiagramElement != null) {
+            addPathItem((Fig) nameDiagramElement,
+                    new PathItemPlacement(this, (Fig) nameDiagramElement, 50, 10));
+        }
+        getFig().setLineColor(Color.black);
+    }
+    
+
+    public DiagramElement getNameDiagramElement() {
+        return nameDiagramElement;
+    }
+    
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBaseNode.java	2012-12-28 10:30:46-0800
@@ -1,108 +1,108 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Dimension;

-import java.awt.Rectangle;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.FigGroup;

-import org.tigris.gef.presentation.FigNode;

-

-/**

- * The Fig for all node diagram elements. All specialist diagram elements

- * decorate this to get specialist behaviour 

- * @author Bob Tarling

- */

-class FigBaseNode extends FigNode implements DiagramNode {

-

-    private FigBasePresentation displayState;

-    private final DiagramSettings settings;

-    private DiagramElement nameDiagramElement;

-    

-    /**

-     * Constructor a new FigBaseNode

-     * 

-     * @param owner the owning UML element

-     * @param bounds rectangle describing bounds

-     * @param settings rendering settings

-     */

-    FigBaseNode(final Object owner, final Rectangle bounds,

-            final DiagramSettings settings) {

-        super(owner);

-        setBounds(bounds);

-        this.settings = settings;

-    }

-    

-    void setDisplayState(FigBasePresentation displayState) {

-        this.displayState = displayState;

-        displayState.setOwner(getOwner());

-        addFig(displayState);

-    }

-    

-    @Override

-    public boolean isDragConnectable() {

-        return false;

-    }

-    

-    @Override

-    public Dimension getMinimumSize() {

-        return displayState.getMinimumSize();

-    }

-

-    public void setNameDiagramElement(DiagramElement name) {

-    }

-

-    // TODO: Move an empty implementation to FigGroup in GEF

-    protected void positionChildren() {

-        Rectangle myBounds = getBounds();

-        if (displayState != null) {

-            displayState.setBounds(myBounds);

-        }

-//      calcBounds();

-        updateEdges();

-    }

-    

-    @Override

-    protected void setBoundsImpl(

-            final int x,

-            final int y,

-            final int w,

-            final int h) {

-

-        _x = x;

-        _y = y;

-        _w = w;

-        _h = h;

-        

-        positionChildren();

-    }

-

-    /**

-     * This is called to rearrange the contents of the Fig when a childs

-     * minimum size means it will no longer fit. If this group also has

-     * a parent and it will no longer fit that parent then control is

-     * delegated to that parent.

-     */

-    public void calcBounds() {

-        if (getGroup() != null) {

-            ((FigGroup) getGroup()).calcBounds();

-        } else {

-            final Dimension min = getMinimumSize();

-            int maxw = Math.max(getWidth(), min.width);

-            int maxh = Math.max(getHeight(), min.height);

-            setBounds(_x, _y, maxw, maxh);

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.FigGroup;
+import org.tigris.gef.presentation.FigNode;
+
+/**
+ * The Fig for all node diagram elements. All specialist diagram elements
+ * decorate this to get specialist behaviour 
+ * @author Bob Tarling
+ */
+class FigBaseNode extends FigNode implements DiagramNode {
+
+    private FigBasePresentation displayState;
+    private final DiagramSettings settings;
+    private DiagramElement nameDiagramElement;
+    
+    /**
+     * Constructor a new FigBaseNode
+     * 
+     * @param owner the owning UML element
+     * @param bounds rectangle describing bounds
+     * @param settings rendering settings
+     */
+    FigBaseNode(final Object owner, final Rectangle bounds,
+            final DiagramSettings settings) {
+        super(owner);
+        setBounds(bounds);
+        this.settings = settings;
+    }
+    
+    void setDisplayState(FigBasePresentation displayState) {
+        this.displayState = displayState;
+        displayState.setOwner(getOwner());
+        addFig(displayState);
+    }
+    
+    @Override
+    public boolean isDragConnectable() {
+        return false;
+    }
+    
+    @Override
+    public Dimension getMinimumSize() {
+        return displayState.getMinimumSize();
+    }
+
+    public void setNameDiagramElement(DiagramElement name) {
+    }
+
+    // TODO: Move an empty implementation to FigGroup in GEF
+    protected void positionChildren() {
+        Rectangle myBounds = getBounds();
+        if (displayState != null) {
+            displayState.setBounds(myBounds);
+        }
+//      calcBounds();
+        updateEdges();
+    }
+    
+    @Override
+    protected void setBoundsImpl(
+            final int x,
+            final int y,
+            final int w,
+            final int h) {
+
+        _x = x;
+        _y = y;
+        _w = w;
+        _h = h;
+        
+        positionChildren();
+    }
+
+    /**
+     * This is called to rearrange the contents of the Fig when a childs
+     * minimum size means it will no longer fit. If this group also has
+     * a parent and it will no longer fit that parent then control is
+     * delegated to that parent.
+     */
+    public void calcBounds() {
+        if (getGroup() != null) {
+            ((FigGroup) getGroup()).calcBounds();
+        } else {
+            final Dimension min = getMinimumSize();
+            int maxw = Math.max(getWidth(), min.width);
+            int maxh = Math.max(getHeight(), min.height);
+            setBounds(_x, _y, maxw, maxh);
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigBasePresentation.java	2012-12-28 10:30:46-0800
@@ -1,106 +1,106 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Color;

-import java.awt.Dimension;

-import java.awt.Rectangle;

-

-import org.argouml.notation2.NotationType;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.Fig;

-

-abstract class FigBasePresentation extends FigComposite

-        implements StereotypeDisplayer, NameDisplayer {

-    

-    private final DiagramElement border;

-    private final FigNameCompartment nameDisplay;

-    private static final int MIN_WIDTH = 90;

-    private static final int MARGIN = 1;

-    

-    public FigBasePresentation(

-            final Object owner,

-            final Rectangle rect,

-            final Color lineColor,

-            final Color fillColor,

-            final Object modelElement,

-            final DiagramSettings settings) {

-        

-        super(owner, settings);

-        nameDisplay = new FigNameCompartment(

-                modelElement,

-                new Rectangle(0, 0, 0, 0),

-                settings);

-        border = createBorder(rect, lineColor, fillColor);

-        addFig((Fig) border);

-        addFig((Fig) getNameDisplay());

-        setBounds(rect);

-    }

-    

-    public DiagramElement getStereotypeDisplay() {

-        return null;

-    }

-

-    public DiagramElement getNameDisplay() {

-        return nameDisplay;

-    }

-

-    abstract DiagramElement createBorder(

-            final Rectangle rect,

-            final Color lineColor,

-            final Color fillColor);

-    

-    DiagramElement getBorder() {

-        return border;

-    }

-    

-    // TODO: Move an empty implementation to FigGroup in GEF

-    protected void positionChildren() {

-        final Rectangle bounds = getBounds();

-        

-        getBorder().setBounds(bounds);

-        

-        getNameDisplay().setBounds(

-                new Rectangle(bounds.x + getLeftMargin(), bounds.y + getTopMargin(), bounds.width - (getLeftMargin() + getRightMargin()), bounds.height - (getTopMargin() + getBottomMargin())));

-    }

-    

-    @Override

-    public Dimension getMinimumSize() {

-        

-        final Dimension nameDim = getNameDisplay().getMinimumSize();

-        int width = nameDim.width;

-        int height = nameDim.height;

-        

-        int w = width + getRightMargin() + getLeftMargin();

-        final int h = height + getTopMargin() + getBottomMargin();

-        w = Math.max(w, MIN_WIDTH);

-        return new Dimension(w, h);

-    }

-    

-    int getRightMargin() {

-        return MARGIN;

-    }

-

-    int getLeftMargin() {

-        return MARGIN;

-    }

-    

-    int getTopMargin() {

-        return MARGIN;

-    }

-    

-    int getBottomMargin() {

-        return MARGIN;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Rectangle;
+
+import org.argouml.notation2.NotationType;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.Fig;
+
+abstract class FigBasePresentation extends FigComposite
+        implements StereotypeDisplayer, NameDisplayer {
+    
+    private final DiagramElement border;
+    private final FigNameCompartment nameDisplay;
+    private static final int MIN_WIDTH = 90;
+    private static final int MARGIN = 1;
+    
+    public FigBasePresentation(
+            final Object owner,
+            final Rectangle rect,
+            final Color lineColor,
+            final Color fillColor,
+            final Object modelElement,
+            final DiagramSettings settings) {
+        
+        super(owner, settings);
+        nameDisplay = new FigNameCompartment(
+                modelElement,
+                new Rectangle(0, 0, 0, 0),
+                settings);
+        border = createBorder(rect, lineColor, fillColor);
+        addFig((Fig) border);
+        addFig((Fig) getNameDisplay());
+        setBounds(rect);
+    }
+    
+    public DiagramElement getStereotypeDisplay() {
+        return null;
+    }
+
+    public DiagramElement getNameDisplay() {
+        return nameDisplay;
+    }
+
+    abstract DiagramElement createBorder(
+            final Rectangle rect,
+            final Color lineColor,
+            final Color fillColor);
+    
+    DiagramElement getBorder() {
+        return border;
+    }
+    
+    // TODO: Move an empty implementation to FigGroup in GEF
+    protected void positionChildren() {
+        final Rectangle bounds = getBounds();
+        
+        getBorder().setBounds(bounds);
+        
+        getNameDisplay().setBounds(
+                new Rectangle(bounds.x + getLeftMargin(), bounds.y + getTopMargin(), bounds.width - (getLeftMargin() + getRightMargin()), bounds.height - (getTopMargin() + getBottomMargin())));
+    }
+    
+    @Override
+    public Dimension getMinimumSize() {
+        
+        final Dimension nameDim = getNameDisplay().getMinimumSize();
+        int width = nameDim.width;
+        int height = nameDim.height;
+        
+        int w = width + getRightMargin() + getLeftMargin();
+        final int h = height + getTopMargin() + getBottomMargin();
+        w = Math.max(w, MIN_WIDTH);
+        return new Dimension(w, h);
+    }
+    
+    int getRightMargin() {
+        return MARGIN;
+    }
+
+    int getLeftMargin() {
+        return MARGIN;
+    }
+    
+    int getTopMargin() {
+        return MARGIN;
+    }
+    
+    int getBottomMargin() {
+        return MARGIN;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigCompartment.java	2012-12-28 10:30:46-0800
@@ -1,148 +1,148 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Dimension;

-import java.awt.Rectangle;

-import java.util.Arrays;

-import java.util.List;

-

-import org.argouml.model.AddAssociationEvent;

-import org.argouml.model.AssociationChangeListener;

-import org.argouml.model.InvalidElementException;

-import org.argouml.model.Model;

-import org.argouml.model.RemoveAssociationEvent;

-import org.argouml.notation2.NotationType;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.Fig;

-

-/**

- * The UML defines a Name Compartment, and a List Compartment. 

- * This class implements the latter.<p>

- * 

- * A List Compartment is a boxed compartment,

- * containing vertically stacked figs,

- * which is common to e.g. a stereotypes compartment, operations

- * compartment and an attributes compartment.<p>

- * 

- * @author Bob Tarling

- */

-class FigCompartment extends FigComposite implements AssociationChangeListener {

-

-    public FigCompartment(

-            final Object owner,

-            final Rectangle bounds,

-            final DiagramSettings settings,

-            final Object metaType,

-            final String propertyName) {

-        this(owner, bounds, settings,

-                Arrays.asList(new Object[] {metaType}),

-                propertyName);

-    }

-    

-    /**

-     * @param owner the model element that owns the compartment

-     * @param bounds the initial bounds of the compartment

-     * @param settings the diagram settings

-     * @param metaType the different metatype that can be displayed in the compartment

-     */

-    public FigCompartment(

-            final Object owner,

-            final Rectangle bounds,

-            final DiagramSettings settings,

-            final List<Object> metaTypes,

-            final String propertyName) {

-        

-        super(owner, settings);

-        

-        Model.getFacade().getModelElementContents(owner);

-        for (Object element

-                : Model.getFacade().getModelElementContents(owner)) {

-            if (metaTypes.contains(element.getClass())) {

-                try {

-                    int y = bounds.y + getTopMargin();

-                    int x = bounds.x + getLeftMargin();

-                    Rectangle childBounds = new Rectangle(x, y, 0, 0);

-                    FigNotation fn = new FigNotation(

-                            element, childBounds, settings, NotationType.NAME);

-                    addFig(fn);

-                    y += fn.getHeight();

-                } catch (InvalidElementException e) {

-                }

-            }

-        }

-        

-        Model.getPump().addModelEventListener(

-                (AssociationChangeListener) this, owner, propertyName);

-        // TODO: Remove listeners for add/remove events

-    }

-    

-    public FigCompartment(

-            final Object owner,

-            final DiagramSettings settings) {

-        super(owner, settings);

-    }

-    

-    

-    @Override

-    public Dimension getMinimumSize() {

-        int minWidth = 0;

-        int minHeight = 0;

-        for (Object f : getFigs()) {

-            Fig fig = (Fig) f;

-            minWidth = Math.max(fig.getMinimumSize().width, minWidth);

-            minHeight += fig.getMinimumSize().height;

-        }

-

-        minHeight += getTopMargin() + getBottomMargin();

-        minWidth += getLeftMargin() + getRightMargin();

-        

-        return new Dimension(minWidth, minHeight);

-    }

-

-    @Override

-    protected void positionChildren() {

-

-        int w = _w - (getLeftMargin() + getRightMargin());

-        int x = _x + getLeftMargin();

-        int y = _y + getTopMargin();

-        

-        for (Object f : getFigs()) {

-            Fig fig = (Fig) f;

-            fig.setBounds(x, y, w, fig.getMinimumSize().height);

-            y += fig.getHeight();

-        }

-    }

-

-    public void elementAdded(AddAssociationEvent evt) {

-        Object element = evt.getNewValue();

-        Rectangle childBounds = new Rectangle(getX() + getHeight(), getY(), 0, 0);

-        FigNotation fn = new FigNotation(

-                element, childBounds, getDiagramSettings(), NotationType.NAME);

-        addFig(fn);

-        calcBounds();

-    }

-

-    public void elementRemoved(RemoveAssociationEvent evt) {

-        Object element = evt.getOldValue();

-        for (Object f : getFigs()) {

-            Fig fig = (Fig) f;

-            if (fig.getOwner() == element) {

-                removeFig(fig);

-                calcBounds();

-                return;

-            }

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.util.Arrays;
+import java.util.List;
+
+import org.argouml.model.AddAssociationEvent;
+import org.argouml.model.AssociationChangeListener;
+import org.argouml.model.InvalidElementException;
+import org.argouml.model.Model;
+import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.notation2.NotationType;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * The UML defines a Name Compartment, and a List Compartment. 
+ * This class implements the latter.<p>
+ * 
+ * A List Compartment is a boxed compartment,
+ * containing vertically stacked figs,
+ * which is common to e.g. a stereotypes compartment, operations
+ * compartment and an attributes compartment.<p>
+ * 
+ * @author Bob Tarling
+ */
+class FigCompartment extends FigComposite implements AssociationChangeListener {
+
+    public FigCompartment(
+            final Object owner,
+            final Rectangle bounds,
+            final DiagramSettings settings,
+            final Object metaType,
+            final String propertyName) {
+        this(owner, bounds, settings,
+                Arrays.asList(new Object[] {metaType}),
+                propertyName);
+    }
+    
+    /**
+     * @param owner the model element that owns the compartment
+     * @param bounds the initial bounds of the compartment
+     * @param settings the diagram settings
+     * @param metaType the different metatype that can be displayed in the compartment
+     */
+    public FigCompartment(
+            final Object owner,
+            final Rectangle bounds,
+            final DiagramSettings settings,
+            final List<Object> metaTypes,
+            final String propertyName) {
+        
+        super(owner, settings);
+        
+        Model.getFacade().getModelElementContents(owner);
+        for (Object element
+                : Model.getFacade().getModelElementContents(owner)) {
+            if (metaTypes.contains(element.getClass())) {
+                try {
+                    int y = bounds.y + getTopMargin();
+                    int x = bounds.x + getLeftMargin();
+                    Rectangle childBounds = new Rectangle(x, y, 0, 0);
+                    FigNotation fn = new FigNotation(
+                            element, childBounds, settings, NotationType.NAME);
+                    addFig(fn);
+                    y += fn.getHeight();
+                } catch (InvalidElementException e) {
+                }
+            }
+        }
+        
+        Model.getPump().addModelEventListener(
+                (AssociationChangeListener) this, owner, propertyName);
+        // TODO: Remove listeners for add/remove events
+    }
+    
+    public FigCompartment(
+            final Object owner,
+            final DiagramSettings settings) {
+        super(owner, settings);
+    }
+    
+    
+    @Override
+    public Dimension getMinimumSize() {
+        int minWidth = 0;
+        int minHeight = 0;
+        for (Object f : getFigs()) {
+            Fig fig = (Fig) f;
+            minWidth = Math.max(fig.getMinimumSize().width, minWidth);
+            minHeight += fig.getMinimumSize().height;
+        }
+
+        minHeight += getTopMargin() + getBottomMargin();
+        minWidth += getLeftMargin() + getRightMargin();
+        
+        return new Dimension(minWidth, minHeight);
+    }
+
+    @Override
+    protected void positionChildren() {
+
+        int w = _w - (getLeftMargin() + getRightMargin());
+        int x = _x + getLeftMargin();
+        int y = _y + getTopMargin();
+        
+        for (Object f : getFigs()) {
+            Fig fig = (Fig) f;
+            fig.setBounds(x, y, w, fig.getMinimumSize().height);
+            y += fig.getHeight();
+        }
+    }
+
+    public void elementAdded(AddAssociationEvent evt) {
+        Object element = evt.getNewValue();
+        Rectangle childBounds = new Rectangle(getX() + getHeight(), getY(), 0, 0);
+        FigNotation fn = new FigNotation(
+                element, childBounds, getDiagramSettings(), NotationType.NAME);
+        addFig(fn);
+        calcBounds();
+    }
+
+    public void elementRemoved(RemoveAssociationEvent evt) {
+        Object element = evt.getOldValue();
+        for (Object f : getFigs()) {
+            Fig fig = (Fig) f;
+            if (fig.getOwner() == element) {
+                removeFig(fig);
+                calcBounds();
+                return;
+            }
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigComposite.java	2012-12-28 10:30:46-0800
@@ -1,82 +1,82 @@
-package org.argouml.activity2.diagram;

-

-import java.awt.Dimension;

-import java.awt.Rectangle;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.FigGroup;

-

-public class FigComposite extends FigGroup implements DiagramElement {

-    

-    private static final int MARGIN = 0;

-    private final DiagramSettings diagramSettings;

-    

-    public FigComposite(

-            final Object owner,

-            final DiagramSettings settings) {

-        setOwner(owner);

-        diagramSettings = settings;

-    }

-    

-    protected DiagramSettings getDiagramSettings() {

-        return diagramSettings;

-    }

-    

-    int getRightMargin() {

-        return MARGIN;

-    }

-

-    int getLeftMargin() {

-        return MARGIN;

-    }

-    

-    int getTopMargin() {

-        return MARGIN;

-    }

-    

-    int getBottomMargin() {

-        return MARGIN;

-    }

-    

-    protected void positionChildren() {

-        

-    }

-    

-    //

-    // !! TODO: All code below here is duplicated in FigBaseNode. The reason

-    // is the GEF defect - http://gef.tigris.org/issues/show_bug.cgi?id=358

-    // Once we have taken a release of GEF with that fix we can remove this

-    // code.

-    //

-    @Override

-    protected void setBoundsImpl(

-            final int x,

-            final int y,

-            final int w,

-            final int h) {

-

-        _x = x;

-        _y = y;

-        _w = w;

-        _h = h;

-        

-        positionChildren();

-    }

-    

-    /**

-     * This is called to rearrange the contents of the Fig when a childs

-     * minimum size means it will no longer fit. If this group also has

-     * a parent and it will no longer fit that parent then control is

-     * delegated to that parent.

-     */

-    public void calcBounds() {

-        if (getGroup() != null) {

-            ((FigGroup) getGroup()).calcBounds();

-        } else {

-            final Dimension min = getMinimumSize();

-            int maxw = Math.max(getWidth(), min.width);

-            int maxh = Math.max(getHeight(), min.height);

-            setBounds(_x, _y, maxw, maxh);

-        }

-    }

-}

+package org.argouml.activity2.diagram;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.FigGroup;
+
+public class FigComposite extends FigGroup implements DiagramElement {
+    
+    private static final int MARGIN = 0;
+    private final DiagramSettings diagramSettings;
+    
+    public FigComposite(
+            final Object owner,
+            final DiagramSettings settings) {
+        setOwner(owner);
+        diagramSettings = settings;
+    }
+    
+    protected DiagramSettings getDiagramSettings() {
+        return diagramSettings;
+    }
+    
+    int getRightMargin() {
+        return MARGIN;
+    }
+
+    int getLeftMargin() {
+        return MARGIN;
+    }
+    
+    int getTopMargin() {
+        return MARGIN;
+    }
+    
+    int getBottomMargin() {
+        return MARGIN;
+    }
+    
+    protected void positionChildren() {
+        
+    }
+    
+    //
+    // !! TODO: All code below here is duplicated in FigBaseNode. The reason
+    // is the GEF defect - http://gef.tigris.org/issues/show_bug.cgi?id=358
+    // Once we have taken a release of GEF with that fix we can remove this
+    // code.
+    //
+    @Override
+    protected void setBoundsImpl(
+            final int x,
+            final int y,
+            final int w,
+            final int h) {
+
+        _x = x;
+        _y = y;
+        _w = w;
+        _h = h;
+        
+        positionChildren();
+    }
+    
+    /**
+     * This is called to rearrange the contents of the Fig when a childs
+     * minimum size means it will no longer fit. If this group also has
+     * a parent and it will no longer fit that parent then control is
+     * delegated to that parent.
+     */
+    public void calcBounds() {
+        if (getGroup() != null) {
+            ((FigGroup) getGroup()).calcBounds();
+        } else {
+            final Dimension min = getMinimumSize();
+            int maxw = Math.max(getWidth(), min.width);
+            int maxh = Math.max(getHeight(), min.height);
+            setBounds(_x, _y, maxw, maxh);
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigGravityPoly.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigGravityPoly.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigGravityPoly.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigGravityPoly.java	2012-12-28 10:30:46-0800
@@ -1,48 +1,48 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2009-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Point;

-import java.awt.Polygon;

-import java.util.List;

-

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

-import org.tigris.gef.presentation.FigPoly;

-

-/**

- * A FigPoly to which edges gravitate to the perimeter instead of the points

- * @author Bob Tarling

- *

- */

-class FigGravityPoly extends FigPoly {

-    

-    FigGravityPoly() {

-        super();

-    }

-    

-    FigGravityPoly(Polygon p) {

-        super();

-        setPolygon(p);

-    }

-

-    @Override

-    public Point getClosestPoint(Point anotherPt) {

-        return Geometry.ptClosestTo(

-                getXs(), getYs(), getYs().length, anotherPt);

-    }

-

-    public List getGravityPoints() {

-        return null;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Point;
+import java.awt.Polygon;
+import java.util.List;
+
+import org.tigris.gef.base.Geometry;
+import org.tigris.gef.presentation.FigPoly;
+
+/**
+ * A FigPoly to which edges gravitate to the perimeter instead of the points
+ * @author Bob Tarling
+ *
+ */
+class FigGravityPoly extends FigPoly {
+    
+    FigGravityPoly() {
+        super();
+    }
+    
+    FigGravityPoly(Polygon p) {
+        super();
+        setPolygon(p);
+    }
+
+    @Override
+    public Point getClosestPoint(Point anotherPt) {
+        return Geometry.ptClosestTo(
+                getXs(), getYs(), getYs().length, anotherPt);
+    }
+
+    public List getGravityPoints() {
+        return null;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNameCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNameCompartment.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNameCompartment.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNameCompartment.java	2012-12-28 10:30:46-0800
@@ -1,38 +1,38 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Rectangle;

-

-import org.argouml.model.Model;

-import org.argouml.notation2.NotationType;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.Fig;

-

-public class FigNameCompartment extends FigCompartment {

-

-    public FigNameCompartment(Object owner, Rectangle bounds,

-            DiagramSettings settings) {

-        super(owner, settings);

-        addFig(new FigCompartment(

-                owner, bounds, settings, 

-                Model.getMetaTypes().getStereotype(), "stereotype"));

-        Fig nameDisplay = new FigNotation(

-                owner,

-                new Rectangle(0, 0, 0, 0),

-                settings,

-                NotationType.NAME);

-        addFig(nameDisplay);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Rectangle;
+
+import org.argouml.model.Model;
+import org.argouml.notation2.NotationType;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.Fig;
+
+public class FigNameCompartment extends FigCompartment {
+
+    public FigNameCompartment(Object owner, Rectangle bounds,
+            DiagramSettings settings) {
+        super(owner, settings);
+        addFig(new FigCompartment(
+                owner, bounds, settings, 
+                Model.getMetaTypes().getStereotype(), "stereotype"));
+        Fig nameDisplay = new FigNotation(
+                owner,
+                new Rectangle(0, 0, 0, 0),
+                settings,
+                NotationType.NAME);
+        addFig(nameDisplay);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedConcavePentagon.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedConcavePentagon.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedConcavePentagon.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedConcavePentagon.java	2012-12-28 10:30:46-0800
@@ -1,62 +1,62 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Color;

-import java.awt.Polygon;

-import java.awt.Rectangle;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.FigPoly;

-

-class FigNamedConcavePentagon extends FigBasePresentation

-        implements StereotypeDisplayer, NameDisplayer {

-

-    public FigNamedConcavePentagon(

-            final Object owner, Rectangle rect, Color lineColor,

-            Color fillColor, Object modelElement, DiagramSettings settings) {

-        super(owner, rect, lineColor, fillColor, modelElement, settings);

-        createBorder(rect, lineColor, fillColor);

-    }

-

-    protected DiagramElement createBorder(

-            final Rectangle rect,

-            final Color lineColor,

-            final Color fillColor) {

-        final Poly poly = new Poly();

-        final int[] xs = new int[6];

-        final int[] ys = new int[6];

-        final int x = rect.x;

-        final int y = rect.y;

-        final int w = rect.width;

-        final int h = rect.height;        

-        xs[0] = x;         ys[0] = y;

-        xs[1] = x + w;     ys[1] = y;

-        xs[2] = x + w;     ys[2] = y + h;

-        xs[3] = x;         ys[3] = y + h;

-        xs[4] = x + h / 2; ys[4] = y + h / 2;

-        xs[5] = x;         ys[5] = y;

-        final Polygon p = new Polygon(xs, ys, 6);

-        poly.setPolygon(p);

-        

-        return poly;

-    }

-    

-    

-    private class Poly extends FigPoly implements DiagramElement {

-        Poly() {

-            super();

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Color;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.FigPoly;
+
+class FigNamedConcavePentagon extends FigBasePresentation
+        implements StereotypeDisplayer, NameDisplayer {
+
+    public FigNamedConcavePentagon(
+            final Object owner, Rectangle rect, Color lineColor,
+            Color fillColor, Object modelElement, DiagramSettings settings) {
+        super(owner, rect, lineColor, fillColor, modelElement, settings);
+        createBorder(rect, lineColor, fillColor);
+    }
+
+    protected DiagramElement createBorder(
+            final Rectangle rect,
+            final Color lineColor,
+            final Color fillColor) {
+        final Poly poly = new Poly();
+        final int[] xs = new int[6];
+        final int[] ys = new int[6];
+        final int x = rect.x;
+        final int y = rect.y;
+        final int w = rect.width;
+        final int h = rect.height;        
+        xs[0] = x;         ys[0] = y;
+        xs[1] = x + w;     ys[1] = y;
+        xs[2] = x + w;     ys[2] = y + h;
+        xs[3] = x;         ys[3] = y + h;
+        xs[4] = x + h / 2; ys[4] = y + h / 2;
+        xs[5] = x;         ys[5] = y;
+        final Polygon p = new Polygon(xs, ys, 6);
+        poly.setPolygon(p);
+        
+        return poly;
+    }
+    
+    
+    private class Poly extends FigPoly implements DiagramElement {
+        Poly() {
+            super();
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedPentagon.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedPentagon.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedPentagon.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedPentagon.java	2012-12-28 10:30:46-0800
@@ -1,66 +1,66 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-package org.argouml.activity2.diagram;

-

-import java.awt.Color;

-import java.awt.Dimension;

-import java.awt.Polygon;

-import java.awt.Rectangle;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.FigPoly;

-

-class FigNamedPentagon extends FigBasePresentation

-        implements StereotypeDisplayer, NameDisplayer {

-

-    private static final int PADDING = 8;

-    

-    public FigNamedPentagon(final Object owner, Rectangle rect, Color lineColor,

-            Color fillColor, Object modelElement, DiagramSettings settings) {

-        super(owner, rect, lineColor, fillColor, modelElement, settings);

-        createBorder(rect, lineColor, fillColor);

-    }

-

-    protected DiagramElement createBorder(

-            final Rectangle rect,

-            final Color lineColor,

-            final Color fillColor) {

-        final Poly poly = new Poly();

-        final int[] xs = new int[6];

-        final int[] ys = new int[6];

-        final int x = rect.x;

-        final int y = rect.y;

-        final int w = rect.width;

-        final int h = rect.height;

-        xs[0] = x;             ys[0] = y;

-        xs[1] = x + w - h / 2; ys[1] = y;

-        xs[2] = x + w;         ys[2] = y + h / 2;

-        xs[3] = x + w - h / 2; ys[3] = y + h;

-        xs[4] = x;             ys[4] = y + h;

-        xs[5] = x;             ys[5] = y;

-        final Polygon p = new Polygon(xs, ys, 6);

-        poly.setPolygon(p);

-        

-        return poly;

-    }

-    

-    protected int getLeftMargin() {

-        return getBounds().height / 2;

-    }

-    

-    private class Poly extends FigPoly implements DiagramElement {

-        Poly() {

-            super();

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+package org.argouml.activity2.diagram;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.FigPoly;
+
+class FigNamedPentagon extends FigBasePresentation
+        implements StereotypeDisplayer, NameDisplayer {
+
+    private static final int PADDING = 8;
+    
+    public FigNamedPentagon(final Object owner, Rectangle rect, Color lineColor,
+            Color fillColor, Object modelElement, DiagramSettings settings) {
+        super(owner, rect, lineColor, fillColor, modelElement, settings);
+        createBorder(rect, lineColor, fillColor);
+    }
+
+    protected DiagramElement createBorder(
+            final Rectangle rect,
+            final Color lineColor,
+            final Color fillColor) {
+        final Poly poly = new Poly();
+        final int[] xs = new int[6];
+        final int[] ys = new int[6];
+        final int x = rect.x;
+        final int y = rect.y;
+        final int w = rect.width;
+        final int h = rect.height;
+        xs[0] = x;             ys[0] = y;
+        xs[1] = x + w - h / 2; ys[1] = y;
+        xs[2] = x + w;         ys[2] = y + h / 2;
+        xs[3] = x + w - h / 2; ys[3] = y + h;
+        xs[4] = x;             ys[4] = y + h;
+        xs[5] = x;             ys[5] = y;
+        final Polygon p = new Polygon(xs, ys, 6);
+        poly.setPolygon(p);
+        
+        return poly;
+    }
+    
+    protected int getLeftMargin() {
+        return getBounds().height / 2;
+    }
+    
+    private class Poly extends FigPoly implements DiagramElement {
+        Poly() {
+            super();
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRRect.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRRect.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRRect.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRRect.java	2012-12-28 10:30:46-0800
@@ -1,69 +1,69 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Color;

-import java.awt.Dimension;

-import java.awt.Rectangle;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.FigRRect;

-

-/**

- * The state for displaying a node as a rounded rectangle

- * @author Bob Tarling

- */

-class FigNamedRRect extends FigBasePresentation

-            implements StereotypeDisplayer, NameDisplayer {

-

-    private static int RADIUS = 16;

-    

-    public FigNamedRRect(

-            final Object owner,

-            final Rectangle rect,

-            final Color lineColor,

-            final Color fillColor,

-            final Object modelElement,

-            final DiagramSettings settings) {

-        super(owner, rect, lineColor, fillColor, modelElement, settings);

-        createBorder(rect, lineColor, fillColor);

-    }

-

-    DiagramElement createBorder(Rectangle rect, Color lineColor, Color fillColor) {

-        return new RRect(

-                rect.x, rect.y, rect.width, rect.height, lineColor, fillColor);

-    }

-    

-    private class RRect extends FigRRect implements DiagramElement {

-        RRect(

-                final int x, 

-                final int y, 

-                final int w, 

-                final int h, 

-                final Color lineColor, 

-                final Color fillColor) {

-            super(x, y, w, h, lineColor, fillColor);

-            this.setCornerRadius(RADIUS);

-        }

-    }

-    

-    

-    protected int getRightMargin() {

-        return RADIUS;

-    }

-    

-    protected int getLeftMargin() {

-        return RADIUS;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.FigRRect;
+
+/**
+ * The state for displaying a node as a rounded rectangle
+ * @author Bob Tarling
+ */
+class FigNamedRRect extends FigBasePresentation
+            implements StereotypeDisplayer, NameDisplayer {
+
+    private static int RADIUS = 16;
+    
+    public FigNamedRRect(
+            final Object owner,
+            final Rectangle rect,
+            final Color lineColor,
+            final Color fillColor,
+            final Object modelElement,
+            final DiagramSettings settings) {
+        super(owner, rect, lineColor, fillColor, modelElement, settings);
+        createBorder(rect, lineColor, fillColor);
+    }
+
+    DiagramElement createBorder(Rectangle rect, Color lineColor, Color fillColor) {
+        return new RRect(
+                rect.x, rect.y, rect.width, rect.height, lineColor, fillColor);
+    }
+    
+    private class RRect extends FigRRect implements DiagramElement {
+        RRect(
+                final int x, 
+                final int y, 
+                final int w, 
+                final int h, 
+                final Color lineColor, 
+                final Color fillColor) {
+            super(x, y, w, h, lineColor, fillColor);
+            this.setCornerRadius(RADIUS);
+        }
+    }
+    
+    
+    protected int getRightMargin() {
+        return RADIUS;
+    }
+    
+    protected int getLeftMargin() {
+        return RADIUS;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRect.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRect.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRect.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNamedRect.java	2012-12-28 10:30:46-0800
@@ -1,52 +1,52 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-package org.argouml.activity2.diagram;

-

-import java.awt.Color;

-import java.awt.Rectangle;

-

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.FigRect;

-

-class FigNamedRect extends FigBasePresentation

-        implements StereotypeDisplayer, NameDisplayer {

-

-    public FigNamedRect(

-            final Object owner, final Rectangle rect, Color lineColor,

-            Color fillColor, Object modelElement, DiagramSettings settings) {

-        super(owner, rect, lineColor,

-                fillColor, modelElement, settings);

-        createBorder(rect, lineColor, fillColor);

-    }

-

-    DiagramElement createBorder(

-            final Rectangle rect,

-            final Color lineColor,

-            final Color fillColor) {

-        return new Rect(

-                rect.x, rect.y, rect.width, rect.height, lineColor, fillColor);

-    }

-    

-    

-    private class Rect extends FigRect implements DiagramElement {

-        Rect(

-                final int x, 

-                final int y, 

-                final int w, 

-                final int h, 

-                final Color lineColor, 

-                final Color fillColor) {

-            super(x, y, w, h, lineColor, fillColor);

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+package org.argouml.activity2.diagram;
+
+import java.awt.Color;
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.FigRect;
+
+class FigNamedRect extends FigBasePresentation
+        implements StereotypeDisplayer, NameDisplayer {
+
+    public FigNamedRect(
+            final Object owner, final Rectangle rect, Color lineColor,
+            Color fillColor, Object modelElement, DiagramSettings settings) {
+        super(owner, rect, lineColor,
+                fillColor, modelElement, settings);
+        createBorder(rect, lineColor, fillColor);
+    }
+
+    DiagramElement createBorder(
+            final Rectangle rect,
+            final Color lineColor,
+            final Color fillColor) {
+        return new Rect(
+                rect.x, rect.y, rect.width, rect.height, lineColor, fillColor);
+    }
+    
+    
+    private class Rect extends FigRect implements DiagramElement {
+        Rect(
+                final int x, 
+                final int y, 
+                final int w, 
+                final int h, 
+                final Color lineColor, 
+                final Color fillColor) {
+            super(x, y, w, h, lineColor, fillColor);
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNotation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNotation.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNotation.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/FigNotation.java	2012-12-28 10:30:46-0800
@@ -1,167 +1,167 @@
-/* $Id: FigNotation.java $

- *****************************************************************************

- * Copyright (c) 20011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Dimension;

-import java.awt.Rectangle;

-

-import org.apache.log4j.Logger;

-import org.argouml.notation2.NotatedItem;

-import org.argouml.notation2.NotationLanguage;

-import org.argouml.notation2.NotationManager;

-import org.argouml.notation2.NotationTextEvent;

-import org.argouml.notation2.NotationType;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.tigris.gef.presentation.FigGroup;

-import org.tigris.gef.presentation.FigText;

-

-/**

- * @author Bob Tarling

- */

-class FigNotation extends FigText implements NotatedItem, DiagramElement {

-

-    private static final Logger LOG = Logger.getLogger(FigNotation.class);

-

-    private final NotationType notationType;

-    

-    /**

-     * Construct the notation fig

-     * 

-     * @param owner owning UML element

-     * @param bounds position and size

-     * @param settings diagram settings

-     * @param notationType the notation type to show

-     */

-    public FigNotation(

-            final Object owner,

-            final Rectangle bounds,

-            final DiagramSettings settings,

-            final NotationType notationType) {

-        super(bounds.x, bounds.y, bounds.width, bounds.height , true);

-        setOwner(owner);

-        setFont(settings.getFontPlain());

-        this.notationType = notationType;

-        setTabAction(FigText.END_EDITING);

-        setReturnAction(FigText.END_EDITING);

-        setLineWidth(0);

-        super.setFilled(true);

-        NotationManager.getInstance().addListener(this);

-    }

-

-    public void setLineWidth(int lw) {

-        super.setLineWidth(0);

-    }

-    

-    /**

-     * Notation is always transparent

-     */

-    public void setFilled(boolean filled) {

-    }

-    

-    @Override

-    public Dimension getMinimumSize() {

-        

-        int w = getFontMetrics().stringWidth(getText());

-        int h = getFontMetrics().getHeight();

-        

-        final int minWidth = 

-            w

-            + getLeftMargin()

-            + getRightMargin()

-            + 2 * getLineWidth();

-        final int minHeight = 

-            h

-            + getTopMargin()

-            + getBotMargin()

-            + 2 * getLineWidth();

-        return new Dimension(minWidth, minHeight);

-    }

-

-    public Object getMetaType() {

-        return getOwner().getClass();

-    }

-

-    public NotationLanguage getNotationLanguage() {

-        return null;

-    }

-

-    public NotationType getNotationType() {

-        return notationType;

-    }

-

-    public void notationTextChanged(NotationTextEvent event) {

-        this.setText(event.getText());

-        this.setUnderline(event.isUnderlined());

-        this.setBold(event.isBold());

-        this.setItalic(event.isItalic());

-        if (getMinimumSize().width > getWidth()) {

-            setWidth(getMinimumSize().width);

-        }

-        this.damage();

-    }

-    

-    public void setText(String s) {

-        final String oldText = getText();

-        if (s.equals(oldText)) {

-            return;

-        }

-        final Rectangle oldBounds = getBounds();

-        super.setText(s);

-        // TODO: This should happen in GEF

-        firePropChange("text", oldText, s);

-        // TODO: setText in GEF should call setBounds instead of directly

-        // changing x, y, w, h - then we will have an event generated

-        // correctly in GEF

-        final FigGroup group = (FigGroup) getGroup();

-        if (group != null

-                && ( oldBounds.width < getBounds().width

-                        || oldBounds.height < getBounds().height)) {

-            group.calcBounds();

-        }

-    }

-    

-    /**

-     * Prevent underline events if underline does not change.

-     * TODO: GEF should manage this after GEF 0.13.4 is included.

-     */

-    public void setUnderline(boolean u) {

-        if (getUnderline() == u) {

-            return;

-        }

-        super.setUnderline(u);

-    }

-    

-    

-    /**

-     * Prevent bold events if bold does not change.

-     * TODO: GEF should manage this after GEF 0.13.4 is included.

-     */

-    public void setBold(boolean b) {

-        if (getBold() == b) {

-            return;

-        }

-        super.setBold(b);

-    }

-    

-    /**

-     * Prevent italic events if italic does not change.

-     * TODO: GEF should manage this after GEF 0.13.4 is included.

-     */

-    public void setItalic(boolean i) {

-        if (getItalic() == i) {

-            return;

-        }

-        super.setItalic(i);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 20011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Dimension;
+import java.awt.Rectangle;
+
+import org.apache.log4j.Logger;
+import org.argouml.notation2.NotatedItem;
+import org.argouml.notation2.NotationLanguage;
+import org.argouml.notation2.NotationManager;
+import org.argouml.notation2.NotationTextEvent;
+import org.argouml.notation2.NotationType;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.FigGroup;
+import org.tigris.gef.presentation.FigText;
+
+/**
+ * @author Bob Tarling
+ */
+class FigNotation extends FigText implements NotatedItem, DiagramElement {
+
+    private static final Logger LOG = Logger.getLogger(FigNotation.class);
+
+    private final NotationType notationType;
+    
+    /**
+     * Construct the notation fig
+     * 
+     * @param owner owning UML element
+     * @param bounds position and size
+     * @param settings diagram settings
+     * @param notationType the notation type to show
+     */
+    public FigNotation(
+            final Object owner,
+            final Rectangle bounds,
+            final DiagramSettings settings,
+            final NotationType notationType) {
+        super(bounds.x, bounds.y, bounds.width, bounds.height , true);
+        setOwner(owner);
+        setFont(settings.getFontPlain());
+        this.notationType = notationType;
+        setTabAction(FigText.END_EDITING);
+        setReturnAction(FigText.END_EDITING);
+        setLineWidth(0);
+        super.setFilled(true);
+        NotationManager.getInstance().addListener(this);
+    }
+
+    public void setLineWidth(int lw) {
+        super.setLineWidth(0);
+    }
+    
+    /**
+     * Notation is always transparent
+     */
+    public void setFilled(boolean filled) {
+    }
+    
+    @Override
+    public Dimension getMinimumSize() {
+        
+        int w = getFontMetrics().stringWidth(getText());
+        int h = getFontMetrics().getHeight();
+        
+        final int minWidth = 
+            w
+            + getLeftMargin()
+            + getRightMargin()
+            + 2 * getLineWidth();
+        final int minHeight = 
+            h
+            + getTopMargin()
+            + getBotMargin()
+            + 2 * getLineWidth();
+        return new Dimension(minWidth, minHeight);
+    }
+
+    public Object getMetaType() {
+        return getOwner().getClass();
+    }
+
+    public NotationLanguage getNotationLanguage() {
+        return null;
+    }
+
+    public NotationType getNotationType() {
+        return notationType;
+    }
+
+    public void notationTextChanged(NotationTextEvent event) {
+        this.setText(event.getText());
+        this.setUnderline(event.isUnderlined());
+        this.setBold(event.isBold());
+        this.setItalic(event.isItalic());
+        if (getMinimumSize().width > getWidth()) {
+            setWidth(getMinimumSize().width);
+        }
+        this.damage();
+    }
+    
+    public void setText(String s) {
+        final String oldText = getText();
+        if (s.equals(oldText)) {
+            return;
+        }
+        final Rectangle oldBounds = getBounds();
+        super.setText(s);
+        // TODO: This should happen in GEF
+        firePropChange("text", oldText, s);
+        // TODO: setText in GEF should call setBounds instead of directly
+        // changing x, y, w, h - then we will have an event generated
+        // correctly in GEF
+        final FigGroup group = (FigGroup) getGroup();
+        if (group != null
+                && ( oldBounds.width < getBounds().width
+                        || oldBounds.height < getBounds().height)) {
+            group.calcBounds();
+        }
+    }
+    
+    /**
+     * Prevent underline events if underline does not change.
+     * TODO: GEF should manage this after GEF 0.13.4 is included.
+     */
+    public void setUnderline(boolean u) {
+        if (getUnderline() == u) {
+            return;
+        }
+        super.setUnderline(u);
+    }
+    
+    
+    /**
+     * Prevent bold events if bold does not change.
+     * TODO: GEF should manage this after GEF 0.13.4 is included.
+     */
+    public void setBold(boolean b) {
+        if (getBold() == b) {
+            return;
+        }
+        super.setBold(b);
+    }
+    
+    /**
+     * Prevent italic events if italic does not change.
+     * TODO: GEF should manage this after GEF 0.13.4 is included.
+     */
+    public void setItalic(boolean i) {
+        if (getItalic() == i) {
+            return;
+        }
+        super.setItalic(i);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ModePlaceDiagramElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ModePlaceDiagramElement.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ModePlaceDiagramElement.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/ModePlaceDiagramElement.java	2012-12-28 10:30:46-0800
@@ -1,142 +1,142 @@
-package org.argouml.activity2.diagram;

-

-import java.awt.Cursor;

-import java.awt.Graphics;

-import java.awt.Point;

-import java.awt.Rectangle;

-import java.awt.event.KeyEvent;

-import java.awt.event.MouseEvent;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.Model;

-import org.argouml.uml.diagram.DiagramSettings;

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

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

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

-import org.tigris.gef.di.GraphNode;

-import org.tigris.gef.graph.MutableGraphModel;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.undo.UndoManager;

-

-class ModePlaceDiagramElement extends FigModifyingModeImpl {

-

-    private static final Logger LOG =

-        Logger.getLogger(ModePlaceDiagramElement.class);

-    private final Object metaType;

-    private final String style;

-    private final String instructions;

-    private final BaseDiagram diagram;

-    

-    private Object modelElement;

-    private GraphNode graphNode;

-

-    private static final int WIDTH = 90;

-    private static final int HEIGHT = 25;

-    

-    public ModePlaceDiagramElement(

-            final BaseDiagram diagram,

-            final Object metaType,

-            final String style,

-            final String instructions) {

-        this.diagram = diagram;

-        this.metaType = metaType;

-        this.style = style;

-        if (instructions == null) {

-            this.instructions = "";

-        } else {

-            this.instructions = instructions;

-        }

-    }

-

-    public String instructions() {

-        return instructions;

-    }

-

-    public Cursor getInitialCursor() {

-        return Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);

-    }

-

-    public void mousePressed(MouseEvent me) {

-        if (me.isConsumed()) {

-            return;

-        }

-        UndoManager.getInstance().addMementoLock(this);

-        // TODO: Something might go wrong during processing. We don't really

-        // want to create the model element until the user releases the mouse

-        // in the place expected.

-        modelElement = Model.getUmlFactory().buildNode(metaType, diagram.getOwner());

-        LOG.info("Created " + modelElement);

-        //

-        start();

-        editor = Globals.curEditor();

-        Layer lay = editor.getLayerManager().getActiveLayer();

-        graphNode = createDiagramElement(lay, modelElement, diagram.getDiagramSettings());

-        mouseMoved(me);

-        me.consume();

-    }

-    

-    private GraphNode createDiagramElement(Layer lay, Object owner, DiagramSettings settings) {

-        FigBaseNode fig = new FigBaseNode(owner, new Rectangle(0, 0, 0, 0), settings);

-        DiagramElementBuilder.buildDiagramElement(fig, style, owner, settings);

-        fig.setLayer(lay);

-        return fig;

-    }

-

-    public void mouseExited(MouseEvent me) {

-        editor.damageAll();

-        me.consume();

-    }

-

-    public void mouseMoved(MouseEvent me) {

-        mouseDragged(me);

-    }

-

-    public void mouseDragged(MouseEvent me) {

-        if (me.isConsumed()) {

-            return;

-        }

-        if (graphNode == null) {

-            me.consume();

-            return;

-        }

-        editor.damageAll();

-        Point snapPt = new Point(me.getX(), me.getY());

-        editor.snap(snapPt);

-        ((Fig) graphNode).setLocation(snapPt.x, snapPt.y);

-        editor.damageAll();

-        me.consume();

-    }

-

-    public void mouseEntered(MouseEvent me) {

-        me.consume();

-    }

-

-    public void mouseReleased(MouseEvent me) {

-        if (me.isConsumed()) {

-            return;

-        }

-

-        LOG.info("Mouse released");

-        MutableGraphModel mgm = (MutableGraphModel) editor.getGraphModel();

-        UndoManager.getInstance().startChain();

-        editor.add((Fig) graphNode);

-        mgm.addNode(modelElement);

-

-        editor.getSelectionManager().select((Fig) graphNode);

-        LOG.info("The diagram element " + graphNode + " was added");

-        done();

-        me.consume();

-    }

-

-    public void keyTyped(KeyEvent ke) {

-        if (ke.getKeyChar() == KeyEvent.VK_ESCAPE) {

-            leave();

-        }

-    }

-

-    public void paint(Graphics g) {

-        if (graphNode != null) {

-            ((Fig) graphNode).paint(g);

-        }

-    }

-}

+package org.argouml.activity2.diagram;
+
+import java.awt.Cursor;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.base.FigModifyingModeImpl;
+import org.tigris.gef.base.Globals;
+import org.tigris.gef.base.Layer;
+import org.tigris.gef.di.GraphNode;
+import org.tigris.gef.graph.MutableGraphModel;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.undo.UndoManager;
+
+class ModePlaceDiagramElement extends FigModifyingModeImpl {
+
+    private static final Logger LOG =
+        Logger.getLogger(ModePlaceDiagramElement.class);
+    private final Object metaType;
+    private final String style;
+    private final String instructions;
+    private final BaseDiagram diagram;
+    
+    private Object modelElement;
+    private GraphNode graphNode;
+
+    private static final int WIDTH = 90;
+    private static final int HEIGHT = 25;
+    
+    public ModePlaceDiagramElement(
+            final BaseDiagram diagram,
+            final Object metaType,
+            final String style,
+            final String instructions) {
+        this.diagram = diagram;
+        this.metaType = metaType;
+        this.style = style;
+        if (instructions == null) {
+            this.instructions = "";
+        } else {
+            this.instructions = instructions;
+        }
+    }
+
+    public String instructions() {
+        return instructions;
+    }
+
+    public Cursor getInitialCursor() {
+        return Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
+    }
+
+    public void mousePressed(MouseEvent me) {
+        if (me.isConsumed()) {
+            return;
+        }
+        UndoManager.getInstance().addMementoLock(this);
+        // TODO: Something might go wrong during processing. We don't really
+        // want to create the model element until the user releases the mouse
+        // in the place expected.
+        modelElement = Model.getUmlFactory().buildNode(metaType, diagram.getOwner());
+        LOG.info("Created " + modelElement);
+        //
+        start();
+        editor = Globals.curEditor();
+        Layer lay = editor.getLayerManager().getActiveLayer();
+        graphNode = createDiagramElement(lay, modelElement, diagram.getDiagramSettings());
+        mouseMoved(me);
+        me.consume();
+    }
+    
+    private GraphNode createDiagramElement(Layer lay, Object owner, DiagramSettings settings) {
+        FigBaseNode fig = new FigBaseNode(owner, new Rectangle(0, 0, 0, 0), settings);
+        DiagramElementBuilder.buildDiagramElement(fig, style, owner, settings);
+        fig.setLayer(lay);
+        return fig;
+    }
+
+    public void mouseExited(MouseEvent me) {
+        editor.damageAll();
+        me.consume();
+    }
+
+    public void mouseMoved(MouseEvent me) {
+        mouseDragged(me);
+    }
+
+    public void mouseDragged(MouseEvent me) {
+        if (me.isConsumed()) {
+            return;
+        }
+        if (graphNode == null) {
+            me.consume();
+            return;
+        }
+        editor.damageAll();
+        Point snapPt = new Point(me.getX(), me.getY());
+        editor.snap(snapPt);
+        ((Fig) graphNode).setLocation(snapPt.x, snapPt.y);
+        editor.damageAll();
+        me.consume();
+    }
+
+    public void mouseEntered(MouseEvent me) {
+        me.consume();
+    }
+
+    public void mouseReleased(MouseEvent me) {
+        if (me.isConsumed()) {
+            return;
+        }
+
+        LOG.info("Mouse released");
+        MutableGraphModel mgm = (MutableGraphModel) editor.getGraphModel();
+        UndoManager.getInstance().startChain();
+        editor.add((Fig) graphNode);
+        mgm.addNode(modelElement);
+
+        editor.getSelectionManager().select((Fig) graphNode);
+        LOG.info("The diagram element " + graphNode + " was added");
+        done();
+        me.consume();
+    }
+
+    public void keyTyped(KeyEvent ke) {
+        if (ke.getKeyChar() == KeyEvent.VK_ESCAPE) {
+            leave();
+        }
+    }
+
+    public void paint(Graphics g) {
+        if (graphNode != null) {
+            ((Fig) graphNode).paint(g);
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/NameDisplayer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/NameDisplayer.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/NameDisplayer.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/NameDisplayer.java	2012-12-28 10:30:46-0800
@@ -1,20 +1,20 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-

-interface NameDisplayer {

-

-    DiagramElement getStereotypeDisplay();

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+
+interface NameDisplayer {
+
+    DiagramElement getStereotypeDisplay();
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/StereotypeDisplayer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/StereotypeDisplayer.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/StereotypeDisplayer.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/StereotypeDisplayer.java	2012-12-28 10:30:46-0800
@@ -1,19 +1,19 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-package org.argouml.activity2.diagram;

-

-

-interface StereotypeDisplayer {

-

-    DiagramElement getStereotypeDisplay();

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+package org.argouml.activity2.diagram;
+
+
+interface StereotypeDisplayer {
+
+    DiagramElement getStereotypeDisplay();
+}

Modified: trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/UMLActivityDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/UMLActivityDiagram.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/UMLActivityDiagram.java	(original)
+++ trunk/src/argouml-core-diagrams-activity2/src/org/argouml/activity2/diagram/UMLActivityDiagram.java	2012-12-28 10:30:46-0800
@@ -1,102 +1,102 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.activity2.diagram;

-

-import java.awt.Rectangle;

-

-import org.argouml.i18n.Translator;

-import org.argouml.model.ActivityDiagram;

-import org.argouml.model.Model;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.UMLMutableGraphSupport;

-import org.argouml.uml.diagram.UmlDiagramRenderer;

-import org.tigris.gef.presentation.FigNode;

-

-/**

- * Diagram class for UML2 Activity Diagram

- * @author Bob Tarling

- */

-public class UMLActivityDiagram extends BaseDiagram implements ActivityDiagram {

-    

-    /**

-     * A UML2 activity diagram is owned by an activity

-     * @param activity

-     */

-    UMLActivityDiagram(Object activity) {

-        super(activity);

-    }

-    

-    @Override

-    UmlDiagramRenderer createDiagramRenderer() {

-        return new ActivityDiagramRenderer();

-    }

-

-    @Override

-    UMLMutableGraphSupport createGraphModel() {

-        return new ActivityDiagramGraphModel(); 

-    }

-

-    @Override

-    public String getLabelName() {

-        return Translator.localize("label.activity-diagram");

-    }

-    

-    @Override

-    public boolean doesAccept(Object objectToAccept) {

-        if (Model.getFacade().isAComment(objectToAccept)

-                || Model.getFacade().isAActivityEdge(objectToAccept) 

-                || Model.getFacade().isAActivityNode(objectToAccept) ) {

-            return true;

-        }

-        return false;

-    }

-    

-    protected String getDiagramXmlFile() {

-        return "org/argouml/activity2/diagram/diagram.xml";

-    }

-    

-    public DiagramElement createDiagramElement(

-            final Object modelElement,

-            final Rectangle bounds) {

-        

-        DiagramElement figNode = null;

-        

-        DiagramSettings settings = getDiagramSettings();

-        

-        if (Model.getFacade().isAActivityNode(modelElement)) {

-            figNode = new FigBaseNode(modelElement, bounds, settings);

-            final String style;

-            if (Model.getFacade().isAObjectNode(modelElement)) {

-                style = "rect";

-            } else if (Model.getFacade().isASendSignalAction(modelElement)) {

-                style = "pentagon";

-            } else if (Model.getFacade().isAAcceptEventAction(modelElement)) {

-                style = "concave-pentagon";

-            } else {

-                style = "rrect";

-            }

-            DiagramElementBuilder.buildDiagramElement(

-                    (FigBaseNode) figNode, style, modelElement, settings);

-        }

-        

-        return figNode;

-    }

-

-    @Override

-    public void encloserChanged(FigNode enclosed, FigNode oldEncloser,

-            FigNode newEncloser) {

-        // TODO Auto-generated method stub

-        

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.activity2.diagram;
+
+import java.awt.Rectangle;
+
+import org.argouml.i18n.Translator;
+import org.argouml.model.ActivityDiagram;
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.UMLMutableGraphSupport;
+import org.argouml.uml.diagram.UmlDiagramRenderer;
+import org.tigris.gef.presentation.FigNode;
+
+/**
+ * Diagram class for UML2 Activity Diagram
+ * @author Bob Tarling
+ */
+public class UMLActivityDiagram extends BaseDiagram implements ActivityDiagram {
+    
+    /**
+     * A UML2 activity diagram is owned by an activity
+     * @param activity
+     */
+    UMLActivityDiagram(Object activity) {
+        super(activity);
+    }
+    
+    @Override
+    UmlDiagramRenderer createDiagramRenderer() {
+        return new ActivityDiagramRenderer();
+    }
+
+    @Override
+    UMLMutableGraphSupport createGraphModel() {
+        return new ActivityDiagramGraphModel(); 
+    }
+
+    @Override
+    public String getLabelName() {
+        return Translator.localize("label.activity-diagram");
+    }
+    
+    @Override
+    public boolean doesAccept(Object objectToAccept) {
+        if (Model.getFacade().isAComment(objectToAccept)
+                || Model.getFacade().isAActivityEdge(objectToAccept) 
+                || Model.getFacade().isAActivityNode(objectToAccept) ) {
+            return true;
+        }
+        return false;
+    }
+    
+    protected String getDiagramXmlFile() {
+        return "org/argouml/activity2/diagram/diagram.xml";
+    }
+    
+    public DiagramElement createDiagramElement(
+            final Object modelElement,
+            final Rectangle bounds) {
+        
+        DiagramElement figNode = null;
+        
+        DiagramSettings settings = getDiagramSettings();
+        
+        if (Model.getFacade().isAActivityNode(modelElement)) {
+            figNode = new FigBaseNode(modelElement, bounds, settings);
+            final String style;
+            if (Model.getFacade().isAObjectNode(modelElement)) {
+                style = "rect";
+            } else if (Model.getFacade().isASendSignalAction(modelElement)) {
+                style = "pentagon";
+            } else if (Model.getFacade().isAAcceptEventAction(modelElement)) {
+                style = "concave-pentagon";
+            } else {
+                style = "rrect";
+            }
+            DiagramElementBuilder.buildDiagramElement(
+                    (FigBaseNode) figNode, style, modelElement, settings);
+        }
+        
+        return figNode;
+    }
+
+    @Override
+    public void encloserChanged(FigNode enclosed, FigNode oldEncloser,
+            FigNode newEncloser) {
+        // TODO Auto-generated method stub
+        
+    }
+}

Modified: trunk/src/argouml-core-diagrams-class2/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-class2/build.properties	(original)
+++ trunk/src/argouml-core-diagrams-class2/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-diagrams-class2/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-class2/plugin.properties	(original)
+++ trunk/src/argouml-core-diagrams-class2/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-diagrams-sequence2

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-diagrams-sequence2
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML Sequence2 Diagram Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-diagrams-deployment2/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/build.properties	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-diagrams-deployment2/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/plugin.properties	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-diagrams-deployment2

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-diagrams-deployment2
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML Deployment2 Diagram Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramModule.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramModule.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramModule.java	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramModule.java	2012-12-28 10:30:46-0800
@@ -1,80 +1,80 @@
-/* $Id:$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.deployment2;

-

-import org.apache.log4j.Logger;

-import org.argouml.deployment2.diagram.DeploymentDiagramFactory;

-import org.argouml.model.Model;

-import org.argouml.moduleloader.ModuleInterface;

-import org.argouml.notation.Notation;

-import org.argouml.notation.NotationName;

-import org.argouml.notation.NotationProviderFactory2;

-import org.argouml.notation.providers.uml.SDMessageNotationUml;

-import org.argouml.persistence.PersistenceManager;

-import org.argouml.uml.diagram.DiagramFactory;

-import org.argouml.uml.diagram.DiagramFactoryInterface2;

-import org.argouml.uml.diagram.DiagramFactory.DiagramType;

-import org.argouml.uml.ui.PropPanelFactoryManager;

-

-public class DeploymentDiagramModule implements ModuleInterface {

-

-    private static final Logger LOG = Logger

-            .getLogger(DeploymentDiagramModule.class);

-

-    private DeploymentDiagramPropPanelFactory propPanelFactory;

-        

-    public boolean enable() {

-        if (Model.getFacade().getUmlVersion().indexOf("2") >= 0) {

-            // This module will still register as enabled for UML1.4 but it won't

-            // actually do anything.

-            propPanelFactory =

-                new DeploymentDiagramPropPanelFactory();

-            PropPanelFactoryManager.addPropPanelFactory(propPanelFactory);

-            DiagramFactory.getInstance().registerDiagramFactory(

-                    DiagramType.Deployment, 

-                    new DeploymentDiagramFactory());

-        }

-        return true;

-    }

-

-    public boolean disable() {

-

-        PropPanelFactoryManager.removePropPanelFactory(propPanelFactory);

-

-        // TODO: Remove the casting to DiagramFactoryInterface2

-        // as soon as DiagramFactoryInterface is removed.

-        DiagramFactory.getInstance().registerDiagramFactory(

-                DiagramType.Deployment, (DiagramFactoryInterface2) null);

-        return true;

-    }

-

-    public String getName() {

-        return "ArgoUML-Deployment";

-    }

-

-    public String getInfo(int type) {

-        switch (type) {

-        case DESCRIPTION:

-            return "Deployment diagram implementation";

-        case AUTHOR:

-            return "ArgoUML Team";

-        case VERSION:

-            return "0.28";

-        case DOWNLOADSITE:

-            return "http://argouml.tigris.org";

-        default:

-            return null;

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.deployment2;
+
+import org.apache.log4j.Logger;
+import org.argouml.deployment2.diagram.DeploymentDiagramFactory;
+import org.argouml.model.Model;
+import org.argouml.moduleloader.ModuleInterface;
+import org.argouml.notation.Notation;
+import org.argouml.notation.NotationName;
+import org.argouml.notation.NotationProviderFactory2;
+import org.argouml.notation.providers.uml.SDMessageNotationUml;
+import org.argouml.persistence.PersistenceManager;
+import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramFactoryInterface2;
+import org.argouml.uml.diagram.DiagramFactory.DiagramType;
+import org.argouml.uml.ui.PropPanelFactoryManager;
+
+public class DeploymentDiagramModule implements ModuleInterface {
+
+    private static final Logger LOG = Logger
+            .getLogger(DeploymentDiagramModule.class);
+
+    private DeploymentDiagramPropPanelFactory propPanelFactory;
+        
+    public boolean enable() {
+        if (Model.getFacade().getUmlVersion().indexOf("2") >= 0) {
+            // This module will still register as enabled for UML1.4 but it won't
+            // actually do anything.
+            propPanelFactory =
+                new DeploymentDiagramPropPanelFactory();
+            PropPanelFactoryManager.addPropPanelFactory(propPanelFactory);
+            DiagramFactory.getInstance().registerDiagramFactory(
+                    DiagramType.Deployment, 
+                    new DeploymentDiagramFactory());
+        }
+        return true;
+    }
+
+    public boolean disable() {
+
+        PropPanelFactoryManager.removePropPanelFactory(propPanelFactory);
+
+        // TODO: Remove the casting to DiagramFactoryInterface2
+        // as soon as DiagramFactoryInterface is removed.
+        DiagramFactory.getInstance().registerDiagramFactory(
+                DiagramType.Deployment, (DiagramFactoryInterface2) null);
+        return true;
+    }
+
+    public String getName() {
+        return "ArgoUML-Deployment";
+    }
+
+    public String getInfo(int type) {
+        switch (type) {
+        case DESCRIPTION:
+            return "Deployment diagram implementation";
+        case AUTHOR:
+            return "ArgoUML Team";
+        case VERSION:
+            return "0.28";
+        case DOWNLOADSITE:
+            return "http://argouml.tigris.org";
+        default:
+            return null;
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramPropPanelFactory.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramPropPanelFactory.java	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/DeploymentDiagramPropPanelFactory.java	2012-12-28 10:30:46-0800
@@ -1,39 +1,39 @@
-/* $Id:$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.deployment2;

-

-import org.argouml.deployment2.diagram.UMLDeploymentDiagram;

-import org.argouml.i18n.Translator;

-import org.argouml.uml.diagram.ui.PropPanelDiagram;

-import org.argouml.uml.ui.PropPanel;

-import org.argouml.uml.ui.PropPanelFactory;

-

-class DeploymentDiagramPropPanelFactory implements PropPanelFactory {

-

-    public PropPanel createPropPanel(Object object) {

-        if (object instanceof UMLDeploymentDiagram) {

-            return new PropPanelUMLDeploymentDiagram();

-        }

-        return null;

-    }

-

-    class PropPanelUMLDeploymentDiagram extends PropPanelDiagram {

-

-        public PropPanelUMLDeploymentDiagram() {

-            super(Translator.localize("label.deployment-diagram"),

-                    lookupIcon("DeploymentDiagram"));

-        }

-

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.deployment2;
+
+import org.argouml.deployment2.diagram.UMLDeploymentDiagram;
+import org.argouml.i18n.Translator;
+import org.argouml.uml.diagram.ui.PropPanelDiagram;
+import org.argouml.uml.ui.PropPanel;
+import org.argouml.uml.ui.PropPanelFactory;
+
+class DeploymentDiagramPropPanelFactory implements PropPanelFactory {
+
+    public PropPanel createPropPanel(Object object) {
+        if (object instanceof UMLDeploymentDiagram) {
+            return new PropPanelUMLDeploymentDiagram();
+        }
+        return null;
+    }
+
+    class PropPanelUMLDeploymentDiagram extends PropPanelDiagram {
+
+        public PropPanelUMLDeploymentDiagram() {
+            super(Translator.localize("label.deployment-diagram"),
+                    lookupIcon("DeploymentDiagram"));
+        }
+
+    }
+}

Modified: trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramFactory.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramFactory.java	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramFactory.java	2012-12-28 10:30:46-0800
@@ -1,27 +1,27 @@
-/* $Id:$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.deployment2.diagram;

-

-import org.argouml.uml.diagram.ArgoDiagram;

-import org.argouml.uml.diagram.DiagramFactoryInterface2;

-import org.argouml.uml.diagram.DiagramSettings;

-

-public class DeploymentDiagramFactory

-        implements DiagramFactoryInterface2{

-

-    public ArgoDiagram createDiagram(Object owner, String name,

-            DiagramSettings settings) {

-        return new UMLDeploymentDiagram(name, owner);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.deployment2.diagram;
+
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramFactoryInterface2;
+import org.argouml.uml.diagram.DiagramSettings;
+
+public class DeploymentDiagramFactory
+        implements DiagramFactoryInterface2{
+
+    public ArgoDiagram createDiagram(Object owner, String name,
+            DiagramSettings settings) {
+        return new UMLDeploymentDiagram(name, owner);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramGraphModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramGraphModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramGraphModel.java	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/DeploymentDiagramGraphModel.java	2012-12-28 10:30:46-0800
@@ -1,29 +1,29 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    bobtarling

- *****************************************************************************

- */

-

-package org.argouml.deployment2.diagram;

-

-public class DeploymentDiagramGraphModel extends org.argouml.uml.diagram.deployment.DeploymentDiagramGraphModel {

-

-    /*

-     * @see org.tigris.gef.graph.MutableGraphModel#addEdge(java.lang.Object)

-     */

-    @Override

-    public void addEdge(Object edge) {

-        if (!canAddEdge(edge)) {

-            return;

-        }

-        getEdges().add(edge);

-        fireEdgeAdded(edge);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    bobtarling
+ *****************************************************************************
+ */
+
+package org.argouml.deployment2.diagram;
+
+public class DeploymentDiagramGraphModel extends org.argouml.uml.diagram.deployment.DeploymentDiagramGraphModel {
+
+    /*
+     * @see org.tigris.gef.graph.MutableGraphModel#addEdge(java.lang.Object)
+     */
+    @Override
+    public void addEdge(Object edge) {
+        if (!canAddEdge(edge)) {
+            return;
+        }
+        getEdges().add(edge);
+        fireEdgeAdded(edge);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigNode.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigNode.java	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigNode.java	2012-12-28 10:30:46-0800
@@ -1,182 +1,182 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.deployment2.diagram;

-

-import java.awt.Color;

-import java.awt.Dimension;

-import java.awt.Graphics;

-import java.awt.Polygon;

-import java.awt.Rectangle;

-import java.awt.event.MouseEvent;

-import java.io.Serializable;

-import java.util.Vector;

-

-import org.argouml.model.Model;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

-import org.tigris.gef.presentation.Fig;

-

-/**

- * A fig representing a node in a UML2 deployment diagram

- * @author Bob Tarling

- */

-public class FigNode extends FigNodeModelElement {

-

-    protected static final int DEPTH = 20;

-    private static final int WIDTH = 200;

-    private static final int HEIGHT = 180;

-    private static final int MIN_WIDTH = 80;

-    private static final int MIN_HEIGHT = 80;

-    private static final int MARGIN = 2;

-

-    @Override

-    protected Fig createBigPortFig() {

-        FigCube port = new FigCube(0, 0, 

-               WIDTH, 

-               HEIGHT, DEPTH);

-        port.setFilled(false);

-        port.setLineWidth(1);

-        return port;

-    }

-

-    public FigNode(Object owner, Rectangle bounds,

-            DiagramSettings settings) {

-        super(owner, bounds, settings);

-        initialize();

-    }

-    

-    private void initialize() {

-        addFig(getBigPort());

-        addFig(getStereotypeFig());

-        addFig(getNameFig());

-    }

-    

-    @Override

-    public Dimension getMinimumSize() {

-        final Dimension stereoDim = getStereotypeFig().getMinimumSize();

-        final Dimension nameDim = getNameFig().getMinimumSize();

-    

-        int w = Math.max(stereoDim.width, nameDim.width) + DEPTH;

-        int h = stereoDim.height + nameDim.height + DEPTH;

-        

-        w = Math.max(MIN_WIDTH, w);

-        h = Math.max(MIN_HEIGHT, h);

-        return new Dimension(w, h);

-    }

-

-    @Override

-    protected void setStandardBounds(int x, int y, int w, int h) {

-        if (getNameFig() == null) {

-            return;

-        }

-        getBigPort().setBounds(x, y, w, h);

-

-        Dimension stereoDim = getStereotypeFig().getMinimumSize();

-        getStereotypeFig().setBounds(

-                x + getLeftMargin(), y + getTopMargin(),

-                w - getLeftMargin() - getRightMargin(), stereoDim.height);

-        

-        Dimension nameDim = getNameFig().getMinimumSize();

-        getNameFig().setBounds(

-                x + getLeftMargin(), getStereotypeFig().getY() + stereoDim.height + 1,

-                w - getLeftMargin() - getRightMargin(), nameDim.height);

-        _x = x;

-        _y = y;

-        _w = w;

-        _h = h;

-        updateEdges();

-    }

-

-    @Override

-    public void setEnclosingFig(Fig encloser) {

-        if (encloser == null

-                || (encloser != null

-                && Model.getFacade().isANode(encloser.getOwner()))) {

-            super.setEnclosingFig(encloser);

-        }

-    }

-

-    @Override

-    public boolean getUseTrapRect() {

-        return true;

-    }

-    

-    public Rectangle getTrapRect() {

-        return new Rectangle(_x, _y + DEPTH, _w - DEPTH, _h - DEPTH);

-    }

-

-    @Override

-    public Vector getPopUpActions(MouseEvent me) {

-        Vector popUpActions = super.getPopUpActions(me);

-        popUpActions.add(

-                popUpActions.size() - getPopupAddOffset(),

-                buildModifierPopUp(ABSTRACT | LEAF | ROOT));

-        return popUpActions;

-    }

-    

-    

-    int getRightMargin() {

-        return DEPTH + MARGIN;

-    }

-

-    int getLeftMargin() {

-        return MARGIN;

-    }

-    

-    int getTopMargin() {

-        return DEPTH + MARGIN;

-    }

-    

-    int getBottomMargin() {

-        return MARGIN;

-    }

-    

-    

-    public class FigCube extends Fig implements Serializable {

-

-        private final int depth;

-

-        public FigCube(int x, int y, int w, int h, int d) {

-            super(x, y, w, h);

-            depth = d;

-        }

-

-        public void paint(Graphics g) {

-

-            final Color fillColor = getFillColor();

-            final Color lineColor = getLineColor();

-

-            g.setColor(fillColor);

-            Polygon p = new Polygon();

-            p.addPoint(_x + depth,      _y);

-            p.addPoint(_x + _w,         _y);

-            p.addPoint(_x + _w,         _y + _h - depth);

-            p.addPoint(_x + _w - depth, _y + _h);

-            p.addPoint(_x,              _y + _h);

-            p.addPoint(_x,              _y + depth);

-            p.addPoint(_x + depth,      _y);

-            g.fillPolygon(p);

-            

-            

-            g.setColor(lineColor);

-            g.drawPolygon(p);

-            g.drawLine(_x, _y + depth, _x + _w - depth, _y + depth);

-            g.drawLine(_x + _w - depth, _y + depth, _x + _w - depth, _y + _h);

-            g.drawLine(_x + _w - depth, _y + depth, _x + _w, _y);

-        }

-

-        public void appendSvg(StringBuffer sb) {

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.deployment2.diagram;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+import java.io.Serializable;
+import java.util.Vector;
+
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * A fig representing a node in a UML2 deployment diagram
+ * @author Bob Tarling
+ */
+public class FigNode extends FigNodeModelElement {
+
+    protected static final int DEPTH = 20;
+    private static final int WIDTH = 200;
+    private static final int HEIGHT = 180;
+    private static final int MIN_WIDTH = 80;
+    private static final int MIN_HEIGHT = 80;
+    private static final int MARGIN = 2;
+
+    @Override
+    protected Fig createBigPortFig() {
+        FigCube port = new FigCube(0, 0, 
+               WIDTH, 
+               HEIGHT, DEPTH);
+        port.setFilled(false);
+        port.setLineWidth(1);
+        return port;
+    }
+
+    public FigNode(Object owner, Rectangle bounds,
+            DiagramSettings settings) {
+        super(owner, bounds, settings);
+        initialize();
+    }
+    
+    private void initialize() {
+        addFig(getBigPort());
+        addFig(getStereotypeFig());
+        addFig(getNameFig());
+    }
+    
+    @Override
+    public Dimension getMinimumSize() {
+        final Dimension stereoDim = getStereotypeFig().getMinimumSize();
+        final Dimension nameDim = getNameFig().getMinimumSize();
+    
+        int w = Math.max(stereoDim.width, nameDim.width) + DEPTH;
+        int h = stereoDim.height + nameDim.height + DEPTH;
+        
+        w = Math.max(MIN_WIDTH, w);
+        h = Math.max(MIN_HEIGHT, h);
+        return new Dimension(w, h);
+    }
+
+    @Override
+    protected void setStandardBounds(int x, int y, int w, int h) {
+        if (getNameFig() == null) {
+            return;
+        }
+        getBigPort().setBounds(x, y, w, h);
+
+        Dimension stereoDim = getStereotypeFig().getMinimumSize();
+        getStereotypeFig().setBounds(
+                x + getLeftMargin(), y + getTopMargin(),
+                w - getLeftMargin() - getRightMargin(), stereoDim.height);
+        
+        Dimension nameDim = getNameFig().getMinimumSize();
+        getNameFig().setBounds(
+                x + getLeftMargin(), getStereotypeFig().getY() + stereoDim.height + 1,
+                w - getLeftMargin() - getRightMargin(), nameDim.height);
+        _x = x;
+        _y = y;
+        _w = w;
+        _h = h;
+        updateEdges();
+    }
+
+    @Override
+    public void setEnclosingFig(Fig encloser) {
+        if (encloser == null
+                || (encloser != null
+                && Model.getFacade().isANode(encloser.getOwner()))) {
+            super.setEnclosingFig(encloser);
+        }
+    }
+
+    @Override
+    public boolean getUseTrapRect() {
+        return true;
+    }
+    
+    public Rectangle getTrapRect() {
+        return new Rectangle(_x, _y + DEPTH, _w - DEPTH, _h - DEPTH);
+    }
+
+    @Override
+    public Vector getPopUpActions(MouseEvent me) {
+        Vector popUpActions = super.getPopUpActions(me);
+        popUpActions.add(
+                popUpActions.size() - getPopupAddOffset(),
+                buildModifierPopUp(ABSTRACT | LEAF | ROOT));
+        return popUpActions;
+    }
+    
+    
+    int getRightMargin() {
+        return DEPTH + MARGIN;
+    }
+
+    int getLeftMargin() {
+        return MARGIN;
+    }
+    
+    int getTopMargin() {
+        return DEPTH + MARGIN;
+    }
+    
+    int getBottomMargin() {
+        return MARGIN;
+    }
+    
+    
+    public class FigCube extends Fig implements Serializable {
+
+        private final int depth;
+
+        public FigCube(int x, int y, int w, int h, int d) {
+            super(x, y, w, h);
+            depth = d;
+        }
+
+        public void paint(Graphics g) {
+
+            final Color fillColor = getFillColor();
+            final Color lineColor = getLineColor();
+
+            g.setColor(fillColor);
+            Polygon p = new Polygon();
+            p.addPoint(_x + depth,      _y);
+            p.addPoint(_x + _w,         _y);
+            p.addPoint(_x + _w,         _y + _h - depth);
+            p.addPoint(_x + _w - depth, _y + _h);
+            p.addPoint(_x,              _y + _h);
+            p.addPoint(_x,              _y + depth);
+            p.addPoint(_x + depth,      _y);
+            g.fillPolygon(p);
+            
+            
+            g.setColor(lineColor);
+            g.drawPolygon(p);
+            g.drawLine(_x, _y + depth, _x + _w - depth, _y + depth);
+            g.drawLine(_x + _w - depth, _y + depth, _x + _w - depth, _y + _h);
+            g.drawLine(_x + _w - depth, _y + depth, _x + _w, _y);
+        }
+
+        public void appendSvg(StringBuffer sb) {
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigPort.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigPort.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigPort.java	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/FigPort.java	2012-12-28 10:30:46-0800
@@ -1,97 +1,97 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.deployment2.diagram;

-

-import java.awt.Point;

-import java.awt.Rectangle;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

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

-import org.tigris.gef.di.GraphNode;

-import org.tigris.gef.presentation.Connector;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.FigRect;

-

-class FigPort extends FigNodeModelElement implements Connector {

-

-    private static final int WIDTH = 16;

-    private static final int HEIGHT = 16;

-

-    FigNode node;

-    

-    public FigPort(Object owner, Rectangle bounds, 

-            DiagramSettings settings) {

-        super(owner, bounds, settings);

-        initialize();

-    }

-    

-    public GraphNode getGraphNode() {

-        return node;

-    }

-

-    public void setGraphNode(GraphNode node) {

-        this.node = (FigNode) node;

-    }

-    

-

-    @Override

-    public void setEnclosingFig(Fig encloser) {

-        // TODO: Note copy/paste code in FigExitPoint - where is this code

-        // better placed in GEF?

-        LayerPerspective lp = (LayerPerspective) getLayer();

-        if (lp == null) {

-            return;

-        }

-        

-        super.setEnclosingFig(encloser);

-        FigNode node = ((FigNode) encloser);

-        

-        if (node != null) {

-            node.addConnector(this);

-        } else {

-            FigNode previousNode = (FigNode) getGraphNode();

-            if (previousNode != null)

-                previousNode.removeConnector(this);

-        }

-    }

-    

-    @Override

-    protected Fig createBigPortFig() {

-        FigRect fr = new FigRect(0, 0, WIDTH, HEIGHT);

-        fr.setLineWidth(1);

-        return fr;

-    }

-

-    private void initialize() {

-        setEditable(false);

-        addFig(getBigPort());

-    }

-

-    @Override

-    public boolean isResizable() {

-        return false;

-    }

-

-    @Override

-    public Point connectionPoint(Point anotherPt) {

-        return getBigPort().connectionPoint(anotherPt);

-    }

-    

-    @Override

-    protected void setStandardBounds(int x, int y, int w, int h) {

-        getBigPort().setBounds(x, y, w, h);

-        calcBounds();

-        updateEdges();

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.deployment2.diagram;
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.di.GraphNode;
+import org.tigris.gef.presentation.Connector;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigRect;
+
+class FigPort extends FigNodeModelElement implements Connector {
+
+    private static final int WIDTH = 16;
+    private static final int HEIGHT = 16;
+
+    FigNode node;
+    
+    public FigPort(Object owner, Rectangle bounds, 
+            DiagramSettings settings) {
+        super(owner, bounds, settings);
+        initialize();
+    }
+    
+    public GraphNode getGraphNode() {
+        return node;
+    }
+
+    public void setGraphNode(GraphNode node) {
+        this.node = (FigNode) node;
+    }
+    
+
+    @Override
+    public void setEnclosingFig(Fig encloser) {
+        // TODO: Note copy/paste code in FigExitPoint - where is this code
+        // better placed in GEF?
+        LayerPerspective lp = (LayerPerspective) getLayer();
+        if (lp == null) {
+            return;
+        }
+        
+        super.setEnclosingFig(encloser);
+        FigNode node = ((FigNode) encloser);
+        
+        if (node != null) {
+            node.addConnector(this);
+        } else {
+            FigNode previousNode = (FigNode) getGraphNode();
+            if (previousNode != null)
+                previousNode.removeConnector(this);
+        }
+    }
+    
+    @Override
+    protected Fig createBigPortFig() {
+        FigRect fr = new FigRect(0, 0, WIDTH, HEIGHT);
+        fr.setLineWidth(1);
+        return fr;
+    }
+
+    private void initialize() {
+        setEditable(false);
+        addFig(getBigPort());
+    }
+
+    @Override
+    public boolean isResizable() {
+        return false;
+    }
+
+    @Override
+    public Point connectionPoint(Point anotherPt) {
+        return getBigPort().connectionPoint(anotherPt);
+    }
+    
+    @Override
+    protected void setStandardBounds(int x, int y, int w, int h) {
+        getBigPort().setBounds(x, y, w, h);
+        calcBounds();
+        updateEdges();
+    }
+}

Modified: trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/UMLDeploymentDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/UMLDeploymentDiagram.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/UMLDeploymentDiagram.java	(original)
+++ trunk/src/argouml-core-diagrams-deployment2/src/org/argouml/deployment2/diagram/UMLDeploymentDiagram.java	2012-12-28 10:30:46-0800
@@ -1,292 +1,292 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2009-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.deployment2.diagram;

-

-import java.awt.Rectangle;

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyVetoException;

-import java.util.ArrayList;

-import java.util.Arrays;

-import java.util.Collection;

-import java.util.List;

-

-import javax.swing.Action;

-

-import org.argouml.i18n.Translator;

-import org.argouml.model.DeleteInstanceEvent;

-import org.argouml.model.DeploymentDiagram;

-import org.argouml.model.Model;

-import org.argouml.ui.CmdCreateNode;

-import org.argouml.uml.diagram.DiagramElement;

-import org.argouml.uml.diagram.DiagramFactory;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.deployment.ui.DeploymentDiagramRenderer;

-import org.argouml.uml.diagram.deployment.ui.FigComponent;

-import org.argouml.uml.diagram.deployment.ui.FigObject;

-import org.argouml.uml.diagram.static_structure.ui.FigClass;

-import org.argouml.uml.diagram.static_structure.ui.FigComment;

-import org.argouml.uml.diagram.static_structure.ui.FigInterface;

-import org.argouml.uml.diagram.ui.ActionSetAddAssociationMode;

-import org.argouml.uml.diagram.ui.ActionSetMode;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

-import org.argouml.uml.diagram.ui.RadioAction;

-import org.argouml.uml.diagram.ui.UMLDiagram;

-import org.argouml.uml.diagram.use_case.ui.FigActor;

-import org.argouml.util.ToolBarUtility;

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

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

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

-

-/**

- * Diagram for UML2 Deployment Diagram

- * @author Bob Tarling

- * @author Thomas Neustupny

- */

-public class UMLDeploymentDiagram extends UMLDiagram implements DeploymentDiagram {

-

-    private static final List acceptList = Arrays.asList(new Object[] {

-            Model.getMetaTypes().getActor(),

-            Model.getMetaTypes().getAssociation(),

-            Model.getMetaTypes().getUMLClass(),

-            Model.getMetaTypes().getComment(),

-            Model.getMetaTypes().getComponent(),

-            Model.getMetaTypes().getInterface(),

-            Model.getMetaTypes().getNode(),

-            Model.getMetaTypes().getObject(),

-            Model.getMetaTypes().getPort()

-    });

-

-    /**

-     * Construct a Deployment Diagram. Default constructor used by PGML parser during

-     * diagram load. It should not be used by other callers.

-     * @deprecated only for use by PGML parser

-     */

-    @Deprecated

-    public UMLDeploymentDiagram() {

-        super(new DeploymentDiagramGraphModel());

-    }

-    

-    /**

-     * Construct a new Deployment Diagram.

-     * 

-     * @param name the name of the new diagram

-     * @param namespace the owner of the new diagram

-     */

-    public UMLDeploymentDiagram(String name, Object namespace) {

-        super(name, namespace, new DeploymentDiagramGraphModel());

-        if (name == null || name.trim().length() == 0) {

-            name = getLabelName() + Model.getFacade().getName(namespace);

-            try {

-                setName(name);

-            } catch (PropertyVetoException pve) {

-                // nothing we can do about veto, so just ignore it

-            }

-        }

-        initialize(namespace);

-    }

-

-    @Override

-    public void initialize(Object o) {

-

-        setNamespace(o);

-

-        DeploymentDiagramGraphModel gm = createGraphModel();

-        gm.setHomeModel(namespace);

-        DeploymentDiagramRenderer rend = new DeploymentDiagramRenderer();

-

-        LayerPerspective lay = new LayerPerspectiveMutable(

-                Model.getFacade().getName(namespace), gm);

-        lay.setGraphNodeRenderer(rend);

-        lay.setGraphEdgeRenderer(rend);

-        setLayer(lay);

-

-        Model.getPump().addModelEventListener(this, namespace, 

-                new String[] {"remove"});

-    }

-

-    private DeploymentDiagramGraphModel createGraphModel() {

-        if ((getGraphModel() instanceof DeploymentDiagramGraphModel)) {

-            return (DeploymentDiagramGraphModel) getGraphModel();

-        } else {

-            return new DeploymentDiagramGraphModel();

-        }

-    }

-

-    /*

-     * @see org.argouml.uml.diagram.ui.UMLDiagram#propertyChange(java.beans.PropertyChangeEvent)

-     */

-    @Override

-    public void propertyChange(PropertyChangeEvent evt) {

-        if ((evt.getSource() == namespace)

-                && (evt instanceof DeleteInstanceEvent)) {

-            Model.getPump().removeModelEventListener(this, 

-                    namespace, new String[] {"remove"});

-            if (getProject() != null) {

-                getProject().moveToTrash(this);

-            } else {

-                DiagramFactory.getInstance().removeDiagram(this);

-            }

-        }

-    }

-

-

-    protected Object[] getUmlActions() {

-        

-        ArrayList actions = new ArrayList();

-        

-        actions.add(getNodeAction(Model.getMetaTypes().getNode()));

-        actions.add(getNodeAction(Model.getMetaTypes().getPort()));

-        actions.add(getNodeAction(Model.getMetaTypes().getComponent()));

-        actions.add(getEdgeAction(Model.getMetaTypes().getGeneralization()));

-        actions.add(getEdgeAction(Model.getMetaTypes().getAbstraction()));

-        actions.add(getEdgeAction(Model.getMetaTypes().getDependency()));

-        actions.add(getAssociationActions());

-        actions.add(getNodeAction(Model.getMetaTypes().getObject()));

-        actions.add(getEdgeAction(Model.getMetaTypes().getLink()));

-        

-        return actions.toArray();

-    }

-    

-    private Object[] getAssociationActions() {

-        Object[] actions = {

-            getAssociationActions(Model.getAggregationKind().getNone()),

-            getAssociationActions(Model.getAggregationKind().getAggregate()),

-            getAssociationActions(Model.getAggregationKind().getComposite()),

-        };

-        ToolBarUtility.manageDefault(actions, "diagram.deployment.association");

-        return actions;

-    }

-

-    public String getLabelName() {

-        return Translator.localize("label.deployment-diagram");

-    }

-

-    private Action getNodeAction(Object metaType) {

-        String label = getLabel(metaType);

-        return new RadioAction(new CmdCreateNode(metaType, label));

-    }

-

-    protected Action[] getAssociationActions(

-            final Object aggregation) {

-        return new Action[] {

-                getAssociationAction(aggregation, false),

-                getAssociationAction(aggregation, true)                

-        };

-    }

-    

-    protected Action getAssociationAction(

-            final Object aggregation,

-            final boolean unidirectional) {

-        String label;

-        if (Model.getAggregationKind().getComposite() == aggregation) {

-            label = "composition";

-        } else if (Model.getAggregationKind().getAggregate() == aggregation) {

-            label = "aggregation";

-        } else {

-            label = "association";

-        }

-        if (unidirectional) {

-            label = "uni" + label;

-        }

-        label = "button.new-" + label;

-        return 

-            new RadioAction(

-                new ActionSetAddAssociationMode(

-                    Model.getAggregationKind().getNone(),

-                    unidirectional,

-                    label));

-    }

-    

-    private Action getEdgeAction(Object metaType) {

-        String label = getLabel(metaType);

-        return new RadioAction(

-                    new ActionSetMode(

-                        ModeCreatePolyEdge.class,

-                        "edgeClass",

-                        metaType,

-                        label));

-    }

-    

-    private String getLabel(Object metaType) {

-        return "button.new-"

-            + Model.getMetaTypes().getName(metaType).toLowerCase();

-    }

-

-    /*

-     * @see org.argouml.uml.diagram.ui.UMLDiagram#relocate(java.lang.Object)

-     */

-    public boolean relocate(Object base) {

-        return false;

-    }

-

-    public void encloserChanged(

-            org.tigris.gef.presentation.FigNode enclosed, 

-            org.tigris.gef.presentation.FigNode oldEncloser,

-            org.tigris.gef.presentation.FigNode newEncloser) {

-    }

-

-    @Override

-    public boolean doesAccept(Object objectToAccept) {

-        for (Object element : acceptList) {

-            if (Model.getFacade().isA(

-                    Model.getMetaTypes().getName(objectToAccept), element)) {

-                return true;

-            }

-        }

-        return false;

-    }

-    

-

-    public DiagramElement createDiagramElement(

-            final Object modelElement,

-            final Rectangle bounds) {

-        

-        FigNodeModelElement figNode = null;

-        

-        DiagramSettings settings = getDiagramSettings();

-        

-        if (Model.getFacade().isANode(modelElement)) {

-            figNode = new FigNode(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAPort(modelElement)) {

-            figNode = new FigPort(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAAssociation(modelElement)) {

-            figNode =

-                createNaryAssociationNode(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAComponent(modelElement)) {

-            figNode = new FigComponent(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAClass(modelElement)) {

-            figNode = new FigClass(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAInterface(modelElement)) {

-            figNode = new FigInterface(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAObject(modelElement)) {

-            figNode = new FigObject(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAActor(modelElement)) {

-            figNode = new FigActor(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAComment(modelElement)) {

-            figNode = new FigComment(modelElement, bounds, settings);

-        }

-        return figNode;

-    }

-

-    @Override

-    public boolean isRelocationAllowed(Object base) {

-        // TODO Auto-generated method stub

-        return false;

-    }

-

-    public Collection getRelocationCandidates(Object root) {

-        // TODO Auto-generated method stub

-        return null;

-    }

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.deployment2.diagram;
+
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.Action;
+
+import org.argouml.i18n.Translator;
+import org.argouml.model.DeleteInstanceEvent;
+import org.argouml.model.DeploymentDiagram;
+import org.argouml.model.Model;
+import org.argouml.ui.CmdCreateNode;
+import org.argouml.uml.diagram.DiagramElement;
+import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.deployment.ui.DeploymentDiagramRenderer;
+import org.argouml.uml.diagram.deployment.ui.FigComponent;
+import org.argouml.uml.diagram.deployment.ui.FigObject;
+import org.argouml.uml.diagram.static_structure.ui.FigClass;
+import org.argouml.uml.diagram.static_structure.ui.FigComment;
+import org.argouml.uml.diagram.static_structure.ui.FigInterface;
+import org.argouml.uml.diagram.ui.ActionSetAddAssociationMode;
+import org.argouml.uml.diagram.ui.ActionSetMode;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.argouml.uml.diagram.ui.RadioAction;
+import org.argouml.uml.diagram.ui.UMLDiagram;
+import org.argouml.uml.diagram.use_case.ui.FigActor;
+import org.argouml.util.ToolBarUtility;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.base.LayerPerspectiveMutable;
+import org.tigris.gef.base.ModeCreatePolyEdge;
+
+/**
+ * Diagram for UML2 Deployment Diagram
+ * @author Bob Tarling
+ * @author Thomas Neustupny
+ */
+public class UMLDeploymentDiagram extends UMLDiagram implements DeploymentDiagram {
+
+    private static final List acceptList = Arrays.asList(new Object[] {
+            Model.getMetaTypes().getActor(),
+            Model.getMetaTypes().getAssociation(),
+            Model.getMetaTypes().getUMLClass(),
+            Model.getMetaTypes().getComment(),
+            Model.getMetaTypes().getComponent(),
+            Model.getMetaTypes().getInterface(),
+            Model.getMetaTypes().getNode(),
+            Model.getMetaTypes().getObject(),
+            Model.getMetaTypes().getPort()
+    });
+
+    /**
+     * Construct a Deployment Diagram. Default constructor used by PGML parser during
+     * diagram load. It should not be used by other callers.
+     * @deprecated only for use by PGML parser
+     */
+    @Deprecated
+    public UMLDeploymentDiagram() {
+        super(new DeploymentDiagramGraphModel());
+    }
+    
+    /**
+     * Construct a new Deployment Diagram.
+     * 
+     * @param name the name of the new diagram
+     * @param namespace the owner of the new diagram
+     */
+    public UMLDeploymentDiagram(String name, Object namespace) {
+        super(name, namespace, new DeploymentDiagramGraphModel());
+        if (name == null || name.trim().length() == 0) {
+            name = getLabelName() + Model.getFacade().getName(namespace);
+            try {
+                setName(name);
+            } catch (PropertyVetoException pve) {
+                // nothing we can do about veto, so just ignore it
+            }
+        }
+        initialize(namespace);
+    }
+
+    @Override
+    public void initialize(Object o) {
+
+        setNamespace(o);
+
+        DeploymentDiagramGraphModel gm = createGraphModel();
+        gm.setHomeModel(namespace);
+        DeploymentDiagramRenderer rend = new DeploymentDiagramRenderer();
+
+        LayerPerspective lay = new LayerPerspectiveMutable(
+                Model.getFacade().getName(namespace), gm);
+        lay.setGraphNodeRenderer(rend);
+        lay.setGraphEdgeRenderer(rend);
+        setLayer(lay);
+
+        Model.getPump().addModelEventListener(this, namespace, 
+                new String[] {"remove"});
+    }
+
+    private DeploymentDiagramGraphModel createGraphModel() {
+        if ((getGraphModel() instanceof DeploymentDiagramGraphModel)) {
+            return (DeploymentDiagramGraphModel) getGraphModel();
+        } else {
+            return new DeploymentDiagramGraphModel();
+        }
+    }
+
+    /*
+     * @see org.argouml.uml.diagram.ui.UMLDiagram#propertyChange(java.beans.PropertyChangeEvent)
+     */
+    @Override
+    public void propertyChange(PropertyChangeEvent evt) {
+        if ((evt.getSource() == namespace)
+                && (evt instanceof DeleteInstanceEvent)) {
+            Model.getPump().removeModelEventListener(this, 
+                    namespace, new String[] {"remove"});
+            if (getProject() != null) {
+                getProject().moveToTrash(this);
+            } else {
+                DiagramFactory.getInstance().removeDiagram(this);
+            }
+        }
+    }
+
+
+    protected Object[] getUmlActions() {
+        
+        ArrayList actions = new ArrayList();
+        
+        actions.add(getNodeAction(Model.getMetaTypes().getNode()));
+        actions.add(getNodeAction(Model.getMetaTypes().getPort()));
+        actions.add(getNodeAction(Model.getMetaTypes().getComponent()));
+        actions.add(getEdgeAction(Model.getMetaTypes().getGeneralization()));
+        actions.add(getEdgeAction(Model.getMetaTypes().getAbstraction()));
+        actions.add(getEdgeAction(Model.getMetaTypes().getDependency()));
+        actions.add(getAssociationActions());
+        actions.add(getNodeAction(Model.getMetaTypes().getObject()));
+        actions.add(getEdgeAction(Model.getMetaTypes().getLink()));
+        
+        return actions.toArray();
+    }
+    
+    private Object[] getAssociationActions() {
+        Object[] actions = {
+            getAssociationActions(Model.getAggregationKind().getNone()),
+            getAssociationActions(Model.getAggregationKind().getAggregate()),
+            getAssociationActions(Model.getAggregationKind().getComposite()),
+        };
+        ToolBarUtility.manageDefault(actions, "diagram.deployment.association");
+        return actions;
+    }
+
+    public String getLabelName() {
+        return Translator.localize("label.deployment-diagram");
+    }
+
+    private Action getNodeAction(Object metaType) {
+        String label = getLabel(metaType);
+        return new RadioAction(new CmdCreateNode(metaType, label));
+    }
+
+    protected Action[] getAssociationActions(
+            final Object aggregation) {
+        return new Action[] {
+                getAssociationAction(aggregation, false),
+                getAssociationAction(aggregation, true)                
+        };
+    }
+    
+    protected Action getAssociationAction(
+            final Object aggregation,
+            final boolean unidirectional) {
+        String label;
+        if (Model.getAggregationKind().getComposite() == aggregation) {
+            label = "composition";
+        } else if (Model.getAggregationKind().getAggregate() == aggregation) {
+            label = "aggregation";
+        } else {
+            label = "association";
+        }
+        if (unidirectional) {
+            label = "uni" + label;
+        }
+        label = "button.new-" + label;
+        return 
+            new RadioAction(
+                new ActionSetAddAssociationMode(
+                    Model.getAggregationKind().getNone(),
+                    unidirectional,
+                    label));
+    }
+    
+    private Action getEdgeAction(Object metaType) {
+        String label = getLabel(metaType);
+        return new RadioAction(
+                    new ActionSetMode(
+                        ModeCreatePolyEdge.class,
+                        "edgeClass",
+                        metaType,
+                        label));
+    }
+    
+    private String getLabel(Object metaType) {
+        return "button.new-"
+            + Model.getMetaTypes().getName(metaType).toLowerCase();
+    }
+
+    /*
+     * @see org.argouml.uml.diagram.ui.UMLDiagram#relocate(java.lang.Object)
+     */
+    public boolean relocate(Object base) {
+        return false;
+    }
+
+    public void encloserChanged(
+            org.tigris.gef.presentation.FigNode enclosed, 
+            org.tigris.gef.presentation.FigNode oldEncloser,
+            org.tigris.gef.presentation.FigNode newEncloser) {
+    }
+
+    @Override
+    public boolean doesAccept(Object objectToAccept) {
+        for (Object element : acceptList) {
+            if (Model.getFacade().isA(
+                    Model.getMetaTypes().getName(objectToAccept), element)) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+
+    public DiagramElement createDiagramElement(
+            final Object modelElement,
+            final Rectangle bounds) {
+        
+        FigNodeModelElement figNode = null;
+        
+        DiagramSettings settings = getDiagramSettings();
+        
+        if (Model.getFacade().isANode(modelElement)) {
+            figNode = new FigNode(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAPort(modelElement)) {
+            figNode = new FigPort(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAAssociation(modelElement)) {
+            figNode =
+                createNaryAssociationNode(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAComponent(modelElement)) {
+            figNode = new FigComponent(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAClass(modelElement)) {
+            figNode = new FigClass(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAInterface(modelElement)) {
+            figNode = new FigInterface(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAObject(modelElement)) {
+            figNode = new FigObject(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAActor(modelElement)) {
+            figNode = new FigActor(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAComment(modelElement)) {
+            figNode = new FigComment(modelElement, bounds, settings);
+        }
+        return figNode;
+    }
+
+    @Override
+    public boolean isRelocationAllowed(Object base) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public Collection getRelocationCandidates(Object root) {
+        // TODO Auto-generated method stub
+        return null;
+    }
 }
\ No newline at end of file

Modified: trunk/src/argouml-core-diagrams-state2/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/build.properties	(original)
+++ trunk/src/argouml-core-diagrams-state2/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-diagrams-state2/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/plugin.properties	(original)
+++ trunk/src/argouml-core-diagrams-state2/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-diagrams-state2

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-diagrams-state2
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML State2 Diagram Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramModule.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramModule.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramModule.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramModule.java	2012-12-28 10:30:46-0800
@@ -1,80 +1,80 @@
-/* $Id:$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.Model;

-import org.argouml.moduleloader.ModuleInterface;

-import org.argouml.notation.Notation;

-import org.argouml.notation.NotationName;

-import org.argouml.notation.NotationProviderFactory2;

-import org.argouml.notation.providers.uml.SDMessageNotationUml;

-import org.argouml.persistence.PersistenceManager;

-import org.argouml.state2.diagram.StateDiagramFactory;

-import org.argouml.uml.diagram.DiagramFactory;

-import org.argouml.uml.diagram.DiagramFactoryInterface2;

-import org.argouml.uml.diagram.DiagramFactory.DiagramType;

-import org.argouml.uml.ui.PropPanelFactoryManager;

-

-public class StateDiagramModule implements ModuleInterface {

-

-    private static final Logger LOG = Logger

-            .getLogger(StateDiagramModule.class);

-

-    private StateDiagramPropPanelFactory propPanelFactory;

-        

-    public boolean enable() {

-        if (Model.getFacade().getUmlVersion().indexOf("2") >= 0) {

-            // This module will still register as enabled for UML1.4 but it won't

-            // actually do anything.

-            propPanelFactory =

-                new StateDiagramPropPanelFactory();

-            PropPanelFactoryManager.addPropPanelFactory(propPanelFactory);

-            DiagramFactory.getInstance().registerDiagramFactory(

-                    DiagramType.State, 

-                    new StateDiagramFactory());

-        }

-        return true;

-    }

-

-    public boolean disable() {

-

-        PropPanelFactoryManager.removePropPanelFactory(propPanelFactory);

-

-        // TODO: Remove the casting to DiagramFactoryInterface2

-        // as soon as DiagramFactoryInterface is removed.

-        DiagramFactory.getInstance().registerDiagramFactory(

-                DiagramType.State, (DiagramFactoryInterface2) null);

-        return true;

-    }

-

-    public String getName() {

-        return "ArgoUML-State";

-    }

-

-    public String getInfo(int type) {

-        switch (type) {

-        case DESCRIPTION:

-            return "State diagram implementation";

-        case AUTHOR:

-            return "ArgoUML Team";

-        case VERSION:

-            return "0.28";

-        case DOWNLOADSITE:

-            return "http://argouml.tigris.org";

-        default:

-            return null;

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.Model;
+import org.argouml.moduleloader.ModuleInterface;
+import org.argouml.notation.Notation;
+import org.argouml.notation.NotationName;
+import org.argouml.notation.NotationProviderFactory2;
+import org.argouml.notation.providers.uml.SDMessageNotationUml;
+import org.argouml.persistence.PersistenceManager;
+import org.argouml.state2.diagram.StateDiagramFactory;
+import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramFactoryInterface2;
+import org.argouml.uml.diagram.DiagramFactory.DiagramType;
+import org.argouml.uml.ui.PropPanelFactoryManager;
+
+public class StateDiagramModule implements ModuleInterface {
+
+    private static final Logger LOG = Logger
+            .getLogger(StateDiagramModule.class);
+
+    private StateDiagramPropPanelFactory propPanelFactory;
+        
+    public boolean enable() {
+        if (Model.getFacade().getUmlVersion().indexOf("2") >= 0) {
+            // This module will still register as enabled for UML1.4 but it won't
+            // actually do anything.
+            propPanelFactory =
+                new StateDiagramPropPanelFactory();
+            PropPanelFactoryManager.addPropPanelFactory(propPanelFactory);
+            DiagramFactory.getInstance().registerDiagramFactory(
+                    DiagramType.State, 
+                    new StateDiagramFactory());
+        }
+        return true;
+    }
+
+    public boolean disable() {
+
+        PropPanelFactoryManager.removePropPanelFactory(propPanelFactory);
+
+        // TODO: Remove the casting to DiagramFactoryInterface2
+        // as soon as DiagramFactoryInterface is removed.
+        DiagramFactory.getInstance().registerDiagramFactory(
+                DiagramType.State, (DiagramFactoryInterface2) null);
+        return true;
+    }
+
+    public String getName() {
+        return "ArgoUML-State";
+    }
+
+    public String getInfo(int type) {
+        switch (type) {
+        case DESCRIPTION:
+            return "State diagram implementation";
+        case AUTHOR:
+            return "ArgoUML Team";
+        case VERSION:
+            return "0.28";
+        case DOWNLOADSITE:
+            return "http://argouml.tigris.org";
+        default:
+            return null;
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramPropPanelFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramPropPanelFactory.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramPropPanelFactory.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/StateDiagramPropPanelFactory.java	2012-12-28 10:30:46-0800
@@ -1,39 +1,39 @@
-/* $Id:$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2;

-

-import org.argouml.i18n.Translator;

-import org.argouml.state2.diagram.UMLStateDiagram;

-import org.argouml.uml.diagram.ui.PropPanelDiagram;

-import org.argouml.uml.ui.PropPanel;

-import org.argouml.uml.ui.PropPanelFactory;

-

-class StateDiagramPropPanelFactory implements PropPanelFactory {

-

-    public PropPanel createPropPanel(Object object) {

-        if (object instanceof UMLStateDiagram) {

-            return new PropPanelUMLStateDiagram();

-        }

-        return null;

-    }

-

-    class PropPanelUMLStateDiagram extends PropPanelDiagram {

-

-        public PropPanelUMLStateDiagram() {

-            super(Translator.localize("label.state-chart-diagram"),

-                    lookupIcon("StateDiagram"));

-        }

-

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2;
+
+import org.argouml.i18n.Translator;
+import org.argouml.state2.diagram.UMLStateDiagram;
+import org.argouml.uml.diagram.ui.PropPanelDiagram;
+import org.argouml.uml.ui.PropPanel;
+import org.argouml.uml.ui.PropPanelFactory;
+
+class StateDiagramPropPanelFactory implements PropPanelFactory {
+
+    public PropPanel createPropPanel(Object object) {
+        if (object instanceof UMLStateDiagram) {
+            return new PropPanelUMLStateDiagram();
+        }
+        return null;
+    }
+
+    class PropPanelUMLStateDiagram extends PropPanelDiagram {
+
+        public PropPanelUMLStateDiagram() {
+            super(Translator.localize("label.state-chart-diagram"),
+                    lookupIcon("StateDiagram"));
+        }
+
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigCircleState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigCircleState.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigCircleState.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigCircleState.java	2012-12-28 10:30:46-0800
@@ -1,66 +1,66 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-import java.awt.Point;

-import java.awt.Rectangle;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.FigCircle;

-

-/**

- * Abstract class for any state class with a circular boundary.

- * @author Bob Tarling

- */

-abstract class FigCircleState extends FigNodeModelElement {

-

-    private static final int WIDTH = 16;

-    private static final int HEIGHT = 16;

-

-    public FigCircleState(Object owner, Rectangle bounds, 

-            DiagramSettings settings) {

-        super(owner, bounds, settings);

-        initialize();

-    }

-

-    @Override

-    protected Fig createBigPortFig() {

-        FigCircle fc = new FigCircle(0, 0, WIDTH, HEIGHT);

-        fc.setLineWidth(1);

-        return fc;

-    }

-

-    private void initialize() {

-        setEditable(false);

-        addFig(getBigPort());

-    }

-

-    @Override

-    public boolean isResizable() {

-        return false;

-    }

-

-    @Override

-    public Point connectionPoint(Point anotherPt) {

-        return getBigPort().connectionPoint(anotherPt);

-    }

-    

-    @Override

-    protected void setStandardBounds(int x, int y, int w, int h) {

-        getBigPort().setBounds(x, y, w, h);

-        calcBounds();

-        updateEdges();

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigCircle;
+
+/**
+ * Abstract class for any state class with a circular boundary.
+ * @author Bob Tarling
+ */
+abstract class FigCircleState extends FigNodeModelElement {
+
+    private static final int WIDTH = 16;
+    private static final int HEIGHT = 16;
+
+    public FigCircleState(Object owner, Rectangle bounds, 
+            DiagramSettings settings) {
+        super(owner, bounds, settings);
+        initialize();
+    }
+
+    @Override
+    protected Fig createBigPortFig() {
+        FigCircle fc = new FigCircle(0, 0, WIDTH, HEIGHT);
+        fc.setLineWidth(1);
+        return fc;
+    }
+
+    private void initialize() {
+        setEditable(false);
+        addFig(getBigPort());
+    }
+
+    @Override
+    public boolean isResizable() {
+        return false;
+    }
+
+    @Override
+    public Point connectionPoint(Point anotherPt) {
+        return getBigPort().connectionPoint(anotherPt);
+    }
+    
+    @Override
+    protected void setStandardBounds(int x, int y, int w, int h) {
+        getBigPort().setBounds(x, y, w, h);
+        calcBounds();
+        updateEdges();
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigEntryPoint.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigEntryPoint.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigEntryPoint.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigEntryPoint.java	2012-12-28 10:30:46-0800
@@ -1,62 +1,62 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-import java.awt.Rectangle;

-import org.argouml.uml.diagram.DiagramSettings;

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

-import org.tigris.gef.di.GraphNode;

-import org.tigris.gef.presentation.Connector;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.FigNode;

-

-class FigEntryPoint extends FigCircleState implements Connector {

-

-    FigVertex node;

-    

-    public FigEntryPoint(Object owner, Rectangle bounds, 

-            DiagramSettings settings) {

-        super(owner, bounds, settings);

-    }

-

-    public GraphNode getGraphNode() {

-        return node;

-    }

-

-    public void setGraphNode(GraphNode node) {

-        this.node = (FigVertex) node;

-    }

-    

-

-    @Override

-    public void setEnclosingFig(Fig encloser) {

-        // TODO: Note copy/paste code in FigExitPoint - where is this code

-        // better placed in GEF?

-        LayerPerspective lp = (LayerPerspective) getLayer();

-        if (lp == null) {

-            return;

-        }

-        

-        super.setEnclosingFig(encloser);

-        FigVertex vertex = ((FigVertex) encloser);

-        

-        if (vertex != null) {

-            vertex.addConnector(this);

-        } else {

-            FigVertex previousVertex = (FigVertex) getGraphNode();

-            if (previousVertex != null)

-                previousVertex.removeConnector(this);

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+import java.awt.Rectangle;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.di.GraphNode;
+import org.tigris.gef.presentation.Connector;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigNode;
+
+class FigEntryPoint extends FigCircleState implements Connector {
+
+    FigVertex node;
+    
+    public FigEntryPoint(Object owner, Rectangle bounds, 
+            DiagramSettings settings) {
+        super(owner, bounds, settings);
+    }
+
+    public GraphNode getGraphNode() {
+        return node;
+    }
+
+    public void setGraphNode(GraphNode node) {
+        this.node = (FigVertex) node;
+    }
+    
+
+    @Override
+    public void setEnclosingFig(Fig encloser) {
+        // TODO: Note copy/paste code in FigExitPoint - where is this code
+        // better placed in GEF?
+        LayerPerspective lp = (LayerPerspective) getLayer();
+        if (lp == null) {
+            return;
+        }
+        
+        super.setEnclosingFig(encloser);
+        FigVertex vertex = ((FigVertex) encloser);
+        
+        if (vertex != null) {
+            vertex.addConnector(this);
+        } else {
+            FigVertex previousVertex = (FigVertex) getGraphNode();
+            if (previousVertex != null)
+                previousVertex.removeConnector(this);
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigExitPoint.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigExitPoint.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigExitPoint.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigExitPoint.java	2012-12-28 10:30:46-0800
@@ -1,63 +1,63 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-import java.awt.Rectangle;

-import org.argouml.uml.diagram.DiagramSettings;

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

-import org.tigris.gef.di.GraphNode;

-import org.tigris.gef.presentation.Connector;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.FigNode;

-

-class FigExitPoint extends FigCircleState implements Connector {

-

-    private FigVertex node;

-    

-    public FigExitPoint(Object owner, Rectangle bounds, 

-            DiagramSettings settings) {

-        super(owner, bounds, settings);

-    }

-

-    public GraphNode getGraphNode() {

-        return node;

-    }

-

-    public void setGraphNode(GraphNode node) {

-        this.node = (FigVertex) node;

-    }

-    

-    

-

-    @Override

-    public void setEnclosingFig(Fig encloser) {

-        // TODO: Note copy/paste code in FigEntryPoint - where is this code

-        // better placed in GEF?

-        LayerPerspective lp = (LayerPerspective) getLayer();

-        if (lp == null) {

-            return;

-        }

-        

-        super.setEnclosingFig(encloser);

-        FigVertex vertex = ((FigVertex) encloser);

-        

-        if (vertex != null) {

-            vertex.addConnector(this);

-        } else {

-            FigVertex previousVertex = (FigVertex) getGraphNode();

-            if (previousVertex != null)

-                previousVertex.removeConnector(this);

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+import java.awt.Rectangle;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.di.GraphNode;
+import org.tigris.gef.presentation.Connector;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigNode;
+
+class FigExitPoint extends FigCircleState implements Connector {
+
+    private FigVertex node;
+    
+    public FigExitPoint(Object owner, Rectangle bounds, 
+            DiagramSettings settings) {
+        super(owner, bounds, settings);
+    }
+
+    public GraphNode getGraphNode() {
+        return node;
+    }
+
+    public void setGraphNode(GraphNode node) {
+        this.node = (FigVertex) node;
+    }
+    
+    
+
+    @Override
+    public void setEnclosingFig(Fig encloser) {
+        // TODO: Note copy/paste code in FigEntryPoint - where is this code
+        // better placed in GEF?
+        LayerPerspective lp = (LayerPerspective) getLayer();
+        if (lp == null) {
+            return;
+        }
+        
+        super.setEnclosingFig(encloser);
+        FigVertex vertex = ((FigVertex) encloser);
+        
+        if (vertex != null) {
+            vertex.addConnector(this);
+        } else {
+            FigVertex previousVertex = (FigVertex) getGraphNode();
+            if (previousVertex != null)
+                previousVertex.removeConnector(this);
+        }
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigRegion.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigRegion.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigRegion.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigRegion.java	2012-12-28 10:30:46-0800
@@ -1,44 +1,44 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-import java.awt.Dimension;

-import org.tigris.gef.presentation.FigRect;

-

-/**

- * Displays a region within a composite state

- */

-public class FigRegion extends FigRect {

-

-    /**

-     * Construct a fig representing a region.

-     * 

-     * @param region owning UML element

-     * @param bounds position and size

-     */

-    public FigRegion(

-            final Object region) {

-        super(0,0,0,0);

-        setLineWidth(0);

-        setOwner(region);

-    }

-    

-    /*

-     * @see org.tigris.gef.presentation.Fig#getMinimumSize()

-     */

-    @Override

-    public Dimension getMinimumSize() {

-        return new Dimension(180, 80);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+import java.awt.Dimension;
+import org.tigris.gef.presentation.FigRect;
+
+/**
+ * Displays a region within a composite state
+ */
+public class FigRegion extends FigRect {
+
+    /**
+     * Construct a fig representing a region.
+     * 
+     * @param region owning UML element
+     * @param bounds position and size
+     */
+    public FigRegion(
+            final Object region) {
+        super(0,0,0,0);
+        setLineWidth(0);
+        setOwner(region);
+    }
+    
+    /*
+     * @see org.tigris.gef.presentation.Fig#getMinimumSize()
+     */
+    @Override
+    public Dimension getMinimumSize() {
+        return new Dimension(180, 80);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/FigVertex.java	2012-12-28 10:30:46-0800
@@ -1,513 +1,513 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *    Michiel van der Wulp

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-import java.awt.Dimension;

-import java.awt.Font;

-import java.awt.Graphics;

-import java.awt.Rectangle;

-import java.awt.event.MouseEvent;

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyVetoException;

-import java.util.ArrayList;

-import java.util.Iterator;

-import java.util.List;

-import java.util.Vector;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.AddAssociationEvent;

-import org.argouml.model.Model;

-import org.argouml.model.RemoveAssociationEvent;

-import org.argouml.notation.Notation;

-import org.argouml.notation.NotationName;

-import org.argouml.notation.NotationProvider;

-import org.argouml.notation.NotationProviderFactory2;

-import org.argouml.notation.NotationSettings;

-import org.argouml.ui.ActionCreateContainedModelElement;

-import org.argouml.ui.targetmanager.TargetManager;

-import org.argouml.uml.diagram.ArgoDiagram;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.state.ui.SelectionState;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

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

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

-import org.tigris.gef.di.DiagramElement;

-import org.tigris.gef.presentation.Connector;

-import org.tigris.gef.presentation.Fig;

-import org.tigris.gef.presentation.FigGroup;

-import org.tigris.gef.presentation.FigRRect;

-import org.tigris.gef.presentation.FigText;

-

-/**

- * A Fig that can represent a UML2 vertex. The current implementation

- * is limited to just handling States. Other vertices are currently handled

- * by different Figs but they will most likely all be handled here in future.

- */

-public class FigVertex extends FigNodeModelElement {

-

-    private static final Logger LOG = Logger.getLogger(FigVertex.class);

-    

-    private static final int MARGIN = 2;

-

-    private NotationProvider notationProviderBody;

-

-    /**

-     * The body for entry/exit/do actions

-     */

-    private FigBody bodyText;

-    

-    private FigGroup regionCompartment;

-

-    /**

-     * Create a new instance of FigVertex

-     * @param owner the vertex that own this diagram element

-     * @param bounds the bounds of the diagram element

-     * @param settings the display settings for this diagram element

-     */

-    public FigVertex(Object owner, Rectangle bounds, DiagramSettings settings) {

-        super(owner, bounds, settings);

-        this.allowRemoveFromDiagram(false);

-

-        initialize();

-

-        NotationName notation = Notation.findNotation(getNotationSettings()

-                .getNotationLanguage());

-        notationProviderBody = NotationProviderFactory2.getInstance()

-                .getNotationProvider(NotationProviderFactory2.TYPE_STATEBODY,

-                        getOwner(), this, notation);

-        updateNameText();

-        

-        LOG.info("Registering as listener");

-        Model.getPump().addModelEventListener(this, getOwner(), "region");

-    }

-

-    @Override

-    public void setEnclosingFig(Fig encloser) {

-        LayerPerspective lp = (LayerPerspective) getLayer();

-        if (lp == null) {

-            return;

-        }

-        

-        super.setEnclosingFig(encloser);

-

-        Object region = null;

-        if (encloser != null) {

-            // Get the region as the first Region in the State.

-            // If there is no region in the StateMachine then create one.

-            List regions = Model.getStateMachinesHelper().getRegions(

-                    encloser.getOwner());

-            if (regions.isEmpty()) {

-                // There are no regions so create one and place the vertex

-                //there.

-                region = Model.getUmlFactory().buildNode(

-                        Model.getMetaTypes().getRegion(), encloser.getOwner());

-            } else {

-                // There are one or more regions so find the one that the

-                //vertex was dropped in

-                FigVertex compositeState = (FigVertex) encloser;

-                for (DiagramElement de :

-                        compositeState.regionCompartment.getDiagramElements()) {

-                    if (((Fig) de).getBounds().contains(getBounds())) {

-                        region = de.getOwner();

-                        break;

-                    }

-                }

-            }

-        } else {

-            // The vertex was dropped onto the diagram.

-            // Get the region as the first Region in the StateMachine.

-            // If there is no region in the StateMachine then create one.

-            ArgoDiagram diagram = (ArgoDiagram) lp.getDiagram();

-            Object stateMachine = diagram.getOwner();

-            List regions = 

-                Model.getStateMachinesHelper().getRegions(stateMachine);

-            if (regions.isEmpty()) {

-                region = Model.getUmlFactory().buildNode(

-                        Model.getMetaTypes().getRegion(), stateMachine);

-            } else {

-                region = regions.get(0);

-            }

-        }

-        if (region != null

-                && Model.getFacade().getContainer(getOwner()) != region) {

-            Model.getStateMachinesHelper().setContainer(getOwner(), region);

-        }

-    }

-

-    @Override

-    protected Fig createBigPortFig() {

-        return new FigRRect(0, 0, 0, 0, LINE_COLOR, FILL_COLOR);

-    }

-

-    private void initialize() {

-        getNameFig().setLineWidth(0);

-        getNameFig().setFilled(false);

-

-        bodyText = new FigBody(0,0,0,0);

-        regionCompartment = new FigRegionCompartment(0,0,0,0);

-        

-        addFig(getBigPort());

-        addFig(getNameFig());

-        addFig(getBodyText());

-        addFig(regionCompartment);

-

-        setBounds(getBounds());

-    }

-

-    /*

-     * @see

-     * org.argouml.uml.diagram.state.ui.FigStateVertex#initNotationProviders

-     * (java.lang.Object)

-     */

-    @Override

-    protected void initNotationProviders(Object own) {

-        if (notationProviderBody != null) {

-            notationProviderBody.cleanListener();

-        }

-        super.initNotationProviders(own);

-        NotationName notation = Notation.findNotation(getNotationSettings()

-                .getNotationLanguage());

-        if (Model.getFacade().isAState(own)) {

-            notationProviderBody = NotationProviderFactory2.getInstance()

-                    .getNotationProvider(

-                            NotationProviderFactory2.TYPE_STATEBODY, own, this,

-                            notation);

-        }

-    }

-

-    @Override

-    protected void modelChanged(PropertyChangeEvent mee) {

-        super.modelChanged(mee);

-        

-        assert (mee.getPropertyName().equals("region"));

-        

-        if (mee instanceof AddAssociationEvent) {

-            // TODO: Before adding a new region make the last region

-            // its minimum size (smallest size that will still

-            // contain all enclosed)

-            

-            Object newRegion = mee.getNewValue();

-            FigRegion rg = new FigRegion(newRegion);

-            rg.setBounds(

-                    regionCompartment.getX(), regionCompartment.getY(),

-                    rg.getMinimumSize().width, rg.getMinimumSize().height);

-            

-            regionCompartment.addFig(rg);

-            setSize(Math.max(getMinimumSize().width, getWidth()),

-                    Math.max(getMinimumSize().height, getHeight()));

-        }

-        if (mee instanceof RemoveAssociationEvent) {

-            Object oldRegion = mee.getNewValue();

-            for (DiagramElement de : regionCompartment.getDiagramElements()) {

-                if (de.getOwner() == oldRegion) {

-                    regionCompartment.removeFig((Fig) de);

-                    // TODO: After removing a region reset the overall

-                    // size of the node.

-                    renderingChanged();

-                    damage();

-                }

-            }

-            LOG.debug("Removing region " + oldRegion);

-        }

-    }

-

-    /*

-     * @see

-     * org.argouml.uml.diagram.ui.FigNodeModelElement#removeFromDiagramImpl()

-     */

-    @Override

-    public void removeFromDiagramImpl() {

-        if (notationProviderBody != null) {

-            notationProviderBody.cleanListener();

-        }

-        super.removeFromDiagramImpl();

-    }

-

-    /*

-     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#renderingChanged()

-     */

-    @Override

-    public void renderingChanged() {

-        super.renderingChanged();

-        if (notationProviderBody != null) {

-            bodyText.setText(notationProviderBody.toString(getOwner(),

-                    getNotationSettings()));

-        }

-        calcBounds();

-        setBounds(getBounds());

-    }

-

-    private FigText getBodyText() {

-        return bodyText;

-    }

-

-    @Override

-    protected void textEditStarted(FigText ft) {

-        super.textEditStarted(ft);

-        if (ft == bodyText) {

-            showHelp(notationProviderBody.getParsingHelp());

-        }

-    }

-

-    @Override

-    public void textEdited(FigText ft) throws PropertyVetoException {

-        super.textEdited(ft);

-        if (ft == getBodyText()) {

-            notationProviderBody.parse(getOwner(), ft.getText());

-            ft.setText(notationProviderBody.toString(getOwner(),

-                    getNotationSettings()));

-        }

-    }

-

-    public void notationRenderingChanged(NotationProvider np, String rendering) {

-        super.notationRenderingChanged(np, rendering);

-        if (notationProviderBody == np) {

-            bodyText.setText(rendering);

-            updateBounds();

-            damage();

-        }

-    }

-

-    public NotationSettings getNotationSettings(NotationProvider np) {

-        return getNotationSettings();

-    }

-

-    public Object getOwner(NotationProvider np) {

-        return getOwner();

-    }

-

-    public Dimension getMinimumSize() {

-        final Dimension nameSize = getNameFig().getMinimumSize();

-        final Dimension bodySize = getBodyText().getMinimumSize();

-

-        int h = getTopMargin()

-            + nameSize.height

-            + getBottomMargin();

-

-        h += regionCompartment.getMinimumSize().height;

-        

-        if (getBodyText().getText().length() > 0) {

-            h += bodySize.height;

-        }

-        

-        int w = getLeftMargin()

-            + Math.max(nameSize.width, bodySize.width)

-            + getRightMargin();

-        

-        if (Model.getFacade().isACompositeState(getOwner())) {

-            w = Math.max(180, w);

-            h = Math.max(150, h);

-        } else {

-            w = Math.max(80, w);

-            h = Math.max(40, h);

-        }

-        

-        return new Dimension(w, h);

-    }

-

-    public boolean getUseTrapRect() {

-        return true;

-    }

-

-    public List<Rectangle> getTrapRects(Fig draggedFig) {

-        if (draggedFig instanceof Connector) {

-            ArrayList<Rectangle> rects = new ArrayList<Rectangle>(1);

-            rects.add(getBigPort().getBounds());

-            return rects;

-        } else {

-            List regions = Model.getStateMachinesHelper().getRegions(getOwner());

-            

-            ArrayList<Rectangle> rects = new ArrayList<Rectangle>(regions.size());

-            if (regions.isEmpty()) {

-                rects.add(regionCompartment.getBounds());

-            } else {

-                for (Fig f : regionCompartment.getFigs()) {

-                    rects.add(f.getBounds());

-                }

-            }

-            return rects;

-        }

-    }

-    

-    protected void setStandardBounds(int x, int y, int w, int h) {

-        Dimension nameSize = getNameFig().getMinimumSize();

-        Dimension bodySize = getBodyText().getMinimumSize();

-

-        getNameFig().setBounds(

-                x + getLeftMargin(), y + getTopMargin(),

-                w - getLeftMargin() - getRightMargin(), nameSize.height);

-

-

-        

-        if (getBodyText().getText().length() > 0) {

-            getBodyText().setBounds(

-                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,

-                    bodySize.width,

-                    bodySize.height);

-        } else {

-            getBodyText().setBounds(

-                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,

-                    bodySize.width,

-                    1);

-        }

-        

-        regionCompartment.setBounds(

-                x + getLeftMargin(),

-                getBodyText().getY() + getBodyText().getHeight(),

-                w - getLeftMargin() - getRightMargin(),

-                h - getTopMargin() - getBottomMargin()

-                    - getNameFig().getHeight() - getBodyText().getHeight());

-

-        getBigPort().setBounds(x, y, w, h);

-        

-        calcBounds(); // _x = x; _y = y; _w = w; _h = h;

-    }

-    

-    

-    

-    int getRightMargin() {

-        return MARGIN;

-    }

-

-    int getLeftMargin() {

-        return MARGIN;

-    }

-    

-    int getTopMargin() {

-        return MARGIN;

-    }

-    

-    int getBottomMargin() {

-        return MARGIN;

-    }

-    

-    /*

-     * @see org.tigris.gef.ui.PopupGenerator#getPopUpActions(java.awt.event.MouseEvent)

-     */

-    public Vector getPopUpActions(MouseEvent me) {

-        Vector popUpActions = super.getPopUpActions(me);

-        if (TargetManager.getInstance().getTargets().size() == 1) {

-            popUpActions.add(

-                    popUpActions.size() - getPopupAddOffset(),

-                    new ActionCreateContainedModelElement(

-                            Model.getMetaTypes().getRegion(), getOwner()));

-        }

-        return popUpActions;

-    }

-    

-    /**

-     * The text Fig that displays the body of the actions on the state

-     *

-     * @author Bob Tarling

-     */

-    private class FigBody extends FigText {

-        public FigBody(int x, int y, int width, int height) {

-            super (x, y, width, height);

-            setFont(getSettings().getFont(Font.PLAIN));

-            setTextColor(TEXT_COLOR);

-            setLineWidth(0);

-            setFilled(false);

-            setExpandOnly(true);

-            setReturnAction(FigText.INSERT);

-            setJustification(FigText.JUSTIFY_LEFT);

-        }

-    }

-    

-    /**

-     * The text Fig that displays the body of the actions on the state

-     *

-     * @author Bob Tarling

-     */

-    private class FigRegionCompartment extends FigGroup {

-        public FigRegionCompartment(int x, int y, int width, int height) {

-            super();

-        }

-        

-        @Override

-        protected void setBoundsImpl(

-                final int x,

-                int y,

-                final int w,

-                int h) {

-

-            _x = x;

-            _y = y;

-            _w = w;

-            _h = h;

-            

-            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {

-                Fig fig = (Fig) it.next();

-                if (it.hasNext()) {

-                    fig.setBounds(x, y, w, fig.getMinimumSize().height);

-                    h -= fig.getMinimumSize().height;

-                } else {

-                    fig.setBounds(x, y, w, h);

-                }

-                y += fig.getHeight();

-            }

-        }

-        

-        

-        @Override

-        public Dimension getMinimumSize() {

-            int minWidth = 0;

-            int minHeight = 0;

-            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {

-                Fig fig = (Fig) it.next();

-                minWidth = Math.max(fig.getMinimumSize().width, minWidth);

-                if (it.hasNext()) {

-                    minHeight += fig.getHeight();

-                } else {

-                    minHeight += fig.getMinimumSize().height;

-                }

-            }

-

-            return new Dimension(minWidth, minHeight);

-        }

-        

-        public void paint(Graphics g) {

-            super.paint(g);

-            

-            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {

-                Fig fig = (Fig) it.next();

-                if (it.hasNext()) {

-                    g.setColor(getLineColor());

-                    

-                    drawDashedLine(

-                            g, 1, 

-                            fig.getX(), 

-                            fig.getY() + fig.getHeight(),

-                            fig.getX() + fig.getWidth(),

-                            fig.getY() + fig.getHeight(),

-                            0, new float [] { 5.0f, 5.0f }, 10);            

-                }

-            }

-            

-        }

-    }

-    

-    /**

-     * Return a Selection for a Vertex.

-     *

-     * {@inheritDoc}

-     */

-    @Override

-    public Selection makeSelection() {

-        if (getOwner() != null) {

-            return new SelectionState(this);

-        }

-        return null;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *    Michiel van der Wulp
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.AddAssociationEvent;
+import org.argouml.model.Model;
+import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.notation.Notation;
+import org.argouml.notation.NotationName;
+import org.argouml.notation.NotationProvider;
+import org.argouml.notation.NotationProviderFactory2;
+import org.argouml.notation.NotationSettings;
+import org.argouml.ui.ActionCreateContainedModelElement;
+import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.state.ui.SelectionState;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.base.Selection;
+import org.tigris.gef.di.DiagramElement;
+import org.tigris.gef.presentation.Connector;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigGroup;
+import org.tigris.gef.presentation.FigRRect;
+import org.tigris.gef.presentation.FigText;
+
+/**
+ * A Fig that can represent a UML2 vertex. The current implementation
+ * is limited to just handling States. Other vertices are currently handled
+ * by different Figs but they will most likely all be handled here in future.
+ */
+public class FigVertex extends FigNodeModelElement {
+
+    private static final Logger LOG = Logger.getLogger(FigVertex.class);
+    
+    private static final int MARGIN = 2;
+
+    private NotationProvider notationProviderBody;
+
+    /**
+     * The body for entry/exit/do actions
+     */
+    private FigBody bodyText;
+    
+    private FigGroup regionCompartment;
+
+    /**
+     * Create a new instance of FigVertex
+     * @param owner the vertex that own this diagram element
+     * @param bounds the bounds of the diagram element
+     * @param settings the display settings for this diagram element
+     */
+    public FigVertex(Object owner, Rectangle bounds, DiagramSettings settings) {
+        super(owner, bounds, settings);
+        this.allowRemoveFromDiagram(false);
+
+        initialize();
+
+        NotationName notation = Notation.findNotation(getNotationSettings()
+                .getNotationLanguage());
+        notationProviderBody = NotationProviderFactory2.getInstance()
+                .getNotationProvider(NotationProviderFactory2.TYPE_STATEBODY,
+                        getOwner(), this, notation);
+        updateNameText();
+        
+        LOG.info("Registering as listener");
+        Model.getPump().addModelEventListener(this, getOwner(), "region");
+    }
+
+    @Override
+    public void setEnclosingFig(Fig encloser) {
+        LayerPerspective lp = (LayerPerspective) getLayer();
+        if (lp == null) {
+            return;
+        }
+        
+        super.setEnclosingFig(encloser);
+
+        Object region = null;
+        if (encloser != null) {
+            // Get the region as the first Region in the State.
+            // If there is no region in the StateMachine then create one.
+            List regions = Model.getStateMachinesHelper().getRegions(
+                    encloser.getOwner());
+            if (regions.isEmpty()) {
+                // There are no regions so create one and place the vertex
+                //there.
+                region = Model.getUmlFactory().buildNode(
+                        Model.getMetaTypes().getRegion(), encloser.getOwner());
+            } else {
+                // There are one or more regions so find the one that the
+                //vertex was dropped in
+                FigVertex compositeState = (FigVertex) encloser;
+                for (DiagramElement de :
+                        compositeState.regionCompartment.getDiagramElements()) {
+                    if (((Fig) de).getBounds().contains(getBounds())) {
+                        region = de.getOwner();
+                        break;
+                    }
+                }
+            }
+        } else {
+            // The vertex was dropped onto the diagram.
+            // Get the region as the first Region in the StateMachine.
+            // If there is no region in the StateMachine then create one.
+            ArgoDiagram diagram = (ArgoDiagram) lp.getDiagram();
+            Object stateMachine = diagram.getOwner();
+            List regions = 
+                Model.getStateMachinesHelper().getRegions(stateMachine);
+            if (regions.isEmpty()) {
+                region = Model.getUmlFactory().buildNode(
+                        Model.getMetaTypes().getRegion(), stateMachine);
+            } else {
+                region = regions.get(0);
+            }
+        }
+        if (region != null
+                && Model.getFacade().getContainer(getOwner()) != region) {
+            Model.getStateMachinesHelper().setContainer(getOwner(), region);
+        }
+    }
+
+    @Override
+    protected Fig createBigPortFig() {
+        return new FigRRect(0, 0, 0, 0, LINE_COLOR, FILL_COLOR);
+    }
+
+    private void initialize() {
+        getNameFig().setLineWidth(0);
+        getNameFig().setFilled(false);
+
+        bodyText = new FigBody(0,0,0,0);
+        regionCompartment = new FigRegionCompartment(0,0,0,0);
+        
+        addFig(getBigPort());
+        addFig(getNameFig());
+        addFig(getBodyText());
+        addFig(regionCompartment);
+
+        setBounds(getBounds());
+    }
+
+    /*
+     * @see
+     * org.argouml.uml.diagram.state.ui.FigStateVertex#initNotationProviders
+     * (java.lang.Object)
+     */
+    @Override
+    protected void initNotationProviders(Object own) {
+        if (notationProviderBody != null) {
+            notationProviderBody.cleanListener();
+        }
+        super.initNotationProviders(own);
+        NotationName notation = Notation.findNotation(getNotationSettings()
+                .getNotationLanguage());
+        if (Model.getFacade().isAState(own)) {
+            notationProviderBody = NotationProviderFactory2.getInstance()
+                    .getNotationProvider(
+                            NotationProviderFactory2.TYPE_STATEBODY, own, this,
+                            notation);
+        }
+    }
+
+    @Override
+    protected void modelChanged(PropertyChangeEvent mee) {
+        super.modelChanged(mee);
+        
+        assert (mee.getPropertyName().equals("region"));
+        
+        if (mee instanceof AddAssociationEvent) {
+            // TODO: Before adding a new region make the last region
+            // its minimum size (smallest size that will still
+            // contain all enclosed)
+            
+            Object newRegion = mee.getNewValue();
+            FigRegion rg = new FigRegion(newRegion);
+            rg.setBounds(
+                    regionCompartment.getX(), regionCompartment.getY(),
+                    rg.getMinimumSize().width, rg.getMinimumSize().height);
+            
+            regionCompartment.addFig(rg);
+            setSize(Math.max(getMinimumSize().width, getWidth()),
+                    Math.max(getMinimumSize().height, getHeight()));
+        }
+        if (mee instanceof RemoveAssociationEvent) {
+            Object oldRegion = mee.getNewValue();
+            for (DiagramElement de : regionCompartment.getDiagramElements()) {
+                if (de.getOwner() == oldRegion) {
+                    regionCompartment.removeFig((Fig) de);
+                    // TODO: After removing a region reset the overall
+                    // size of the node.
+                    renderingChanged();
+                    damage();
+                }
+            }
+            LOG.debug("Removing region " + oldRegion);
+        }
+    }
+
+    /*
+     * @see
+     * org.argouml.uml.diagram.ui.FigNodeModelElement#removeFromDiagramImpl()
+     */
+    @Override
+    public void removeFromDiagramImpl() {
+        if (notationProviderBody != null) {
+            notationProviderBody.cleanListener();
+        }
+        super.removeFromDiagramImpl();
+    }
+
+    /*
+     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#renderingChanged()
+     */
+    @Override
+    public void renderingChanged() {
+        super.renderingChanged();
+        if (notationProviderBody != null) {
+            bodyText.setText(notationProviderBody.toString(getOwner(),
+                    getNotationSettings()));
+        }
+        calcBounds();
+        setBounds(getBounds());
+    }
+
+    private FigText getBodyText() {
+        return bodyText;
+    }
+
+    @Override
+    protected void textEditStarted(FigText ft) {
+        super.textEditStarted(ft);
+        if (ft == bodyText) {
+            showHelp(notationProviderBody.getParsingHelp());
+        }
+    }
+
+    @Override
+    public void textEdited(FigText ft) throws PropertyVetoException {
+        super.textEdited(ft);
+        if (ft == getBodyText()) {
+            notationProviderBody.parse(getOwner(), ft.getText());
+            ft.setText(notationProviderBody.toString(getOwner(),
+                    getNotationSettings()));
+        }
+    }
+
+    public void notationRenderingChanged(NotationProvider np, String rendering) {
+        super.notationRenderingChanged(np, rendering);
+        if (notationProviderBody == np) {
+            bodyText.setText(rendering);
+            updateBounds();
+            damage();
+        }
+    }
+
+    public NotationSettings getNotationSettings(NotationProvider np) {
+        return getNotationSettings();
+    }
+
+    public Object getOwner(NotationProvider np) {
+        return getOwner();
+    }
+
+    public Dimension getMinimumSize() {
+        final Dimension nameSize = getNameFig().getMinimumSize();
+        final Dimension bodySize = getBodyText().getMinimumSize();
+
+        int h = getTopMargin()
+            + nameSize.height
+            + getBottomMargin();
+
+        h += regionCompartment.getMinimumSize().height;
+        
+        if (getBodyText().getText().length() > 0) {
+            h += bodySize.height;
+        }
+        
+        int w = getLeftMargin()
+            + Math.max(nameSize.width, bodySize.width)
+            + getRightMargin();
+        
+        if (Model.getFacade().isACompositeState(getOwner())) {
+            w = Math.max(180, w);
+            h = Math.max(150, h);
+        } else {
+            w = Math.max(80, w);
+            h = Math.max(40, h);
+        }
+        
+        return new Dimension(w, h);
+    }
+
+    public boolean getUseTrapRect() {
+        return true;
+    }
+
+    public List<Rectangle> getTrapRects(Fig draggedFig) {
+        if (draggedFig instanceof Connector) {
+            ArrayList<Rectangle> rects = new ArrayList<Rectangle>(1);
+            rects.add(getBigPort().getBounds());
+            return rects;
+        } else {
+            List regions = Model.getStateMachinesHelper().getRegions(getOwner());
+            
+            ArrayList<Rectangle> rects = new ArrayList<Rectangle>(regions.size());
+            if (regions.isEmpty()) {
+                rects.add(regionCompartment.getBounds());
+            } else {
+                for (Fig f : regionCompartment.getFigs()) {
+                    rects.add(f.getBounds());
+                }
+            }
+            return rects;
+        }
+    }
+    
+    protected void setStandardBounds(int x, int y, int w, int h) {
+        Dimension nameSize = getNameFig().getMinimumSize();
+        Dimension bodySize = getBodyText().getMinimumSize();
+
+        getNameFig().setBounds(
+                x + getLeftMargin(), y + getTopMargin(),
+                w - getLeftMargin() - getRightMargin(), nameSize.height);
+
+
+        
+        if (getBodyText().getText().length() > 0) {
+            getBodyText().setBounds(
+                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,
+                    bodySize.width,
+                    bodySize.height);
+        } else {
+            getBodyText().setBounds(
+                    x + getLeftMargin(), y + getTopMargin() + nameSize.height,
+                    bodySize.width,
+                    1);
+        }
+        
+        regionCompartment.setBounds(
+                x + getLeftMargin(),
+                getBodyText().getY() + getBodyText().getHeight(),
+                w - getLeftMargin() - getRightMargin(),
+                h - getTopMargin() - getBottomMargin()
+                    - getNameFig().getHeight() - getBodyText().getHeight());
+
+        getBigPort().setBounds(x, y, w, h);
+        
+        calcBounds(); // _x = x; _y = y; _w = w; _h = h;
+    }
+    
+    
+    
+    int getRightMargin() {
+        return MARGIN;
+    }
+
+    int getLeftMargin() {
+        return MARGIN;
+    }
+    
+    int getTopMargin() {
+        return MARGIN;
+    }
+    
+    int getBottomMargin() {
+        return MARGIN;
+    }
+    
+    /*
+     * @see org.tigris.gef.ui.PopupGenerator#getPopUpActions(java.awt.event.MouseEvent)
+     */
+    public Vector getPopUpActions(MouseEvent me) {
+        Vector popUpActions = super.getPopUpActions(me);
+        if (TargetManager.getInstance().getTargets().size() == 1) {
+            popUpActions.add(
+                    popUpActions.size() - getPopupAddOffset(),
+                    new ActionCreateContainedModelElement(
+                            Model.getMetaTypes().getRegion(), getOwner()));
+        }
+        return popUpActions;
+    }
+    
+    /**
+     * The text Fig that displays the body of the actions on the state
+     *
+     * @author Bob Tarling
+     */
+    private class FigBody extends FigText {
+        public FigBody(int x, int y, int width, int height) {
+            super (x, y, width, height);
+            setFont(getSettings().getFont(Font.PLAIN));
+            setTextColor(TEXT_COLOR);
+            setLineWidth(0);
+            setFilled(false);
+            setExpandOnly(true);
+            setReturnAction(FigText.INSERT);
+            setJustification(FigText.JUSTIFY_LEFT);
+        }
+    }
+    
+    /**
+     * The text Fig that displays the body of the actions on the state
+     *
+     * @author Bob Tarling
+     */
+    private class FigRegionCompartment extends FigGroup {
+        public FigRegionCompartment(int x, int y, int width, int height) {
+            super();
+        }
+        
+        @Override
+        protected void setBoundsImpl(
+                final int x,
+                int y,
+                final int w,
+                int h) {
+
+            _x = x;
+            _y = y;
+            _w = w;
+            _h = h;
+            
+            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
+                Fig fig = (Fig) it.next();
+                if (it.hasNext()) {
+                    fig.setBounds(x, y, w, fig.getMinimumSize().height);
+                    h -= fig.getMinimumSize().height;
+                } else {
+                    fig.setBounds(x, y, w, h);
+                }
+                y += fig.getHeight();
+            }
+        }
+        
+        
+        @Override
+        public Dimension getMinimumSize() {
+            int minWidth = 0;
+            int minHeight = 0;
+            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
+                Fig fig = (Fig) it.next();
+                minWidth = Math.max(fig.getMinimumSize().width, minWidth);
+                if (it.hasNext()) {
+                    minHeight += fig.getHeight();
+                } else {
+                    minHeight += fig.getMinimumSize().height;
+                }
+            }
+
+            return new Dimension(minWidth, minHeight);
+        }
+        
+        public void paint(Graphics g) {
+            super.paint(g);
+            
+            for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
+                Fig fig = (Fig) it.next();
+                if (it.hasNext()) {
+                    g.setColor(getLineColor());
+                    
+                    drawDashedLine(
+                            g, 1, 
+                            fig.getX(), 
+                            fig.getY() + fig.getHeight(),
+                            fig.getX() + fig.getWidth(),
+                            fig.getY() + fig.getHeight(),
+                            0, new float [] { 5.0f, 5.0f }, 10);            
+                }
+            }
+            
+        }
+    }
+    
+    /**
+     * Return a Selection for a Vertex.
+     *
+     * {@inheritDoc}
+     */
+    @Override
+    public Selection makeSelection() {
+        if (getOwner() != null) {
+            return new SelectionState(this);
+        }
+        return null;
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramFactory.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramFactory.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramFactory.java	2012-12-28 10:30:46-0800
@@ -1,27 +1,27 @@
-/* $Id:$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-import org.argouml.uml.diagram.ArgoDiagram;

-import org.argouml.uml.diagram.DiagramFactoryInterface2;

-import org.argouml.uml.diagram.DiagramSettings;

-

-public class StateDiagramFactory

-        implements DiagramFactoryInterface2{

-

-    public ArgoDiagram createDiagram(Object owner, String name,

-            DiagramSettings settings) {

-        return new UMLStateDiagram(name, owner);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramFactoryInterface2;
+import org.argouml.uml.diagram.DiagramSettings;
+
+public class StateDiagramFactory
+        implements DiagramFactoryInterface2{
+
+    public ArgoDiagram createDiagram(Object owner, String name,
+            DiagramSettings settings) {
+        return new UMLStateDiagram(name, owner);
+    }
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramGraphModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramGraphModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramGraphModel.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/StateDiagramGraphModel.java	2012-12-28 10:30:46-0800
@@ -1,24 +1,24 @@
-/* $Id: StateDiagramGraphModel.java 19385 2011-05-09 19:41:39Z bobtarling $

- *****************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-public class StateDiagramGraphModel extends org.argouml.uml.diagram.state.StateDiagramGraphModel {

-

-    

-    public void setHomeModel(Object ns) {

-        super.setHomeModel(ns);

-        setMachine(ns);

-    }

-    

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+public class StateDiagramGraphModel extends org.argouml.uml.diagram.state.StateDiagramGraphModel {
+
+    
+    public void setHomeModel(Object ns) {
+        super.setHomeModel(ns);
+        setMachine(ns);
+    }
+    
+}

Modified: trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/UMLStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/UMLStateDiagram.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/UMLStateDiagram.java	(original)
+++ trunk/src/argouml-core-diagrams-state2/src/org/argouml/state2/diagram/UMLStateDiagram.java	2012-12-28 10:30:46-0800
@@ -1,286 +1,286 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2009-2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.state2.diagram;

-

-import java.awt.Rectangle;

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyVetoException;

-import java.util.ArrayList;

-import java.util.Collection;

-

-import javax.swing.Action;

-

-import org.argouml.i18n.Translator;

-import org.argouml.model.DeleteInstanceEvent;

-import org.argouml.model.Model;

-import org.argouml.model.StateDiagram;

-import org.argouml.ui.CmdCreateNode;

-import org.argouml.uml.diagram.DiagramElement;

-import org.argouml.uml.diagram.DiagramFactory;

-import org.argouml.uml.diagram.DiagramSettings;

-import org.argouml.uml.diagram.state.ui.FigBranchState;

-import org.argouml.uml.diagram.state.ui.FigDeepHistoryState;

-import org.argouml.uml.diagram.state.ui.FigFinalState;

-import org.argouml.uml.diagram.state.ui.FigForkState;

-import org.argouml.uml.diagram.state.ui.FigInitialState;

-import org.argouml.uml.diagram.state.ui.FigJoinState;

-import org.argouml.uml.diagram.state.ui.FigJunctionState;

-import org.argouml.uml.diagram.state.ui.FigShallowHistoryState;

-import org.argouml.uml.diagram.state.ui.StateDiagramRenderer;

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

-import org.argouml.uml.diagram.static_structure.ui.FigComment;

-import org.argouml.uml.diagram.ui.ActionSetMode;

-import org.argouml.uml.diagram.ui.FigNodeModelElement;

-import org.argouml.uml.diagram.ui.RadioAction;

-import org.argouml.uml.diagram.ui.UMLDiagram;

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

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

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

-import org.tigris.gef.presentation.FigNode;

-

-/**

- * Diagram for UML2 State Machine diagram

- * @author Bob Tarling

- */

-public class UMLStateDiagram extends UMLDiagram implements StateDiagram {

-

-    /**

-     * Construct a State Diagram. Default constructor used by PGML parser during

-     * diagram load. It should not be used by other callers.

-     * @deprecated only for use by PGML parser

-     */

-    @Deprecated

-    public UMLStateDiagram() {

-        super(new StateDiagramGraphModel());

-    }

-    

-    /**

-     * Construct a new State Machine diagram.

-     * 

-     * @param name the name of the new diagram

-     * @param machine the owner of the diagram which will be a state machine

-     */

-    public UMLStateDiagram(String name, Object machine) {

-        super(name, machine, new StateDiagramGraphModel());

-        if (name == null || name.trim().length() == 0) {

-            name = getLabelName() + Model.getFacade().getName(machine);

-            try {

-                setName(name);

-            } catch (PropertyVetoException pve) {

-                // nothing we can do about veto, so just ignore it

-            }

-        }

-        initialize(machine);

-    }

-

-    @Override

-    public void initialize(Object o) {

-

-        setNamespace(o);

-

-        StateDiagramGraphModel gm = createGraphModel();

-        gm.setHomeModel(namespace);

-        StateDiagramRenderer rend = new StateDiagramRenderer();

-

-        LayerPerspective lay = new LayerPerspectiveMutable(

-                Model.getFacade().getName(namespace), gm);

-        lay.setGraphNodeRenderer(rend);

-        lay.setGraphEdgeRenderer(rend);

-        setLayer(lay);

-

-        Model.getPump().addModelEventListener(this, namespace, 

-                new String[] {"remove"});

-    }

-

-    private StateDiagramGraphModel createGraphModel() {

-        if ((getGraphModel() instanceof StateDiagramGraphModel)) {

-            return (StateDiagramGraphModel) getGraphModel();

-        } else {

-            return new StateDiagramGraphModel();

-        }

-    }

-

-    /*

-     * @see org.argouml.uml.diagram.ui.UMLDiagram#propertyChange(java.beans.PropertyChangeEvent)

-     */

-    @Override

-    public void propertyChange(PropertyChangeEvent evt) {

-        if ((evt.getSource() == namespace)

-                && (evt instanceof DeleteInstanceEvent)) {

-            Model.getPump().removeModelEventListener(this, 

-                    namespace, new String[] {"remove"});

-            if (getProject() != null) {

-                getProject().moveToTrash(this);

-            } else {

-                DiagramFactory.getInstance().removeDiagram(this);

-            }

-        }

-    }

-

-

-    protected Object[] getUmlActions() {

-        

-        ArrayList actions = new ArrayList();

-        

-        actions.add(getNodeAction(Model.getMetaTypes().getState()));

-        actions.add(getEdgeAction(Model.getMetaTypes().getTransition()));

-        actions.add(null);

-        actions.add(getPseudoAction(Model.getPseudostateKind().getInitial()));

-        actions.add(getNodeAction(Model.getMetaTypes().getFinalState()));

-        actions.add(getPseudoAction(

-                Model.getPseudostateKind().getEntryPoint()));

-        actions.add(getPseudoAction(Model.getPseudostateKind().getExitPoint()));

-        actions.add(getPseudoAction(Model.getPseudostateKind().getJunction()));

-        actions.add(getPseudoAction(Model.getPseudostateKind().getChoice()));

-        actions.add(getPseudoAction(Model.getPseudostateKind().getFork()));

-        actions.add(getPseudoAction(Model.getPseudostateKind().getJoin()));

-        actions.add(getPseudoAction(

-                Model.getPseudostateKind().getShallowHistory()));

-        actions.add(getPseudoAction(

-                Model.getPseudostateKind().getDeepHistory()));

-        

-        return actions.toArray();

-    }

-

-    public String getLabelName() {

-        return Translator.localize("label.statemachine-diagram");

-    }

-

-    private Action getNodeAction(Object metaType) {

-        String label = getLabel(metaType);

-        return new RadioAction(new CmdCreateNode(metaType, label));

-    }

-

-    private Action getPseudoAction(Object kind) {

-        String label = 

-            "button.new-" + Model.getFacade().getName(kind).toLowerCase();

-        return new RadioAction(new CreatePseudostateAction(kind, label));

-    }

-    

-    

-    private Action getEdgeAction(Object metaType) {

-        String label = getLabel(metaType);

-        return new RadioAction(

-                    new ActionSetMode(

-                        ModeCreatePolyEdge.class,

-                        "edgeClass",

-                        metaType,

-                        label));

-    }

-    

-    private String getLabel(Object metaType) {

-        return "button.new-"

-            + Model.getMetaTypes().getName(metaType).toLowerCase();

-    }

-

-    /*

-     * @see org.argouml.uml.diagram.ui.UMLDiagram#relocate(java.lang.Object)

-     */

-    public boolean relocate(Object base) {

-        return false;

-    }

-

-    public void encloserChanged(FigNode enclosed, 

-            FigNode oldEncloser, FigNode newEncloser) {

-    }

-

-    @Override

-    public boolean doesAccept(Object objectToAccept) {

-        if (Model.getFacade().isAVertex(objectToAccept)) {

-            return true;

-        } else if (Model.getFacade().isAComment(objectToAccept)) {

-            return true;

-        } 

-        return false;

-    }

-    

-

-    public DiagramElement createDiagramElement(

-            final Object modelElement,

-            final Rectangle bounds) {

-        

-        FigNodeModelElement figNode = null;

-        

-        DiagramSettings settings = getDiagramSettings();

-        

-        if (Model.getFacade().isAFinalState(modelElement)) {

-            figNode = new FigFinalState(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAState(modelElement)) {

-            figNode = new FigVertex(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAComment(modelElement)) {

-            figNode = new FigComment(modelElement, bounds, settings);

-        } else if (Model.getFacade().isAPseudostate(modelElement)) {

-            Object kind = Model.getFacade().getKind(modelElement);

-            if (kind == null) {

-                return null;

-            }

-            if (kind.equals(Model.getPseudostateKind().getInitial())) {

-                figNode = new FigInitialState(modelElement, bounds, settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getEntryPoint())) {

-                figNode = 

-                        new FigEntryPoint(modelElement, bounds, settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getExitPoint())) {

-                figNode = new FigExitPoint(modelElement, bounds, settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getChoice())) {

-                figNode = new FigBranchState(modelElement, bounds, settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getJunction())) {

-                figNode = new FigJunctionState(modelElement, bounds, settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getFork())) {

-                figNode = new FigForkState(modelElement, bounds, settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getJoin())) {

-                figNode = new FigJoinState(modelElement, bounds, settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getShallowHistory())) {

-                figNode = new FigShallowHistoryState(modelElement, bounds, 

-                        settings);

-            } else if (kind.equals(

-                    Model.getPseudostateKind().getDeepHistory())) {

-                figNode = new FigDeepHistoryState(modelElement, bounds, 

-                        settings);

-            }

-        }

-        return figNode;

-    }

-

-    @Override

-    public boolean isRelocationAllowed(Object base) {

-        // TODO Auto-generated method stub

-        return false;

-    }

-

-    public Collection getRelocationCandidates(Object root) {

-        // TODO Auto-generated method stub

-        return null;

-    }

-    

-    private class CreatePseudostateAction extends CmdCreateNode {

-        public CreatePseudostateAction(Object kind, String name) {

-            super(Model.getMetaTypes().getPseudostate(), name);

-            setArg("kind", kind);

-        }

-

-        public Object makeNode() {

-            Object newNode = super.makeNode();

-            Object kind = getArg("kind");

-            Model.getCoreHelper().setKind(newNode, kind);

-            return newNode;

-        }

-    }

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009-2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.state2.diagram;
+
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.swing.Action;
+
+import org.argouml.i18n.Translator;
+import org.argouml.model.DeleteInstanceEvent;
+import org.argouml.model.Model;
+import org.argouml.model.StateDiagram;
+import org.argouml.ui.CmdCreateNode;
+import org.argouml.uml.diagram.DiagramElement;
+import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.state.ui.FigBranchState;
+import org.argouml.uml.diagram.state.ui.FigDeepHistoryState;
+import org.argouml.uml.diagram.state.ui.FigFinalState;
+import org.argouml.uml.diagram.state.ui.FigForkState;
+import org.argouml.uml.diagram.state.ui.FigInitialState;
+import org.argouml.uml.diagram.state.ui.FigJoinState;
+import org.argouml.uml.diagram.state.ui.FigJunctionState;
+import org.argouml.uml.diagram.state.ui.FigShallowHistoryState;
+import org.argouml.uml.diagram.state.ui.StateDiagramRenderer;
+import org.argouml.uml.diagram.static_structure.ClassDiagramGraphModel;
+import org.argouml.uml.diagram.static_structure.ui.FigComment;
+import org.argouml.uml.diagram.ui.ActionSetMode;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.argouml.uml.diagram.ui.RadioAction;
+import org.argouml.uml.diagram.ui.UMLDiagram;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.base.LayerPerspectiveMutable;
+import org.tigris.gef.base.ModeCreatePolyEdge;
+import org.tigris.gef.presentation.FigNode;
+
+/**
+ * Diagram for UML2 State Machine diagram
+ * @author Bob Tarling
+ */
+public class UMLStateDiagram extends UMLDiagram implements StateDiagram {
+
+    /**
+     * Construct a State Diagram. Default constructor used by PGML parser during
+     * diagram load. It should not be used by other callers.
+     * @deprecated only for use by PGML parser
+     */
+    @Deprecated
+    public UMLStateDiagram() {
+        super(new StateDiagramGraphModel());
+    }
+    
+    /**
+     * Construct a new State Machine diagram.
+     * 
+     * @param name the name of the new diagram
+     * @param machine the owner of the diagram which will be a state machine
+     */
+    public UMLStateDiagram(String name, Object machine) {
+        super(name, machine, new StateDiagramGraphModel());
+        if (name == null || name.trim().length() == 0) {
+            name = getLabelName() + Model.getFacade().getName(machine);
+            try {
+                setName(name);
+            } catch (PropertyVetoException pve) {
+                // nothing we can do about veto, so just ignore it
+            }
+        }
+        initialize(machine);
+    }
+
+    @Override
+    public void initialize(Object o) {
+
+        setNamespace(o);
+
+        StateDiagramGraphModel gm = createGraphModel();
+        gm.setHomeModel(namespace);
+        StateDiagramRenderer rend = new StateDiagramRenderer();
+
+        LayerPerspective lay = new LayerPerspectiveMutable(
+                Model.getFacade().getName(namespace), gm);
+        lay.setGraphNodeRenderer(rend);
+        lay.setGraphEdgeRenderer(rend);
+        setLayer(lay);
+
+        Model.getPump().addModelEventListener(this, namespace, 
+                new String[] {"remove"});
+    }
+
+    private StateDiagramGraphModel createGraphModel() {
+        if ((getGraphModel() instanceof StateDiagramGraphModel)) {
+            return (StateDiagramGraphModel) getGraphModel();
+        } else {
+            return new StateDiagramGraphModel();
+        }
+    }
+
+    /*
+     * @see org.argouml.uml.diagram.ui.UMLDiagram#propertyChange(java.beans.PropertyChangeEvent)
+     */
+    @Override
+    public void propertyChange(PropertyChangeEvent evt) {
+        if ((evt.getSource() == namespace)
+                && (evt instanceof DeleteInstanceEvent)) {
+            Model.getPump().removeModelEventListener(this, 
+                    namespace, new String[] {"remove"});
+            if (getProject() != null) {
+                getProject().moveToTrash(this);
+            } else {
+                DiagramFactory.getInstance().removeDiagram(this);
+            }
+        }
+    }
+
+
+    protected Object[] getUmlActions() {
+        
+        ArrayList actions = new ArrayList();
+        
+        actions.add(getNodeAction(Model.getMetaTypes().getState()));
+        actions.add(getEdgeAction(Model.getMetaTypes().getTransition()));
+        actions.add(null);
+        actions.add(getPseudoAction(Model.getPseudostateKind().getInitial()));
+        actions.add(getNodeAction(Model.getMetaTypes().getFinalState()));
+        actions.add(getPseudoAction(
+                Model.getPseudostateKind().getEntryPoint()));
+        actions.add(getPseudoAction(Model.getPseudostateKind().getExitPoint()));
+        actions.add(getPseudoAction(Model.getPseudostateKind().getJunction()));
+        actions.add(getPseudoAction(Model.getPseudostateKind().getChoice()));
+        actions.add(getPseudoAction(Model.getPseudostateKind().getFork()));
+        actions.add(getPseudoAction(Model.getPseudostateKind().getJoin()));
+        actions.add(getPseudoAction(
+                Model.getPseudostateKind().getShallowHistory()));
+        actions.add(getPseudoAction(
+                Model.getPseudostateKind().getDeepHistory()));
+        
+        return actions.toArray();
+    }
+
+    public String getLabelName() {
+        return Translator.localize("label.statemachine-diagram");
+    }
+
+    private Action getNodeAction(Object metaType) {
+        String label = getLabel(metaType);
+        return new RadioAction(new CmdCreateNode(metaType, label));
+    }
+
+    private Action getPseudoAction(Object kind) {
+        String label = 
+            "button.new-" + Model.getFacade().getName(kind).toLowerCase();
+        return new RadioAction(new CreatePseudostateAction(kind, label));
+    }
+    
+    
+    private Action getEdgeAction(Object metaType) {
+        String label = getLabel(metaType);
+        return new RadioAction(
+                    new ActionSetMode(
+                        ModeCreatePolyEdge.class,
+                        "edgeClass",
+                        metaType,
+                        label));
+    }
+    
+    private String getLabel(Object metaType) {
+        return "button.new-"
+            + Model.getMetaTypes().getName(metaType).toLowerCase();
+    }
+
+    /*
+     * @see org.argouml.uml.diagram.ui.UMLDiagram#relocate(java.lang.Object)
+     */
+    public boolean relocate(Object base) {
+        return false;
+    }
+
+    public void encloserChanged(FigNode enclosed, 
+            FigNode oldEncloser, FigNode newEncloser) {
+    }
+
+    @Override
+    public boolean doesAccept(Object objectToAccept) {
+        if (Model.getFacade().isAVertex(objectToAccept)) {
+            return true;
+        } else if (Model.getFacade().isAComment(objectToAccept)) {
+            return true;
+        } 
+        return false;
+    }
+    
+
+    public DiagramElement createDiagramElement(
+            final Object modelElement,
+            final Rectangle bounds) {
+        
+        FigNodeModelElement figNode = null;
+        
+        DiagramSettings settings = getDiagramSettings();
+        
+        if (Model.getFacade().isAFinalState(modelElement)) {
+            figNode = new FigFinalState(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAState(modelElement)) {
+            figNode = new FigVertex(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAComment(modelElement)) {
+            figNode = new FigComment(modelElement, bounds, settings);
+        } else if (Model.getFacade().isAPseudostate(modelElement)) {
+            Object kind = Model.getFacade().getKind(modelElement);
+            if (kind == null) {
+                return null;
+            }
+            if (kind.equals(Model.getPseudostateKind().getInitial())) {
+                figNode = new FigInitialState(modelElement, bounds, settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getEntryPoint())) {
+                figNode = 
+                        new FigEntryPoint(modelElement, bounds, settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getExitPoint())) {
+                figNode = new FigExitPoint(modelElement, bounds, settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getChoice())) {
+                figNode = new FigBranchState(modelElement, bounds, settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getJunction())) {
+                figNode = new FigJunctionState(modelElement, bounds, settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getFork())) {
+                figNode = new FigForkState(modelElement, bounds, settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getJoin())) {
+                figNode = new FigJoinState(modelElement, bounds, settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getShallowHistory())) {
+                figNode = new FigShallowHistoryState(modelElement, bounds, 
+                        settings);
+            } else if (kind.equals(
+                    Model.getPseudostateKind().getDeepHistory())) {
+                figNode = new FigDeepHistoryState(modelElement, bounds, 
+                        settings);
+            }
+        }
+        return figNode;
+    }
+
+    @Override
+    public boolean isRelocationAllowed(Object base) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public Collection getRelocationCandidates(Object root) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+    
+    private class CreatePseudostateAction extends CmdCreateNode {
+        public CreatePseudostateAction(Object kind, String name) {
+            super(Model.getMetaTypes().getPseudostate(), name);
+            setArg("kind", kind);
+        }
+
+        public Object makeNode() {
+            Object newNode = super.makeNode();
+            Object kind = getArg("kind");
+            Model.getCoreHelper().setKind(newNode, kind);
+            return newNode;
+        }
+    }
 }
\ No newline at end of file

Modified: trunk/src/argouml-core-diagrams-structure2/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-structure2/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-structure2/build.properties	(original)
+++ trunk/src/argouml-core-diagrams-structure2/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-diagrams-structure2/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-structure2/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-structure2/plugin.properties	(original)
+++ trunk/src/argouml-core-diagrams-structure2/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-diagrams-structure2

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-diagrams-structure2
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML Structure2 Diagram Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-diagrams-uml2/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-uml2/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-uml2/build.properties	(original)
+++ trunk/src/argouml-core-diagrams-uml2/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-diagrams-uml2/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-uml2/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-diagrams-uml2/plugin.properties	(original)
+++ trunk/src/argouml-core-diagrams-uml2/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-diagrams-uml2

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-diagrams-uml2
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML UML2 Diagram Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-model-euml/lib/eUML required plugins.txt
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/lib/eUML%20required%20plugins.txt?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model-euml/lib/eUML required plugins.txt	(original)
+++ trunk/src/argouml-core-model-euml/lib/eUML required plugins.txt	2012-12-28 10:30:46-0800
@@ -1,20 +1,20 @@
-EMF download site: http://www.eclipse.org/modeling/emf/downloads/index.php?project=emf

-UML2 download site: http://www.eclipse.org/modeling/mdt/downloads/?project=uml2

-

-EMF required jars (current 2.6.1, before 2.5.0, before 2.4.2, original 2.3.1)

-org.eclipse.emf.common

-org.eclipse.emf.ecore.change.edit

-org.eclipse.emf.ecore.change

-org.eclipse.emf.ecore.edit

-org.eclipse.emf.ecore.xmi

-org.eclipse.emf.ecore

-org.eclipse.emf.edit

-org.eclipse.emf.mapping.ecore2xml

-org.eclipse.emf.mapping

-

-UML2 required jars (current 3.1.1, before 3.0.1, before 2.2.2, original 2.1.1)

-org.eclipse.uml2.common.edit

-org.eclipse.uml2.common

-org.eclipse.uml2.uml.edit

-org.eclipse.uml2.uml.resources

+EMF download site: http://www.eclipse.org/modeling/emf/downloads/index.php?project=emf
+UML2 download site: http://www.eclipse.org/modeling/mdt/downloads/?project=uml2
+
+EMF required jars (current 2.6.1, before 2.5.0, before 2.4.2, original 2.3.1)
+org.eclipse.emf.common
+org.eclipse.emf.ecore.change.edit
+org.eclipse.emf.ecore.change
+org.eclipse.emf.ecore.edit
+org.eclipse.emf.ecore.xmi
+org.eclipse.emf.ecore
+org.eclipse.emf.edit
+org.eclipse.emf.mapping.ecore2xml
+org.eclipse.emf.mapping
+
+UML2 required jars (current 3.1.1, before 3.0.1, before 2.2.2, original 2.1.1)
+org.eclipse.uml2.common.edit
+org.eclipse.uml2.common
+org.eclipse.uml2.uml.edit
+org.eclipse.uml2.uml.resources
 org.eclipse.uml2.uml
\ No newline at end of file

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java	2012-12-28 10:30:46-0800
@@ -1,47 +1,47 @@
-// $Id: MessageSortEUMLImpl.java 18220 2010-04-08 20:37:15Z bobtarling $

-/*******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************/

-

-package org.argouml.model.euml;

-

-import org.argouml.model.MessageSort;

-

-/**

- * The implementation of the OrderingKindEUMLImpl.java for EUML2.

- */

-class MessageSortEUMLImpl implements MessageSort {

-

-    public Object getASynchCall() {

-        return org.eclipse.uml2.uml.MessageSort.ASYNCH_CALL_LITERAL;

-    }

-

-    public Object getCreateMessage() {

-        return org.eclipse.uml2.uml.MessageSort.CREATE_MESSAGE_LITERAL;

-    }

-

-    public Object getDeleteMessage() {

-        return org.eclipse.uml2.uml.MessageSort.DELETE_MESSAGE_LITERAL;

-    }

-

-    public Object getReply() {

-        return org.eclipse.uml2.uml.MessageSort.REPLY_LITERAL;

-    }

-

-    public Object getSynchCall() {

-        return org.eclipse.uml2.uml.MessageSort.SYNCH_CALL_LITERAL;

-    }

-

-    public Object getASynchSignal() {

-        return org.eclipse.uml2.uml.MessageSort.ASYNCH_SIGNAL_LITERAL;

-    }

-

-

-}

+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************/
+
+package org.argouml.model.euml;
+
+import org.argouml.model.MessageSort;
+
+/**
+ * The implementation of the OrderingKindEUMLImpl.java for EUML2.
+ */
+class MessageSortEUMLImpl implements MessageSort {
+
+    public Object getASynchCall() {
+        return org.eclipse.uml2.uml.MessageSort.ASYNCH_CALL_LITERAL;
+    }
+
+    public Object getCreateMessage() {
+        return org.eclipse.uml2.uml.MessageSort.CREATE_MESSAGE_LITERAL;
+    }
+
+    public Object getDeleteMessage() {
+        return org.eclipse.uml2.uml.MessageSort.DELETE_MESSAGE_LITERAL;
+    }
+
+    public Object getReply() {
+        return org.eclipse.uml2.uml.MessageSort.REPLY_LITERAL;
+    }
+
+    public Object getSynchCall() {
+        return org.eclipse.uml2.uml.MessageSort.SYNCH_CALL_LITERAL;
+    }
+
+    public Object getASynchSignal() {
+        return org.eclipse.uml2.uml.MessageSort.ASYNCH_SIGNAL_LITERAL;
+    }
+
+
+}

Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java	(original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java	2012-12-28 10:30:46-0800
@@ -1,51 +1,51 @@
-// $Id: MessageSortEUMLImpl.java 18220 2010-04-08 20:37:15Z bobtarling $

-/*******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************/

-

-package org.argouml.model.mdr;

-

-import org.argouml.model.MessageSort;

-import org.argouml.model.NotImplementedException;

-import org.omg.uml.behavioralelements.commonbehavior.CallAction;

-import org.omg.uml.behavioralelements.commonbehavior.CreateAction;

-import org.omg.uml.behavioralelements.commonbehavior.DestroyAction;

-import org.omg.uml.behavioralelements.commonbehavior.ReturnAction;

-import org.omg.uml.behavioralelements.commonbehavior.SendAction;

-

-/**

- * The implementation of the OrderingKindEUMLImpl.java for EUML2.

- */

-class MessageSortMDRImpl implements MessageSort {

-

-    public Object getASynchCall() {

-        return CallAction.class;

-    }

-

-    public Object getCreateMessage() {

-        return CreateAction.class;

-    }

-

-    public Object getDeleteMessage() {

-        return DestroyAction.class;

-    }

-

-    public Object getReply() {

-        return ReturnAction.class;

-    }

-

-    public Object getSynchCall() {

-        return CallAction.class;

-    }

-    

-    public Object getASynchSignal() {

-        return SendAction.class;

-    }

-}

+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************/
+
+package org.argouml.model.mdr;
+
+import org.argouml.model.MessageSort;
+import org.argouml.model.NotImplementedException;
+import org.omg.uml.behavioralelements.commonbehavior.CallAction;
+import org.omg.uml.behavioralelements.commonbehavior.CreateAction;
+import org.omg.uml.behavioralelements.commonbehavior.DestroyAction;
+import org.omg.uml.behavioralelements.commonbehavior.ReturnAction;
+import org.omg.uml.behavioralelements.commonbehavior.SendAction;
+
+/**
+ * The implementation of the OrderingKindEUMLImpl.java for EUML2.
+ */
+class MessageSortMDRImpl implements MessageSort {
+
+    public Object getASynchCall() {
+        return CallAction.class;
+    }
+
+    public Object getCreateMessage() {
+        return CreateAction.class;
+    }
+
+    public Object getDeleteMessage() {
+        return DestroyAction.class;
+    }
+
+    public Object getReply() {
+        return ReturnAction.class;
+    }
+
+    public Object getSynchCall() {
+        return CallAction.class;
+    }
+    
+    public Object getASynchSignal() {
+        return SendAction.class;
+    }
+}

Modified: trunk/src/argouml-core-model/src/org/argouml/model/AssociationChangeListener.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/AssociationChangeListener.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/AssociationChangeListener.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/AssociationChangeListener.java	2012-12-28 10:30:46-0800
@@ -1,34 +1,34 @@
-/* $Id: org.eclipse.jdt.ui.prefs 17993 2010-02-11 21:46:56Z linus $

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.model;

-

-

-/**

- * An interface to be implemented by those classes wishing to listen for addition and removal

- * of model events.

- *

- * @author Bob Tarling

- */

-public interface AssociationChangeListener extends UmlChangeListener {

-    /**

-     * Called when model element has been added to another

-     * @param evt

-     */

-    void elementAdded(AddAssociationEvent evt);

-    /**

-     * Called when model element has been removed from another

-     * @param evt

-     */

-    void elementRemoved(RemoveAssociationEvent evt);

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.model;
+
+
+/**
+ * An interface to be implemented by those classes wishing to listen for addition and removal
+ * of model events.
+ *
+ * @author Bob Tarling
+ */
+public interface AssociationChangeListener extends UmlChangeListener {
+    /**
+     * Called when model element has been added to another
+     * @param evt
+     */
+    void elementAdded(AddAssociationEvent evt);
+    /**
+     * Called when model element has been removed from another
+     * @param evt
+     */
+    void elementRemoved(RemoveAssociationEvent evt);
+}

Modified: trunk/src/argouml-core-model/src/org/argouml/model/Defaults.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/Defaults.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/Defaults.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/Defaults.java	2012-12-28 10:30:46-0800
@@ -1,36 +1,36 @@
-/* $Id: org.eclipse.jdt.ui.prefs 17993 2010-02-11 21:46:56Z linus $

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.model;

-

-/**

- * Contains information on what default properties should be applied to a newly created

- * model element.

- * @author Bob Tarling

- */

-public interface Defaults {

-    

-    /**

-     * Get the default type to apply when creating on object of the given meta type.

-     * @param metaType that is to be created

-     * @return the type instance to apply to the newly created object

-     */

-    Object getDefaultType(Object metaType);

-    

-    /**

-     * Get the default name to apply when creating on object of the given meta type.

-     * @param metaType that is to be created

-     * @return the name to apply to the newly created object

-     */

-    String getDefaultName(Object metaType);

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.model;
+
+/**
+ * Contains information on what default properties should be applied to a newly created
+ * model element.
+ * @author Bob Tarling
+ */
+public interface Defaults {
+    
+    /**
+     * Get the default type to apply when creating on object of the given meta type.
+     * @param metaType that is to be created
+     * @return the type instance to apply to the newly created object
+     */
+    Object getDefaultType(Object metaType);
+    
+    /**
+     * Get the default name to apply when creating on object of the given meta type.
+     * @param metaType that is to be created
+     * @return the name to apply to the newly created object
+     */
+    String getDefaultName(Object metaType);
+}

Modified: trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java	2012-12-28 10:30:46-0800
@@ -1,50 +1,50 @@
-/* $Id: MessageKind.java 17747 2010-01-10 21:16:51Z linus $

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.model;

-

-/**

- * The different AggregationKinds.

- */

-public interface MessageSort {

-    

-    /**

-     * @return Returns the SynchCall MessageSort

-     */

-    Object getSynchCall();

-

-    /**

-     * @return Returns the ASynchCall MessageSort

-     */

-    Object getASynchCall();

-    

-    /**

-     * @return Returns the CreateMessage MessageSort

-     */

-    Object getCreateMessage();

-

-    /**

-     * @return Returns the DeleteMessage MessageSort

-     */

-    Object getDeleteMessage();

-

-    /**

-     * @return Returns the Reply MessageSort

-     */

-    Object getReply();

-    

-    /**

-     * @return Returns the ASynchSignal MessageSort

-     */

-    Object getASynchSignal();    

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.model;
+
+/**
+ * The different AggregationKinds.
+ */
+public interface MessageSort {
+    
+    /**
+     * @return Returns the SynchCall MessageSort
+     */
+    Object getSynchCall();
+
+    /**
+     * @return Returns the ASynchCall MessageSort
+     */
+    Object getASynchCall();
+    
+    /**
+     * @return Returns the CreateMessage MessageSort
+     */
+    Object getCreateMessage();
+
+    /**
+     * @return Returns the DeleteMessage MessageSort
+     */
+    Object getDeleteMessage();
+
+    /**
+     * @return Returns the Reply MessageSort
+     */
+    Object getReply();
+    
+    /**
+     * @return Returns the ASynchSignal MessageSort
+     */
+    Object getASynchSignal();    
+}

Modified: trunk/src/argouml-core-model/src/org/argouml/model/UmlChangeListener.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/UmlChangeListener.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/UmlChangeListener.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/UmlChangeListener.java	2012-12-28 10:30:46-0800
@@ -1,20 +1,20 @@
-/* $Id: org.eclipse.jdt.ui.prefs 17993 2010-02-11 21:46:56Z linus $

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.model;

-

-import java.util.EventListener;

-

-public interface UmlChangeListener extends EventListener {

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.model;
+
+import java.util.EventListener;
+
+public interface UmlChangeListener extends EventListener {
+
+}

Modified: trunk/src/argouml-core-model/src/org/argouml/model/UmlFactoryDefaults.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/UmlFactoryDefaults.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-model/src/org/argouml/model/UmlFactoryDefaults.java	(original)
+++ trunk/src/argouml-core-model/src/org/argouml/model/UmlFactoryDefaults.java	2012-12-28 10:30:46-0800
@@ -1,36 +1,36 @@
-/* $Id: org.eclipse.jdt.ui.prefs 17993 2010-02-11 21:46:56Z linus $

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.model;

-

-/**

- * Contains information on what default properties should be applied to a newly created

- * model element.

- * @author Bob Tarling

- */

-public interface UmlFactoryDefaults {

-    

-    /**

-     * Get the default type to apply when creating on object of the given meta type.

-     * @param metaType that is to be created

-     * @return the type instance to apply to the newly created object

-     */

-    Object getDefaultType(Object metaType);

-    

-    /**

-     * Get the default name to apply when creating on object of the given meta type.

-     * @param metaType that is to be created

-     * @return the name to apply to the newly created object

-     */

-    String getDefaultName(Object metaType);

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.model;
+
+/**
+ * Contains information on what default properties should be applied to a newly created
+ * model element.
+ * @author Bob Tarling
+ */
+public interface UmlFactoryDefaults {
+    
+    /**
+     * Get the default type to apply when creating on object of the given meta type.
+     * @param metaType that is to be created
+     * @return the type instance to apply to the newly created object
+     */
+    Object getDefaultType(Object metaType);
+    
+    /**
+     * Get the default name to apply when creating on object of the given meta type.
+     * @param metaType that is to be created
+     * @return the name to apply to the newly created object
+     */
+    String getDefaultName(Object metaType);
+}

Modified: trunk/src/argouml-core-notation/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/build.properties	(original)
+++ trunk/src/argouml-core-notation/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-notation/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/plugin.properties	(original)
+++ trunk/src/argouml-core-notation/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-notation

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-notation
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML Notation Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NameUmlNotation.java	2012-12-28 10:30:46-0800
@@ -1,62 +1,62 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyChangeListener;

-

-import javax.swing.SwingUtilities;

-

-import org.argouml.model.InvalidElementException;

-import org.argouml.model.Model;

-

-class NameUmlNotation implements NotationText, PropertyChangeListener {

-

-    final private NotatedItem notatedItem;

-    

-    NameUmlNotation(NotatedItem item) {

-        notatedItem = item;

-    }

-

-    public Object getMetaType() {

-        return notatedItem.getMetaType();

-    }

-

-    public NotationType getNotationType() {

-        return notatedItem.getNotationType();

-    }

-

-    public void propertyChange(PropertyChangeEvent evt) {

-        try {

-            final Object owner = notatedItem.getOwner();

-            final String name = Model.getFacade().getName(owner);

-            final boolean isAbstract = Model.getFacade().isAbstract(owner);

-            final boolean isStatic =

-                Model.getFacade().isAFeature(owner) && Model.getFacade().isStatic(owner);

-            

-            Runnable doWorkRunnable = new Runnable() {

-                public void run() {

-                        NotationTextEvent event = new UmlNotationTextEvent(

-                                name, 

-                                isAbstract, 

-                                isStatic, 

-                                false);

-                        notatedItem.notationTextChanged(event);

-                }  

-            };

-            SwingUtilities.invokeLater(doWorkRunnable);

-        } catch (InvalidElementException e) {

-        }

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.SwingUtilities;
+
+import org.argouml.model.InvalidElementException;
+import org.argouml.model.Model;
+
+class NameUmlNotation implements NotationText, PropertyChangeListener {
+
+    final private NotatedItem notatedItem;
+    
+    NameUmlNotation(NotatedItem item) {
+        notatedItem = item;
+    }
+
+    public Object getMetaType() {
+        return notatedItem.getMetaType();
+    }
+
+    public NotationType getNotationType() {
+        return notatedItem.getNotationType();
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        try {
+            final Object owner = notatedItem.getOwner();
+            final String name = Model.getFacade().getName(owner);
+            final boolean isAbstract = Model.getFacade().isAbstract(owner);
+            final boolean isStatic =
+                Model.getFacade().isAFeature(owner) && Model.getFacade().isStatic(owner);
+            
+            Runnable doWorkRunnable = new Runnable() {
+                public void run() {
+                        NotationTextEvent event = new UmlNotationTextEvent(
+                                name, 
+                                isAbstract, 
+                                isStatic, 
+                                false);
+                        notatedItem.notationTextChanged(event);
+                }  
+            };
+            SwingUtilities.invokeLater(doWorkRunnable);
+        } catch (InvalidElementException e) {
+        }
+    }
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotatedItem.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotatedItem.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotatedItem.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotatedItem.java	2012-12-28 10:30:46-0800
@@ -1,23 +1,23 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-public interface NotatedItem {

-

-    void notationTextChanged(NotationTextEvent event);

-    Object getMetaType();

-    Object getOwner();

-    NotationType getNotationType();

-    NotationLanguage getNotationLanguage();

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+public interface NotatedItem {
+
+    void notationTextChanged(NotationTextEvent event);
+    Object getMetaType();
+    Object getOwner();
+    NotationType getNotationType();
+    NotationLanguage getNotationLanguage();
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationLanguage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationLanguage.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationLanguage.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationLanguage.java	2012-12-28 10:30:46-0800
@@ -1,33 +1,33 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-public interface NotationLanguage {

-

-    /**

-     * Get the name the language

-     * @return the language name

-     */

-    public String getName();

-    

-    

-    /**

-     * Create the NotationText instance for the given NotatedItem.

-     * The implementation determines the actual instance to create

-     * depending on the met type and notation type of the NotatedItem.

-     * @param item the NotatedItem

-     * @return the NotationText instance

-     */

-    public NotationText createNotationText(NotatedItem item);

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+public interface NotationLanguage {
+
+    /**
+     * Get the name the language
+     * @return the language name
+     */
+    public String getName();
+    
+    
+    /**
+     * Create the NotationText instance for the given NotatedItem.
+     * The implementation determines the actual instance to create
+     * depending on the met type and notation type of the NotatedItem.
+     * @param item the NotatedItem
+     * @return the NotationText instance
+     */
+    public NotationText createNotationText(NotatedItem item);
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationManager.java	2012-12-28 10:30:46-0800
@@ -1,60 +1,60 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-import java.util.ArrayList;

-import java.util.List;

-

-/**

- * The singleton manager for notations.

- * All notation languages and objects requesting notation events register here.

- *

- * @author Bob Tarling

- */

-public final class NotationManager {

-

-    /**

-     * The singleton instance.

-     */

-    private static NotationManager instance = new NotationManager();

-    

-    private List<NotationLanguage> languages =

-        new ArrayList<NotationLanguage>();

-    private List<NotatedItem> items =

-        new ArrayList<NotatedItem>();

-    

-    private NotationManager() {

-    }

-

-    public static NotationManager getInstance() {

-        return instance;

-    }

-

-    public void addNotationLanguage(NotationLanguage language) {

-        languages.add(language);

-    }

-    

-    public void addListener(NotatedItem item) {

-        NotationLanguage nl = item.getNotationLanguage();

-        if (nl == null) {

-            nl = languages.get(0);

-        }

-        nl.createNotationText(item);

-        items.add(item);

-    }

-    

-    public void removeListener(NotatedItem item) {

-        items.remove(item);

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The singleton manager for notations.
+ * All notation languages and objects requesting notation events register here.
+ *
+ * @author Bob Tarling
+ */
+public final class NotationManager {
+
+    /**
+     * The singleton instance.
+     */
+    private static NotationManager instance = new NotationManager();
+    
+    private List<NotationLanguage> languages =
+        new ArrayList<NotationLanguage>();
+    private List<NotatedItem> items =
+        new ArrayList<NotatedItem>();
+    
+    private NotationManager() {
+    }
+
+    public static NotationManager getInstance() {
+        return instance;
+    }
+
+    public void addNotationLanguage(NotationLanguage language) {
+        languages.add(language);
+    }
+    
+    public void addListener(NotatedItem item) {
+        NotationLanguage nl = item.getNotationLanguage();
+        if (nl == null) {
+            nl = languages.get(0);
+        }
+        nl.createNotationText(item);
+        items.add(item);
+    }
+    
+    public void removeListener(NotatedItem item) {
+        items.remove(item);
+    }
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationModule.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationModule.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationModule.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationModule.java	2012-12-28 10:30:46-0800
@@ -1,59 +1,59 @@
-/* $Id$

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Michiel van der Wulp

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.notation2;

-

-import org.apache.log4j.Logger;

-import org.argouml.moduleloader.ModuleInterface;

-

-

-public class NotationModule implements ModuleInterface {

-

-    private static final Logger LOG = Logger

-            .getLogger(NotationModule.class);

-

-    public boolean enable() {

-        

-        LOG.info("Notation Module enabled.");

-        NotationLanguage lang = new UmlNotationLanguage();

-        NotationManager.getInstance().addNotationLanguage(lang);

-        

-        return true;

-    }

-

-    public boolean disable() {

-

-        LOG.info("Notation Module disabled.");

-        return true;

-    }

-

-    public String getName() {

-        return "ArgoUML-Notation";

-    }

-

-    public String getInfo(int type) {

-        switch (type) {

-        case DESCRIPTION:

-            return "The notation subsystem";

-        case AUTHOR:

-            return "The ArgoUML Team";

-        case VERSION:

-            return "0.34";

-        case DOWNLOADSITE:

-            return "http://argouml.tigris.org";

-        default:

-            return null;

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Michiel van der Wulp
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.notation2;
+
+import org.apache.log4j.Logger;
+import org.argouml.moduleloader.ModuleInterface;
+
+
+public class NotationModule implements ModuleInterface {
+
+    private static final Logger LOG = Logger
+            .getLogger(NotationModule.class);
+
+    public boolean enable() {
+        
+        LOG.info("Notation Module enabled.");
+        NotationLanguage lang = new UmlNotationLanguage();
+        NotationManager.getInstance().addNotationLanguage(lang);
+        
+        return true;
+    }
+
+    public boolean disable() {
+
+        LOG.info("Notation Module disabled.");
+        return true;
+    }
+
+    public String getName() {
+        return "ArgoUML-Notation";
+    }
+
+    public String getInfo(int type) {
+        switch (type) {
+        case DESCRIPTION:
+            return "The notation subsystem";
+        case AUTHOR:
+            return "The ArgoUML Team";
+        case VERSION:
+            return "0.34";
+        case DOWNLOADSITE:
+            return "http://argouml.tigris.org";
+        default:
+            return null;
+        }
+    }
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationText.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationText.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationText.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationText.java	2012-12-28 10:30:46-0800
@@ -1,20 +1,20 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-public interface NotationText {

-

-    NotationType getNotationType();

-    Object getMetaType();

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+public interface NotationText {
+
+    NotationType getNotationType();
+    Object getMetaType();
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationTextEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationTextEvent.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationTextEvent.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationTextEvent.java	2012-12-28 10:30:46-0800
@@ -1,42 +1,42 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-/**

- * The event fired whenever notation text should change display

- *

- * @author Bob Tarling

- */

-public interface NotationTextEvent {

-    /**

-     * Provides the new text to display

-     * @return text

-     */

-    String getText();

-    /**

-     * Indicate if the text should be underlined

-     * @return text

-     */

-    boolean isUnderlined();

-    /**

-     * Indicate if the text should be underlined

-     * @return text

-     */

-    boolean isItalic();

-    /**

-     * Indicate if the text should be bold

-     * @return text

-     */

-    boolean isBold();

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+/**
+ * The event fired whenever notation text should change display
+ *
+ * @author Bob Tarling
+ */
+public interface NotationTextEvent {
+    /**
+     * Provides the new text to display
+     * @return text
+     */
+    String getText();
+    /**
+     * Indicate if the text should be underlined
+     * @return text
+     */
+    boolean isUnderlined();
+    /**
+     * Indicate if the text should be underlined
+     * @return text
+     */
+    boolean isItalic();
+    /**
+     * Indicate if the text should be bold
+     * @return text
+     */
+    boolean isBold();
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationType.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationType.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationType.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/NotationType.java	2012-12-28 10:30:46-0800
@@ -1,24 +1,24 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-/**

- * The type of notation

- *

- * @author Bob Tarling

- */

-public enum NotationType {

-    NAME,

-    MULTIPLICITY

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+/**
+ * The type of notation
+ *
+ * @author Bob Tarling
+ */
+public enum NotationType {
+    NAME,
+    MULTIPLICITY
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/StereotypeUmlNotation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/StereotypeUmlNotation.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/StereotypeUmlNotation.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/StereotypeUmlNotation.java	2012-12-28 10:30:46-0800
@@ -1,62 +1,62 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyChangeListener;

-

-import javax.swing.SwingUtilities;

-

-import org.argouml.model.InvalidElementException;

-import org.argouml.model.Model;

-

-public class StereotypeUmlNotation implements NotationText,

-        PropertyChangeListener {

-

-    final private NotatedItem notatedItem;

-

-    StereotypeUmlNotation(NotatedItem item) {

-        notatedItem = item;

-    }

-    

-    public Object getMetaType() {

-        return notatedItem.getMetaType();

-    }

-

-    public NotationType getNotationType() {

-        return notatedItem.getNotationType();

-    }

-

-    public void propertyChange(PropertyChangeEvent arg0) {

-        try {

-            final Object owner = notatedItem.getOwner();

-            final String name = "<<" + Model.getFacade().getName(owner) + ">>";

-            final boolean isAbstract = Model.getFacade().isAbstract(owner);

-            

-            Runnable doWorkRunnable = new Runnable() {

-                public void run() {

-                        NotationTextEvent event = new UmlNotationTextEvent(

-                                name, 

-                                isAbstract, 

-                                false, 

-                                false);

-                        notatedItem.notationTextChanged(event);

-                }  

-            };

-            SwingUtilities.invokeLater(doWorkRunnable);

-        } catch (InvalidElementException e) {

-        }

-    }

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.SwingUtilities;
+
+import org.argouml.model.InvalidElementException;
+import org.argouml.model.Model;
+
+public class StereotypeUmlNotation implements NotationText,
+        PropertyChangeListener {
+
+    final private NotatedItem notatedItem;
+
+    StereotypeUmlNotation(NotatedItem item) {
+        notatedItem = item;
+    }
+    
+    public Object getMetaType() {
+        return notatedItem.getMetaType();
+    }
+
+    public NotationType getNotationType() {
+        return notatedItem.getNotationType();
+    }
+
+    public void propertyChange(PropertyChangeEvent arg0) {
+        try {
+            final Object owner = notatedItem.getOwner();
+            final String name = "<<" + Model.getFacade().getName(owner) + ">>";
+            final boolean isAbstract = Model.getFacade().isAbstract(owner);
+            
+            Runnable doWorkRunnable = new Runnable() {
+                public void run() {
+                        NotationTextEvent event = new UmlNotationTextEvent(
+                                name, 
+                                isAbstract, 
+                                false, 
+                                false);
+                        notatedItem.notationTextChanged(event);
+                }  
+            };
+            SwingUtilities.invokeLater(doWorkRunnable);
+        } catch (InvalidElementException e) {
+        }
+    }
+
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationLanguage.java	2012-12-28 10:30:46-0800
@@ -1,44 +1,44 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-import java.beans.PropertyChangeListener;

-

-import org.argouml.model.Model;

-

-class UmlNotationLanguage implements NotationLanguage {

-

-    public String getName() {

-        return "UML";

-    }

-

-    public NotationText createNotationText(NotatedItem item) {

-        

-        final NotationText nt;

-        if (Model.getCoreHelper().isSubType(

-                Model.getMetaTypes().getStereotype(), item.getMetaType())) {

-            nt = new StereotypeUmlNotation(item);

-        } else {

-            nt = new NameUmlNotation(item);

-        }

-        Model.getPump().addModelEventListener(

-                (PropertyChangeListener) nt, item.getOwner());

-        

-        // As soon as we've created a notation and have registered it listener

-        // force an event to go to the listener so it draws for the first time.

-        ((PropertyChangeListener) nt).propertyChange(null);

-        

-        return nt;

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+import java.beans.PropertyChangeListener;
+
+import org.argouml.model.Model;
+
+class UmlNotationLanguage implements NotationLanguage {
+
+    public String getName() {
+        return "UML";
+    }
+
+    public NotationText createNotationText(NotatedItem item) {
+        
+        final NotationText nt;
+        if (Model.getCoreHelper().isSubType(
+                Model.getMetaTypes().getStereotype(), item.getMetaType())) {
+            nt = new StereotypeUmlNotation(item);
+        } else {
+            nt = new NameUmlNotation(item);
+        }
+        Model.getPump().addModelEventListener(
+                (PropertyChangeListener) nt, item.getOwner());
+        
+        // As soon as we've created a notation and have registered it listener
+        // force an event to go to the listener so it draws for the first time.
+        ((PropertyChangeListener) nt).propertyChange(null);
+        
+        return nt;
+    }
+}

Modified: trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationTextEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationTextEvent.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationTextEvent.java	(original)
+++ trunk/src/argouml-core-notation/src/org/argouml/notation2/UmlNotationTextEvent.java	2012-12-28 10:30:46-0800
@@ -1,49 +1,49 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.notation2;

-

-class UmlNotationTextEvent implements NotationTextEvent {

-

-    private final String text;

-    private final boolean underlined;

-    private final boolean italic;

-    private final boolean bold;

-    

-    UmlNotationTextEvent(

-            final String text,

-            final boolean italic,

-            final boolean underlined,

-            final boolean bold) {

-        this.text = text;

-        this.italic = italic;

-        this.underlined = underlined;

-        this.bold = bold;

-    }

-    

-    public String getText() {

-        return text;

-    }

-

-    public boolean isUnderlined() {

-        return underlined;

-    }

-

-    public boolean isItalic() {

-        return italic;

-    }

-

-    public boolean isBold() {

-        return bold;

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.notation2;
+
+class UmlNotationTextEvent implements NotationTextEvent {
+
+    private final String text;
+    private final boolean underlined;
+    private final boolean italic;
+    private final boolean bold;
+    
+    UmlNotationTextEvent(
+            final String text,
+            final boolean italic,
+            final boolean underlined,
+            final boolean bold) {
+        this.text = text;
+        this.italic = italic;
+        this.underlined = underlined;
+        this.bold = bold;
+    }
+    
+    public String getText() {
+        return text;
+    }
+
+    public boolean isUnderlined() {
+        return underlined;
+    }
+
+    public boolean isItalic() {
+        return italic;
+    }
+
+    public boolean isBold() {
+        return bold;
+    }
+}

Modified: trunk/src/argouml-core-transformer/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-transformer/build.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-transformer/build.properties	(original)
+++ trunk/src/argouml-core-transformer/build.properties	2012-12-28 10:30:46-0800
@@ -1,6 +1,6 @@
-custom = true

-source.. = src/,\

-           tests/

-bin.includes = META-INF/,\

-               .,\

-               plugin.properties

+custom = true
+source.. = src/,\
+           tests/
+bin.includes = META-INF/,\
+               .,\
+               plugin.properties

Modified: trunk/src/argouml-core-transformer/plugin.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-transformer/plugin.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-transformer/plugin.properties	(original)
+++ trunk/src/argouml-core-transformer/plugin.properties	2012-12-28 10:30:46-0800
@@ -1,3 +1,3 @@
-#Properties file for argouml-core-transformer

-pluginProvider = The ArgoUML team

+#Properties file for argouml-core-transformer
+pluginProvider = The ArgoUML team
 pluginName = ArgoUML Transformer Subsystem
\ No newline at end of file

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/CheckBoxData.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/CheckBoxData.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/CheckBoxData.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/CheckBoxData.java	2012-12-28 10:30:46-0800
@@ -1,39 +1,39 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.core.propertypanels.model;

-

-public class CheckBoxData {

-    

-    private Class<?> type;

-    private String propertyName;

-    

-    public CheckBoxData(

-            final Class<?> type,

-            final String propertyName) {

-        this.type = type;

-        this.propertyName = propertyName;

-    }

-    

-    public Class<?> getType() {

-        return type;

-    }

-

-    public String getPropertyName() {

-        return propertyName;

-    }

-

-    public String getLabel() {

-        return propertyName;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.core.propertypanels.model;
+
+public class CheckBoxData {
+    
+    private Class<?> type;
+    private String propertyName;
+    
+    public CheckBoxData(
+            final Class<?> type,
+            final String propertyName) {
+        this.type = type;
+        this.propertyName = propertyName;
+    }
+    
+    public Class<?> getType() {
+        return type;
+    }
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    public String getLabel() {
+        return propertyName;
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/ControlData.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/ControlData.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/ControlData.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/ControlData.java	2012-12-28 10:30:46-0800
@@ -1,74 +1,74 @@
-/* $Id: $

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.model;

-

-import java.util.ArrayList;

-import java.util.Collections;

-import java.util.List;

-

-public class ControlData {

-    

-    private String controlType;

-    private String propertyName;

-    private String label;

-    

-    private List<Class<?>> types = new ArrayList<Class<?>>();

-    private List<CheckBoxData> checkboxes = new ArrayList<CheckBoxData>();

-    

-    public ControlData(

-            final String controlType,

-            final String propertyName,

-            final String label) {

-        this.controlType = controlType;

-        this.propertyName = propertyName;

-        

-        if (label != null && label.length() > 0) {

-            this.label = label;

-        } else {

-            this.label = "label." + propertyName.toLowerCase();

-        }

-    }

-    

-    public String getControlType() {

-        return controlType;

-    }

-

-    public String getPropertyName() {

-        return propertyName;

-    }

-    

-    public String getLabel() {

-    	return label;

-    }

-    

-    public List<CheckBoxData> getCheckboxes() {

-        return Collections.unmodifiableList(checkboxes);

-    }

-    

-    public List<Class<?>> getTypes() {

-        return Collections.unmodifiableList(types);

-    }

-    

-    public Class<?> getType() {

-        return types.get(0);

-    }

-    

-    public void addType(Class<?> type) {

-        types.add(type);

-    }

-    

-    public void addCheckbox(CheckBoxData child) {

-        checkboxes.add(child);

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class ControlData {
+    
+    private String controlType;
+    private String propertyName;
+    private String label;
+    
+    private List<Class<?>> types = new ArrayList<Class<?>>();
+    private List<CheckBoxData> checkboxes = new ArrayList<CheckBoxData>();
+    
+    public ControlData(
+            final String controlType,
+            final String propertyName,
+            final String label) {
+        this.controlType = controlType;
+        this.propertyName = propertyName;
+        
+        if (label != null && label.length() > 0) {
+            this.label = label;
+        } else {
+            this.label = "label." + propertyName.toLowerCase();
+        }
+    }
+    
+    public String getControlType() {
+        return controlType;
+    }
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+    
+    public String getLabel() {
+    	return label;
+    }
+    
+    public List<CheckBoxData> getCheckboxes() {
+        return Collections.unmodifiableList(checkboxes);
+    }
+    
+    public List<Class<?>> getTypes() {
+        return Collections.unmodifiableList(types);
+    }
+    
+    public Class<?> getType() {
+        return types.get(0);
+    }
+    
+    public void addType(Class<?> type) {
+        types.add(type);
+    }
+    
+    public void addCheckbox(CheckBoxData child) {
+        checkboxes.add(child);
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/IconIdentifiable.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/IconIdentifiable.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/IconIdentifiable.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/IconIdentifiable.java	2012-12-28 10:30:46-0800
@@ -1,20 +1,20 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.model;

-

-import javax.swing.Icon;

-

-public interface IconIdentifiable {

-	public Icon getIcon();

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.model;
+
+import javax.swing.Icon;
+
+public interface IconIdentifiable {
+	public Icon getIcon();
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/MetaDataCache.java	2012-12-28 10:30:46-0800
@@ -1,204 +1,204 @@
-/* $Id:  $

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.core.propertypanels.model;

-

-import java.io.IOException;

-import java.io.InputStream;

-import java.util.ArrayList;

-import java.util.HashMap;

-import java.util.List;

-import java.util.Map;

-import java.util.StringTokenizer;

-

-import javax.xml.parsers.DocumentBuilder;

-import javax.xml.parsers.DocumentBuilderFactory;

-import javax.xml.parsers.ParserConfigurationException;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.Model;

-import org.w3c.dom.DOMException;

-import org.w3c.dom.Document;

-import org.w3c.dom.Element;

-import org.w3c.dom.Node;

-import org.w3c.dom.NodeList;

-import org.xml.sax.InputSource;

-import org.xml.sax.SAXException;

-

-/**

- * The cache of property panel metadata

- *

- * @author Bob Tarling

- */

-public class MetaDataCache {

-    

-    private static final Logger LOG = Logger.getLogger(MetaDataCache.class);

-    

-    private Map<Class<?>, PanelData> cache =

-        new HashMap<Class<?>, PanelData>();

-    

-    private Map<String, Class<?>> metaTypeByName;

-    private Map<Class<?>, String> nameByMetaType;

-

-    public MetaDataCache() throws Exception {

-        Document doc = getDocument();

-        NodeList nl = doc.getDocumentElement().getChildNodes();

-        for (int i = 0; i < nl.getLength(); ++i) {

-            Node n = nl.item(i);

-            if (n.getNodeName().equals("classes")) {

-        	final int size = n.getChildNodes().getLength();

-        	nameByMetaType = new HashMap<Class<?>, String>(size);

-        	metaTypeByName = new HashMap<String, Class<?>>(size);

-        	populateClassMaps((Element) n, nameByMetaType, metaTypeByName);

-            } else if (n.getNodeName().equals("panels")) {

-        	cache = getPanels((Element) n);

-            }

-        }

-    }

-    

-    public PanelData get(Class<?> clazz) {

-	Class<?>[] interfaces = clazz.getInterfaces();

-	

-	for (Class interfaze : interfaces) {

-	    PanelData pd = cache.get(interfaze);

-	    if (pd != null) {

-		return pd;

-	    }

-	}

-        return null;

-    }

-    

-    private Document getDocument() throws IOException, DOMException, ParserConfigurationException, SAXException {

-        final String filename;

-        if (Model.getFacade().getUmlVersion().charAt(0) == '2') {

-            filename = "org/argouml/core/propertypanels/model/metamodel2.xml";

-        } else {

-            filename = "org/argouml/core/propertypanels/model/metamodel.xml";

-        }

-        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(filename);

-        InputSource inputSource = new InputSource(inputStream);

-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

-        DocumentBuilder db = dbf.newDocumentBuilder();

-        return db.parse(inputSource);

-    }

-    

-    private void populateClassMaps(

-	    final Element classesNode,

-	    final Map<Class<?>, String> nameByMetaType,

-	    final Map<String, Class<?>> metaTypeByName) {

-        final NodeList nl = classesNode.getElementsByTagName("class");

-        for (int i = 0; i < nl.getLength(); ++i) {

-            Node classNode = nl.item(i);

-            String className = classNode.getTextContent();

-            try {

-                final String name = 

-        	    classNode.getAttributes().getNamedItem("name").getNodeValue();

-                Class<?> clazz = Class.forName(className);

-                metaTypeByName.put(name, clazz);

-    	        nameByMetaType.put(clazz, name);

-            } catch (ClassNotFoundException e) {

-        	    LOG.error("Class not found " + className, e);

-            }

-        }

-    }

-    

-    private Map<Class<?>, PanelData> getPanels(Element panelsNode) {

-	

-        final Map<Class<?>, PanelData> map =

-            new HashMap<Class<?>, PanelData>();

-        

-        final NodeList panelNodes = panelsNode.getElementsByTagName("panel");

-        for (int i = 0; i < panelNodes.getLength(); ++i) {

-            

-            Element panelNode = (Element) panelNodes.item(i);

-            final String name = panelNode.getAttribute("name");

-

-            Class<?> clazz = metaTypeByName.get(name);

-

-            if (clazz == null) {

-                LOG.warn("No class name translation found for panel: " + name);

-            } else {

-                final List<Class<?>> newChildTypes =

-                    stringToMetaTypes(panelNode.getAttribute("new-child"));

-                final List<Class<?>> newSiblingTypes =

-                    stringToMetaTypes(panelNode.getAttribute("new-sibling"));

-                

-                final boolean siblingNavigation =

-                    "true".equals(panelNode.getAttribute("navigate-sibling"));

-                

-                final PanelData pm =

-                    new PanelData(clazz, name, newChildTypes, newSiblingTypes, siblingNavigation);

-                map.put(clazz, pm);

-                

-                final NodeList controlNodes =

-                    panelNode.getElementsByTagName("*");

-                for (int j = 0; j < controlNodes.getLength(); ++j) {

-                    Element controlNode = (Element) controlNodes.item(j);

-                    

-                    final String propertyName =

-                	controlNode.getAttribute("name");

-                    final String label = controlNode.getAttribute("label");

-                    

-                    final ControlData controlData =

-                        new ControlData(controlNode.getTagName(), propertyName, label);

-                    

-                    final List<Class<?>> types =

-                	stringToMetaTypes(controlNode.getAttribute("type"));

-                    for (Class<?> metaType : types) {

-                        controlData.addType(metaType);

-                    }

-                    

-                    if (controlNode.getTagName().equals("checkgroup")) {

-                        addCheckboxes(controlData, controlNode);

-                    }

-                    pm.addControlData(controlData);

-                }

-            }

-        }

-	    

-        return map;

-    }

-    

-    /**

-     * Takes as input a string of comma separated metatypes (e.g.

-     * "Class,Interface,Attribute") and converts it to a list of classes of

-     * the appropriate type.

-     * @param typesString

-     * @return 

-     */

-    private List<Class<?>> stringToMetaTypes(String typesString) {

-	List<Class<?>> classes = new ArrayList<Class<?>>();

-        StringTokenizer st = new StringTokenizer(typesString, ",");

-        while (st.hasMoreTokens()) {

-            classes.add(metaTypeByName.get(st.nextToken()));

-        }

-        return classes;

-    }

-    

-    private void addCheckboxes(ControlData controlData, Element controlElement) {

-        final NodeList checkBoxElements =

-            controlElement.getElementsByTagName("checkbox");

-        for (int i = 0; i < checkBoxElements.getLength(); ++i) {

-            Element cbNode = (Element) checkBoxElements.item(i);

-            

-            final String checkBoxType =

-        	cbNode.getAttributes().getNamedItem("type").getNodeValue();

-            final String checkBoxName = 

-    	        cbNode.getAttributes().getNamedItem("name").getNodeValue();

-            

-            CheckBoxData cbd =

-        	new CheckBoxData(metaTypeByName.get(checkBoxType), checkBoxName);

-            controlData.addCheckbox(cbd);

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.core.propertypanels.model;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.Model;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * The cache of property panel metadata
+ *
+ * @author Bob Tarling
+ */
+public class MetaDataCache {
+    
+    private static final Logger LOG = Logger.getLogger(MetaDataCache.class);
+    
+    private Map<Class<?>, PanelData> cache =
+        new HashMap<Class<?>, PanelData>();
+    
+    private Map<String, Class<?>> metaTypeByName;
+    private Map<Class<?>, String> nameByMetaType;
+
+    public MetaDataCache() throws Exception {
+        Document doc = getDocument();
+        NodeList nl = doc.getDocumentElement().getChildNodes();
+        for (int i = 0; i < nl.getLength(); ++i) {
+            Node n = nl.item(i);
+            if (n.getNodeName().equals("classes")) {
+        	final int size = n.getChildNodes().getLength();
+        	nameByMetaType = new HashMap<Class<?>, String>(size);
+        	metaTypeByName = new HashMap<String, Class<?>>(size);
+        	populateClassMaps((Element) n, nameByMetaType, metaTypeByName);
+            } else if (n.getNodeName().equals("panels")) {
+        	cache = getPanels((Element) n);
+            }
+        }
+    }
+    
+    public PanelData get(Class<?> clazz) {
+	Class<?>[] interfaces = clazz.getInterfaces();
+	
+	for (Class interfaze : interfaces) {
+	    PanelData pd = cache.get(interfaze);
+	    if (pd != null) {
+		return pd;
+	    }
+	}
+        return null;
+    }
+    
+    private Document getDocument() throws IOException, DOMException, ParserConfigurationException, SAXException {
+        final String filename;
+        if (Model.getFacade().getUmlVersion().charAt(0) == '2') {
+            filename = "org/argouml/core/propertypanels/model/metamodel2.xml";
+        } else {
+            filename = "org/argouml/core/propertypanels/model/metamodel.xml";
+        }
+        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(filename);
+        InputSource inputSource = new InputSource(inputStream);
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        DocumentBuilder db = dbf.newDocumentBuilder();
+        return db.parse(inputSource);
+    }
+    
+    private void populateClassMaps(
+	    final Element classesNode,
+	    final Map<Class<?>, String> nameByMetaType,
+	    final Map<String, Class<?>> metaTypeByName) {
+        final NodeList nl = classesNode.getElementsByTagName("class");
+        for (int i = 0; i < nl.getLength(); ++i) {
+            Node classNode = nl.item(i);
+            String className = classNode.getTextContent();
+            try {
+                final String name = 
+        	    classNode.getAttributes().getNamedItem("name").getNodeValue();
+                Class<?> clazz = Class.forName(className);
+                metaTypeByName.put(name, clazz);
+    	        nameByMetaType.put(clazz, name);
+            } catch (ClassNotFoundException e) {
+        	    LOG.error("Class not found " + className, e);
+            }
+        }
+    }
+    
+    private Map<Class<?>, PanelData> getPanels(Element panelsNode) {
+	
+        final Map<Class<?>, PanelData> map =
+            new HashMap<Class<?>, PanelData>();
+        
+        final NodeList panelNodes = panelsNode.getElementsByTagName("panel");
+        for (int i = 0; i < panelNodes.getLength(); ++i) {
+            
+            Element panelNode = (Element) panelNodes.item(i);
+            final String name = panelNode.getAttribute("name");
+
+            Class<?> clazz = metaTypeByName.get(name);
+
+            if (clazz == null) {
+                LOG.warn("No class name translation found for panel: " + name);
+            } else {
+                final List<Class<?>> newChildTypes =
+                    stringToMetaTypes(panelNode.getAttribute("new-child"));
+                final List<Class<?>> newSiblingTypes =
+                    stringToMetaTypes(panelNode.getAttribute("new-sibling"));
+                
+                final boolean siblingNavigation =
+                    "true".equals(panelNode.getAttribute("navigate-sibling"));
+                
+                final PanelData pm =
+                    new PanelData(clazz, name, newChildTypes, newSiblingTypes, siblingNavigation);
+                map.put(clazz, pm);
+                
+                final NodeList controlNodes =
+                    panelNode.getElementsByTagName("*");
+                for (int j = 0; j < controlNodes.getLength(); ++j) {
+                    Element controlNode = (Element) controlNodes.item(j);
+                    
+                    final String propertyName =
+                	controlNode.getAttribute("name");
+                    final String label = controlNode.getAttribute("label");
+                    
+                    final ControlData controlData =
+                        new ControlData(controlNode.getTagName(), propertyName, label);
+                    
+                    final List<Class<?>> types =
+                	stringToMetaTypes(controlNode.getAttribute("type"));
+                    for (Class<?> metaType : types) {
+                        controlData.addType(metaType);
+                    }
+                    
+                    if (controlNode.getTagName().equals("checkgroup")) {
+                        addCheckboxes(controlData, controlNode);
+                    }
+                    pm.addControlData(controlData);
+                }
+            }
+        }
+	    
+        return map;
+    }
+    
+    /**
+     * Takes as input a string of comma separated metatypes (e.g.
+     * "Class,Interface,Attribute") and converts it to a list of classes of
+     * the appropriate type.
+     * @param typesString
+     * @return 
+     */
+    private List<Class<?>> stringToMetaTypes(String typesString) {
+	List<Class<?>> classes = new ArrayList<Class<?>>();
+        StringTokenizer st = new StringTokenizer(typesString, ",");
+        while (st.hasMoreTokens()) {
+            classes.add(metaTypeByName.get(st.nextToken()));
+        }
+        return classes;
+    }
+    
+    private void addCheckboxes(ControlData controlData, Element controlElement) {
+        final NodeList checkBoxElements =
+            controlElement.getElementsByTagName("checkbox");
+        for (int i = 0; i < checkBoxElements.getLength(); ++i) {
+            Element cbNode = (Element) checkBoxElements.item(i);
+            
+            final String checkBoxType =
+        	cbNode.getAttributes().getNamedItem("type").getNodeValue();
+            final String checkBoxName = 
+    	        cbNode.getAttributes().getNamedItem("name").getNodeValue();
+            
+            CheckBoxData cbd =
+        	new CheckBoxData(metaTypeByName.get(checkBoxType), checkBoxName);
+            controlData.addCheckbox(cbd);
+        }
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/Named.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/Named.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/Named.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/Named.java	2012-12-28 10:30:46-0800
@@ -1,18 +1,18 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.model;

-

-public interface Named {

-    String getName();

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.model;
+
+public interface Named {
+    String getName();
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/PanelData.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/PanelData.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/PanelData.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/PanelData.java	2012-12-28 10:30:46-0800
@@ -1,72 +1,72 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.core.propertypanels.model;

-

-import java.util.Collection;

-import java.util.Collections;

-import java.util.LinkedList;

-import java.util.List;

-

-public class PanelData  {

-    

-    private final Class<?> clazz;

-    private final List<ControlData> properties;

-    private final String name;

-    private final Collection<Class<?>> newChildElements;

-    private final Collection<Class<?>> newSiblingElements;

-    private final boolean siblingNavigation;

-    

-    public PanelData(

-	    final Class<?> clazz,

-	    final String name,

-	    final Collection<Class<?>> newChildElements,

-	    final Collection<Class<?>> newSiblingElements,

-	    final boolean siblingNavigation) {

-	

-        this.clazz = clazz;

-        this.name = name;

-        properties = new LinkedList<ControlData>();

-        this.newChildElements = newChildElements;

-        this.newSiblingElements = newSiblingElements;

-        this.siblingNavigation = siblingNavigation;

-    }

-    

-    public boolean isSiblingNavigation() {

-        return siblingNavigation;

-    }

-

-    public void addControlData(ControlData record) {

-        properties.add(record);

-    }

-    

-    public Class<?> getClazz() {

-        return clazz;

-    }    

-    

-    public String getName() {

-	return name;

-    }

-    

-    public List<ControlData> getProperties () {

-        return Collections.unmodifiableList(properties);

-    }

-

-    public Collection<Class<?>> getNewChildElements() {

-        return newChildElements;

-    }

-

-    public Collection<Class<?>> getNewSiblingElements() {

-        return newSiblingElements;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.core.propertypanels.model;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+public class PanelData  {
+    
+    private final Class<?> clazz;
+    private final List<ControlData> properties;
+    private final String name;
+    private final Collection<Class<?>> newChildElements;
+    private final Collection<Class<?>> newSiblingElements;
+    private final boolean siblingNavigation;
+    
+    public PanelData(
+	    final Class<?> clazz,
+	    final String name,
+	    final Collection<Class<?>> newChildElements,
+	    final Collection<Class<?>> newSiblingElements,
+	    final boolean siblingNavigation) {
+	
+        this.clazz = clazz;
+        this.name = name;
+        properties = new LinkedList<ControlData>();
+        this.newChildElements = newChildElements;
+        this.newSiblingElements = newSiblingElements;
+        this.siblingNavigation = siblingNavigation;
+    }
+    
+    public boolean isSiblingNavigation() {
+        return siblingNavigation;
+    }
+
+    public void addControlData(ControlData record) {
+        properties.add(record);
+    }
+    
+    public Class<?> getClazz() {
+        return clazz;
+    }    
+    
+    public String getName() {
+	return name;
+    }
+    
+    public List<ControlData> getProperties () {
+        return Collections.unmodifiableList(properties);
+    }
+
+    public Collection<Class<?>> getNewChildElements() {
+        return newChildElements;
+    }
+
+    public Collection<Class<?>> getNewSiblingElements() {
+        return newSiblingElements;
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/AbstractActionAddModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/AbstractActionAddModelElement.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/AbstractActionAddModelElement.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/AbstractActionAddModelElement.java	2012-12-28 10:30:46-0800
@@ -1,200 +1,200 @@
-/* $Id: AbstractActionAddModelElement2.java 17881 2010-01-12 21:09:28Z linus $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    bobtarling

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-import java.util.Collection;

-import java.util.List;

-

-import javax.swing.Action;

-import javax.swing.Icon;

-import javax.swing.JOptionPane;

-

-import org.argouml.i18n.Translator;

-import org.argouml.kernel.UmlModelMutator;

-import org.argouml.util.ArgoFrame;

-import org.argouml.ui.UndoableAction;

-import org.argouml.uml.ui.UMLAddDialog;

-

-/**

- * Abstract action that is the parent to all add actions that add the

- * modelelements via the UMLAddDialog.

- * 

- * @since Oct 2, 2002

- * @author [email protected]

- */

-@UmlModelMutator

-public abstract class AbstractActionAddModelElement extends UndoableAction {

-

-    private Object target;

-    private boolean multiSelect = true;

-    private boolean exclusive = true;

-

-    /**

-     * Construct an action to add a model element to some list.

-     */

-    protected AbstractActionAddModelElement() {

-        super(Translator.localize("menu.popup.add-modelelement"), null);

-        // Set the tooltip string:

-        putValue(Action.SHORT_DESCRIPTION, 

-                Translator.localize("menu.popup.add-modelelement"));

-    }

-

-    /**

-     * Construct a named action to add a model element to some list.

-     * @param name name for action

-     */

-    public AbstractActionAddModelElement(String name) {

-        super(name);

-    }

-

-    /**

-     * Construct an action to add a model element to some list with the

-     * given name and icon.

-     * @param name name for action

-     * @param icon icon for action

-     */

-    public AbstractActionAddModelElement(String name, Icon icon) {

-        super(name, icon);

-    }

-    

-

-    /*

-     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

-     */

-    @Override

-    public void actionPerformed(ActionEvent e) {

-        super.actionPerformed(e);

-        UMLAddDialog dialog =

-            new UMLAddDialog(getChoices(), getSelected(), getDialogTitle(),

-                             isMultiSelect(),

-                             isExclusive());

-        int result = dialog.showDialog(ArgoFrame.getFrame());

-        if (result == JOptionPane.OK_OPTION) {

-            doIt(dialog.getSelected());

-        }

-    }

-    

-    /**

-     * Returns the choices the user has in the UMLAddDialog. The choices are

-     * depicted on the left side of the UMLAddDialog (sorry Arabic users) and

-     * can be moved via the buttons on the dialog to the right side. On the

-     * right side are the selected modelelements.

-     * @return List of choices

-     */

-    protected abstract List getChoices();

-

-    

-    /**

-     * The modelelements already selected BEFORE the dialog is shown.

-     * @return List of model elements

-     */

-    protected abstract List getSelected();

-

-    /**

-     * The action that has to be done by ArgoUml after the user clicks ok in the

-     * UMLAddDialog.

-     * @param selected The choices the user has selected in the UMLAddDialog

-     */

-    protected abstract void doIt(Collection selected);

-

-    /*

-     * @see javax.swing.Action#isEnabled()

-     */

-    @Override

-    public boolean isEnabled() {

-        return !getChoices().isEmpty();

-    }

-    

-    

-    /**

-     * Returns the UML model target.

-     * @return UML ModelElement

-     */

-    protected Object getTarget() {

-        return target;

-    }

-

-    /**

-     * Sets the UML model target.

-     * @param theTarget The target to set

-     */

-    public void setTarget(Object theTarget) {

-        target = theTarget;

-    }

-

-    /**

-     * Returns the title of the dialog.

-     * @return String

-     */

-    protected abstract String getDialogTitle();

-

-    /**

-     * Returns the exclusive.

-     * @return boolean

-     */

-    public boolean isExclusive() {

-        return exclusive;

-    }

-

-    /**

-     * Returns the multiSelect.

-     * @return boolean

-     */

-    public boolean isMultiSelect() {

-        return multiSelect;

-    }

-

-    /**

-     * Sets the exclusive.

-     * @param theExclusive The exclusive to set

-     */

-    public void setExclusive(boolean theExclusive) {

-        exclusive = theExclusive;

-    }

-

-    /**

-     * Sets the multiSelect.

-     * @param theMultiSelect The multiSelect to set

-     */

-    public void setMultiSelect(boolean theMultiSelect) {

-        multiSelect = theMultiSelect;

-    }

-

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    bobtarling
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.JOptionPane;
+
+import org.argouml.i18n.Translator;
+import org.argouml.kernel.UmlModelMutator;
+import org.argouml.util.ArgoFrame;
+import org.argouml.ui.UndoableAction;
+import org.argouml.uml.ui.UMLAddDialog;
+
+/**
+ * Abstract action that is the parent to all add actions that add the
+ * modelelements via the UMLAddDialog.
+ * 
+ * @since Oct 2, 2002
+ * @author [email protected]
+ */
+@UmlModelMutator
+public abstract class AbstractActionAddModelElement extends UndoableAction {
+
+    private Object target;
+    private boolean multiSelect = true;
+    private boolean exclusive = true;
+
+    /**
+     * Construct an action to add a model element to some list.
+     */
+    protected AbstractActionAddModelElement() {
+        super(Translator.localize("menu.popup.add-modelelement"), null);
+        // Set the tooltip string:
+        putValue(Action.SHORT_DESCRIPTION, 
+                Translator.localize("menu.popup.add-modelelement"));
+    }
+
+    /**
+     * Construct a named action to add a model element to some list.
+     * @param name name for action
+     */
+    public AbstractActionAddModelElement(String name) {
+        super(name);
+    }
+
+    /**
+     * Construct an action to add a model element to some list with the
+     * given name and icon.
+     * @param name name for action
+     * @param icon icon for action
+     */
+    public AbstractActionAddModelElement(String name, Icon icon) {
+        super(name, icon);
+    }
+    
+
+    /*
+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+     */
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        super.actionPerformed(e);
+        UMLAddDialog dialog =
+            new UMLAddDialog(getChoices(), getSelected(), getDialogTitle(),
+                             isMultiSelect(),
+                             isExclusive());
+        int result = dialog.showDialog(ArgoFrame.getFrame());
+        if (result == JOptionPane.OK_OPTION) {
+            doIt(dialog.getSelected());
+        }
+    }
+    
+    /**
+     * Returns the choices the user has in the UMLAddDialog. The choices are
+     * depicted on the left side of the UMLAddDialog (sorry Arabic users) and
+     * can be moved via the buttons on the dialog to the right side. On the
+     * right side are the selected modelelements.
+     * @return List of choices
+     */
+    protected abstract List getChoices();
+
+    
+    /**
+     * The modelelements already selected BEFORE the dialog is shown.
+     * @return List of model elements
+     */
+    protected abstract List getSelected();
+
+    /**
+     * The action that has to be done by ArgoUml after the user clicks ok in the
+     * UMLAddDialog.
+     * @param selected The choices the user has selected in the UMLAddDialog
+     */
+    protected abstract void doIt(Collection selected);
+
+    /*
+     * @see javax.swing.Action#isEnabled()
+     */
+    @Override
+    public boolean isEnabled() {
+        return !getChoices().isEmpty();
+    }
+    
+    
+    /**
+     * Returns the UML model target.
+     * @return UML ModelElement
+     */
+    protected Object getTarget() {
+        return target;
+    }
+
+    /**
+     * Sets the UML model target.
+     * @param theTarget The target to set
+     */
+    public void setTarget(Object theTarget) {
+        target = theTarget;
+    }
+
+    /**
+     * Returns the title of the dialog.
+     * @return String
+     */
+    protected abstract String getDialogTitle();
+
+    /**
+     * Returns the exclusive.
+     * @return boolean
+     */
+    public boolean isExclusive() {
+        return exclusive;
+    }
+
+    /**
+     * Returns the multiSelect.
+     * @return boolean
+     */
+    public boolean isMultiSelect() {
+        return multiSelect;
+    }
+
+    /**
+     * Sets the exclusive.
+     * @param theExclusive The exclusive to set
+     */
+    public void setExclusive(boolean theExclusive) {
+        exclusive = theExclusive;
+    }
+
+    /**
+     * Sets the multiSelect.
+     * @param theMultiSelect The multiSelect to set
+     */
+    public void setMultiSelect(boolean theMultiSelect) {
+        multiSelect = theMultiSelect;
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/Expandable.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/Expandable.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/Expandable.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/Expandable.java	2012-12-28 10:30:46-0800
@@ -1,31 +1,31 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import javax.swing.JComponent;

-

-/**

- * An interface for components that have the possibility of being expanded and

- * shrunk.

- * Not all components that implement this interface can actually be expanded,

- * they only have the potential to do so. isExpandable must also return true.

- *

- * @author Bob Tarling

- */

-interface Expandable {

-    boolean isExpandable();

-    boolean isExpanded();

-    void setExpanded(boolean expanded);

-    JComponent getExpansion();

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import javax.swing.JComponent;
+
+/**
+ * An interface for components that have the possibility of being expanded and
+ * shrunk.
+ * Not all components that implement this interface can actually be expanded,
+ * they only have the potential to do so. isExpandable must also return true.
+ *
+ * @author Bob Tarling
+ */
+interface Expandable {
+    boolean isExpandable();
+    boolean isExpanded();
+    void setExpanded(boolean expanded);
+    JComponent getExpansion();
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateNextAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateNextAction.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateNextAction.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateNextAction.java	2012-12-28 10:30:46-0800
@@ -1,40 +1,40 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.util.List;

-

-/**

- * This action changes the target to the owning model element

- * of the given element.

- *

- * @author Bob Tarling

- */

-class NavigateNextAction extends NavigateSiblingAction {

-

-    public NavigateNextAction(final Object modelElement) {

-        super(modelElement, "action.navigate-forward");

-    }

-    

-    protected Object getTargetSibling() {

-        List list = getAllSiblings();

-        if (list != null) {

-            final int posn = list.indexOf(modelElement);

-            if (posn >= 0 && posn < list.size() - 1) {

-                return list.get(posn + 1);

-            }

-        }

-        return null;

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.util.List;
+
+/**
+ * This action changes the target to the owning model element
+ * of the given element.
+ *
+ * @author Bob Tarling
+ */
+class NavigateNextAction extends NavigateSiblingAction {
+
+    public NavigateNextAction(final Object modelElement) {
+        super(modelElement, "action.navigate-forward");
+    }
+    
+    protected Object getTargetSibling() {
+        List list = getAllSiblings();
+        if (list != null) {
+            final int posn = list.indexOf(modelElement);
+            if (posn >= 0 && posn < list.size() - 1) {
+                return list.get(posn + 1);
+            }
+        }
+        return null;
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigatePreviousAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigatePreviousAction.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigatePreviousAction.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigatePreviousAction.java	2012-12-28 10:30:46-0800
@@ -1,40 +1,40 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.util.List;

-

-/**

- * This action changes the target to the owning model element

- * of the given element.

- *

- * @author Bob Tarling

- */

-class NavigatePreviousAction extends NavigateSiblingAction {

-

-    public NavigatePreviousAction(Object modelElement) {

-    	super(modelElement, "action.navigate-back");

-    }

-    

-    protected Object getTargetSibling() {

-        List list = getAllSiblings();

-        if (list != null) {

-            final int posn = list.indexOf(modelElement);

-            if (posn > 0) {

-                return list.get(posn - 1);

-            }

-        }

-        return null;

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.util.List;
+
+/**
+ * This action changes the target to the owning model element
+ * of the given element.
+ *
+ * @author Bob Tarling
+ */
+class NavigatePreviousAction extends NavigateSiblingAction {
+
+    public NavigatePreviousAction(Object modelElement) {
+    	super(modelElement, "action.navigate-back");
+    }
+    
+    protected Object getTargetSibling() {
+        List list = getAllSiblings();
+        if (list != null) {
+            final int posn = list.indexOf(modelElement);
+            if (posn > 0) {
+                return list.get(posn - 1);
+            }
+        }
+        return null;
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateSiblingAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateSiblingAction.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateSiblingAction.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateSiblingAction.java	2012-12-28 10:30:46-0800
@@ -1,72 +1,72 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-import java.util.ArrayList;

-import java.util.List;

-

-import javax.swing.AbstractAction;

-

-import org.argouml.application.helpers.ResourceLoaderWrapper;

-import org.argouml.i18n.Translator;

-import org.argouml.model.Model;

-import org.argouml.ui.targetmanager.TargetManager;

-

-/**

- * This action changes the target to the owning model element

- * of the given element.

- *

- * @author Bob Tarling

- */

-abstract class NavigateSiblingAction extends AbstractAction {

-

-    final Object modelElement;

-    

-    public NavigateSiblingAction(Object modelElement, String name) {

-        super(Translator.localize(name),

-                ResourceLoaderWrapper.lookupIcon(name));

-        

-        this.modelElement = modelElement;

-        setEnabled(getTargetSibling() != null);

-    }

-    

-    public void actionPerformed(ActionEvent arg0) {

-        TargetManager.getInstance().setTarget(getTargetSibling());

-    }

-

-    abstract protected Object getTargetSibling();

-    

-    protected List getAllSiblings() {

-        List list = null;

-        final Object owner =

-            Model.getFacade().getModelElementContainer(modelElement);

-        if (Model.getFacade().isAAttribute(modelElement)) {

-            if (Model.getFacade().isAAssociationEnd(Model.getFacade().getOwner(modelElement))) {

-                list = Model.getFacade().getQualifiers(owner);

-            } else {

-                list = Model.getFacade().getAttributes(owner);

-            }

-        } else if (Model.getFacade().isAOperation(modelElement)

-                || Model.getFacade().isAReception(modelElement)) {

-            list = Model.getFacade().getOperationsAndReceptions(owner);

-        } else if (Model.getFacade().isAParameter(modelElement)) {

-            list = Model.getFacade().getParametersList(owner);

-        } else if (Model.getFacade().isAAssociationEnd(modelElement)) {

-            list = new ArrayList(

-            		Model.getFacade().getConnections(owner));

-        }

-        return list;

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+
+import org.argouml.application.helpers.ResourceLoaderWrapper;
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.ui.targetmanager.TargetManager;
+
+/**
+ * This action changes the target to the owning model element
+ * of the given element.
+ *
+ * @author Bob Tarling
+ */
+abstract class NavigateSiblingAction extends AbstractAction {
+
+    final Object modelElement;
+    
+    public NavigateSiblingAction(Object modelElement, String name) {
+        super(Translator.localize(name),
+                ResourceLoaderWrapper.lookupIcon(name));
+        
+        this.modelElement = modelElement;
+        setEnabled(getTargetSibling() != null);
+    }
+    
+    public void actionPerformed(ActionEvent arg0) {
+        TargetManager.getInstance().setTarget(getTargetSibling());
+    }
+
+    abstract protected Object getTargetSibling();
+    
+    protected List getAllSiblings() {
+        List list = null;
+        final Object owner =
+            Model.getFacade().getModelElementContainer(modelElement);
+        if (Model.getFacade().isAAttribute(modelElement)) {
+            if (Model.getFacade().isAAssociationEnd(Model.getFacade().getOwner(modelElement))) {
+                list = Model.getFacade().getQualifiers(owner);
+            } else {
+                list = Model.getFacade().getAttributes(owner);
+            }
+        } else if (Model.getFacade().isAOperation(modelElement)
+                || Model.getFacade().isAReception(modelElement)) {
+            list = Model.getFacade().getOperationsAndReceptions(owner);
+        } else if (Model.getFacade().isAParameter(modelElement)) {
+            list = Model.getFacade().getParametersList(owner);
+        } else if (Model.getFacade().isAAssociationEnd(modelElement)) {
+            list = new ArrayList(
+            		Model.getFacade().getConnections(owner));
+        }
+        return list;
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateUpAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateUpAction.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateUpAction.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateUpAction.java	2012-12-28 10:30:46-0800
@@ -1,46 +1,46 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010-2012 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-

-import javax.swing.AbstractAction;

-

-import org.argouml.application.helpers.ResourceLoaderWrapper;

-import org.argouml.i18n.Translator;

-import org.argouml.model.Model;

-import org.argouml.ui.targetmanager.TargetManager;

-

-/**

- * This action changes the target to the owning model element

- * of the given element.

- *

- * @author Bob Tarling

- */

-class NavigateUpAction extends AbstractAction {

-

-    final Object modelElement;

-    

-    public NavigateUpAction(Object modelElement) {

-        super(Translator.localize("action.navigate-up"),

-                ResourceLoaderWrapper.lookupIcon("action.navigate-up"));

-        

-        this.modelElement = modelElement;

-    }

-    public void actionPerformed(ActionEvent arg0) {

-        TargetManager.getInstance().setTarget(

-                Model.getFacade().getModelElementContainer(modelElement));

-    }

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010-2012 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+import org.argouml.application.helpers.ResourceLoaderWrapper;
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.ui.targetmanager.TargetManager;
+
+/**
+ * This action changes the target to the owning model element
+ * of the given element.
+ *
+ * @author Bob Tarling
+ */
+class NavigateUpAction extends AbstractAction {
+
+    final Object modelElement;
+    
+    public NavigateUpAction(Object modelElement) {
+        super(Translator.localize("action.navigate-up"),
+                ResourceLoaderWrapper.lookupIcon("action.navigate-up"));
+        
+        this.modelElement = modelElement;
+    }
+    public void actionPerformed(ActionEvent arg0) {
+        TargetManager.getInstance().setTarget(
+                Model.getFacade().getModelElementContainer(modelElement));
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java	2012-12-28 10:30:46-0800
@@ -1,153 +1,153 @@
-/* $Id: UMLActivityGraphContextComboBoxModel.java 17883 2010-01-12 21:11:38Z linus $

- *****************************************************************************

- * Copyright (c) 2009-2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

-// Copyright (c) 2006 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.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-import java.util.ArrayList;

-import java.util.Collection;

-

-import javax.swing.Action;

-

-import org.argouml.i18n.Translator;

-import org.argouml.kernel.Project;

-import org.argouml.kernel.ProjectManager;

-import org.argouml.model.Model;

-import org.argouml.model.UmlChangeEvent;

-import org.argouml.ui.UndoableAction;

-

-/**

- * Listmodel for the Context of an ActivityGraph.

- * 

- * @author Michiel

- */

-class UMLActivityGraphContextComboBoxModel extends  UMLComboBoxModel {

-    

-    /**

-     * 

-     */

-    private static final long serialVersionUID = 8957839123057771519L;

-

-    /**

-     * Constructor for UMLStateMachineContextListModel.

-     */

-    public UMLActivityGraphContextComboBoxModel(String propertyName, final Object target) {

-        super(target, propertyName, false);

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()

-     */

-    protected void buildModelList() {

-        Collection elements = new ArrayList();

-        Project p = ProjectManager.getManager().getCurrentProject();

-        for (Object model : p.getUserDefinedModelList()) {

-            elements.addAll(Model

-                    .getModelManagementHelper().getAllModelElementsOfKind(

-                            model, Model.getMetaTypes().getClassifier()));

-            elements.addAll(Model

-                    .getModelManagementHelper().getAllModelElementsOfKind(

-                            model, 

-                            Model.getMetaTypes().getBehavioralFeature()));

-            elements.addAll(Model

-                    .getModelManagementHelper().getAllModelElementsOfKind(

-                            model, Model.getMetaTypes().getPackage()));

-        }

-

-        setElements(elements);

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)

-     */

-    protected boolean isValidElement(Object element) {

-        return Model.getFacade().isAClassifier(element)

-            || Model.getFacade().isABehavioralFeature(element)

-            || Model.getFacade().isAPackage(element);

-    }

-    

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()

-     */

-    protected Object getSelectedModelElement() {

-        return Model.getFacade().getContext(getTarget());

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel2#propertyChange(java.beans.PropertyChangeEvent)

-     */

-    public void modelChange(UmlChangeEvent evt) {

-        /* Do nothing by design. */

-    }

-    

-    public Action getAction() {

-        return new ActionSetContext();

-    }

-    

-    private class ActionSetContext extends UndoableAction {

-

-        /**

-         * The UID.

-         */

-        private static final long serialVersionUID = -8118983979324112900L;

-

-        /**

-         * Constructor for ActionSetCompositeStateConcurrent.

-         */

-        protected ActionSetContext() {

-            super(Translator.localize("action.set"), null);

-            // Set the tooltip string:

-            putValue(Action.SHORT_DESCRIPTION, 

-                    Translator.localize("action.set"));

-        }

-

-        /*

-         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

-         */

-        public void actionPerformed(ActionEvent e) {

-            super.actionPerformed(e);

-            UMLComboBox source = (UMLComboBox) e.getSource();

-            Object target = source.getTarget();

-            if (Model.getFacade().getContext(target)

-                    != source.getSelectedItem()) {

-                Model.getStateMachinesHelper().setContext(

-                        target, source.getSelectedItem());

-            }

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009-2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+// Copyright (c) 2006 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.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.swing.Action;
+
+import org.argouml.i18n.Translator;
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
+import org.argouml.model.Model;
+import org.argouml.model.UmlChangeEvent;
+import org.argouml.ui.UndoableAction;
+
+/**
+ * Listmodel for the Context of an ActivityGraph.
+ * 
+ * @author Michiel
+ */
+class UMLActivityGraphContextComboBoxModel extends  UMLComboBoxModel {
+    
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 8957839123057771519L;
+
+    /**
+     * Constructor for UMLStateMachineContextListModel.
+     */
+    public UMLActivityGraphContextComboBoxModel(String propertyName, final Object target) {
+        super(target, propertyName, false);
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+     */
+    protected void buildModelList() {
+        Collection elements = new ArrayList();
+        Project p = ProjectManager.getManager().getCurrentProject();
+        for (Object model : p.getUserDefinedModelList()) {
+            elements.addAll(Model
+                    .getModelManagementHelper().getAllModelElementsOfKind(
+                            model, Model.getMetaTypes().getClassifier()));
+            elements.addAll(Model
+                    .getModelManagementHelper().getAllModelElementsOfKind(
+                            model, 
+                            Model.getMetaTypes().getBehavioralFeature()));
+            elements.addAll(Model
+                    .getModelManagementHelper().getAllModelElementsOfKind(
+                            model, Model.getMetaTypes().getPackage()));
+        }
+
+        setElements(elements);
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)
+     */
+    protected boolean isValidElement(Object element) {
+        return Model.getFacade().isAClassifier(element)
+            || Model.getFacade().isABehavioralFeature(element)
+            || Model.getFacade().isAPackage(element);
+    }
+    
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()
+     */
+    protected Object getSelectedModelElement() {
+        return Model.getFacade().getContext(getTarget());
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel2#propertyChange(java.beans.PropertyChangeEvent)
+     */
+    public void modelChange(UmlChangeEvent evt) {
+        /* Do nothing by design. */
+    }
+    
+    public Action getAction() {
+        return new ActionSetContext();
+    }
+    
+    private class ActionSetContext extends UndoableAction {
+
+        /**
+         * The UID.
+         */
+        private static final long serialVersionUID = -8118983979324112900L;
+
+        /**
+         * Constructor for ActionSetCompositeStateConcurrent.
+         */
+        protected ActionSetContext() {
+            super(Translator.localize("action.set"), null);
+            // Set the tooltip string:
+            putValue(Action.SHORT_DESCRIPTION, 
+                    Translator.localize("action.set"));
+        }
+
+        /*
+         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+         */
+        public void actionPerformed(ActionEvent e) {
+            super.actionPerformed(e);
+            UMLComboBox source = (UMLComboBox) e.getSource();
+            Object target = source.getTarget();
+            if (Model.getFacade().getContext(target)
+                    != source.getSelectedItem()) {
+                Model.getStateMachinesHelper().setContext(
+                        target, source.getSelectedItem());
+            }
+        }
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java	2012-12-28 10:30:46-0800
@@ -1,178 +1,178 @@
-/* $Id: UMLComboBoxNavigator.java 17881 2010-01-12 21:09:28Z linus $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    tfmorris

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

-// Copyright (c) 1996-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.core.propertypanels.ui;

-

-import java.awt.BorderLayout;

-import java.awt.Dimension;

-import java.awt.event.ActionListener;

-import java.awt.event.ItemEvent;

-import java.awt.event.ItemListener;

-import java.util.List;

-

-import javax.swing.Action;

-import javax.swing.ComboBoxModel;

-import javax.swing.ImageIcon;

-import javax.swing.JButton;

-import javax.swing.JComboBox;

-import javax.swing.JPanel;

-

-import org.argouml.application.helpers.ResourceLoaderWrapper;

-import org.argouml.ui.targetmanager.TargetManager;

-

-/**

- * This class implements a panel that adds a navigation button to the right of

- * the combo box

- * 

- * @author Curt Arnold

- * @since 0.9

- */

-public class UMLComboBoxNavigator extends UmlControl implements ActionListener,

-        ItemListener {

-

-    /**

-     * The UID

-     */

-    private static final long serialVersionUID = -4076669106516586439L;

-

-    private static ImageIcon icon = ResourceLoaderWrapper

-            .lookupIconResource("ComboNav");

-

-    private JComboBox theComboBox;

-

-    private JButton theButton;

-

-

-    /**

-     * Constructor

-     * 

-     * @param tooltip

-     *            Tooltip key for button

-     * @param box

-     *            Associated combo box

-     */

-    public UMLComboBoxNavigator(String tooltip, UMLComboBox box) {

-        super(new BorderLayout());

-        theButton = new JButton(icon);

-        theComboBox = box;

-        theButton.setPreferredSize(new Dimension(icon.getIconWidth() + 6, icon

-                .getIconHeight() + 6));

-        theButton.setToolTipText(tooltip);

-        theButton.addActionListener(this);

-        box.addActionListener(this);

-        box.addItemListener(this);

-        add(theComboBox, BorderLayout.CENTER);

-        add(theButton, BorderLayout.EAST);

-        

-        ComboBoxModel model = box.getModel();

-        if (model instanceof UMLComboBoxModel) {

-            final List<Action> actions = ((UMLComboBoxModel) model).getActions();

-            if (!actions.isEmpty()) {

-                final JPanel buttonPanel =

-                	createSingleButtonPanel(actions);

-                add(buttonPanel, BorderLayout.WEST);

-                

-            }

-        }

-        Object item = theComboBox.getSelectedItem();

-        setButtonEnabled(item);

-    }

-

-    /**

-     * Enforce that the preferred height is the minimum height.

-     * This works around a bug in Windows LAF of JRE5 where a change

-     * in the preferred/min size of a combo has changed and has a knock

-     * on effect here.

-     * If the layout manager for prop panels finds the preferred

-     * height is greater than the minimum height then it will allow

-     * this component to resize in error.

-     * See issue 4333 - Sun has now fixed this bug in JRE6 and so this

-     * method can be removed once JRE5 is no longer supported.

-     * @return the preferred size

-     */

-    @Override

-    public Dimension getPreferredSize() {

-        return new Dimension(

-                super.getPreferredSize().width,

-                getMinimumSize().height);

-    }

-

-

-

-    /**

-     * Fired when the button is pushed. Navigates to the currently selected item

-     * in the combo box.

-     * 

-     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

-     */

-    public void actionPerformed(final java.awt.event.ActionEvent event) {

-        // button action:

-        if (event.getSource() == theButton) {

-            Object item = theComboBox.getSelectedItem();

-            if (item != null) {

-                TargetManager.getInstance().setTarget(item);

-            }

-

-        }

-        if (event.getSource() == theComboBox) {

-            Object item = theComboBox.getSelectedItem();

-            setButtonEnabled(item);

-        }

-    }

-

-    public void itemStateChanged(ItemEvent event) {

-        if (event.getSource() == theComboBox) {

-            Object item = theComboBox.getSelectedItem();

-            setButtonEnabled(item);

-

-        }

-    }

-

-    private void setButtonEnabled(Object item) {

-        if (item != null) {

-            theButton.setEnabled(true);

-        } else {

-            theButton.setEnabled(false);

-        }

-    }

-    

-    public void setEnabled(boolean enabled) {

-        theComboBox.setEnabled(enabled);

-        theComboBox.setEditable(enabled);

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    tfmorris
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+// Copyright (c) 1996-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.core.propertypanels.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.List;
+
+import javax.swing.Action;
+import javax.swing.ComboBoxModel;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+
+import org.argouml.application.helpers.ResourceLoaderWrapper;
+import org.argouml.ui.targetmanager.TargetManager;
+
+/**
+ * This class implements a panel that adds a navigation button to the right of
+ * the combo box
+ * 
+ * @author Curt Arnold
+ * @since 0.9
+ */
+public class UMLComboBoxNavigator extends UmlControl implements ActionListener,
+        ItemListener {
+
+    /**
+     * The UID
+     */
+    private static final long serialVersionUID = -4076669106516586439L;
+
+    private static ImageIcon icon = ResourceLoaderWrapper
+            .lookupIconResource("ComboNav");
+
+    private JComboBox theComboBox;
+
+    private JButton theButton;
+
+
+    /**
+     * Constructor
+     * 
+     * @param tooltip
+     *            Tooltip key for button
+     * @param box
+     *            Associated combo box
+     */
+    public UMLComboBoxNavigator(String tooltip, UMLComboBox box) {
+        super(new BorderLayout());
+        theButton = new JButton(icon);
+        theComboBox = box;
+        theButton.setPreferredSize(new Dimension(icon.getIconWidth() + 6, icon
+                .getIconHeight() + 6));
+        theButton.setToolTipText(tooltip);
+        theButton.addActionListener(this);
+        box.addActionListener(this);
+        box.addItemListener(this);
+        add(theComboBox, BorderLayout.CENTER);
+        add(theButton, BorderLayout.EAST);
+        
+        ComboBoxModel model = box.getModel();
+        if (model instanceof UMLComboBoxModel) {
+            final List<Action> actions = ((UMLComboBoxModel) model).getActions();
+            if (!actions.isEmpty()) {
+                final JPanel buttonPanel =
+                	createSingleButtonPanel(actions);
+                add(buttonPanel, BorderLayout.WEST);
+                
+            }
+        }
+        Object item = theComboBox.getSelectedItem();
+        setButtonEnabled(item);
+    }
+
+    /**
+     * Enforce that the preferred height is the minimum height.
+     * This works around a bug in Windows LAF of JRE5 where a change
+     * in the preferred/min size of a combo has changed and has a knock
+     * on effect here.
+     * If the layout manager for prop panels finds the preferred
+     * height is greater than the minimum height then it will allow
+     * this component to resize in error.
+     * See issue 4333 - Sun has now fixed this bug in JRE6 and so this
+     * method can be removed once JRE5 is no longer supported.
+     * @return the preferred size
+     */
+    @Override
+    public Dimension getPreferredSize() {
+        return new Dimension(
+                super.getPreferredSize().width,
+                getMinimumSize().height);
+    }
+
+
+
+    /**
+     * Fired when the button is pushed. Navigates to the currently selected item
+     * in the combo box.
+     * 
+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+     */
+    public void actionPerformed(final java.awt.event.ActionEvent event) {
+        // button action:
+        if (event.getSource() == theButton) {
+            Object item = theComboBox.getSelectedItem();
+            if (item != null) {
+                TargetManager.getInstance().setTarget(item);
+            }
+
+        }
+        if (event.getSource() == theComboBox) {
+            Object item = theComboBox.getSelectedItem();
+            setButtonEnabled(item);
+        }
+    }
+
+    public void itemStateChanged(ItemEvent event) {
+        if (event.getSource() == theComboBox) {
+            Object item = theComboBox.getSelectedItem();
+            setButtonEnabled(item);
+
+        }
+    }
+
+    private void setButtonEnabled(Object item) {
+        if (item != null) {
+            theButton.setEnabled(true);
+        } else {
+            theButton.setEnabled(false);
+        }
+    }
+    
+    public void setEnabled(boolean enabled) {
+        theComboBox.setEnabled(enabled);
+        theComboBox.setEditable(enabled);
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java	2012-12-28 10:30:46-0800
@@ -1,121 +1,121 @@
-/* $Id: $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-import java.util.ArrayList;

-import java.util.Collection;

-import java.util.List;

-

-import javax.swing.Action;

-

-import org.apache.log4j.Logger;

-import org.argouml.application.helpers.ResourceLoaderWrapper;

-import org.argouml.i18n.Translator;

-import org.argouml.kernel.Project;

-import org.argouml.kernel.ProjectManager;

-import org.argouml.model.Model;

-import org.argouml.profile.Profile;

-import org.argouml.profile.ProfileException;

-import org.argouml.ui.UndoableAction;

-

-class UMLComponentInstanceClassifierComboBoxModel

-    extends  UMLComboBoxModel {

-    

-    private static final Logger LOG =

-	Logger.getLogger("UMLComponentInstanceClassifierComboBoxModel");

-    

-    public UMLComponentInstanceClassifierComboBoxModel(

-            final String propertyName,

-            final Object target) {

-        super(target, propertyName, true);

-    }

-    

-    /*

-     * @see org.argouml.uml.ui.UMLModelElementListModel#buildModelList()

-     */

-    protected void buildModelList() {

-        List list = new ArrayList();

-        

-        // Get all classifiers in our model

-        // TODO: We need the property panels to have some reference to the

-        // project they belong to instead of using deprecated functionality

-        Project p = ProjectManager.getManager().getCurrentProject();

-        Object model = p.getRoot();

-        list.addAll(Model.getModelManagementHelper()

-                .getAllModelElementsOfKindWithModel(model, Model.getMetaTypes().getComponent()));

-        

-        // Get all classifiers in all top level packages of all profiles

-        for (Profile profile : p.getProfileConfiguration().getProfiles()) {

-    	try {

-		    for (Object topPackage : profile.getProfilePackages()) {

-		            list.addAll(Model.getModelManagementHelper()

-		                    .getAllModelElementsOfKindWithModel(topPackage,

-		                	    Model.getMetaTypes().getComponent()));

-		    }

-		} catch (ProfileException e) {

-		    // TODO: We need to rethrow this as some other exception

-		    // type but that is too much change for the moment.

-		    LOG.error("Exception", e);

-		}

-        }

-        setElements(list);

-    }

-    

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel#isValidElement(Object)

-     */

-    protected boolean isValidElement(Object element) {

-        return Model.getFacade().isAClassifier(element)

-            && Model.getFacade().getRepresentedClassifier(getTarget()) 

-                == element;

-    }

-    

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel#getSelectedModelElement()

-     */

-    protected Object getSelectedModelElement() {

-        Collection list = Model.getFacade().getClassifiers(getTarget());

-        if (list.size() == 0) {

-            return null;

-        }

-        return list.iterator().next();

-    }

-    

-    public Action getAction() {

-        return new ActionSet();

-    }

-    

-    private class ActionSet extends UndoableAction {

-

-        ActionSet() {

-            super(Translator.localize("action.set"),

-                    ResourceLoaderWrapper.lookupIcon("action.set"));

-        }

-

-        public void actionPerformed(ActionEvent e) {

-            super.actionPerformed(e);

-            UMLComboBox source = (UMLComboBox) e.getSource();

-            Object target = source.getTarget();

-            Object newValue = source.getSelectedItem();

-            List classifiers = new ArrayList(1);

-            if (Model.getFacade().isAClassifier(newValue)) {

-                classifiers.add(newValue);

-            }

-   	    Model.getCommonBehaviorHelper().setClassifiers(getTarget(), classifiers);

-        }

-

-    }

-}

-

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.Action;
+
+import org.apache.log4j.Logger;
+import org.argouml.application.helpers.ResourceLoaderWrapper;
+import org.argouml.i18n.Translator;
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
+import org.argouml.model.Model;
+import org.argouml.profile.Profile;
+import org.argouml.profile.ProfileException;
+import org.argouml.ui.UndoableAction;
+
+class UMLComponentInstanceClassifierComboBoxModel
+    extends  UMLComboBoxModel {
+    
+    private static final Logger LOG =
+	Logger.getLogger("UMLComponentInstanceClassifierComboBoxModel");
+    
+    public UMLComponentInstanceClassifierComboBoxModel(
+            final String propertyName,
+            final Object target) {
+        super(target, propertyName, true);
+    }
+    
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel#buildModelList()
+     */
+    protected void buildModelList() {
+        List list = new ArrayList();
+        
+        // Get all classifiers in our model
+        // TODO: We need the property panels to have some reference to the
+        // project they belong to instead of using deprecated functionality
+        Project p = ProjectManager.getManager().getCurrentProject();
+        Object model = p.getRoot();
+        list.addAll(Model.getModelManagementHelper()
+                .getAllModelElementsOfKindWithModel(model, Model.getMetaTypes().getComponent()));
+        
+        // Get all classifiers in all top level packages of all profiles
+        for (Profile profile : p.getProfileConfiguration().getProfiles()) {
+    	try {
+		    for (Object topPackage : profile.getProfilePackages()) {
+		            list.addAll(Model.getModelManagementHelper()
+		                    .getAllModelElementsOfKindWithModel(topPackage,
+		                	    Model.getMetaTypes().getComponent()));
+		    }
+		} catch (ProfileException e) {
+		    // TODO: We need to rethrow this as some other exception
+		    // type but that is too much change for the moment.
+		    LOG.error("Exception", e);
+		}
+        }
+        setElements(list);
+    }
+    
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel#isValidElement(Object)
+     */
+    protected boolean isValidElement(Object element) {
+        return Model.getFacade().isAClassifier(element)
+            && Model.getFacade().getRepresentedClassifier(getTarget()) 
+                == element;
+    }
+    
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel#getSelectedModelElement()
+     */
+    protected Object getSelectedModelElement() {
+        Collection list = Model.getFacade().getClassifiers(getTarget());
+        if (list.size() == 0) {
+            return null;
+        }
+        return list.iterator().next();
+    }
+    
+    public Action getAction() {
+        return new ActionSet();
+    }
+    
+    private class ActionSet extends UndoableAction {
+
+        ActionSet() {
+            super(Translator.localize("action.set"),
+                    ResourceLoaderWrapper.lookupIcon("action.set"));
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            super.actionPerformed(e);
+            UMLComboBox source = (UMLComboBox) e.getSource();
+            Object target = source.getTarget();
+            Object newValue = source.getSelectedItem();
+            List classifiers = new ArrayList(1);
+            if (Model.getFacade().isAClassifier(newValue)) {
+                classifiers.add(newValue);
+            }
+   	    Model.getCommonBehaviorHelper().setClassifiers(getTarget(), classifiers);
+        }
+
+    }
+}
+

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSpecificationDocument.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSpecificationDocument.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSpecificationDocument.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSpecificationDocument.java	2012-12-28 10:30:46-0800
@@ -1,78 +1,78 @@
-/* $Id: UMLReceptionSpecificationDocument.java 17890 2010-01-12 21:21:00Z linus $

- *****************************************************************************

- * Copyright (c) 2009 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    tfmorris

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

-// Copyright (c) 2003-2006 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.core.propertypanels.ui;

-

-import org.argouml.model.Model;

-import org.argouml.uml.ui.UMLPlainTextDocument;

-

-/**

- *

- * @author mkl

- *

- */

-public class UMLReceptionSpecificationDocument extends UMLPlainTextDocument {

-

-    /**

-     * Constructor.

-     */

-    public UMLReceptionSpecificationDocument() {

-        super("specification");

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLPlainTextDocument#setProperty(java.lang.String)

-     */

-    protected void setProperty(String text) {

-        if (Model.getFacade().isAReception(getTarget())) {

-            Model.getCommonBehaviorHelper().setSpecification(getTarget(), text);

-        }

-

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLPlainTextDocument#getProperty()

-     */

-    protected String getProperty() {

-        if (Model.getFacade().isAReception(getTarget())) {

-            return Model.getFacade().getSpecification(getTarget());

-        }

-        return null;

-    }

-

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    tfmorris
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+// Copyright (c) 2003-2006 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.core.propertypanels.ui;
+
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLPlainTextDocument;
+
+/**
+ *
+ * @author mkl
+ *
+ */
+public class UMLReceptionSpecificationDocument extends UMLPlainTextDocument {
+
+    /**
+     * Constructor.
+     */
+    public UMLReceptionSpecificationDocument() {
+        super("specification");
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLPlainTextDocument#setProperty(java.lang.String)
+     */
+    protected void setProperty(String text) {
+        if (Model.getFacade().isAReception(getTarget())) {
+            Model.getCommonBehaviorHelper().setSpecification(getTarget(), text);
+        }
+
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLPlainTextDocument#getProperty()
+     */
+    protected String getProperty() {
+        if (Model.getFacade().isAReception(getTarget())) {
+            return Model.getFacade().getSpecification(getTarget());
+        }
+        return null;
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java	2012-12-28 10:30:46-0800
@@ -1,176 +1,176 @@
-/* $Id: UMLSignalComboBoxModel.java 17890 2010-01-12 21:21:00Z linus $

- *****************************************************************************

- * Copyright (c) 2009-2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *****************************************************************************

- *

- * Some portions of this file was previously release using the BSD License:

- */

-

-// Copyright (c) 1996-2006 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.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-import java.util.ArrayList;

-import java.util.Collection;

-import java.util.List;

-

-import javax.swing.Action;

-

-import org.argouml.kernel.Project;

-import org.argouml.kernel.ProjectManager;

-import org.argouml.model.Model;

-import org.argouml.model.RemoveAssociationEvent;

-import org.argouml.model.UmlChangeEvent;

-import org.argouml.ui.ActionCreateContainedModelElement;

-import org.argouml.ui.UndoableAction;

-

-

-/**

- * The model for the signal combobox on the reception proppanel.

- */

-public class UMLSignalComboBoxModel extends UMLComboBoxModel {

-

-    /**

-     * Constructor for UMLReceptionSignalComboBoxModel.

-     */

-    public UMLSignalComboBoxModel(

-        final String propertyName,

-        final Object target) {

-        super(target, propertyName, false);

-        Model.getPump().addClassModelEventListener(this,

-                Model.getMetaTypes().getNamespace(), propertyName);

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel2#buildModelList()

-     */

-    protected void buildModelList() {

-        Object target = getTarget();

-        if (Model.getFacade().isAReception(target) || Model.getFacade().isASignalEvent(target)) {

-            removeAllElements();

-            Project p = ProjectManager.getManager().getCurrentProject();

-            Object model = p.getRoot();

-            setElements(Model.getModelManagementHelper()

-                    .getAllModelElementsOfKindWithModel(

-                            model,

-                            Model.getMetaTypes().getSignal()));

-            setSelectedItem(Model.getFacade().getSignal(target));

-        } else {

-        	throw new IllegalStateException(

-        			"Expected a Reception or SignalEvent - got a " + target);

-        }

-

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)

-     */

-    protected boolean isValidElement(Object m) {

-        return Model.getFacade().isASignal(m);

-    }

-

-    /*

-     * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()

-     */

-    protected Object getSelectedModelElement() {

-        if (getTarget() != null) {

-            return Model.getFacade().getSignal(getTarget());

-        }

-        return null;

-    }

-

-    /**

-     * Override UMLComboBoxModel2's default handling of RemoveAssociation. We

-     * get this from MDR for the previous signal when a different signal is

-     * selected. Don't let that remove it from the combo box. Only remove it if

-     * the signal was removed from the namespace.

-     * <p>

-     * @param evt the event describing the property change

-     */

-    public void modelChanged(UmlChangeEvent evt) {

-        if (evt instanceof RemoveAssociationEvent) {

-            Object o = getChangedElement(evt);

-            if (contains(o)) {

-                if (o instanceof Collection) {

-                    removeAll((Collection) o);

-                } else {

-                    removeElement(o);

-                }

-            }

-        } else {

-            super.propertyChange(evt);

-        }

-    }

-    

-    public List<Action> getActions() {

-        final ArrayList<Action> actions = new ArrayList<Action>();

-        actions.add(new ActionCreateContainedModelElement(

-                Model.getMetaTypes().getSignal(), getTarget()));

-        return actions;

-    }

-    

-    public Action getAction() {

-        

-        return new SetAction();

-    }

-    

-    class SetAction extends UndoableAction {

-        

-        /**

-         * The class uid

-         */

-        private static final long serialVersionUID = 6281434994800778660L;

-

-        /**

-         * Constructor for ActionSetModelElementNamespace.

-         */

-        public SetAction() {

-            super();

-        }

-

-        /*

-         * @see java.awt.event.ActionListener#actionPerformed(

-         * java.awt.event.ActionEvent)

-         */

-        public void actionPerformed(ActionEvent e) {

-            Object source = e.getSource();

-            UMLComboBox box = (UMLComboBox) source;

-            Object o = getTarget();

-            o = box.getSelectedItem();

-            Object signal = o;

-            if (signal != Model.getFacade().getSignal(getTarget())) {

-                super.actionPerformed(e);

-                Model.getCommonBehaviorHelper().setSignal(getTarget(), signal);

-            }

-        }

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2009-2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *****************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+// Copyright (c) 1996-2006 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.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.Action;
+
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
+import org.argouml.model.Model;
+import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.model.UmlChangeEvent;
+import org.argouml.ui.ActionCreateContainedModelElement;
+import org.argouml.ui.UndoableAction;
+
+
+/**
+ * The model for the signal combobox on the reception proppanel.
+ */
+public class UMLSignalComboBoxModel extends UMLComboBoxModel {
+
+    /**
+     * Constructor for UMLReceptionSignalComboBoxModel.
+     */
+    public UMLSignalComboBoxModel(
+        final String propertyName,
+        final Object target) {
+        super(target, propertyName, false);
+        Model.getPump().addClassModelEventListener(this,
+                Model.getMetaTypes().getNamespace(), propertyName);
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel2#buildModelList()
+     */
+    protected void buildModelList() {
+        Object target = getTarget();
+        if (Model.getFacade().isAReception(target) || Model.getFacade().isASignalEvent(target)) {
+            removeAllElements();
+            Project p = ProjectManager.getManager().getCurrentProject();
+            Object model = p.getRoot();
+            setElements(Model.getModelManagementHelper()
+                    .getAllModelElementsOfKindWithModel(
+                            model,
+                            Model.getMetaTypes().getSignal()));
+            setSelectedItem(Model.getFacade().getSignal(target));
+        } else {
+        	throw new IllegalStateException(
+        			"Expected a Reception or SignalEvent - got a " + target);
+        }
+
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)
+     */
+    protected boolean isValidElement(Object m) {
+        return Model.getFacade().isASignal(m);
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()
+     */
+    protected Object getSelectedModelElement() {
+        if (getTarget() != null) {
+            return Model.getFacade().getSignal(getTarget());
+        }
+        return null;
+    }
+
+    /**
+     * Override UMLComboBoxModel2's default handling of RemoveAssociation. We
+     * get this from MDR for the previous signal when a different signal is
+     * selected. Don't let that remove it from the combo box. Only remove it if
+     * the signal was removed from the namespace.
+     * <p>
+     * @param evt the event describing the property change
+     */
+    public void modelChanged(UmlChangeEvent evt) {
+        if (evt instanceof RemoveAssociationEvent) {
+            Object o = getChangedElement(evt);
+            if (contains(o)) {
+                if (o instanceof Collection) {
+                    removeAll((Collection) o);
+                } else {
+                    removeElement(o);
+                }
+            }
+        } else {
+            super.propertyChange(evt);
+        }
+    }
+    
+    public List<Action> getActions() {
+        final ArrayList<Action> actions = new ArrayList<Action>();
+        actions.add(new ActionCreateContainedModelElement(
+                Model.getMetaTypes().getSignal(), getTarget()));
+        return actions;
+    }
+    
+    public Action getAction() {
+        
+        return new SetAction();
+    }
+    
+    class SetAction extends UndoableAction {
+        
+        /**
+         * The class uid
+         */
+        private static final long serialVersionUID = 6281434994800778660L;
+
+        /**
+         * Constructor for ActionSetModelElementNamespace.
+         */
+        public SetAction() {
+            super();
+        }
+
+        /*
+         * @see java.awt.event.ActionListener#actionPerformed(
+         * java.awt.event.ActionEvent)
+         */
+        public void actionPerformed(ActionEvent e) {
+            Object source = e.getSource();
+            UMLComboBox box = (UMLComboBox) source;
+            Object o = getTarget();
+            o = box.getSelectedItem();
+            Object signal = o;
+            if (signal != Model.getFacade().getSignal(getTarget())) {
+                super.actionPerformed(e);
+                Model.getCommonBehaviorHelper().setSignal(getTarget(), signal);
+            }
+        }
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java	2012-12-28 10:30:46-0800
@@ -1,129 +1,129 @@
-/* $Id: 

- *****************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *    Michiel van der Wulp

- *****************************************************************************/

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-import java.util.ArrayList;

-import java.util.Collection;

-import java.util.List;

-

-import javax.swing.Action;

-

-import org.argouml.model.Model;

-import org.argouml.ui.ActionCreateContainedModelElement;

-import org.argouml.ui.UndoableAction;

-

-

-public class UMLTransitionTriggerComboBoxModel extends UMLComboBoxModel {

-

-    public UMLTransitionTriggerComboBoxModel(

-            final String propertyName,

-            final Object target) {

-        super(target, propertyName, false);

-        Model.getPump().addClassModelEventListener(this,

-                Model.getMetaTypes().getNamespace(), "ownedElement");

-    }

-    

-    @SuppressWarnings("unchecked")

-    @Override

-    protected void buildMinimalModelList() {

-        Collection list = new ArrayList(1);

-        Object element = getSelectedModelElement();

-        if (element != null) {

-            list.add(element);

-        }

-        setElements(list);

-    }

-    

-    @Override

-    protected boolean isLazy() {

-        return true;

-    }

-    

-    /**

-     * For the list of possible items include all events under the first package

-     * above the target transition

-     * 

-     * @see org.argouml.core.propertypanels.ui.UMLComboBoxModel#buildModelList()

-     */

-    protected void buildModelList() {

-        final Object transition = getTarget();

-        removeAllElements();

-

-        Object parent =

-            Model.getStateMachinesHelper()

-                .findNamespaceForEvent(transition, null);

-        final Collection list =

-            Model.getModelManagementHelper().getAllModelElementsOfKind(

-                parent,

-                Model.getMetaTypes().getEvent());

-        

-        Object selectedElement = getSelectedModelElement();

-        if (selectedElement != null && !list.contains(selectedElement)) {

-            // Just in case the existing selected element is from elsewhere

-            // make sure it is in the list

-            list.add(selectedElement);

-        }

-        setElements(list);

-    }

-

-    protected boolean isValidElement(Object m) {

-        return Model.getFacade().isAEvent(m);

-    }

-

-    protected Object getSelectedModelElement() {

-        if (getTarget() != null) {

-            return Model.getFacade().getTrigger(getTarget());

-        }

-        return null;

-    }

-    

-    public List<Action> getActions() {

-        final ArrayList<Action> actions = new ArrayList<Action>();

-        actions.add(new ActionCreateContainedModelElement(

-                Model.getMetaTypes().getCallEvent(), getTarget()));

-        actions.add(new ActionCreateContainedModelElement(

-                Model.getMetaTypes().getChangeEvent(), getTarget()));

-        actions.add(new ActionCreateContainedModelElement(

-                Model.getMetaTypes().getSignalEvent(), getTarget()));

-        actions.add(new ActionCreateContainedModelElement(

-                Model.getMetaTypes().getTimeEvent(), getTarget()));

-        return actions;

-    }

-

-    public Action getAction() {

-        

-        return new SetAction();

-    }

-    

-    class SetAction extends UndoableAction {

-        

-        /**

-         * Constructor for ActionSetModelElementNamespace.

-         */

-        public SetAction() {

-            super();

-        }

-

-        public void actionPerformed(ActionEvent e) {

-            final Object source = e.getSource();

-            final UMLComboBox box = (UMLComboBox) source;

-            final Object trigger = box.getSelectedItem();

-            if (trigger != Model.getFacade().getTrigger(getTarget())) {

-                super.actionPerformed(e);

-                Model.getStateMachinesHelper().setTrigger(getTarget(), trigger);

-            }

-        }

-    }

-}

+/* $Id: 
+ *****************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *    Michiel van der Wulp
+ *****************************************************************************/
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.Action;
+
+import org.argouml.model.Model;
+import org.argouml.ui.ActionCreateContainedModelElement;
+import org.argouml.ui.UndoableAction;
+
+
+public class UMLTransitionTriggerComboBoxModel extends UMLComboBoxModel {
+
+    public UMLTransitionTriggerComboBoxModel(
+            final String propertyName,
+            final Object target) {
+        super(target, propertyName, false);
+        Model.getPump().addClassModelEventListener(this,
+                Model.getMetaTypes().getNamespace(), "ownedElement");
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    protected void buildMinimalModelList() {
+        Collection list = new ArrayList(1);
+        Object element = getSelectedModelElement();
+        if (element != null) {
+            list.add(element);
+        }
+        setElements(list);
+    }
+    
+    @Override
+    protected boolean isLazy() {
+        return true;
+    }
+    
+    /**
+     * For the list of possible items include all events under the first package
+     * above the target transition
+     * 
+     * @see org.argouml.core.propertypanels.ui.UMLComboBoxModel#buildModelList()
+     */
+    protected void buildModelList() {
+        final Object transition = getTarget();
+        removeAllElements();
+
+        Object parent =
+            Model.getStateMachinesHelper()
+                .findNamespaceForEvent(transition, null);
+        final Collection list =
+            Model.getModelManagementHelper().getAllModelElementsOfKind(
+                parent,
+                Model.getMetaTypes().getEvent());
+        
+        Object selectedElement = getSelectedModelElement();
+        if (selectedElement != null && !list.contains(selectedElement)) {
+            // Just in case the existing selected element is from elsewhere
+            // make sure it is in the list
+            list.add(selectedElement);
+        }
+        setElements(list);
+    }
+
+    protected boolean isValidElement(Object m) {
+        return Model.getFacade().isAEvent(m);
+    }
+
+    protected Object getSelectedModelElement() {
+        if (getTarget() != null) {
+            return Model.getFacade().getTrigger(getTarget());
+        }
+        return null;
+    }
+    
+    public List<Action> getActions() {
+        final ArrayList<Action> actions = new ArrayList<Action>();
+        actions.add(new ActionCreateContainedModelElement(
+                Model.getMetaTypes().getCallEvent(), getTarget()));
+        actions.add(new ActionCreateContainedModelElement(
+                Model.getMetaTypes().getChangeEvent(), getTarget()));
+        actions.add(new ActionCreateContainedModelElement(
+                Model.getMetaTypes().getSignalEvent(), getTarget()));
+        actions.add(new ActionCreateContainedModelElement(
+                Model.getMetaTypes().getTimeEvent(), getTarget()));
+        return actions;
+    }
+
+    public Action getAction() {
+        
+        return new SetAction();
+    }
+    
+    class SetAction extends UndoableAction {
+        
+        /**
+         * Constructor for ActionSetModelElementNamespace.
+         */
+        public SetAction() {
+            super();
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            final Object source = e.getSource();
+            final UMLComboBox box = (UMLComboBox) source;
+            final Object trigger = box.getSelectedItem();
+            if (trigger != Model.getFacade().getTrigger(getTarget())) {
+                super.actionPerformed(e);
+                Model.getStateMachinesHelper().setTrigger(getTarget(), trigger);
+            }
+        }
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationModel.java	2012-12-28 10:30:46-0800
@@ -1,242 +1,242 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Thomas Neustupny

- *    Laurent Braud

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.beans.PropertyChangeEvent;

-import java.beans.PropertyChangeListener;

-

-import javax.swing.event.ChangeEvent;

-import javax.swing.event.ChangeListener;

-import javax.swing.event.EventListenerList;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.Model;

-

-/**

- * The model for value specifications.

- * The target is the UML element to which this ValueSpecification is attached.

- *

- * The ChangeEvent/ChangeListener handling is inspired by

- * javax.swing.DefaultBoundedRangeModel.

- * It listens to UML model changes not caused by us,

- * which need to trigger an update of the UI rendering.

- *

- * @author Thomas Neustupny

- */

- class UMLValueSpecificationModel

-	implements PropertyChangeListener {

-

-    private static final Logger LOG =

-        Logger.getLogger(UMLValueSpecificationModel.class);

-

-    private Object target;

-    private String propertyName;

-

-    /** This member is only used when we set the expression ourselves.

-     * In this case, we do not wish to receive UML model change events

-     * for this self-inflicted change.

-     * So, this member is used to detect this situation. */

-    private Object rememberExpression;

-

-//    private boolean mustRefresh;

-    private static final String EMPTYSTRING = "";

-

-    /** The listeners waiting for model changes. */

-    protected EventListenerList listenerList = new EventListenerList();

-

-    /**

-     * Only one <code>ChangeEvent</code> is needed per model instance

-     * since the event's only (read-only) state is the expression.  The source

-     * of events generated here is always "this".

-     */

-    protected transient ChangeEvent changeEvent = null;

-

-    /**

-     * The constructor.

-     *

-     * @param target the UML element

-     * @param name the name of the property

-     */

-    public UMLValueSpecificationModel(Object target, String name) {

-        this.target = target;

-        propertyName = name;

-//        mustRefresh = true;

-        startListeningForModelChanges();

-    }

-

-    protected void startListeningForModelChanges() {

-	if (Model.getFacade().isAUMLElement(target)) {

-	    Model.getPump().addModelEventListener(this, target,

-		    propertyName);

-	}

-	LOG.debug(">>Start listening for UML changes...");

-    }

-

-    protected void stopListeningForModelChanges() {

-	if (Model.getFacade().isAUMLElement(target)) {

-	    Model.getPump().removeModelEventListener(this, target,

-	                propertyName);

-	}

-	LOG.debug(">>Stop listening for UML changes...");

-    }

-

-    public void propertyChange(PropertyChangeEvent e) {

-	if (propertyName.equals(e.getPropertyName())) {

-	    if (rememberExpression != e.getNewValue()) {

-		fireStateChanged();

-		LOG.debug(">>UML expression changed.");

-	    } else {

-		/* This should not happen. */

-		LOG.debug(">>Got an event for a modelchange that we inflicted ourselves...");

-	    }

-	}

-    }

-

-    protected Object getTarget() {

-        return target;

-    }

-

-    /**

-     * @return the expression

-     */

-    public Object getExpression() {

-        return Model.getFacade().getInitialValue(getTarget());

-    }

-

-    /**

-     * @param expr the expression

-     */

-    private void setExpression(Object expression) {

-        Object target = getTarget();

-        assert (expression == null) || Model.getFacade().isAExpression(expression);

-        /* If we do not set it to null first, then we get a MDR DebugException: */

-        Model.getCoreHelper().setInitialValue(target, null);

-        Model.getCoreHelper().setInitialValue(target, expression);

-    }

-

-    /**

-     * @return a new expression with given language and body

-     */

-    public Object newExpression(String lang, String body) {

-        return Model.getDataTypesFactory().createExpression(lang, body);

-    }

-

-    /**

-     * @return The value text of the value specification.

-     * @deprecated I don't use it.

-     */

-    public String getText() {

-        Object expression = getExpression();

-        if (expression == null) {

-            return EMPTYSTRING;

-        }

-        return Model.getFacade().getBody(expression).toString();

-    }

-

-    

-    /**

-     * Get the ValueSpecification

-     * @return

-     */

-    public Object[] getValue(){

-	return Model.getDataTypesHelper().getValueSpecificationValues(getExpression());

-    }

-    /**

-     * Set ValueSpecification

-     * 

-     * @param tabValues: A formated array depends on type of ValueSpecification.

-     */

-    public void setValue(Object tabValues[]) {

-        // Expressions are DataTypes, not independent model elements

-        // be careful not to reuse them

-	rememberExpression = getExpression();

-	

-	//

-	stopListeningForModelChanges();

-	if (tabValues == null) {

-	    if (rememberExpression != null) {

-		    Model.getUmlFactory().delete(rememberExpression);

-	    }

-	    rememberExpression = null;

-	    

-	    setExpression(rememberExpression);

-	} else {

-	    Model.getDataTypesHelper().modifyValueSpecification(rememberExpression, tabValues);

-	    // We need to to this otherwise there is no notification

-	    // and diagram isn't change 

-	    Model.getCoreHelper().setInitialValue(target, rememberExpression);

-	    

-	    

-	}

-	

-	startListeningForModelChanges();

-    }

-

-    /**

-    *

-    * @param sType 

-    */

-   public void createValueSpecification(String sType) {

-	

-	Object exp=Model.getDataTypesHelper().createValueSpecification(getTarget(),sType);

-	// needed for notification 

-	Model.getCoreHelper().setInitialValue(target,exp);	

-	

-   }

-   

-    /**

-     * Adds a <code>ChangeListener</code>.

-     * The change listeners are run each

-     * time the expression changes.

-     *

-     * @param l the ChangeListener to add

-     * @see #removeChangeListener

-     */

-    public void addChangeListener(ChangeListener l) {

-        listenerList.add(ChangeListener.class, l);

-        LOG.debug(">>Add listener");

-    }

-

-    /**

-     * Removes a <code>ChangeListener</code>.

-     *

-     * @param l the <code>ChangeListener</code> to remove

-     * @see #addChangeListener

-     */

-    public void removeChangeListener(ChangeListener l) {

-        listenerList.remove(ChangeListener.class, l);

-        LOG.debug(">>Remove listener");

-    }

-

-    /**

-     * Runs each <code>ChangeListener</code>'s

-     * <code>stateChanged</code> method.

-     *

-     * @see #setRangeProperties

-     * @see EventListenerList

-     */

-    protected void fireStateChanged() {

-	LOG.debug(">>Fire state changed to listeners.");

-        Object[] listeners = listenerList.getListenerList();

-        for (int i = listeners.length - 2; i >= 0; i -=2 ) {

-            if (listeners[i] == ChangeListener.class) {

-                if (changeEvent == null) {

-                    changeEvent = new ChangeEvent(this);

-                }

-                ((ChangeListener)listeners[i+1]).stateChanged(changeEvent);

-            }

-        }

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Thomas Neustupny
+ *    Laurent Braud
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.EventListenerList;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.Model;
+
+/**
+ * The model for value specifications.
+ * The target is the UML element to which this ValueSpecification is attached.
+ *
+ * The ChangeEvent/ChangeListener handling is inspired by
+ * javax.swing.DefaultBoundedRangeModel.
+ * It listens to UML model changes not caused by us,
+ * which need to trigger an update of the UI rendering.
+ *
+ * @author Thomas Neustupny
+ */
+ class UMLValueSpecificationModel
+	implements PropertyChangeListener {
+
+    private static final Logger LOG =
+        Logger.getLogger(UMLValueSpecificationModel.class);
+
+    private Object target;
+    private String propertyName;
+
+    /** This member is only used when we set the expression ourselves.
+     * In this case, we do not wish to receive UML model change events
+     * for this self-inflicted change.
+     * So, this member is used to detect this situation. */
+    private Object rememberExpression;
+
+//    private boolean mustRefresh;
+    private static final String EMPTYSTRING = "";
+
+    /** The listeners waiting for model changes. */
+    protected EventListenerList listenerList = new EventListenerList();
+
+    /**
+     * Only one <code>ChangeEvent</code> is needed per model instance
+     * since the event's only (read-only) state is the expression.  The source
+     * of events generated here is always "this".
+     */
+    protected transient ChangeEvent changeEvent = null;
+
+    /**
+     * The constructor.
+     *
+     * @param target the UML element
+     * @param name the name of the property
+     */
+    public UMLValueSpecificationModel(Object target, String name) {
+        this.target = target;
+        propertyName = name;
+//        mustRefresh = true;
+        startListeningForModelChanges();
+    }
+
+    protected void startListeningForModelChanges() {
+	if (Model.getFacade().isAUMLElement(target)) {
+	    Model.getPump().addModelEventListener(this, target,
+		    propertyName);
+	}
+	LOG.debug(">>Start listening for UML changes...");
+    }
+
+    protected void stopListeningForModelChanges() {
+	if (Model.getFacade().isAUMLElement(target)) {
+	    Model.getPump().removeModelEventListener(this, target,
+	                propertyName);
+	}
+	LOG.debug(">>Stop listening for UML changes...");
+    }
+
+    public void propertyChange(PropertyChangeEvent e) {
+	if (propertyName.equals(e.getPropertyName())) {
+	    if (rememberExpression != e.getNewValue()) {
+		fireStateChanged();
+		LOG.debug(">>UML expression changed.");
+	    } else {
+		/* This should not happen. */
+		LOG.debug(">>Got an event for a modelchange that we inflicted ourselves...");
+	    }
+	}
+    }
+
+    protected Object getTarget() {
+        return target;
+    }
+
+    /**
+     * @return the expression
+     */
+    public Object getExpression() {
+        return Model.getFacade().getInitialValue(getTarget());
+    }
+
+    /**
+     * @param expr the expression
+     */
+    private void setExpression(Object expression) {
+        Object target = getTarget();
+        assert (expression == null) || Model.getFacade().isAExpression(expression);
+        /* If we do not set it to null first, then we get a MDR DebugException: */
+        Model.getCoreHelper().setInitialValue(target, null);
+        Model.getCoreHelper().setInitialValue(target, expression);
+    }
+
+    /**
+     * @return a new expression with given language and body
+     */
+    public Object newExpression(String lang, String body) {
+        return Model.getDataTypesFactory().createExpression(lang, body);
+    }
+
+    /**
+     * @return The value text of the value specification.
+     * @deprecated I don't use it.
+     */
+    public String getText() {
+        Object expression = getExpression();
+        if (expression == null) {
+            return EMPTYSTRING;
+        }
+        return Model.getFacade().getBody(expression).toString();
+    }
+
+    
+    /**
+     * Get the ValueSpecification
+     * @return
+     */
+    public Object[] getValue(){
+	return Model.getDataTypesHelper().getValueSpecificationValues(getExpression());
+    }
+    /**
+     * Set ValueSpecification
+     * 
+     * @param tabValues: A formated array depends on type of ValueSpecification.
+     */
+    public void setValue(Object tabValues[]) {
+        // Expressions are DataTypes, not independent model elements
+        // be careful not to reuse them
+	rememberExpression = getExpression();
+	
+	//
+	stopListeningForModelChanges();
+	if (tabValues == null) {
+	    if (rememberExpression != null) {
+		    Model.getUmlFactory().delete(rememberExpression);
+	    }
+	    rememberExpression = null;
+	    
+	    setExpression(rememberExpression);
+	} else {
+	    Model.getDataTypesHelper().modifyValueSpecification(rememberExpression, tabValues);
+	    // We need to to this otherwise there is no notification
+	    // and diagram isn't change 
+	    Model.getCoreHelper().setInitialValue(target, rememberExpression);
+	    
+	    
+	}
+	
+	startListeningForModelChanges();
+    }
+
+    /**
+    *
+    * @param sType 
+    */
+   public void createValueSpecification(String sType) {
+	
+	Object exp=Model.getDataTypesHelper().createValueSpecification(getTarget(),sType);
+	// needed for notification 
+	Model.getCoreHelper().setInitialValue(target,exp);	
+	
+   }
+   
+    /**
+     * Adds a <code>ChangeListener</code>.
+     * The change listeners are run each
+     * time the expression changes.
+     *
+     * @param l the ChangeListener to add
+     * @see #removeChangeListener
+     */
+    public void addChangeListener(ChangeListener l) {
+        listenerList.add(ChangeListener.class, l);
+        LOG.debug(">>Add listener");
+    }
+
+    /**
+     * Removes a <code>ChangeListener</code>.
+     *
+     * @param l the <code>ChangeListener</code> to remove
+     * @see #addChangeListener
+     */
+    public void removeChangeListener(ChangeListener l) {
+        listenerList.remove(ChangeListener.class, l);
+        LOG.debug(">>Remove listener");
+    }
+
+    /**
+     * Runs each <code>ChangeListener</code>'s
+     * <code>stateChanged</code> method.
+     *
+     * @see #setRangeProperties
+     * @see EventListenerList
+     */
+    protected void fireStateChanged() {
+	LOG.debug(">>Fire state changed to listeners.");
+        Object[] listeners = listenerList.getListenerList();
+        for (int i = listeners.length - 2; i >= 0; i -=2 ) {
+            if (listeners[i] == ChangeListener.class) {
+                if (changeEvent == null) {
+                    changeEvent = new ChangeEvent(this);
+                }
+                ((ChangeListener)listeners[i+1]).stateChanged(changeEvent);
+            }
+        }
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanel.java	2012-12-28 10:30:46-0800
@@ -1,240 +1,240 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Thomas Neustupny

- *    Laurent Braud

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.Component;

-import java.awt.GridBagConstraints;

-import java.awt.GridBagLayout;

-import java.awt.event.ActionEvent;

-import java.awt.event.ActionListener;

-import java.lang.reflect.Constructor;

-import java.util.Collection;

-

-import javax.swing.JComboBox;

-import javax.swing.JPanel;

-import javax.swing.border.TitledBorder;

-

-import org.apache.log4j.Logger;

-import org.argouml.model.Model;

-

-/**

- * The panel that shows a value specification for an other UML element.

- * 

- * 

- * TODO: Do we need to implements ChangeListener If yes => ok If no => Can't be

- * use without *Optional class, or the *Optional don't need to !

- * 

- */

-class UMLValueSpecificationPanel extends JPanel {

-

-    /**

-     * Generated UID.

-     */

-    private static final long serialVersionUID = 1494398250907085817L;

-

-    private static final Logger LOG = Logger

-	    .getLogger(UMLValueSpecificationPanel.class);

-

-    /**

-     * 

-     */

-    private final UMLValueSpecificationModel model;

-

-    /**

-     * The component for view/change the type.

-     */

-    private JComboBox typeInstanceValueList;

-

-    /**

-     * This contains a panel to display (A checkbox for boolean, ...)

-     */

-    private UMLValueSpecificationValueField valueField;

-

-    /**

-     * 

-     * TODO: Try to use valueField.getComponent()

-     */

-    private Component scrollPane;

-

-    /**

-     * 

-     * @param model

-     * @param title

-     */

-    public UMLValueSpecificationPanel(UMLValueSpecificationModel model,

-	    String title) {

-

-	//super(new LabelledLayout());

-	super(new GridBagLayout());

-	LOG.debug(">>New ValueSpecification panel created");

-

-	TitledBorder border = new TitledBorder(title);

-	this.setBorder(border);

-

-	this.model = model;

-

-	GridBagConstraints c = new GridBagConstraints();

-	c.fill = GridBagConstraints.HORIZONTAL;

-	// c.insets = new Insets(1, 1, 1, 1);

-	c.gridx = 0;

-	c.gridy = 0;

-	c.gridwidth = GridBagConstraints.RELATIVE;

-	c.weightx = 1;

-	c.weighty = 0;

-	

-	JComboBox combo = uiSelect();

-	add(combo, c);

-

-	this.valueField = createField((String) combo.getSelectedItem());

-	

-	

-

-    }

-

-    /**

-     * 

-     * @param sType

-     * @return

-     */

-    private UMLValueSpecificationValueField createField(String sType) {

-

-	if (scrollPane != null) {

-	    remove(scrollPane);

-	}

-

-	UMLValueSpecificationValueField ret = null;

-

-	try {

-	    // TODO: Bob says the reflective code following should be replaced

-	    // with something more specific like this commented out code.

-	    // This would mean we need sType changed to a meta type Object

-	    // rather than a String.

-	    

-//	    if (Model.getFacade().isALiteralBoolean(sType)) {

-//		fieldControl = new UMLValueSpecificationValueFieldLiteralBoolean(model, true);

-//	    } else if (Model.getFacade().isALiteralString(sType)) {

-//		fieldControl = new UMLValueSpecificationValueFieldLiteralString(model, true);

-//	    } else if (Model.getFacade().isAOpaqueExpression(sType)) {

-//		fieldControl = new UMLValueSpecificationValueFieldLiteralString(model, true);

-//	    }	    

-	    

-	    Class<?> oClass= Class.forName("org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField"+sType);

-	    Constructor<?> constructeur = oClass.getConstructor (new Class [] {UMLValueSpecificationModel.class,boolean.class});

-	    ret=(UMLValueSpecificationValueField) constructeur.newInstance (new Object [] {model, true});

-	} catch (Exception e) {

-	    LOG.error("Unknow type "+sType+" : "+e, e);

-	    return null;

-	}

-

-	scrollPane = ret.getComponent();

-	

-	GridBagConstraints c = new GridBagConstraints();

-	c.fill = GridBagConstraints.BOTH;

-	c.gridx = 0;

-	c.gridy = 1;

-	c.gridwidth = GridBagConstraints.RELATIVE;

-	c.gridwidth = GridBagConstraints.RELATIVE;

-	c.weightx = 1;

-	c.weighty = 1;

-	add(scrollPane, c);

-

-	return ret;

-    }

-

-    /**

-     * Create the combobox wich display available ValueSpecification (type)

-     * 

-     * TODO LiteralNull,Expression, InstanceValue,... TODO ? Use something else

-     * that a combobox. TODO ? If combobox, can we restrict list ? For instance,

-     * can we create a Boolean for a Integer Value ?

-     * 

-     * TODO

-     * 

-     * @return

-     */

-    private JComboBox uiSelect() {

-

-	// Get the list: OpaqueExpression, LiteralString,...

-	Collection<String> listVS = Model.getDataTypesHelper()

-		.getValueSpecifications();

-	Object[] typeInstanceValue = listVS.toArray();

-

-	typeInstanceValueList = new JComboBox(typeInstanceValue);

-

-	int iSel = 0;// By default, the first value of the combobox is selected.

-

-	if (model != null) {

-	    // Get current InitialValue

-	    Object expression = this.model.getExpression();

-

-	    if (expression != null) {

-		// Select the Current type in the combobox

-

-		// if "expression" implements one of the combobox, select it

-		// TODO ? Do it in eUML module project ?

-		Class<?>[] interfaces = expression.getClass().getInterfaces();

-		iSel = -1;

-		for (int iInterf = 0; iInterf < interfaces.length && iSel == -1; iInterf++) {

-		    for (int iVS = 0; iVS < typeInstanceValue.length

-			    && iSel == -1; iVS++) {

-			if (interfaces[iInterf].getSimpleName().equals(

-				typeInstanceValue[iVS])) {

-			    iSel = iVS;

-			}

-		    }

-		}

-	    }

-

-	}

-

-	typeInstanceValueList.setSelectedIndex(iSel);

-

-	/**

-	 * When we change the type, we need to create a new Initial Value. And

-	 * to display the Panel

-	 * 

-	 * TODO: if we select the same type that the current, do nothing.

-	 */

-	typeInstanceValueList.addActionListener(new ActionListener() {

-

-	    public void actionPerformed(ActionEvent ae) {

-

-		if (ae.getActionCommand().equals("comboBoxChanged")) {

-

-		    JComboBox lst = (JComboBox) ae.getSource();

-		    String sTypeVS = (String) lst.getSelectedItem();

-		    model.createValueSpecification(sTypeVS);

-		    createField(sTypeVS);

-		    // TODO: When the attribute isn't in the diagram

-		    // , for exemple: select attribut by Explorer

-		    // Then, the refresh isn't auto: we had to click !!

-		}

-

-	    }

-	});

-

-	return typeInstanceValueList;

-    }

-

-    /**

-     * Select element in a combo.

-     */

-    public void selectDefaultVS() {

-	// default : 0 => OpaqueExpression

-	// set to 1 for test

-	typeInstanceValueList.setSelectedIndex(0);

-    }

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Thomas Neustupny
+ *    Laurent Braud
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.lang.reflect.Constructor;
+import java.util.Collection;
+
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+import javax.swing.border.TitledBorder;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.Model;
+
+/**
+ * The panel that shows a value specification for an other UML element.
+ * 
+ * 
+ * TODO: Do we need to implements ChangeListener If yes => ok If no => Can't be
+ * use without *Optional class, or the *Optional don't need to !
+ * 
+ */
+class UMLValueSpecificationPanel extends JPanel {
+
+    /**
+     * Generated UID.
+     */
+    private static final long serialVersionUID = 1494398250907085817L;
+
+    private static final Logger LOG = Logger
+	    .getLogger(UMLValueSpecificationPanel.class);
+
+    /**
+     * 
+     */
+    private final UMLValueSpecificationModel model;
+
+    /**
+     * The component for view/change the type.
+     */
+    private JComboBox typeInstanceValueList;
+
+    /**
+     * This contains a panel to display (A checkbox for boolean, ...)
+     */
+    private UMLValueSpecificationValueField valueField;
+
+    /**
+     * 
+     * TODO: Try to use valueField.getComponent()
+     */
+    private Component scrollPane;
+
+    /**
+     * 
+     * @param model
+     * @param title
+     */
+    public UMLValueSpecificationPanel(UMLValueSpecificationModel model,
+	    String title) {
+
+	//super(new LabelledLayout());
+	super(new GridBagLayout());
+	LOG.debug(">>New ValueSpecification panel created");
+
+	TitledBorder border = new TitledBorder(title);
+	this.setBorder(border);
+
+	this.model = model;
+
+	GridBagConstraints c = new GridBagConstraints();
+	c.fill = GridBagConstraints.HORIZONTAL;
+	// c.insets = new Insets(1, 1, 1, 1);
+	c.gridx = 0;
+	c.gridy = 0;
+	c.gridwidth = GridBagConstraints.RELATIVE;
+	c.weightx = 1;
+	c.weighty = 0;
+	
+	JComboBox combo = uiSelect();
+	add(combo, c);
+
+	this.valueField = createField((String) combo.getSelectedItem());
+	
+	
+
+    }
+
+    /**
+     * 
+     * @param sType
+     * @return
+     */
+    private UMLValueSpecificationValueField createField(String sType) {
+
+	if (scrollPane != null) {
+	    remove(scrollPane);
+	}
+
+	UMLValueSpecificationValueField ret = null;
+
+	try {
+	    // TODO: Bob says the reflective code following should be replaced
+	    // with something more specific like this commented out code.
+	    // This would mean we need sType changed to a meta type Object
+	    // rather than a String.
+	    
+//	    if (Model.getFacade().isALiteralBoolean(sType)) {
+//		fieldControl = new UMLValueSpecificationValueFieldLiteralBoolean(model, true);
+//	    } else if (Model.getFacade().isALiteralString(sType)) {
+//		fieldControl = new UMLValueSpecificationValueFieldLiteralString(model, true);
+//	    } else if (Model.getFacade().isAOpaqueExpression(sType)) {
+//		fieldControl = new UMLValueSpecificationValueFieldLiteralString(model, true);
+//	    }	    
+	    
+	    Class<?> oClass= Class.forName("org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField"+sType);
+	    Constructor<?> constructeur = oClass.getConstructor (new Class [] {UMLValueSpecificationModel.class,boolean.class});
+	    ret=(UMLValueSpecificationValueField) constructeur.newInstance (new Object [] {model, true});
+	} catch (Exception e) {
+	    LOG.error("Unknow type "+sType+" : "+e, e);
+	    return null;
+	}
+
+	scrollPane = ret.getComponent();
+	
+	GridBagConstraints c = new GridBagConstraints();
+	c.fill = GridBagConstraints.BOTH;
+	c.gridx = 0;
+	c.gridy = 1;
+	c.gridwidth = GridBagConstraints.RELATIVE;
+	c.gridwidth = GridBagConstraints.RELATIVE;
+	c.weightx = 1;
+	c.weighty = 1;
+	add(scrollPane, c);
+
+	return ret;
+    }
+
+    /**
+     * Create the combobox wich display available ValueSpecification (type)
+     * 
+     * TODO LiteralNull,Expression, InstanceValue,... TODO ? Use something else
+     * that a combobox. TODO ? If combobox, can we restrict list ? For instance,
+     * can we create a Boolean for a Integer Value ?
+     * 
+     * TODO
+     * 
+     * @return
+     */
+    private JComboBox uiSelect() {
+
+	// Get the list: OpaqueExpression, LiteralString,...
+	Collection<String> listVS = Model.getDataTypesHelper()
+		.getValueSpecifications();
+	Object[] typeInstanceValue = listVS.toArray();
+
+	typeInstanceValueList = new JComboBox(typeInstanceValue);
+
+	int iSel = 0;// By default, the first value of the combobox is selected.
+
+	if (model != null) {
+	    // Get current InitialValue
+	    Object expression = this.model.getExpression();
+
+	    if (expression != null) {
+		// Select the Current type in the combobox
+
+		// if "expression" implements one of the combobox, select it
+		// TODO ? Do it in eUML module project ?
+		Class<?>[] interfaces = expression.getClass().getInterfaces();
+		iSel = -1;
+		for (int iInterf = 0; iInterf < interfaces.length && iSel == -1; iInterf++) {
+		    for (int iVS = 0; iVS < typeInstanceValue.length
+			    && iSel == -1; iVS++) {
+			if (interfaces[iInterf].getSimpleName().equals(
+				typeInstanceValue[iVS])) {
+			    iSel = iVS;
+			}
+		    }
+		}
+	    }
+
+	}
+
+	typeInstanceValueList.setSelectedIndex(iSel);
+
+	/**
+	 * When we change the type, we need to create a new Initial Value. And
+	 * to display the Panel
+	 * 
+	 * TODO: if we select the same type that the current, do nothing.
+	 */
+	typeInstanceValueList.addActionListener(new ActionListener() {
+
+	    public void actionPerformed(ActionEvent ae) {
+
+		if (ae.getActionCommand().equals("comboBoxChanged")) {
+
+		    JComboBox lst = (JComboBox) ae.getSource();
+		    String sTypeVS = (String) lst.getSelectedItem();
+		    model.createValueSpecification(sTypeVS);
+		    createField(sTypeVS);
+		    // TODO: When the attribute isn't in the diagram
+		    // , for exemple: select attribut by Explorer
+		    // Then, the refresh isn't auto: we had to click !!
+		}
+
+	    }
+	});
+
+	return typeInstanceValueList;
+    }
+
+    /**
+     * Select element in a combo.
+     */
+    public void selectDefaultVS() {
+	// default : 0 => OpaqueExpression
+	// set to 1 for test
+	typeInstanceValueList.setSelectedIndex(0);
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanelOptional.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanelOptional.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanelOptional.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationPanelOptional.java	2012-12-28 10:30:46-0800
@@ -1,125 +1,125 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Laurent Braud (issue 6215)

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.BorderLayout;

-import java.awt.event.ActionEvent;

-import java.awt.event.ActionListener;

-

-import javax.swing.JCheckBox;

-import javax.swing.JPanel;

-import javax.swing.border.TitledBorder;

-import javax.swing.event.ChangeEvent;

-import javax.swing.event.ChangeListener;

-

-import org.apache.log4j.Logger;

-

-/**

- * Checkbox creates or nulls the instance of valueSpecificationPanel

- * 

- * @author BRAUD (issue 6215)

- * 

- *         Do we need : ChangeListener

- */

-class UMLValueSpecificationPanelOptional extends JPanel implements

-	ChangeListener {

-

-    private static final Logger LOG = Logger

-	    .getLogger(UMLValueSpecificationPanel.class);

-

-    /**

-     * 

-     */

-    private JCheckBox valueExists;

-

-    /**

-     * Is null if valueExists isn't check

-     */

-    private UMLValueSpecificationPanel uvsPanel;

-

-    /**

-     * 

-     */

-    private final UMLValueSpecificationModel model;

-

-    public UMLValueSpecificationPanelOptional(

-	    UMLValueSpecificationModel aModel, String title) {

-

-	super(new BorderLayout());

-	

-	LOG.debug(">>New Optional ValueSpecification panel created");

-

-	TitledBorder border = new TitledBorder(title);

-	this.setBorder(border);

-

-	this.model = aModel;

-

-	// TODO : ?? use an other CheckBox (defines in Argo and extends

-	// JCheckBox )

-	valueExists = new JCheckBox();

-

-	//

-	boolean withDefault = model.getExpression() != null;

-	valueExists.setSelected(withDefault);

-

-	valueExists.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent e) {

-		uvsPanel.setVisible(valueExists.isSelected());

-		if (valueExists.isSelected()) {

-		    // Create it [Here, OpaqueExpression which is the first

-		    // choice]

-		    // Note that if we edit the Initial value in the diagram

-		    // (double clic)

-		    // it was replaced by an OpaqueExpression

-		    uvsPanel.selectDefaultVS();

-		} else {

-		    // Destroy it

-		    model.setValue(null);

-		}

-	    }

-	});

-

-	// title = "" because already done for Optional

-	uvsPanel = new UMLValueSpecificationPanel(model, "");

-	uvsPanel.setVisible(valueExists.isSelected());

-

-	add(valueExists, BorderLayout.WEST);

-	add(uvsPanel, BorderLayout.CENTER);

-

-	model.addChangeListener(this);

-

-    }

-

-    /**

-     * TODO: Is is really used ?

-     * 

-     * @see javax.swing.JComponent#removeNotify()

-     */

-    @Override

-    public void removeNotify() {

-	model.removeChangeListener(this);

-	super.removeNotify();

-    }

-

-    /**

-     * TODO: Is is really used ?

-     * 

-     * @see javax.swing.JComponent#removeNotify()

-     */

-    public void stateChanged(ChangeEvent e) {

-	LOG.debug(">>Values shown on panel are changed");

-

-    }

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Laurent Braud (issue 6215)
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Checkbox creates or nulls the instance of valueSpecificationPanel
+ * 
+ * @author BRAUD (issue 6215)
+ * 
+ *         Do we need : ChangeListener
+ */
+class UMLValueSpecificationPanelOptional extends JPanel implements
+	ChangeListener {
+
+    private static final Logger LOG = Logger
+	    .getLogger(UMLValueSpecificationPanel.class);
+
+    /**
+     * 
+     */
+    private JCheckBox valueExists;
+
+    /**
+     * Is null if valueExists isn't check
+     */
+    private UMLValueSpecificationPanel uvsPanel;
+
+    /**
+     * 
+     */
+    private final UMLValueSpecificationModel model;
+
+    public UMLValueSpecificationPanelOptional(
+	    UMLValueSpecificationModel aModel, String title) {
+
+	super(new BorderLayout());
+	
+	LOG.debug(">>New Optional ValueSpecification panel created");
+
+	TitledBorder border = new TitledBorder(title);
+	this.setBorder(border);
+
+	this.model = aModel;
+
+	// TODO : ?? use an other CheckBox (defines in Argo and extends
+	// JCheckBox )
+	valueExists = new JCheckBox();
+
+	//
+	boolean withDefault = model.getExpression() != null;
+	valueExists.setSelected(withDefault);
+
+	valueExists.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent e) {
+		uvsPanel.setVisible(valueExists.isSelected());
+		if (valueExists.isSelected()) {
+		    // Create it [Here, OpaqueExpression which is the first
+		    // choice]
+		    // Note that if we edit the Initial value in the diagram
+		    // (double clic)
+		    // it was replaced by an OpaqueExpression
+		    uvsPanel.selectDefaultVS();
+		} else {
+		    // Destroy it
+		    model.setValue(null);
+		}
+	    }
+	});
+
+	// title = "" because already done for Optional
+	uvsPanel = new UMLValueSpecificationPanel(model, "");
+	uvsPanel.setVisible(valueExists.isSelected());
+
+	add(valueExists, BorderLayout.WEST);
+	add(uvsPanel, BorderLayout.CENTER);
+
+	model.addChangeListener(this);
+
+    }
+
+    /**
+     * TODO: Is is really used ?
+     * 
+     * @see javax.swing.JComponent#removeNotify()
+     */
+    @Override
+    public void removeNotify() {
+	model.removeChangeListener(this);
+	super.removeNotify();
+    }
+
+    /**
+     * TODO: Is is really used ?
+     * 
+     * @see javax.swing.JComponent#removeNotify()
+     */
+    public void stateChanged(ChangeEvent e) {
+	LOG.debug(">>Values shown on panel are changed");
+
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueField.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueField.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueField.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueField.java	2012-12-28 10:30:46-0800
@@ -1,94 +1,94 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Thomas Neustupny

- *    Laurent Braud

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.Component;

-

-import org.apache.log4j.Logger;

-

-abstract class UMLValueSpecificationValueField {

-

-    /**

-     * TODO: see if protected or need to be present in each subclass

-     */

-    protected static final Logger LOG = Logger

-	    .getLogger(UMLValueSpecificationValueField.class);

-

-    /**

-     * 

-     */

-    private UMLValueSpecificationModel model;

-

-    /**

-     * TODO: Use it notify Set to true to forward events to model. Only one of

-     * Language and Body fields should have this set to true.

-     */

-    private boolean notifyModel;

-

-    protected Component allField;

-

-    /**

-     * Constructor which create the Component

-     * 

-     * @param model

-     * @param notify

-     */

-    public UMLValueSpecificationValueField(UMLValueSpecificationModel aModel,

-	    boolean notify) {

-	this.model = aModel;

-	this.notifyModel = notify;

-

-	buildPanel();

-	updateFields();

-

-    }

-

-    /**

-     * Update all the Field in the Component "allField", which are display, with

-     * the value of the model

-     * 

-     */

-    protected abstract void updateFields();

-

-    /**

-     * Update the model with the field If field aren't display, need to get the

-     * current value before update

-     */

-    protected abstract void updateModel();

-

-    /**

-     * build the panel for the ValueSpecification's type

-     */

-    public abstract void buildPanel();

-

-    /**

-     * Return a component with all field need to display and modify this

-     * ValueSpecification

-     * 

-     * @return

-     */

-    public Component getComponent() {

-	return allField;

-    }

-

-    public boolean isNotifyModel() {

-	return notifyModel;

-    }

-

-    public UMLValueSpecificationModel getModel() {

-	return model;

-    }

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Thomas Neustupny
+ *    Laurent Braud
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.Component;
+
+import org.apache.log4j.Logger;
+
+abstract class UMLValueSpecificationValueField {
+
+    /**
+     * TODO: see if protected or need to be present in each subclass
+     */
+    protected static final Logger LOG = Logger
+	    .getLogger(UMLValueSpecificationValueField.class);
+
+    /**
+     * 
+     */
+    private UMLValueSpecificationModel model;
+
+    /**
+     * TODO: Use it notify Set to true to forward events to model. Only one of
+     * Language and Body fields should have this set to true.
+     */
+    private boolean notifyModel;
+
+    protected Component allField;
+
+    /**
+     * Constructor which create the Component
+     * 
+     * @param model
+     * @param notify
+     */
+    public UMLValueSpecificationValueField(UMLValueSpecificationModel aModel,
+	    boolean notify) {
+	this.model = aModel;
+	this.notifyModel = notify;
+
+	buildPanel();
+	updateFields();
+
+    }
+
+    /**
+     * Update all the Field in the Component "allField", which are display, with
+     * the value of the model
+     * 
+     */
+    protected abstract void updateFields();
+
+    /**
+     * Update the model with the field If field aren't display, need to get the
+     * current value before update
+     */
+    protected abstract void updateModel();
+
+    /**
+     * build the panel for the ValueSpecification's type
+     */
+    public abstract void buildPanel();
+
+    /**
+     * Return a component with all field need to display and modify this
+     * ValueSpecification
+     * 
+     * @return
+     */
+    public Component getComponent() {
+	return allField;
+    }
+
+    public boolean isNotifyModel() {
+	return notifyModel;
+    }
+
+    public UMLValueSpecificationModel getModel() {
+	return model;
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralBoolean.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralBoolean.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralBoolean.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralBoolean.java	2012-12-28 10:30:46-0800
@@ -1,158 +1,158 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Laurent Braud

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.event.ActionEvent;

-import java.awt.event.ActionListener;

-

-import javax.swing.ButtonGroup;

-import javax.swing.JPanel;

-import javax.swing.JRadioButton;

-import javax.swing.JScrollPane;

-

-import org.argouml.i18n.Translator;

-import org.argouml.ui.LookAndFeelMgr;

-

-class UMLValueSpecificationValueFieldLiteralBoolean extends

-	UMLValueSpecificationValueField {

-

-    private JRadioButton trueButton;

-

-    private JRadioButton falseButton;

-

-    private ButtonGroup trueFalseGroup;

-    

-    /**

-     * true if we can call UpdateModele

-     * false : We have read the model, so we have to update field. Don't update Modele a new.

-     */

-    private boolean activeUpdateModele;

-

-    /**

-     * 

-     * @param model

-     * @param notify

-     */

-    public UMLValueSpecificationValueFieldLiteralBoolean(

-	    UMLValueSpecificationModel model, boolean notify) {

-

-	super(model, notify);

-	activeUpdateModele = true;

-    }

-

-    /**

-     * The panel consist of: One CheckBox

-     * 

-     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#buildPanel()

-     */

-    @Override

-    public void buildPanel() {

-	// ///////////////////////////////////////

-	// Build the field

-	// ///////////////////////////////////////

-

-	trueButton = new JRadioButton(Translator.localize("misc.boolean.true"));

-	falseButton = new JRadioButton(Translator

-		.localize("misc.boolean.false"));

-

-	trueFalseGroup = new ButtonGroup();

-	trueFalseGroup.add(trueButton);

-	trueFalseGroup.add(falseButton);

-

-	trueButton.setFont(LookAndFeelMgr.getInstance().getStandardFont());

-	falseButton.setFont(LookAndFeelMgr.getInstance().getStandardFont());

-

-	/**

-	 * on change : Change the value in the model

-	 */

-	trueButton.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent e) {

-		updateModel();

-	    }

-	});

-

-	falseButton.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent e) {

-		updateModel();

-	    }

-	});

-

-	// ///////////////////////////////////////

-	// Add field(s) to panel

-	// ///////////////////////////////////////

-	JPanel panel = new JPanel();

-	panel.add(trueButton);

-	panel.add(falseButton);

-	this.allField = new JScrollPane(panel);

-

-    }

-

-    /**

-     * 

-     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateModel()

-     */

-    protected void updateModel() {

-	if (activeUpdateModele) {

-	    boolean oldSelected = trueButton.isSelected();

-	    boolean newSelected = isToCheck();

-

-	    // click on the already selected value must not call setValue

-	    if (oldSelected != newSelected) {

-		// The 2 Radios have only one information.

-		Boolean[] values = new Boolean[1];

-		values[0] = trueButton.isSelected();

-

-		// Update the model, and then notify

-		getModel().setValue(values);

-	    }

-	}

-    }

-

-    /**

-     * 

-     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateFields()

-     */

-    protected void updateFields() {

-	boolean oldSelected = trueButton.isSelected();

-	boolean newSelected = isToCheck();

-

-	if (oldSelected != newSelected) {

-	    boolean oldActiveUpdateModele = activeUpdateModele;

-	    activeUpdateModele = false;

-	    trueButton.setSelected(newSelected);

-	    falseButton.setSelected(!newSelected);

-	    activeUpdateModele = oldActiveUpdateModele;

-	} else {

-	    // When call by contructor : no one is selected

-	    oldSelected = falseButton.isSelected();

-	    if (oldSelected == false && newSelected == false) {

-		boolean oldActiveUpdateModele = activeUpdateModele;

-		activeUpdateModele = false;

-		falseButton.setSelected(true);

-		activeUpdateModele = oldActiveUpdateModele;

-	    }

-	}

-    }

-    

-    /**

-     * return if the value in model is "true" or not.

-     * 

-     * @return

-     */

-    public boolean isToCheck() {

-	Boolean[] values = (Boolean[]) getModel().getValue();

-	return values[0];

-    }

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Laurent Braud
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+
+import org.argouml.i18n.Translator;
+import org.argouml.ui.LookAndFeelMgr;
+
+class UMLValueSpecificationValueFieldLiteralBoolean extends
+	UMLValueSpecificationValueField {
+
+    private JRadioButton trueButton;
+
+    private JRadioButton falseButton;
+
+    private ButtonGroup trueFalseGroup;
+    
+    /**
+     * true if we can call UpdateModele
+     * false : We have read the model, so we have to update field. Don't update Modele a new.
+     */
+    private boolean activeUpdateModele;
+
+    /**
+     * 
+     * @param model
+     * @param notify
+     */
+    public UMLValueSpecificationValueFieldLiteralBoolean(
+	    UMLValueSpecificationModel model, boolean notify) {
+
+	super(model, notify);
+	activeUpdateModele = true;
+    }
+
+    /**
+     * The panel consist of: One CheckBox
+     * 
+     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#buildPanel()
+     */
+    @Override
+    public void buildPanel() {
+	// ///////////////////////////////////////
+	// Build the field
+	// ///////////////////////////////////////
+
+	trueButton = new JRadioButton(Translator.localize("misc.boolean.true"));
+	falseButton = new JRadioButton(Translator
+		.localize("misc.boolean.false"));
+
+	trueFalseGroup = new ButtonGroup();
+	trueFalseGroup.add(trueButton);
+	trueFalseGroup.add(falseButton);
+
+	trueButton.setFont(LookAndFeelMgr.getInstance().getStandardFont());
+	falseButton.setFont(LookAndFeelMgr.getInstance().getStandardFont());
+
+	/**
+	 * on change : Change the value in the model
+	 */
+	trueButton.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent e) {
+		updateModel();
+	    }
+	});
+
+	falseButton.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent e) {
+		updateModel();
+	    }
+	});
+
+	// ///////////////////////////////////////
+	// Add field(s) to panel
+	// ///////////////////////////////////////
+	JPanel panel = new JPanel();
+	panel.add(trueButton);
+	panel.add(falseButton);
+	this.allField = new JScrollPane(panel);
+
+    }
+
+    /**
+     * 
+     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateModel()
+     */
+    protected void updateModel() {
+	if (activeUpdateModele) {
+	    boolean oldSelected = trueButton.isSelected();
+	    boolean newSelected = isToCheck();
+
+	    // click on the already selected value must not call setValue
+	    if (oldSelected != newSelected) {
+		// The 2 Radios have only one information.
+		Boolean[] values = new Boolean[1];
+		values[0] = trueButton.isSelected();
+
+		// Update the model, and then notify
+		getModel().setValue(values);
+	    }
+	}
+    }
+
+    /**
+     * 
+     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateFields()
+     */
+    protected void updateFields() {
+	boolean oldSelected = trueButton.isSelected();
+	boolean newSelected = isToCheck();
+
+	if (oldSelected != newSelected) {
+	    boolean oldActiveUpdateModele = activeUpdateModele;
+	    activeUpdateModele = false;
+	    trueButton.setSelected(newSelected);
+	    falseButton.setSelected(!newSelected);
+	    activeUpdateModele = oldActiveUpdateModele;
+	} else {
+	    // When call by contructor : no one is selected
+	    oldSelected = falseButton.isSelected();
+	    if (oldSelected == false && newSelected == false) {
+		boolean oldActiveUpdateModele = activeUpdateModele;
+		activeUpdateModele = false;
+		falseButton.setSelected(true);
+		activeUpdateModele = oldActiveUpdateModele;
+	    }
+	}
+    }
+    
+    /**
+     * return if the value in model is "true" or not.
+     * 
+     * @return
+     */
+    public boolean isToCheck() {
+	Boolean[] values = (Boolean[]) getModel().getValue();
+	return values[0];
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralString.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralString.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralString.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldLiteralString.java	2012-12-28 10:30:46-0800
@@ -1,106 +1,106 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Laurent Braud

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import javax.swing.JScrollPane;

-import javax.swing.JTextArea;

-import javax.swing.event.DocumentEvent;

-import javax.swing.event.DocumentListener;

-

-import org.argouml.ui.LookAndFeelMgr;

-

-class UMLValueSpecificationValueFieldLiteralString extends

-	UMLValueSpecificationValueField implements DocumentListener {

-

-    /**

-     * Field TODO: TextArea or TextField

-     */

-    private JTextArea stringField;

-

-    /**

-     * The constructor.

-     * 

-     * @param model

-     *            ValueSpecification model, should be shared between the fields

-     * @param notify

-     *            Set to true to forward events to model. Only one of Language

-     *            and Body fields should have this set to true.

-     */

-    public UMLValueSpecificationValueFieldLiteralString(

-	    UMLValueSpecificationModel model, boolean notify) {

-	super(model, notify);

-

-    }

-

-    /**

-     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#buildPanel()

-     */

-    @Override

-    public void buildPanel() {

-	stringField = new JTextArea();

-	stringField.getDocument().addDocumentListener(this);

-	// TODO: review the tool tips ?

-	// stringField.setToolTipText(Translator.localize("label.body.tooltip"));

-	stringField.setFont(LookAndFeelMgr.getInstance().getStandardFont());

-	stringField.setRows(2); // make it stretch vertically

-

-	allField = new JScrollPane(stringField);

-

-    }

-

-    /**

-     * 

-     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateFields()

-     */

-    public void updateFields() {

-	String oldText = stringField.getText();

-	String[] tabNewText = (String[]) getModel().getValue();

-	String newText = tabNewText[0];

-	if (oldText == null || newText == null || !oldText.equals(newText)) {

-	    if (oldText != newText) {

-		stringField.setText(newText);

-	    }

-	}

-    }

-

-    @Override

-    protected void updateModel() {

-	String[] tabValues = new String[] { stringField.getText() };

-	getModel().setValue(tabValues);

-    }

-

-    /*

-     * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.

-     * DocumentEvent) TODO: Are the 3 methods uses ?

-     */

-    public void changedUpdate(final DocumentEvent p1) {

-	updateModel();

-    }

-

-    /*

-     * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.

-     * DocumentEvent)

-     */

-    public void removeUpdate(final DocumentEvent p1) {

-	updateModel();

-    }

-

-    /*

-     * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.

-     * DocumentEvent)

-     */

-    public void insertUpdate(final DocumentEvent p1) {

-	updateModel();

-    }

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Laurent Braud
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+import org.argouml.ui.LookAndFeelMgr;
+
+class UMLValueSpecificationValueFieldLiteralString extends
+	UMLValueSpecificationValueField implements DocumentListener {
+
+    /**
+     * Field TODO: TextArea or TextField
+     */
+    private JTextArea stringField;
+
+    /**
+     * The constructor.
+     * 
+     * @param model
+     *            ValueSpecification model, should be shared between the fields
+     * @param notify
+     *            Set to true to forward events to model. Only one of Language
+     *            and Body fields should have this set to true.
+     */
+    public UMLValueSpecificationValueFieldLiteralString(
+	    UMLValueSpecificationModel model, boolean notify) {
+	super(model, notify);
+
+    }
+
+    /**
+     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#buildPanel()
+     */
+    @Override
+    public void buildPanel() {
+	stringField = new JTextArea();
+	stringField.getDocument().addDocumentListener(this);
+	// TODO: review the tool tips ?
+	// stringField.setToolTipText(Translator.localize("label.body.tooltip"));
+	stringField.setFont(LookAndFeelMgr.getInstance().getStandardFont());
+	stringField.setRows(2); // make it stretch vertically
+
+	allField = new JScrollPane(stringField);
+
+    }
+
+    /**
+     * 
+     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateFields()
+     */
+    public void updateFields() {
+	String oldText = stringField.getText();
+	String[] tabNewText = (String[]) getModel().getValue();
+	String newText = tabNewText[0];
+	if (oldText == null || newText == null || !oldText.equals(newText)) {
+	    if (oldText != newText) {
+		stringField.setText(newText);
+	    }
+	}
+    }
+
+    @Override
+    protected void updateModel() {
+	String[] tabValues = new String[] { stringField.getText() };
+	getModel().setValue(tabValues);
+    }
+
+    /*
+     * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.
+     * DocumentEvent) TODO: Are the 3 methods uses ?
+     */
+    public void changedUpdate(final DocumentEvent p1) {
+	updateModel();
+    }
+
+    /*
+     * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.
+     * DocumentEvent)
+     */
+    public void removeUpdate(final DocumentEvent p1) {
+	updateModel();
+    }
+
+    /*
+     * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.
+     * DocumentEvent)
+     */
+    public void insertUpdate(final DocumentEvent p1) {
+	updateModel();
+    }
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpression.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpression.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpression.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpression.java	2012-12-28 10:30:46-0800
@@ -1,201 +1,201 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Laurent Braud

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.GridBagConstraints;

-import java.awt.GridBagLayout;

-import java.awt.Insets;

-import java.awt.event.ActionEvent;

-import java.awt.event.ActionListener;

-

-import javax.swing.JButton;

-import javax.swing.JPanel;

-import javax.swing.JTextArea;

-import javax.swing.JTextField;

-import javax.swing.event.DocumentEvent;

-import javax.swing.event.DocumentListener;

-

-import org.argouml.i18n.Translator;

-import org.argouml.ui.LookAndFeelMgr;

-

-/**

- * An OpaqueExpression can have n body n language

- * 

- * When display to user, we only show one body. A "..." button is enabled for

- * edit other.

- * 

- * TODO: Can we, by Import XMI, have 0 language/body ?

- * 

- * @author Laurent Braud

- */

-class UMLValueSpecificationValueFieldOpaqueExpression extends

-	UMLValueSpecificationValueField implements DocumentListener {

-

-    /**

-     * The body display at the moment

-     */

-    private JTextArea curBody;

-    /**

-     * The Language display at the moment

-     */

-    private JTextField curLanguage;

-

-    /**

-     * The number of the currentBody and currentLangage

-     */

-    private int currentText;

-

-    /**

-     * true if we can call UpdateModele

-     * false : We have read the model, so we have to update field. Don't update Modele a new.

-     */

-    private boolean activeUpdateModele;

-    /**

-     * The constructor.

-     */

-    public UMLValueSpecificationValueFieldOpaqueExpression(

-	    UMLValueSpecificationModel model, boolean notify) {

-	super(model, notify);

-	activeUpdateModele=true;

-    }

-

-    /**

-     * 

-     * 

-     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#buildPanel()

-     */

-    public void buildPanel() {

-	currentText = 0;

-	// Create the body and language Field

-	curBody = new JTextArea();

-	curBody.setToolTipText(Translator.localize("label.body.tooltip"));

-	curBody.setRows(2); // make it stretch vertically

-	curBody.getDocument().addDocumentListener(this);

-

-	curLanguage = new JTextField();

-	curLanguage.setToolTipText(Translator

-		.localize("label.language.tooltip"));

-	curLanguage.getDocument().addDocumentListener(this);

-

-	// Create other panel element

-	JButton button = new JButton("...");

-	button.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent e) {

-		UMLValueSpecificationValueFieldOpaqueExpressionDialog dialog = new UMLValueSpecificationValueFieldOpaqueExpressionDialog(

-			getModel(), currentText);

-		dialog.setVisible(true);

-

-		// TODO ? if this class listen the model, it will be able to

-		// change in live as it is done in the figs (diagram)

-		updateFields();

-	    }

-	});

-

-	// create Panel containing the previous field

-	JPanel panel = new JPanel();

-	panel.setFont(LookAndFeelMgr.getInstance().getStandardFont());

-

-	GridBagLayout layout = new GridBagLayout();

-	panel.setLayout(layout);

-

-	// TODO : Redo it (curBody should be as long as curLanguage+button)

-	GridBagConstraints c = new GridBagConstraints();

-	c.fill = GridBagConstraints.HORIZONTAL;

-	c.insets = new Insets(1, 1, 1, 1);

-	c.gridx = 0;

-	c.gridy = 0;

-	c.weightx = 1;

-	panel.add(curLanguage, c);

-

-	c = new GridBagConstraints();

-	c.fill = GridBagConstraints.NONE;

-	c.insets = new Insets(0, 0, 0, 0);

-	c.gridx = 1;

-	c.gridy = 0;

-	c.weightx = 0;

-	panel.add(button, c);

-

-	c = new GridBagConstraints();

-	c.fill = GridBagConstraints.BOTH;

-	c.insets = new Insets(1, 1, 1, 1);

-	c.gridx = 0;

-	c.gridy = 1;

-	c.gridwidth = GridBagConstraints.RELATIVE;

-	c.gridheight = GridBagConstraints.RELATIVE;

-	c.weightx = 1;

-	c.weighty = 1;

-	panel.add(curBody, c);

-

-	this.allField = panel;

-

-    }

-

-    /***

-     * 

-     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateFields()

-     */

-    public void updateFields() {

-	activeUpdateModele=false;

-	String oldText = curBody.getText();

-	String[] newTabText = (String[]) getModel().getValue();

-	String newText = "";

-	if (newTabText != null) {

-	    newText = newTabText[2 * currentText];

-	}

-

-	if (oldText == null || newText == null || !oldText.equals(newText)) {

-	    if (oldText != newText) {

-		curBody.setText(newText);

-	    }

-	}

-

-	oldText = curLanguage.getText();

-	newText = "";

-	if (newTabText != null) {

-	    newText = newTabText[2 * currentText + 1];

-	}

-

-	if (oldText == null || newText == null || !oldText.equals(newText)) {

-	    if (oldText != newText) {

-		curLanguage.setText(newText);

-	    }

-	}

-	activeUpdateModele=true;

-    }

-

-    /*

-     * TODO: Are the 3 methods uses ?

-     */

-    public void changedUpdate(DocumentEvent arg0) {

-	updateModel();

-    }

-

-    public void insertUpdate(DocumentEvent arg0) {

-	updateModel();

-    }

-

-    public void removeUpdate(DocumentEvent arg0) {

-	updateModel();

-    }

-

-    protected void updateModel() {

-	if(activeUpdateModele){

-	    String[] tabValues = (String[]) getModel().getValue();

-	    tabValues[2 * currentText] = curBody.getText();

-	    tabValues[2 * currentText + 1] = curLanguage.getText();

-	    getModel().setValue(tabValues);

-	}

-    }

-

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Laurent Braud
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+import org.argouml.i18n.Translator;
+import org.argouml.ui.LookAndFeelMgr;
+
+/**
+ * An OpaqueExpression can have n body n language
+ * 
+ * When display to user, we only show one body. A "..." button is enabled for
+ * edit other.
+ * 
+ * TODO: Can we, by Import XMI, have 0 language/body ?
+ * 
+ * @author Laurent Braud
+ */
+class UMLValueSpecificationValueFieldOpaqueExpression extends
+	UMLValueSpecificationValueField implements DocumentListener {
+
+    /**
+     * The body display at the moment
+     */
+    private JTextArea curBody;
+    /**
+     * The Language display at the moment
+     */
+    private JTextField curLanguage;
+
+    /**
+     * The number of the currentBody and currentLangage
+     */
+    private int currentText;
+
+    /**
+     * true if we can call UpdateModele
+     * false : We have read the model, so we have to update field. Don't update Modele a new.
+     */
+    private boolean activeUpdateModele;
+    /**
+     * The constructor.
+     */
+    public UMLValueSpecificationValueFieldOpaqueExpression(
+	    UMLValueSpecificationModel model, boolean notify) {
+	super(model, notify);
+	activeUpdateModele=true;
+    }
+
+    /**
+     * 
+     * 
+     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#buildPanel()
+     */
+    public void buildPanel() {
+	currentText = 0;
+	// Create the body and language Field
+	curBody = new JTextArea();
+	curBody.setToolTipText(Translator.localize("label.body.tooltip"));
+	curBody.setRows(2); // make it stretch vertically
+	curBody.getDocument().addDocumentListener(this);
+
+	curLanguage = new JTextField();
+	curLanguage.setToolTipText(Translator
+		.localize("label.language.tooltip"));
+	curLanguage.getDocument().addDocumentListener(this);
+
+	// Create other panel element
+	JButton button = new JButton("...");
+	button.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent e) {
+		UMLValueSpecificationValueFieldOpaqueExpressionDialog dialog = new UMLValueSpecificationValueFieldOpaqueExpressionDialog(
+			getModel(), currentText);
+		dialog.setVisible(true);
+
+		// TODO ? if this class listen the model, it will be able to
+		// change in live as it is done in the figs (diagram)
+		updateFields();
+	    }
+	});
+
+	// create Panel containing the previous field
+	JPanel panel = new JPanel();
+	panel.setFont(LookAndFeelMgr.getInstance().getStandardFont());
+
+	GridBagLayout layout = new GridBagLayout();
+	panel.setLayout(layout);
+
+	// TODO : Redo it (curBody should be as long as curLanguage+button)
+	GridBagConstraints c = new GridBagConstraints();
+	c.fill = GridBagConstraints.HORIZONTAL;
+	c.insets = new Insets(1, 1, 1, 1);
+	c.gridx = 0;
+	c.gridy = 0;
+	c.weightx = 1;
+	panel.add(curLanguage, c);
+
+	c = new GridBagConstraints();
+	c.fill = GridBagConstraints.NONE;
+	c.insets = new Insets(0, 0, 0, 0);
+	c.gridx = 1;
+	c.gridy = 0;
+	c.weightx = 0;
+	panel.add(button, c);
+
+	c = new GridBagConstraints();
+	c.fill = GridBagConstraints.BOTH;
+	c.insets = new Insets(1, 1, 1, 1);
+	c.gridx = 0;
+	c.gridy = 1;
+	c.gridwidth = GridBagConstraints.RELATIVE;
+	c.gridheight = GridBagConstraints.RELATIVE;
+	c.weightx = 1;
+	c.weighty = 1;
+	panel.add(curBody, c);
+
+	this.allField = panel;
+
+    }
+
+    /***
+     * 
+     * @see org.argouml.core.propertypanels.ui.UMLValueSpecificationValueField#updateFields()
+     */
+    public void updateFields() {
+	activeUpdateModele=false;
+	String oldText = curBody.getText();
+	String[] newTabText = (String[]) getModel().getValue();
+	String newText = "";
+	if (newTabText != null) {
+	    newText = newTabText[2 * currentText];
+	}
+
+	if (oldText == null || newText == null || !oldText.equals(newText)) {
+	    if (oldText != newText) {
+		curBody.setText(newText);
+	    }
+	}
+
+	oldText = curLanguage.getText();
+	newText = "";
+	if (newTabText != null) {
+	    newText = newTabText[2 * currentText + 1];
+	}
+
+	if (oldText == null || newText == null || !oldText.equals(newText)) {
+	    if (oldText != newText) {
+		curLanguage.setText(newText);
+	    }
+	}
+	activeUpdateModele=true;
+    }
+
+    /*
+     * TODO: Are the 3 methods uses ?
+     */
+    public void changedUpdate(DocumentEvent arg0) {
+	updateModel();
+    }
+
+    public void insertUpdate(DocumentEvent arg0) {
+	updateModel();
+    }
+
+    public void removeUpdate(DocumentEvent arg0) {
+	updateModel();
+    }
+
+    protected void updateModel() {
+	if(activeUpdateModele){
+	    String[] tabValues = (String[]) getModel().getValue();
+	    tabValues[2 * currentText] = curBody.getText();
+	    tabValues[2 * currentText + 1] = curLanguage.getText();
+	    getModel().setValue(tabValues);
+	}
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpressionDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpressionDialog.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpressionDialog.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLValueSpecificationValueFieldOpaqueExpressionDialog.java	2012-12-28 10:30:46-0800
@@ -1,456 +1,456 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2011 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Laurent Braud

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.GridBagConstraints;

-import java.awt.GridBagLayout;

-import java.awt.Insets;

-import java.awt.event.ActionEvent;

-import java.awt.event.ActionListener;

-

-import javax.swing.DefaultListModel;

-import javax.swing.JButton;

-import javax.swing.JLabel;

-import javax.swing.JList;

-import javax.swing.JPanel;

-import javax.swing.JTextArea;

-import javax.swing.JTextField;

-import javax.swing.ListSelectionModel;

-import javax.swing.event.ListSelectionEvent;

-import javax.swing.event.ListSelectionListener;

-

-import org.argouml.i18n.Translator;

-import org.argouml.util.ArgoDialog;

-

-/**

- * 

- * A dialog to edit OpaqueExpression (usefull for more than one language/Body)

- * 

- * TODO ? Review the layout

- * 

- */

-class UMLValueSpecificationValueFieldOpaqueExpressionDialog extends

-	ArgoDialog {

-

-    /**

-     * The serial version.

-     */

-    private static final long serialVersionUID = -5429439639242117770L;

-

-    /**

-     * 

-     */

-    private UMLValueSpecificationModel model;

-

-    /**

-     * current index of body/language at call

-     */

-    private int currentIndexCall;

-

-    /**

-     * current index of body/language display

-     */

-    private int currentIndex;

-

-    /**

-     * The Language field

-     */

-    private JTextField curLanguage;

-

-    /**

-     * 

-     */

-    private JTextArea curBody;

-

-    /**

-     * 

-     */

-    private JList list;

-    /**

-     * Model for JList, containing all the language value for this Property

-     */

-    private DefaultListModel listModel;

-

-    public UMLValueSpecificationValueFieldOpaqueExpressionDialog(

-	    UMLValueSpecificationModel aModel, int currentIndex) {

-

-	super("OpaqueExpression", true); //$NON-NLS-1$

-

-	this.model = aModel;

-

-	this.currentIndexCall = currentIndex;

-	this.currentIndex = currentIndex;

-

-	setSize(450, 300);

-	buildFirstPanel();

-

-	updateFields();

-    }

-

-    private void buildFirstPanel() {

-	JPanel contentPanel = new JPanel(new GridBagLayout());

-	add(contentPanel);

-

-	// The 5 main component : 2 label, a panel for langage , a panel with

-	// button, a textarea

-	JLabel labelLangage = new JLabel(Translator

-		.localize("label.language.tooltip"));

-	JLabel labelBody = new JLabel(Translator.localize("label.body.tooltip"));

-

-	curBody = new JTextArea();

-	curBody.setToolTipText(Translator.localize("label.body.tooltip"));

-	curBody.setRows(2); // make it stretch vertically

-	// TODO: The curBody must notify modification

-

-	JPanel languagePanel = buildLanguagePanel();

-

-	JPanel paneBtn = buildBoutonPanel();

-

-	// Layout

-	GridBagConstraints c = new GridBagConstraints();

-	c.fill = GridBagConstraints.HORIZONTAL;

-	c.insets = new Insets(1, 1, 1, 1);

-	c.gridx = 0;

-	c.gridy = 0;

-	c.weightx = 0.5;

-	c.weighty = 0;

-	contentPanel.add(labelLangage, c);

-

-	c = new GridBagConstraints();

-	c.insets = new Insets(1, 1, 1, 1);

-	c.fill = GridBagConstraints.HORIZONTAL;

-	c.gridx = 2;

-	c.gridy = 0;

-	c.weightx = 0.5;

-	c.weighty = 0;

-	contentPanel.add(labelBody, c);

-

-	c = new GridBagConstraints();

-	c.insets = new Insets(1, 1, 1, 1);

-	c.fill = GridBagConstraints.HORIZONTAL;

-	c.gridx = 0;

-	c.gridy = 1;

-	c.weightx = 0.5;

-	c.weighty = 0;

-	c.anchor = GridBagConstraints.NORTHEAST;

-	contentPanel.add(languagePanel, c);

-

-	c = new GridBagConstraints();

-	c.insets = new Insets(1, 1, 1, 1);

-	c.fill = GridBagConstraints.BOTH;

-	c.gridx = 2;

-	c.gridy = 1;

-	c.weightx = 0.5;

-	c.weighty = 1;

-	contentPanel.add(curBody, c);

-

-	c = new GridBagConstraints();

-	c.insets = new Insets(1, 1, 1, 1);

-	c.fill = GridBagConstraints.NONE;

-	c.gridx = 1;

-	c.gridy = 1;

-	contentPanel.add(paneBtn, c);

-

-    }

-

-    private JPanel buildBoutonPanel() {

-	JPanel paneBtn = new JPanel(new GridBagLayout());

-

-	// Save the model (current)

-	JButton btnApply = new JButton(Translator.localize("button.ok"));

-	btnApply.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent arg0) {

-		String[] tabValues = (String[]) model.getValue();

-		boolean bContinue = true;

-		if (!curLanguage.getText().equals(

-			tabValues[2 * currentIndex + 1])) {

-		    // Language has changed

-		    bContinue = isUniqueLanguage(tabValues, curLanguage

-			    .getText());

-

-		}

-		if (bContinue) {

-		    tabValues[2 * currentIndex] = curBody.getText();

-		    tabValues[2 * currentIndex + 1] = curLanguage.getText();

-		    model.setValue(tabValues);

-		    updateFields();

-		}

-		// TODO: else : alert

-

-	    }

-	});

-

-	// Add a new entry in the list and select it.

-	// Translator.localize("button.add")

-	JButton btnAdd = new JButton("+"); // +

-	btnAdd.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent arg0) {

-		String[] tabValues = (String[]) model.getValue();

-

-		int num = getEmptyLanguage(tabValues);

-		if (num == -1) {

-		    String[] newTabValues = new String[tabValues.length + 2];

-		    System.arraycopy(tabValues, 0, newTabValues, 0,

-			    tabValues.length);

-		    newTabValues[tabValues.length] = "";

-		    newTabValues[tabValues.length + 1] = "";

-		    model.setValue(newTabValues);

-

-		    currentIndex = newTabValues.length / 2 - 1;

-

-		    updateFields();

-		} else {

-		    // A language must be unique

-		    // So, select the current empty language.

-		    // TODO ? Alert

-		    currentIndex = num;

-		    updateFields();

-

-		}

-

-	    }

-	});

-

-	// Translator.localize("button.delete")

-	JButton btnDel = new JButton("-");

-	btnDel.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent arg0) {

-		String[] tabValues = (String[]) model.getValue();

-		if (tabValues.length > 2) {

-		    String[] newTabValues = new String[tabValues.length - 2];

-

-		    if (currentIndex > 0) {

-			// Copy previous element

-			System.arraycopy(tabValues, 0, newTabValues, 0,

-				currentIndex * 2);

-		    }

-		    if (currentIndex < tabValues.length / 2) {

-			// Copy next element

-			System.arraycopy(tabValues, currentIndex * 2 + 2,

-				newTabValues, currentIndex * 2,

-				tabValues.length - (currentIndex * 2 + 2));

-		    }

-

-		    model.setValue(newTabValues);

-

-		    if (currentIndex * 2 > newTabValues.length) {

-			currentIndex = newTabValues.length / 2 - 1;

-		    }

-

-		    updateFields();

-

-		} else {

-		    String[] newTabValues = new String[2];

-		    newTabValues[0] = "";

-		    newTabValues[1] = "";

-		    model.setValue(newTabValues);

-		    updateFields();

-		}

-

-	    }

-	});

-

-	// Translator.localize("button.move-up")

-	JButton btnUp = new JButton("/\\");

-	btnUp.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent arg0) {

-		if (currentIndex > 0) {

-		    String[] tabValues = (String[]) model.getValue();

-		    String[] savTabValues = new String[2];

-		    // Copy in memory the current

-		    System.arraycopy(tabValues, currentIndex * 2, savTabValues,

-			    0, 2);

-

-		    // Copy the previous value in the current

-		    tabValues[currentIndex * 2] = tabValues[currentIndex * 2 - 2];

-		    tabValues[currentIndex * 2 + 1] = tabValues[currentIndex * 2 - 1];

-

-		    // Copy the current in the previous

-		    tabValues[(currentIndex - 1) * 2] = savTabValues[0];

-		    tabValues[(currentIndex - 1) * 2 + 1] = savTabValues[1];

-

-		    model.setValue(tabValues);

-

-		    currentIndex = currentIndex - 1;

-		    updateFields();

-

-		}

-

-	    }

-	});

-

-	// Translator.localize("button.move-down")

-	JButton btnDown = new JButton("\\/");

-	btnDown.addActionListener(new ActionListener() {

-	    public void actionPerformed(ActionEvent arg0) {

-

-		if (currentIndex + 1 < listModel.size()) {

-		    String[] tabValues = (String[]) model.getValue();

-		    String[] savTabValues = new String[2];

-		    // Copy in memory the current

-		    System.arraycopy(tabValues, currentIndex * 2, savTabValues,

-			    0, 2);

-

-		    // Copy the next value in the current

-		    tabValues[currentIndex * 2] = tabValues[(currentIndex + 1) * 2];

-		    tabValues[currentIndex * 2 + 1] = tabValues[(currentIndex + 1) * 2 + 1];

-

-		    // Copy the current in the next

-		    tabValues[(currentIndex + 1) * 2] = savTabValues[0];

-		    tabValues[(currentIndex + 1) * 2 + 1] = savTabValues[1];

-

-		    model.setValue(tabValues);

-

-		    currentIndex = currentIndex + 1;

-		    updateFields();

-

-		}

-

-	    }

-	});

-	// Layout

-	GridBagConstraints c = new GridBagConstraints();

-	c.fill = GridBagConstraints.NONE;

-	c.gridx = 0;

-	c.gridy = 0;

-	paneBtn.add(btnApply, c);

-

-	c = new GridBagConstraints();

-	c.fill = GridBagConstraints.NONE;

-	c.gridx = 0;

-	c.gridy = 1;

-	paneBtn.add(btnAdd, c);

-

-	c = new GridBagConstraints();

-	c.fill = GridBagConstraints.NONE;

-	c.gridx = 0;

-	c.gridy = 2;

-	paneBtn.add(btnDel, c);

-

-	c = new GridBagConstraints();

-	c.fill = GridBagConstraints.NONE;

-	c.gridx = 0;

-	c.gridy = 3;

-	paneBtn.add(btnUp, c);

-

-	c = new GridBagConstraints();

-	c.fill = GridBagConstraints.NONE;

-	c.gridx = 0;

-	c.gridy = 4;

-	paneBtn.add(btnDown, c);

-

-	return paneBtn;

-    }

-

-    private JPanel buildLanguagePanel() {

-	JPanel panel = new JPanel(new GridBagLayout());

-

-	// The 2 component: a textField and a list

-	curLanguage = new JTextField();

-

-	listModel = new DefaultListModel();

-	list = new JList(listModel);

-	list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

-	list.setSelectedIndex(currentIndex);

-

-	list.addListSelectionListener(new ListSelectionListener() {

-

-	    public void valueChanged(ListSelectionEvent arg0) {

-		if (list.getSelectedIndex() != -1) {

-		    if (list.getSelectedIndex() != currentIndex) {

-			currentIndex = list.getSelectedIndex();

-			updateFields();

-		    }

-

-		}

-

-	    }

-	});

-

-	// Layout

-	GridBagConstraints c = new GridBagConstraints();

-	c.insets = new Insets(1, 1, 1, 1);

-	c.fill = GridBagConstraints.HORIZONTAL;

-	c.gridx = 0;

-	c.gridy = 0;

-	c.weightx = 1;

-	panel.add(curLanguage, c);

-

-	c = new GridBagConstraints();

-	c.insets = new Insets(1, 1, 1, 1);

-	c.fill = GridBagConstraints.BOTH;

-	c.gridx = 0;

-	c.gridy = 1;

-	c.weightx = 1;

-	c.weighty = 1;

-	c.anchor = GridBagConstraints.NORTHEAST;

-	panel.add(list, c);

-

-	return panel;

-

-    }

-

-    private void updateFields() {

-	String[] newTabText = (String[]) this.model.getValue();

-

-	if (newTabText != null) {

-	    listModel.removeAllElements();

-	    for (int i = 1; i < newTabText.length; i += 2) {

-		listModel.addElement(newTabText[i]);

-	    }

-

-	    if (currentIndex * 2 < newTabText.length) {

-

-		list.setSelectedIndex(currentIndex);

-

-		curBody.setText(newTabText[2 * currentIndex]);

-		curLanguage.setText(newTabText[2 * currentIndex + 1]);

-

-	    }

-	}

-

-    }

-

-    private boolean isUniqueLanguage(String[] tabValues, String newLanguage) {

-	// Language must be unique

-	// TODO: do it in the model (if don't use the dialog, and

-	// change the first)

-	boolean bContinue = true;

-	for (int i = 1; i < tabValues.length && bContinue; i += 2) {

-	    if (i != currentIndex) {

-		bContinue = !tabValues[i].equals(newLanguage);

-	    }

-

-	}

-	return bContinue;

-    }

-

-    /**

-     * Return the language which is empty

-     * 

-     * @param tabValues

-     * @return -1 if it doesn't exist a such language

-     * 

-     */

-    private int getEmptyLanguage(String[] tabValues) {

-	int num = -1;

-	for (int i = 1; i < tabValues.length && num == -1; i += 2) {

-	    if (tabValues[i].equals("")) {

-		num = (i - 1) / 2;

-	    }

-	}

-	return num;

-    }

-

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2011 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Laurent Braud
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.argouml.i18n.Translator;
+import org.argouml.util.ArgoDialog;
+
+/**
+ * 
+ * A dialog to edit OpaqueExpression (usefull for more than one language/Body)
+ * 
+ * TODO ? Review the layout
+ * 
+ */
+class UMLValueSpecificationValueFieldOpaqueExpressionDialog extends
+	ArgoDialog {
+
+    /**
+     * The serial version.
+     */
+    private static final long serialVersionUID = -5429439639242117770L;
+
+    /**
+     * 
+     */
+    private UMLValueSpecificationModel model;
+
+    /**
+     * current index of body/language at call
+     */
+    private int currentIndexCall;
+
+    /**
+     * current index of body/language display
+     */
+    private int currentIndex;
+
+    /**
+     * The Language field
+     */
+    private JTextField curLanguage;
+
+    /**
+     * 
+     */
+    private JTextArea curBody;
+
+    /**
+     * 
+     */
+    private JList list;
+    /**
+     * Model for JList, containing all the language value for this Property
+     */
+    private DefaultListModel listModel;
+
+    public UMLValueSpecificationValueFieldOpaqueExpressionDialog(
+	    UMLValueSpecificationModel aModel, int currentIndex) {
+
+	super("OpaqueExpression", true); //$NON-NLS-1$
+
+	this.model = aModel;
+
+	this.currentIndexCall = currentIndex;
+	this.currentIndex = currentIndex;
+
+	setSize(450, 300);
+	buildFirstPanel();
+
+	updateFields();
+    }
+
+    private void buildFirstPanel() {
+	JPanel contentPanel = new JPanel(new GridBagLayout());
+	add(contentPanel);
+
+	// The 5 main component : 2 label, a panel for langage , a panel with
+	// button, a textarea
+	JLabel labelLangage = new JLabel(Translator
+		.localize("label.language.tooltip"));
+	JLabel labelBody = new JLabel(Translator.localize("label.body.tooltip"));
+
+	curBody = new JTextArea();
+	curBody.setToolTipText(Translator.localize("label.body.tooltip"));
+	curBody.setRows(2); // make it stretch vertically
+	// TODO: The curBody must notify modification
+
+	JPanel languagePanel = buildLanguagePanel();
+
+	JPanel paneBtn = buildBoutonPanel();
+
+	// Layout
+	GridBagConstraints c = new GridBagConstraints();
+	c.fill = GridBagConstraints.HORIZONTAL;
+	c.insets = new Insets(1, 1, 1, 1);
+	c.gridx = 0;
+	c.gridy = 0;
+	c.weightx = 0.5;
+	c.weighty = 0;
+	contentPanel.add(labelLangage, c);
+
+	c = new GridBagConstraints();
+	c.insets = new Insets(1, 1, 1, 1);
+	c.fill = GridBagConstraints.HORIZONTAL;
+	c.gridx = 2;
+	c.gridy = 0;
+	c.weightx = 0.5;
+	c.weighty = 0;
+	contentPanel.add(labelBody, c);
+
+	c = new GridBagConstraints();
+	c.insets = new Insets(1, 1, 1, 1);
+	c.fill = GridBagConstraints.HORIZONTAL;
+	c.gridx = 0;
+	c.gridy = 1;
+	c.weightx = 0.5;
+	c.weighty = 0;
+	c.anchor = GridBagConstraints.NORTHEAST;
+	contentPanel.add(languagePanel, c);
+
+	c = new GridBagConstraints();
+	c.insets = new Insets(1, 1, 1, 1);
+	c.fill = GridBagConstraints.BOTH;
+	c.gridx = 2;
+	c.gridy = 1;
+	c.weightx = 0.5;
+	c.weighty = 1;
+	contentPanel.add(curBody, c);
+
+	c = new GridBagConstraints();
+	c.insets = new Insets(1, 1, 1, 1);
+	c.fill = GridBagConstraints.NONE;
+	c.gridx = 1;
+	c.gridy = 1;
+	contentPanel.add(paneBtn, c);
+
+    }
+
+    private JPanel buildBoutonPanel() {
+	JPanel paneBtn = new JPanel(new GridBagLayout());
+
+	// Save the model (current)
+	JButton btnApply = new JButton(Translator.localize("button.ok"));
+	btnApply.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent arg0) {
+		String[] tabValues = (String[]) model.getValue();
+		boolean bContinue = true;
+		if (!curLanguage.getText().equals(
+			tabValues[2 * currentIndex + 1])) {
+		    // Language has changed
+		    bContinue = isUniqueLanguage(tabValues, curLanguage
+			    .getText());
+
+		}
+		if (bContinue) {
+		    tabValues[2 * currentIndex] = curBody.getText();
+		    tabValues[2 * currentIndex + 1] = curLanguage.getText();
+		    model.setValue(tabValues);
+		    updateFields();
+		}
+		// TODO: else : alert
+
+	    }
+	});
+
+	// Add a new entry in the list and select it.
+	// Translator.localize("button.add")
+	JButton btnAdd = new JButton("+"); // +
+	btnAdd.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent arg0) {
+		String[] tabValues = (String[]) model.getValue();
+
+		int num = getEmptyLanguage(tabValues);
+		if (num == -1) {
+		    String[] newTabValues = new String[tabValues.length + 2];
+		    System.arraycopy(tabValues, 0, newTabValues, 0,
+			    tabValues.length);
+		    newTabValues[tabValues.length] = "";
+		    newTabValues[tabValues.length + 1] = "";
+		    model.setValue(newTabValues);
+
+		    currentIndex = newTabValues.length / 2 - 1;
+
+		    updateFields();
+		} else {
+		    // A language must be unique
+		    // So, select the current empty language.
+		    // TODO ? Alert
+		    currentIndex = num;
+		    updateFields();
+
+		}
+
+	    }
+	});
+
+	// Translator.localize("button.delete")
+	JButton btnDel = new JButton("-");
+	btnDel.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent arg0) {
+		String[] tabValues = (String[]) model.getValue();
+		if (tabValues.length > 2) {
+		    String[] newTabValues = new String[tabValues.length - 2];
+
+		    if (currentIndex > 0) {
+			// Copy previous element
+			System.arraycopy(tabValues, 0, newTabValues, 0,
+				currentIndex * 2);
+		    }
+		    if (currentIndex < tabValues.length / 2) {
+			// Copy next element
+			System.arraycopy(tabValues, currentIndex * 2 + 2,
+				newTabValues, currentIndex * 2,
+				tabValues.length - (currentIndex * 2 + 2));
+		    }
+
+		    model.setValue(newTabValues);
+
+		    if (currentIndex * 2 > newTabValues.length) {
+			currentIndex = newTabValues.length / 2 - 1;
+		    }
+
+		    updateFields();
+
+		} else {
+		    String[] newTabValues = new String[2];
+		    newTabValues[0] = "";
+		    newTabValues[1] = "";
+		    model.setValue(newTabValues);
+		    updateFields();
+		}
+
+	    }
+	});
+
+	// Translator.localize("button.move-up")
+	JButton btnUp = new JButton("/\\");
+	btnUp.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent arg0) {
+		if (currentIndex > 0) {
+		    String[] tabValues = (String[]) model.getValue();
+		    String[] savTabValues = new String[2];
+		    // Copy in memory the current
+		    System.arraycopy(tabValues, currentIndex * 2, savTabValues,
+			    0, 2);
+
+		    // Copy the previous value in the current
+		    tabValues[currentIndex * 2] = tabValues[currentIndex * 2 - 2];
+		    tabValues[currentIndex * 2 + 1] = tabValues[currentIndex * 2 - 1];
+
+		    // Copy the current in the previous
+		    tabValues[(currentIndex - 1) * 2] = savTabValues[0];
+		    tabValues[(currentIndex - 1) * 2 + 1] = savTabValues[1];
+
+		    model.setValue(tabValues);
+
+		    currentIndex = currentIndex - 1;
+		    updateFields();
+
+		}
+
+	    }
+	});
+
+	// Translator.localize("button.move-down")
+	JButton btnDown = new JButton("\\/");
+	btnDown.addActionListener(new ActionListener() {
+	    public void actionPerformed(ActionEvent arg0) {
+
+		if (currentIndex + 1 < listModel.size()) {
+		    String[] tabValues = (String[]) model.getValue();
+		    String[] savTabValues = new String[2];
+		    // Copy in memory the current
+		    System.arraycopy(tabValues, currentIndex * 2, savTabValues,
+			    0, 2);
+
+		    // Copy the next value in the current
+		    tabValues[currentIndex * 2] = tabValues[(currentIndex + 1) * 2];
+		    tabValues[currentIndex * 2 + 1] = tabValues[(currentIndex + 1) * 2 + 1];
+
+		    // Copy the current in the next
+		    tabValues[(currentIndex + 1) * 2] = savTabValues[0];
+		    tabValues[(currentIndex + 1) * 2 + 1] = savTabValues[1];
+
+		    model.setValue(tabValues);
+
+		    currentIndex = currentIndex + 1;
+		    updateFields();
+
+		}
+
+	    }
+	});
+	// Layout
+	GridBagConstraints c = new GridBagConstraints();
+	c.fill = GridBagConstraints.NONE;
+	c.gridx = 0;
+	c.gridy = 0;
+	paneBtn.add(btnApply, c);
+
+	c = new GridBagConstraints();
+	c.fill = GridBagConstraints.NONE;
+	c.gridx = 0;
+	c.gridy = 1;
+	paneBtn.add(btnAdd, c);
+
+	c = new GridBagConstraints();
+	c.fill = GridBagConstraints.NONE;
+	c.gridx = 0;
+	c.gridy = 2;
+	paneBtn.add(btnDel, c);
+
+	c = new GridBagConstraints();
+	c.fill = GridBagConstraints.NONE;
+	c.gridx = 0;
+	c.gridy = 3;
+	paneBtn.add(btnUp, c);
+
+	c = new GridBagConstraints();
+	c.fill = GridBagConstraints.NONE;
+	c.gridx = 0;
+	c.gridy = 4;
+	paneBtn.add(btnDown, c);
+
+	return paneBtn;
+    }
+
+    private JPanel buildLanguagePanel() {
+	JPanel panel = new JPanel(new GridBagLayout());
+
+	// The 2 component: a textField and a list
+	curLanguage = new JTextField();
+
+	listModel = new DefaultListModel();
+	list = new JList(listModel);
+	list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+	list.setSelectedIndex(currentIndex);
+
+	list.addListSelectionListener(new ListSelectionListener() {
+
+	    public void valueChanged(ListSelectionEvent arg0) {
+		if (list.getSelectedIndex() != -1) {
+		    if (list.getSelectedIndex() != currentIndex) {
+			currentIndex = list.getSelectedIndex();
+			updateFields();
+		    }
+
+		}
+
+	    }
+	});
+
+	// Layout
+	GridBagConstraints c = new GridBagConstraints();
+	c.insets = new Insets(1, 1, 1, 1);
+	c.fill = GridBagConstraints.HORIZONTAL;
+	c.gridx = 0;
+	c.gridy = 0;
+	c.weightx = 1;
+	panel.add(curLanguage, c);
+
+	c = new GridBagConstraints();
+	c.insets = new Insets(1, 1, 1, 1);
+	c.fill = GridBagConstraints.BOTH;
+	c.gridx = 0;
+	c.gridy = 1;
+	c.weightx = 1;
+	c.weighty = 1;
+	c.anchor = GridBagConstraints.NORTHEAST;
+	panel.add(list, c);
+
+	return panel;
+
+    }
+
+    private void updateFields() {
+	String[] newTabText = (String[]) this.model.getValue();
+
+	if (newTabText != null) {
+	    listModel.removeAllElements();
+	    for (int i = 1; i < newTabText.length; i += 2) {
+		listModel.addElement(newTabText[i]);
+	    }
+
+	    if (currentIndex * 2 < newTabText.length) {
+
+		list.setSelectedIndex(currentIndex);
+
+		curBody.setText(newTabText[2 * currentIndex]);
+		curLanguage.setText(newTabText[2 * currentIndex + 1]);
+
+	    }
+	}
+
+    }
+
+    private boolean isUniqueLanguage(String[] tabValues, String newLanguage) {
+	// Language must be unique
+	// TODO: do it in the model (if don't use the dialog, and
+	// change the first)
+	boolean bContinue = true;
+	for (int i = 1; i < tabValues.length && bContinue; i += 2) {
+	    if (i != currentIndex) {
+		bContinue = !tabValues[i].equals(newLanguage);
+	    }
+
+	}
+	return bContinue;
+    }
+
+    /**
+     * Return the language which is empty
+     * 
+     * @param tabValues
+     * @return -1 if it doesn't exist a such language
+     * 
+     */
+    private int getEmptyLanguage(String[] tabValues) {
+	int num = -1;
+	for (int i = 1; i < tabValues.length && num == -1; i += 2) {
+	    if (tabValues[i].equals("")) {
+		num = (i - 1) / 2;
+	    }
+	}
+	return num;
+    }
+
 }
\ No newline at end of file

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java	2012-12-28 10:30:46-0800
@@ -1,75 +1,75 @@
-/* $Id$

- *******************************************************************************

- * Copyright (c) 2010 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    Bob Tarling

- *******************************************************************************

- */

-

-package org.argouml.core.propertypanels.ui;

-

-import java.awt.LayoutManager;

-import java.util.List;

-

-import javax.swing.Action;

-import javax.swing.JPanel;

-import javax.swing.JToolBar;

-

-import org.tigris.swidgets.FlexiGridLayout;

-import org.tigris.toolbar.ToolBarFactory;

-import org.tigris.toolbar.toolbutton.PopupToolBoxButton;

-import org.tigris.toolbar.toolbutton.ToolButton;

-

-/**

- * The base class for controls on a panel.

- *

- * @author Bob Tarling

- */

-class UmlControl extends JPanel {

-	

-	/**

-	 * The uid

-	 */

-	private static final long serialVersionUID = -826243573886719300L;

-

-	public UmlControl(LayoutManager layout) {

-		super(layout);

-	}

-	

-	/**

-	 * Create a JPanel containing a single button to access the given actions.

-	 * If there if more than one button then a drop down button is created

-	 * with the actions otherwise there is a simple button for the single

-	 * action.

-	 * @param actions the actions from which to generate the panel

-	 * @return the panel containing the actions required.

-	 */

-	protected JPanel createSingleButtonPanel(List<Action> actions) {

-        final JPanel buttonPanel =

-            new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));

-		final JToolBar toolbar;

-    	if (actions.size() == 1) {

-    		final ToolButton tb = new ToolButton(actions.get(0));

-            final ToolBarFactory tbf = new ToolBarFactory(actions);

-            toolbar = tbf.createToolBar();

-            toolbar.setRollover(true);

-    	} else {

-    		final PopupToolBoxButton ptb =

-    			new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);

-            for (Action action : actions) {

-                ptb.add(action);

-            }

-            final ToolBarFactory tbf = new ToolBarFactory(new Object[] {});

-            toolbar = tbf.createToolBar();

-            toolbar.setRollover(true);

-    		toolbar.add(ptb);

-    	}

-		buttonPanel.add(toolbar);

-        return buttonPanel;

-	}

-}

+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Bob Tarling
+ *******************************************************************************
+ */
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.LayoutManager;
+import java.util.List;
+
+import javax.swing.Action;
+import javax.swing.JPanel;
+import javax.swing.JToolBar;
+
+import org.tigris.swidgets.FlexiGridLayout;
+import org.tigris.toolbar.ToolBarFactory;
+import org.tigris.toolbar.toolbutton.PopupToolBoxButton;
+import org.tigris.toolbar.toolbutton.ToolButton;
+
+/**
+ * The base class for controls on a panel.
+ *
+ * @author Bob Tarling
+ */
+class UmlControl extends JPanel {
+	
+	/**
+	 * The uid
+	 */
+	private static final long serialVersionUID = -826243573886719300L;
+
+	public UmlControl(LayoutManager layout) {
+		super(layout);
+	}
+	
+	/**
+	 * Create a JPanel containing a single button to access the given actions.
+	 * If there if more than one button then a drop down button is created
+	 * with the actions otherwise there is a simple button for the single
+	 * action.
+	 * @param actions the actions from which to generate the panel
+	 * @return the panel containing the actions required.
+	 */
+	protected JPanel createSingleButtonPanel(List<Action> actions) {
+        final JPanel buttonPanel =
+            new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
+		final JToolBar toolbar;
+    	if (actions.size() == 1) {
+    		final ToolButton tb = new ToolButton(actions.get(0));
+            final ToolBarFactory tbf = new ToolBarFactory(actions);
+            toolbar = tbf.createToolBar();
+            toolbar.setRollover(true);
+    	} else {
+    		final PopupToolBoxButton ptb =
+    			new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
+            for (Action action : actions) {
+                ptb.add(action);
+            }
+            final ToolBarFactory tbf = new ToolBarFactory(new Object[] {});
+            toolbar = tbf.createToolBar();
+            toolbar.setRollover(true);
+    		toolbar.add(ptb);
+    	}
+		buttonPanel.add(toolbar);
+        return buttonPanel;
+	}
+}

Modified: trunk/tools/cruisecontrol/emailmap.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tools/cruisecontrol/emailmap.properties?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/tools/cruisecontrol/emailmap.properties	(original)
+++ trunk/tools/cruisecontrol/emailmap.properties	2012-12-28 10:30:46-0800
@@ -1,4 +1,4 @@
[email protected]

[email protected]

[email protected]

[email protected]

[email protected]
[email protected]
[email protected]
[email protected]

Modified: trunk/tools/test-with-model/src/org/argouml/model/InitializeModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tools/test-with-model/src/org/argouml/model/InitializeModel.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/tools/test-with-model/src/org/argouml/model/InitializeModel.java	(original)
+++ trunk/tools/test-with-model/src/org/argouml/model/InitializeModel.java	2012-12-28 10:30:46-0800
@@ -1,97 +1,97 @@
-/* $Id: InitializeModel.java 17766 2010-01-11 21:21:20Z linus $

- *****************************************************************************

- * Copyright (c) 2012 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    tfmorris

- *    Linus Tolke

- *****************************************************************************

- *

- * This file was copied from the tests of argouml-app.

- */

-

-package org.argouml.model;

-

-import junit.framework.TestCase;

-

-/**

- * Class to initialize the model.

- *

- * @author lito

- */

-public final class InitializeModel {

-    

-    /**

-     * The default model implementation to start.

-     */

-    private static final String DEFAULT_MODEL_IMPLEMENTATION =

-        "org.argouml.model.mdr.MDRModelImplementation";

-

-

-    /**

-     * This is never instantiated.

-     */

-    private InitializeModel() {

-    }

-    

-    /**

-     * Initialize the Model subsystem with the default ModelImplementation.

-     */

-    public static void initializeDefault() {

-    	if (Model.isInitiated()) {

-    	    return;

-    	}

-        String className =

-            System.getProperty(

-                    "argouml.model.implementation",

-                    DEFAULT_MODEL_IMPLEMENTATION);

-        initializeModelImplementation(className);

-    }

-

-    /**

-     * Initialize the Model subsystem with the MDR ModelImplementation.

-     */

-    public static void initializeMDR() {

-        initializeModelImplementation(

-                "org.argouml.model.mdr.MDRModelImplementation");

-    }

-

-    /**

-     * Initialize the Model subsystem with the Mock Implementation.

-     *

-     * @return the newly created MockModelImplementation.

-     */

-    public static MockModelImplementation initializeMock() {

-        return (MockModelImplementation)

-            initializeModelImplementation(

-                "org.argouml.model.MockModelImplementation");

-    }

-

-    private static ModelImplementation initializeModelImplementation(

-            String name) {

-        ModelImplementation impl = null;

-

-        Class implType;

-        try {

-            implType =

-                Class.forName(name);

-        } catch (ClassNotFoundException e) {

-            TestCase.fail(e.toString());

-            return null;

-        }

-

-        try {

-            impl = (ModelImplementation) implType.newInstance();

-        } catch (InstantiationException e) {

-            TestCase.fail(e.toString());

-        } catch (IllegalAccessException e) {

-            TestCase.fail(e.toString());

-        }

-        Model.setImplementation(impl);

-        return impl;

-    }

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2012 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    tfmorris
+ *    Linus Tolke
+ *****************************************************************************
+ *
+ * This file was copied from the tests of argouml-app.
+ */
+
+package org.argouml.model;
+
+import junit.framework.TestCase;
+
+/**
+ * Class to initialize the model.
+ *
+ * @author lito
+ */
+public final class InitializeModel {
+    
+    /**
+     * The default model implementation to start.
+     */
+    private static final String DEFAULT_MODEL_IMPLEMENTATION =
+        "org.argouml.model.mdr.MDRModelImplementation";
+
+
+    /**
+     * This is never instantiated.
+     */
+    private InitializeModel() {
+    }
+    
+    /**
+     * Initialize the Model subsystem with the default ModelImplementation.
+     */
+    public static void initializeDefault() {
+    	if (Model.isInitiated()) {
+    	    return;
+    	}
+        String className =
+            System.getProperty(
+                    "argouml.model.implementation",
+                    DEFAULT_MODEL_IMPLEMENTATION);
+        initializeModelImplementation(className);
+    }
+
+    /**
+     * Initialize the Model subsystem with the MDR ModelImplementation.
+     */
+    public static void initializeMDR() {
+        initializeModelImplementation(
+                "org.argouml.model.mdr.MDRModelImplementation");
+    }
+
+    /**
+     * Initialize the Model subsystem with the Mock Implementation.
+     *
+     * @return the newly created MockModelImplementation.
+     */
+    public static MockModelImplementation initializeMock() {
+        return (MockModelImplementation)
+            initializeModelImplementation(
+                "org.argouml.model.MockModelImplementation");
+    }
+
+    private static ModelImplementation initializeModelImplementation(
+            String name) {
+        ModelImplementation impl = null;
+
+        Class implType;
+        try {
+            implType =
+                Class.forName(name);
+        } catch (ClassNotFoundException e) {
+            TestCase.fail(e.toString());
+            return null;
+        }
+
+        try {
+            impl = (ModelImplementation) implType.newInstance();
+        } catch (InstantiationException e) {
+            TestCase.fail(e.toString());
+        } catch (IllegalAccessException e) {
+            TestCase.fail(e.toString());
+        }
+        Model.setImplementation(impl);
+        return impl;
+    }
+}

Modified: trunk/tools/test-with-model/src/org/argouml/model/MockModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tools/test-with-model/src/org/argouml/model/MockModelImplementation.java?view=diff&pathrev=19906&r1=19905&r2=19906
==============================================================================
--- trunk/tools/test-with-model/src/org/argouml/model/MockModelImplementation.java	(original)
+++ trunk/tools/test-with-model/src/org/argouml/model/MockModelImplementation.java	2012-12-28 10:30:46-0800
@@ -1,666 +1,666 @@
-/* $Id: MockModelImplementation.java 19137 2011-03-25 17:11:22Z bobtarling $

- *****************************************************************************

- * Copyright (c) 2012 Contributors - see below

- * All rights reserved. This program and the accompanying materials

- * are made available under the terms of the Eclipse Public License v1.0

- * which accompanies this distribution, and is available at

- * http://www.eclipse.org/legal/epl-v10.html

- *

- * Contributors:

- *    tfmorris

- *    Linus Tolke

- *****************************************************************************

- *

- * This file was copied from the tests of argouml-app.

- */

-

-package org.argouml.model;

-

-import java.io.OutputStream;

-import java.io.Writer;

-import java.util.ArrayList;

-import java.util.List;

-

-import org.easymock.MockControl;

-

-/**

- * A mock ModelImplementation.<p>

- *

- * The Facade, the ModelEventPump, the Factories and Helpers are all

- * created as mock objects using EasyMock. For each of them, there

- * should also be a possibility to access their {@link MockControl}

- * object.

- * TODO: Create the rest of the getters for the control objects.

- *

- * @author Linus Tolke

- */

-class MockModelImplementation implements ModelImplementation {

-

-    /**

-     * A list of all the control objects.

-     */

-    private List<MockControl> controls;

-

-    /**

-     * The instance that was just created.

-     */

-    private static MockModelImplementation lastCreatedInstance;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlFacade;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlDIM;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlMEP;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlAGF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlAGH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCBF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCBH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCoreFactory;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCoreHelper;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlDTF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlDTH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlEMF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlEMH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlMMF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlMMH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlSMF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlSMH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlUmlFactory;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlUmlHelper;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlUCF;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlUCH;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlMT;

-    

-    /**

-     * Control object.

-     */

-    private MockControl controlMS;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlAK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlPK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlSK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlConK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlDK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlOK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlVK;

-

-    /**

-     * Control object.

-     */

-    private MockControl controlCopyHelper;

-

-    /**

-     * Constructor.

-     */

-    public MockModelImplementation() {

-        controls = new ArrayList<MockControl>();

-        lastCreatedInstance = this;

-

-        controlFacade = MockControl.createControl(Facade.class);

-        controls.add(controlFacade);

-

-        controlDIM = MockControl.createControl(DiagramInterchangeModel.class);

-        controls.add(controlDIM);

-

-        controlMEP = MockControl.createControl(ModelEventPump.class);

-        controls.add(controlMEP);

-

-        createBehaviorControls();

-

-        createFoundationControls();

-

-        controlMMF = MockControl.createControl(ModelManagementFactory.class);

-        controls.add(controlMMF);

-

-        controlMMH = MockControl.createControl(ModelManagementHelper.class);

-        controls.add(controlMMH);

-

-        controlUmlFactory = MockControl.createControl(UmlFactory.class);

-        controls.add(controlUmlFactory);

-

-        controlUmlHelper = MockControl.createControl(UmlHelper.class);

-        controls.add(controlUmlHelper);

-

-        controlCopyHelper = MockControl.createControl(CopyHelper.class);

-        controls.add(controlCopyHelper);

-

-	controlMS = MockControl.createControl(MessageSort.class);

-	controls.add(controlMS);

-

-        controlMT = MockControl.createControl(MetaTypes.class);

-        controls.add(controlMT);

-

-        createKindControls();

-    }

-

-    /**

-     * Create the controls for the foundation factories and helpers.

-     */

-    private void createFoundationControls() {

-        controlCoreFactory = MockControl.createControl(CoreFactory.class);

-        controls.add(controlCoreFactory);

-

-        controlCoreHelper = MockControl.createControl(CoreHelper.class);

-        controls.add(controlCoreHelper);

-

-        controlDTF = MockControl.createControl(DataTypesFactory.class);

-        controls.add(controlDTF);

-

-        controlDTH = MockControl.createControl(DataTypesHelper.class);

-        controls.add(controlDTH);

-

-        controlEMF =

-            MockControl.createControl(ExtensionMechanismsFactory.class);

-        controls.add(controlEMF);

-

-        controlEMH = MockControl.createControl(ExtensionMechanismsHelper.class);

-        controls.add(controlEMH);

-    }

-

-    /**

-     * Create the controls for all behavior elements' factories and helpers.

-     */

-    private void createBehaviorControls() {

-        controlAGH = MockControl.createControl(ActivityGraphsHelper.class);

-        controls.add(controlAGH);

-

-        controlAGF = MockControl.createControl(ActivityGraphsFactory.class);

-        controls.add(controlAGF);

-

-        controlCF = MockControl.createControl(CollaborationsFactory.class);

-        controls.add(controlCF);

-

-        controlCH = MockControl.createControl(CollaborationsHelper.class);

-        controls.add(controlCH);

-

-        controlCBF = MockControl.createControl(CommonBehaviorFactory.class);

-        controls.add(controlCBF);

-

-        controlCBH = MockControl.createControl(CommonBehaviorHelper.class);

-        controls.add(controlCBH);

-

-        controlSMF = MockControl.createControl(StateMachinesFactory.class);

-        controls.add(controlSMF);

-

-        controlSMH = MockControl.createControl(StateMachinesHelper.class);

-        controls.add(controlSMH);

-

-        controlUCF = MockControl.createControl(UseCasesFactory.class);

-        controls.add(controlUCF);

-

-        controlUCH = MockControl.createControl(UseCasesHelper.class);

-        controls.add(controlUCH);

-    }

-

-    /**

-     * Create the controls for the Kinds.

-     */

-    private void createKindControls() {

-        controlCK = MockControl.createControl(ChangeableKind.class);

-        controls.add(controlCK);

-

-        controlAK = MockControl.createControl(AggregationKind.class);

-        controls.add(controlAK);

-

-        controlPK = MockControl.createControl(PseudostateKind.class);

-        controls.add(controlPK);

-

-        controlSK = MockControl.createControl(ScopeKind.class);

-        controls.add(controlSK);

-

-        controlConK = MockControl.createControl(ConcurrencyKind.class);

-        controls.add(controlConK);

-

-        controlDK = MockControl.createControl(DirectionKind.class);

-        controls.add(controlDK);

-

-        controlOK = MockControl.createControl(OrderingKind.class);

-        controls.add(controlOK);

-

-        controlVK = MockControl.createControl(VisibilityKind.class);

-        controls.add(controlVK);

-    }

-

-    /**

-     * @return The last created MockModelImplementation.

-     */

-    public static MockModelImplementation getLatest() {

-        return lastCreatedInstance;

-    }

-

-    /**

-     * Reset all mock objects.

-     */

-    public void reset() {

-        for (MockControl control : controls) {

-            control.reset();

-        }

-    }

-

-    /**

-     * Replay all mock objects.

-     */

-    public void replay() {

-        for (MockControl control : controls) {

-            control.replay();

-        }

-    }

-    /**

-     * Verify all mock objects.

-     */

-    public void verify() {

-        for (MockControl control : controls) {

-            control.verify();

-        }

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getFacade()

-     */

-    public Facade getFacade() {

-        return (Facade) controlFacade.getMock();

-    }

-

-    /**

-     * @return The {@link MockControl} object for the Facade.

-     */

-    public MockControl getFacadeControl() {

-        return controlFacade;

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getDiagramInterchangeModel()

-     */

-    public DiagramInterchangeModel getDiagramInterchangeModel() {

-        return (DiagramInterchangeModel) controlDIM.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getModelEventPump()

-     */

-    public ModelEventPump getModelEventPump() {

-        return (ModelEventPump) controlMEP.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getActivityGraphsFactory()

-     */

-    public ActivityGraphsFactory getActivityGraphsFactory() {

-        return (ActivityGraphsFactory) controlAGF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getActivityGraphsHelper()

-     */

-    public ActivityGraphsHelper getActivityGraphsHelper() {

-        return (ActivityGraphsHelper) controlAGH.getMock();

-    }

-

-    /**

-     * @return The {@link MockControl} object for the ActivityGraphsHelper.

-     */

-    public MockControl getActivityGraphsHelperControl() {

-        return controlAGH;

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getCollaborationsFactory()

-     */

-    public CollaborationsFactory getCollaborationsFactory() {

-        return (CollaborationsFactory) controlCF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getCollaborationsHelper()

-     */

-    public CollaborationsHelper getCollaborationsHelper() {

-        return (CollaborationsHelper) controlCH.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getCommonBehaviorFactory()

-     */

-    public CommonBehaviorFactory getCommonBehaviorFactory() {

-        return (CommonBehaviorFactory) controlCBF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getCommonBehaviorHelper()

-     */

-    public CommonBehaviorHelper getCommonBehaviorHelper() {

-        return (CommonBehaviorHelper) controlCBH.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getCoreFactory()

-     */

-    public CoreFactory getCoreFactory() {

-        return (CoreFactory) controlCoreFactory.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getCoreHelper()

-     */

-    public CoreHelper getCoreHelper() {

-        return (CoreHelper) controlCoreHelper.getMock();

-    }

-

-    /**

-     * @return The {@link MockControl} object for the CoreHelper.

-     */

-    public MockControl getCoreHelperControl() {

-        return controlCoreHelper;

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getDataTypesFactory()

-     */

-    public DataTypesFactory getDataTypesFactory() {

-        return (DataTypesFactory) controlDTF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getDataTypesHelper()

-     */

-    public DataTypesHelper getDataTypesHelper() {

-        return (DataTypesHelper) controlDTH.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getExtensionMechanismsFactory()

-     */

-    public ExtensionMechanismsFactory getExtensionMechanismsFactory() {

-        return (ExtensionMechanismsFactory) controlEMF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getExtensionMechanismsHelper()

-     */

-    public ExtensionMechanismsHelper getExtensionMechanismsHelper() {

-        return (ExtensionMechanismsHelper) controlEMH.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getModelManagementFactory()

-     */

-    public ModelManagementFactory getModelManagementFactory() {

-        return (ModelManagementFactory) controlMMF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getModelManagementHelper()

-     */

-    public ModelManagementHelper getModelManagementHelper() {

-        return (ModelManagementHelper) controlMMH.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getStateMachinesFactory()

-     */

-    public StateMachinesFactory getStateMachinesFactory() {

-        return (StateMachinesFactory) controlSMF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getStateMachinesHelper()

-     */

-    public StateMachinesHelper getStateMachinesHelper() {

-        return (StateMachinesHelper) controlSMH.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getUmlFactory()

-     */

-    public UmlFactory getUmlFactory() {

-        return (UmlFactory) controlUmlFactory.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getUmlHelper()

-     */

-    public UmlHelper getUmlHelper() {

-        return (UmlHelper) controlUmlHelper.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getUseCasesFactory()

-     */

-    public UseCasesFactory getUseCasesFactory() {

-        return (UseCasesFactory) controlUCF.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getUseCasesHelper()

-     */

-    public UseCasesHelper getUseCasesHelper() {

-        return (UseCasesHelper) controlUCH.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getMessageSort()

-     */

-    public MessageSort getMessageSort() {

-        return (MessageSort) controlMS.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getMetaTypes()

-     */

-    public MetaTypes getMetaTypes() {

-        return (MetaTypes) controlMT.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getChangeableKind()

-     */

-    @SuppressWarnings("deprecation")

-    public ChangeableKind getChangeableKind() {

-        return (ChangeableKind) controlCK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getAggregationKind()

-     */

-    public AggregationKind getAggregationKind() {

-        return (AggregationKind) controlAK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getPseudostateKind()

-     */

-    public PseudostateKind getPseudostateKind() {

-        return (PseudostateKind) controlPK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getScopeKind()

-     */

-    @SuppressWarnings("deprecation")

-    public ScopeKind getScopeKind() {

-        return (ScopeKind) controlSK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getConcurrencyKind()

-     */

-    public ConcurrencyKind getConcurrencyKind() {

-        return (ConcurrencyKind) controlConK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getDirectionKind()

-     */

-    public DirectionKind getDirectionKind() {

-        return (DirectionKind) controlDK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getOrderingKind()

-     */

-    public OrderingKind getOrderingKind() {

-        return (OrderingKind) controlOK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getVisibilityKind()

-     */

-    public VisibilityKind getVisibilityKind() {

-        return (VisibilityKind) controlVK.getMock();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getXmiReader()

-     */

-    public XmiReader getXmiReader() throws UmlException {

-        throw new NotImplementedException();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getXmiWriter(java.lang.Object, java.io.Writer, java.lang.String)

-     */

-    @SuppressWarnings("deprecation")

-    public XmiWriter getXmiWriter(Object model, Writer writer, String version)

-        throws UmlException {

-        throw new NotImplementedException();

-    }

-

-    /*

-     * @see org.argouml.model.ModelImplementation#getCopyHelper()

-     */

-    public CopyHelper getCopyHelper() {

-        return (CopyHelper) controlCopyHelper.getMock();

-    }

-

-    public XmiWriter getXmiWriter(Object model, OutputStream stream,

-            String version) throws UmlException {

-        throw new NotImplementedException();

-    }

-

-}

+/* $Id$
+ *****************************************************************************
+ * Copyright (c) 2012 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    tfmorris
+ *    Linus Tolke
+ *****************************************************************************
+ *
+ * This file was copied from the tests of argouml-app.
+ */
+
+package org.argouml.model;
+
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.easymock.MockControl;
+
+/**
+ * A mock ModelImplementation.<p>
+ *
+ * The Facade, the ModelEventPump, the Factories and Helpers are all
+ * created as mock objects using EasyMock. For each of them, there
+ * should also be a possibility to access their {@link MockControl}
+ * object.
+ * TODO: Create the rest of the getters for the control objects.
+ *
+ * @author Linus Tolke
+ */
+class MockModelImplementation implements ModelImplementation {
+
+    /**
+     * A list of all the control objects.
+     */
+    private List<MockControl> controls;
+
+    /**
+     * The instance that was just created.
+     */
+    private static MockModelImplementation lastCreatedInstance;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlFacade;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlDIM;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlMEP;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlAGF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlAGH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCBF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCBH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCoreFactory;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCoreHelper;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlDTF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlDTH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlEMF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlEMH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlMMF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlMMH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlSMF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlSMH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlUmlFactory;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlUmlHelper;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlUCF;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlUCH;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlMT;
+    
+    /**
+     * Control object.
+     */
+    private MockControl controlMS;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlAK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlPK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlSK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlConK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlDK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlOK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlVK;
+
+    /**
+     * Control object.
+     */
+    private MockControl controlCopyHelper;
+
+    /**
+     * Constructor.
+     */
+    public MockModelImplementation() {
+        controls = new ArrayList<MockControl>();
+        lastCreatedInstance = this;
+
+        controlFacade = MockControl.createControl(Facade.class);
+        controls.add(controlFacade);
+
+        controlDIM = MockControl.createControl(DiagramInterchangeModel.class);
+        controls.add(controlDIM);
+
+        controlMEP = MockControl.createControl(ModelEventPump.class);
+        controls.add(controlMEP);
+
+        createBehaviorControls();
+
+        createFoundationControls();
+
+        controlMMF = MockControl.createControl(ModelManagementFactory.class);
+        controls.add(controlMMF);
+
+        controlMMH = MockControl.createControl(ModelManagementHelper.class);
+        controls.add(controlMMH);
+
+        controlUmlFactory = MockControl.createControl(UmlFactory.class);
+        controls.add(controlUmlFactory);
+
+        controlUmlHelper = MockControl.createControl(UmlHelper.class);
+        controls.add(controlUmlHelper);
+
+        controlCopyHelper = MockControl.createControl(CopyHelper.class);
+        controls.add(controlCopyHelper);
+
+	controlMS = MockControl.createControl(MessageSort.class);
+	controls.add(controlMS);
+
+        controlMT = MockControl.createControl(MetaTypes.class);
+        controls.add(controlMT);
+
+        createKindControls();
+    }
+
+    /**
+     * Create the controls for the foundation factories and helpers.
+     */
+    private void createFoundationControls() {
+        controlCoreFactory = MockControl.createControl(CoreFactory.class);
+        controls.add(controlCoreFactory);
+
+        controlCoreHelper = MockControl.createControl(CoreHelper.class);
+        controls.add(controlCoreHelper);
+
+        controlDTF = MockControl.createControl(DataTypesFactory.class);
+        controls.add(controlDTF);
+
+        controlDTH = MockControl.createControl(DataTypesHelper.class);
+        controls.add(controlDTH);
+
+        controlEMF =
+            MockControl.createControl(ExtensionMechanismsFactory.class);
+        controls.add(controlEMF);
+
+        controlEMH = MockControl.createControl(ExtensionMechanismsHelper.class);
+        controls.add(controlEMH);
+    }
+
+    /**
+     * Create the controls for all behavior elements' factories and helpers.
+     */
+    private void createBehaviorControls() {
+        controlAGH = MockControl.createControl(ActivityGraphsHelper.class);
+        controls.add(controlAGH);
+
+        controlAGF = MockControl.createControl(ActivityGraphsFactory.class);
+        controls.add(controlAGF);
+
+        controlCF = MockControl.createControl(CollaborationsFactory.class);
+        controls.add(controlCF);
+
+        controlCH = MockControl.createControl(CollaborationsHelper.class);
+        controls.add(controlCH);
+
+        controlCBF = MockControl.createControl(CommonBehaviorFactory.class);
+        controls.add(controlCBF);
+
+        controlCBH = MockControl.createControl(CommonBehaviorHelper.class);
+        controls.add(controlCBH);
+
+        controlSMF = MockControl.createControl(StateMachinesFactory.class);
+        controls.add(controlSMF);
+
+        controlSMH = MockControl.createControl(StateMachinesHelper.class);
+        controls.add(controlSMH);
+
+        controlUCF = MockControl.createControl(UseCasesFactory.class);
+        controls.add(controlUCF);
+
+        controlUCH = MockControl.createControl(UseCasesHelper.class);
+        controls.add(controlUCH);
+    }
+
+    /**
+     * Create the controls for the Kinds.
+     */
+    private void createKindControls() {
+        controlCK = MockControl.createControl(ChangeableKind.class);
+        controls.add(controlCK);
+
+        controlAK = MockControl.createControl(AggregationKind.class);
+        controls.add(controlAK);
+
+        controlPK = MockControl.createControl(PseudostateKind.class);
+        controls.add(controlPK);
+
+        controlSK = MockControl.createControl(ScopeKind.class);
+        controls.add(controlSK);
+
+        controlConK = MockControl.createControl(ConcurrencyKind.class);
+        controls.add(controlConK);
+
+        controlDK = MockControl.createControl(DirectionKind.class);
+        controls.add(controlDK);
+
+        controlOK = MockControl.createControl(OrderingKind.class);
+        controls.add(controlOK);
+
+        controlVK = MockControl.createControl(VisibilityKind.class);
+        controls.add(controlVK);
+    }
+
+    /**
+     * @return The last created MockModelImplementation.
+     */
+    public static MockModelImplementation getLatest() {
+        return lastCreatedInstance;
+    }
+
+    /**
+     * Reset all mock objects.
+     */
+    public void reset() {
+        for (MockControl control : controls) {
+            control.reset();
+        }
+    }
+
+    /**
+     * Replay all mock objects.
+     */
+    public void replay() {
+        for (MockControl control : controls) {
+            control.replay();
+        }
+    }
+    /**
+     * Verify all mock objects.
+     */
+    public void verify() {
+        for (MockControl control : controls) {
+            control.verify();
+        }
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getFacade()
+     */
+    public Facade getFacade() {
+        return (Facade) controlFacade.getMock();
+    }
+
+    /**
+     * @return The {@link MockControl} object for the Facade.
+     */
+    public MockControl getFacadeControl() {
+        return controlFacade;
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getDiagramInterchangeModel()
+     */
+    public DiagramInterchangeModel getDiagramInterchangeModel() {
+        return (DiagramInterchangeModel) controlDIM.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getModelEventPump()
+     */
+    public ModelEventPump getModelEventPump() {
+        return (ModelEventPump) controlMEP.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getActivityGraphsFactory()
+     */
+    public ActivityGraphsFactory getActivityGraphsFactory() {
+        return (ActivityGraphsFactory) controlAGF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getActivityGraphsHelper()
+     */
+    public ActivityGraphsHelper getActivityGraphsHelper() {
+        return (ActivityGraphsHelper) controlAGH.getMock();
+    }
+
+    /**
+     * @return The {@link MockControl} object for the ActivityGraphsHelper.
+     */
+    public MockControl getActivityGraphsHelperControl() {
+        return controlAGH;
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getCollaborationsFactory()
+     */
+    public CollaborationsFactory getCollaborationsFactory() {
+        return (CollaborationsFactory) controlCF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getCollaborationsHelper()
+     */
+    public CollaborationsHelper getCollaborationsHelper() {
+        return (CollaborationsHelper) controlCH.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getCommonBehaviorFactory()
+     */
+    public CommonBehaviorFactory getCommonBehaviorFactory() {
+        return (CommonBehaviorFactory) controlCBF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getCommonBehaviorHelper()
+     */
+    public CommonBehaviorHelper getCommonBehaviorHelper() {
+        return (CommonBehaviorHelper) controlCBH.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getCoreFactory()
+     */
+    public CoreFactory getCoreFactory() {
+        return (CoreFactory) controlCoreFactory.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getCoreHelper()
+     */
+    public CoreHelper getCoreHelper() {
+        return (CoreHelper) controlCoreHelper.getMock();
+    }
+
+    /**
+     * @return The {@link MockControl} object for the CoreHelper.
+     */
+    public MockControl getCoreHelperControl() {
+        return controlCoreHelper;
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getDataTypesFactory()
+     */
+    public DataTypesFactory getDataTypesFactory() {
+        return (DataTypesFactory) controlDTF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getDataTypesHelper()
+     */
+    public DataTypesHelper getDataTypesHelper() {
+        return (DataTypesHelper) controlDTH.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getExtensionMechanismsFactory()
+     */
+    public ExtensionMechanismsFactory getExtensionMechanismsFactory() {
+        return (ExtensionMechanismsFactory) controlEMF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getExtensionMechanismsHelper()
+     */
+    public ExtensionMechanismsHelper getExtensionMechanismsHelper() {
+        return (ExtensionMechanismsHelper) controlEMH.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getModelManagementFactory()
+     */
+    public ModelManagementFactory getModelManagementFactory() {
+        return (ModelManagementFactory) controlMMF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getModelManagementHelper()
+     */
+    public ModelManagementHelper getModelManagementHelper() {
+        return (ModelManagementHelper) controlMMH.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getStateMachinesFactory()
+     */
+    public StateMachinesFactory getStateMachinesFactory() {
+        return (StateMachinesFactory) controlSMF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getStateMachinesHelper()
+     */
+    public StateMachinesHelper getStateMachinesHelper() {
+        return (StateMachinesHelper) controlSMH.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getUmlFactory()
+     */
+    public UmlFactory getUmlFactory() {
+        return (UmlFactory) controlUmlFactory.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getUmlHelper()
+     */
+    public UmlHelper getUmlHelper() {
+        return (UmlHelper) controlUmlHelper.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getUseCasesFactory()
+     */
+    public UseCasesFactory getUseCasesFactory() {
+        return (UseCasesFactory) controlUCF.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getUseCasesHelper()
+     */
+    public UseCasesHelper getUseCasesHelper() {
+        return (UseCasesHelper) controlUCH.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getMessageSort()
+     */
+    public MessageSort getMessageSort() {
+        return (MessageSort) controlMS.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getMetaTypes()
+     */
+    public MetaTypes getMetaTypes() {
+        return (MetaTypes) controlMT.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getChangeableKind()
+     */
+    @SuppressWarnings("deprecation")
+    public ChangeableKind getChangeableKind() {
+        return (ChangeableKind) controlCK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getAggregationKind()
+     */
+    public AggregationKind getAggregationKind() {
+        return (AggregationKind) controlAK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getPseudostateKind()
+     */
+    public PseudostateKind getPseudostateKind() {
+        return (PseudostateKind) controlPK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getScopeKind()
+     */
+    @SuppressWarnings("deprecation")
+    public ScopeKind getScopeKind() {
+        return (ScopeKind) controlSK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getConcurrencyKind()
+     */
+    public ConcurrencyKind getConcurrencyKind() {
+        return (ConcurrencyKind) controlConK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getDirectionKind()
+     */
+    public DirectionKind getDirectionKind() {
+        return (DirectionKind) controlDK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getOrderingKind()
+     */
+    public OrderingKind getOrderingKind() {
+        return (OrderingKind) controlOK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getVisibilityKind()
+     */
+    public VisibilityKind getVisibilityKind() {
+        return (VisibilityKind) controlVK.getMock();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getXmiReader()
+     */
+    public XmiReader getXmiReader() throws UmlException {
+        throw new NotImplementedException();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getXmiWriter(java.lang.Object, java.io.Writer, java.lang.String)
+     */
+    @SuppressWarnings("deprecation")
+    public XmiWriter getXmiWriter(Object model, Writer writer, String version)
+        throws UmlException {
+        throw new NotImplementedException();
+    }
+
+    /*
+     * @see org.argouml.model.ModelImplementation#getCopyHelper()
+     */
+    public CopyHelper getCopyHelper() {
+        return (CopyHelper) controlCopyHelper.getMock();
+    }
+
+    public XmiWriter getXmiWriter(Object model, OutputStream stream,
+            String version) throws UmlException {
+        throw new NotImplementedException();
+    }
+
+}


------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=3040008

To unsubscribe from this discussion, e-mail: [[email protected]].