svn commit: r18181 - branches/BRANCH_0_30_x: . src/argouml-app src/argouml-app/src/org/argouml/Images src/argouml-app/src/org/argouml/application/helpers src/argouml-app/src/org/argouml/ui/cmd src/argouml-app/src/org/argouml/ui/explorer src/argouml-app/src/org/argouml/uml src/argouml-app/src/org/argouml/uml/ui/foundation/core src/argouml-app/tests/org/argouml/profile src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram src/argouml-core-model-euml src/argouml-core-model-euml/src/org/argouml/model/euml src/argouml-core-model-mdr/src/org/argouml/model/mdr src/argouml-core-model/src/org/argouml/model src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui www/psf
Linus Tolke <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: linus
Date: 2010-03-28 07:20:44-0700
New Revision: 18181
Added:
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/Images/Property.gif
- copied unchanged from r18178, /trunk/src/argouml-app/src/org/argouml/Images/Property.gif
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/Images/Remove.gif
- copied unchanged from r18178, /trunk/src/argouml-app/src/org/argouml/Images/Remove.gif
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels2.xml
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels2.xml
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/AbstractActionAddModelElement.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/AbstractActionAddModelElement.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateNextAction.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateNextAction.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigatePreviousAction.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigatePreviousAction.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateUpAction.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/NavigateUpAction.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxNavigator.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSignalComboBoxModel.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSignalComboBoxModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSpecificationDocument.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLReceptionSpecificationDocument.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java
- copied unchanged from r18178, /trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java
Removed:
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionArgumentListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleMessageListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierPackageImportsListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendExtensionPointListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInteractionMessagesListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLNamespaceOwnedElementListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionEffectListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionGuardListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLUseCaseExtensionPointListModel.java
Modified:
branches/BRANCH_0_30_x/ (props changed)
branches/BRANCH_0_30_x/src/argouml-app/ (props changed)
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/Images/Add.gif
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/StereotypeUtility.java
branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelFeature.java
branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/ (props changed)
branches/BRANCH_0_30_x/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigMessage.java
branches/BRANCH_0_30_x/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch
branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CommonBehaviorFactoryMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesFactoryMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesHelperMDRImpl.java
branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/Facade.java
branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/XmiReferenceRuntimeException.java (props changed)
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PanelMetaCache.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManager.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java
branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java
branches/BRANCH_0_30_x/www/psf/argouml-xml-umlpropertypanels.psf (props changed)
Log:
Merged revisions 18089 through 18178 from trunk.
Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/Images/Add.gif
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/Images/Add.gif?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
Binary files. No diff available.
Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java 2010-03-28 07:20:44-0700
@@ -1,13 +1,15 @@
/* $Id$
*****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * 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:
- * thn
+ * Thomas Neustupny
+ * Bob Tarling
+ *
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -348,8 +350,9 @@
images.put("action.find", "Find...");
images.put("action.import-sources", "Import Sources...");
images.put("action.more-info", "More Info...");
- images.put("action.navigate-back", "Navigate Back");
- images.put("action.navigate-forward", "Navigate Forward");
+ images.put("action.navigate-back", "NavigateBack");
+ images.put("action.navigate-forward", "NavigateForward");
+ images.put("action.navigate-up", "NavigateUp");
images.put("action.new", "New");
images.put("action.new-profile", "NewProfile");
images.put("action.new-todo-item", "New To Do Item...");
@@ -378,7 +381,13 @@
images.put("button.new-associationrole", "AssociationRole");
images.put("button.new-attribute", "New Attribute");
images.put("button.new-callaction", "CallAction");
+ images.put("button.new-terminateaction", "TerminateAction");
+ images.put("button.new-uninterpretedaction", "UninterpretedAction");
+ images.put("button.new-actionsequence", "ActionSequence");
+ images.put("button.new-callaction", "CallAction");
+ images.put("button.new-callevent", "CallEvent");
images.put("button.new-callstate", "CallState");
+ images.put("button.new-changeevent", "ChangeEvent");
images.put("button.new-choice", "Choice");
images.put("button.new-class", "Class");
images.put("button.new-classifierrole", "ClassifierRole");
@@ -397,6 +406,12 @@
images.put("button.new-extension-point", "New Extension Point");
images.put("button.new-extend", "Extend");
images.put("button.new-exception", "Exception");
+ images.put("button.new-extensionpoint", "ExtensionPoint");
+ images.put("button.new-guard", "Guard");
+ images.put("button.new-method", "Method");
+ images.put("button.new-message", "Message");
+ images.put("button.new-argument", "Argument");
+ images.put("button.new-property", "Property");
images.put("button.new-template-parameter", "TemplateParameter");
}
@@ -434,12 +449,14 @@
images.put("button.new-sendaction", "SendAction");
images.put("button.new-shallowhistory", "ShallowHistory");
images.put("button.new-signal", "Signal");
+ images.put("button.new-signalevent", "SignalEvent");
images.put("button.new-simplestate", "SimpleState");
images.put("button.new-stereotype", "Stereotype");
images.put("button.new-stubstate", "StubState");
images.put("button.new-subactivitystate", "SubactivityState");
images.put("button.new-submachinestate", "SubmachineState");
images.put("button.new-synchstate", "SynchState");
+ images.put("button.new-timeevent", "TimeEvent");
images.put("button.new-tagdefinition", "TagDefinition");
images.put("button.new-transition", "Transition");
images.put("button.new-uniaggregation", "UniAggregation");
Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java 2010-03-28 07:20:44-0700
@@ -1153,16 +1153,16 @@
// we wish to use as delegates for various
// com.apple.eawt.ApplicationListener methods
LOG.info("Registering Quit handler for Mac");
- OSXAdapter.setQuitHandler(this, getClass().getDeclaredMethod(
+ OSXAdapter.setQuitHandler(this, getClass().getMethod(
"macQuit", (Class[]) null));
LOG.info("Registering About handler for Mac");
- OSXAdapter.setAboutHandler(this, getClass().getDeclaredMethod(
+ OSXAdapter.setAboutHandler(this, getClass().getMethod(
"macAbout", (Class[]) null));
LOG.info("Registering Preferences handler for Mac");
OSXAdapter.setPreferencesHandler(this, getClass()
- .getDeclaredMethod("macPreferences", (Class[]) null));
+ .getMethod("macPreferences", (Class[]) null));
LOG.info("Registering File handler for Mac");
- OSXAdapter.setFileHandler(this, getClass().getDeclaredMethod(
+ OSXAdapter.setFileHandler(this, getClass().getMethod(
"macOpenFile", new Class[] {String.class}));
LOG.info("All Mac handlers set");
} catch (Exception e) {
Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/ExplorerPopup.java 2010-03-28 07:20:44-0700
@@ -114,6 +114,8 @@
new Object[] {
Model.getMetaTypes().getProfile(), // needs to be the first entry
"button.new-profile-package", // because of UML1/UML2 differences
+ Model.getMetaTypes().getParameter(),
+ "button.new-parameter",
Model.getMetaTypes().getTemplateParameter(),
"button.new-template-parameter",
Model.getMetaTypes().getPackage(),
Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/explorer/PerspectiveManager.java 2010-03-28 07:20:44-0700
@@ -47,6 +47,7 @@
import org.apache.log4j.Logger;
import org.argouml.application.api.Argo;
import org.argouml.configuration.Configuration;
+import org.argouml.model.Model;
import org.argouml.ui.explorer.rules.GoAssocRoleToMessages;
import org.argouml.ui.explorer.rules.GoBehavioralFeatureToStateDiagram;
import org.argouml.ui.explorer.rules.GoBehavioralFeatureToStateMachine;
@@ -387,7 +388,9 @@
packagePerspective.addRule(new GoLinkToStimuli());
packagePerspective.addRule(new GoStimulusToAction());
packagePerspective.addRule(new GoClassifierToCollaboration());
+ // TODO: We need a factory pattern for GoXXX classes that can determine if they are required
packagePerspective.addRule(new GoOperationToCollaboration());
+ packagePerspective.addRule(new GoOperationToSequenceDiagram());
packagePerspective.addRule(new GoModelElementToComment());
packagePerspective.addRule(new GoCollaborationToDiagram());
packagePerspective.addRule(new GoModelElementToTemplateParameter());
@@ -406,7 +409,6 @@
packagePerspective.addRule(new GoStateToEntry());
packagePerspective.addRule(new GoStateToExit());
packagePerspective.addRule(new GoClassifierToSequenceDiagram());
- packagePerspective.addRule(new GoOperationToSequenceDiagram());
packagePerspective.addRule(new GoClassifierToInstance());
packagePerspective.addRule(new GoStateToIncomingTrans());
packagePerspective.addRule(new GoStateToOutgoingTrans());
@@ -559,9 +561,10 @@
new GoModelToNode(), new GoNamespaceToClassifierAndPackage(),
new GoNamespaceToDiagram(), new GoNamespaceToOwnedElements(),
new GoNodeToResidentComponent(),
- new GoOperationToCollaborationDiagram(),
new GoOperationToCollaboration(),
- new GoOperationToSequenceDiagram(), new GoPackageToClass(),
+ new GoOperationToCollaborationDiagram(),
+ new GoOperationToSequenceDiagram(),
+ new GoPackageToClass(),
new GoPackageToElementImport(),
new GoProjectToCollaboration(), new GoProjectToDiagram(),
new GoProjectToModel(), new GoProjectToStateMachine(),
@@ -588,8 +591,24 @@
new GoUseCaseToExtensionPoint(),
new GoSubmachineStateToStateMachine(),
};
+
+ // TODO: We need a factory pattern for GoXXX classes that can determine if they are required
+ PerspectiveRule[] ruleNamesArray14 = {
+ // Enter here go rules only relevant for UML 1.4
+ // empty for now
+ };
+
+ PerspectiveRule[] ruleNamesArray2 = {
+ // Enter here go rules only relevant for UML 2
+ // empty for now
+ };
rules = Arrays.asList(ruleNamesArray);
+ if (Model.getFacade().getUmlVersion().charAt(0) == '1') {
+ rules.addAll(Arrays.asList(ruleNamesArray14));
+ } else {
+ rules.addAll(Arrays.asList(ruleNamesArray2));
+ }
}
/**
Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/StereotypeUtility.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/StereotypeUtility.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/StereotypeUtility.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/StereotypeUtility.java 2010-03-28 07:20:44-0700
@@ -56,9 +56,6 @@
/**
* Utility classes for use in diagram popup menus for stereotypes.
- *
- * @author Bob Tarling
- *
*/
public class StereotypeUtility {
Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelFeature.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelFeature.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelFeature.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/core/PropPanelFeature.java 2010-03-28 07:20:44-0700
@@ -48,7 +48,10 @@
*
* @since Nov 6, 2002
* @author [email protected]
+ * @deprecated in 0.30.1 by Bob Tarling
+ * Panels will be built by Panels subsystem in future
*/
+@Deprecated
public abstract class PropPanelFeature extends PropPanelModelElement {
private UMLFeatureOwnerScopeCheckBox ownerScopeCheckbox;
Modified: branches/BRANCH_0_30_x/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigMessage.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigMessage.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigMessage.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/FigMessage.java 2010-03-28 07:20:44-0700
@@ -414,8 +414,11 @@
protected void updateListeners(Object oldOwner, Object newOwner ) {
action = Model.getFacade().getAction(newOwner);
Set<Object[]> listeners = new HashSet<Object[]>();
+ Object action = getAction();
listeners.add(new Object[] {getOwner(), "remove"});
- listeners.add(new Object[] {getAction(), "isAsynchronous"});
+ if (action != null) {
+ listeners.add(new Object[] {action, "isAsynchronous"});
+ }
try {
updateElementListeners(listeners);
} catch (Exception e) {
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/ArgoUML%20UML2-EUML%20debug.launch?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/ArgoUML UML2-EUML debug.launch 2010-03-28 07:20:44-0700
@@ -55,5 +55,5 @@
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.argouml.application.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nouml2warning"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="argouml-app"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx400M -ea -Dargouml.modules=org.argouml.sequence2.SequenceDiagramModule -Dlog4j.configuration=org/argouml/resource/full_console.lcf -DeUML.resources=../argouml-core-model-euml/lib/uml2/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar -Dargouml.model.implementation=org.argouml.model.euml.EUMLModelImplementation"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx400M -ea -Dargouml.modules=org.argouml.sequence2.SequenceDiagramModule;org.argouml.core.propertypanels.module.XmlPropertyPanelsModule -Dlog4j.configuration=org/argouml/resource/full_console.lcf -DeUML.resources=../argouml-core-model-euml/lib/uml2/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar -Dargouml.model.implementation=org.argouml.model.euml.EUMLModelImplementation"/>
</launchConfiguration>
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java 2010-03-28 07:20:44-0700
@@ -81,6 +81,8 @@
import org.eclipse.uml2.uml.Parameter;
import org.eclipse.uml2.uml.ParameterDirectionKind;
import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Pseudostate;
+import org.eclipse.uml2.uml.PseudostateKind;
import org.eclipse.uml2.uml.RedefinableElement;
import org.eclipse.uml2.uml.Relationship;
import org.eclipse.uml2.uml.Stereotype;
@@ -1406,7 +1408,15 @@
}
public void setKind(Object handle, Object kind) {
- throw new NotYetImplementedException();
+ if( handle instanceof Parameter && kind instanceof ParameterDirectionKind) {
+ ((Parameter)handle).setDirection( (ParameterDirectionKind)kind);
+ return;
+ }
+ if( handle instanceof Pseudostate && kind instanceof PseudostateKind) {
+ ((Pseudostate)handle).setKind( (PseudostateKind)kind);
+ return;
+ }
+ throw new IllegalArgumentException( "handle: " + handle + " or kind: " + kind);
}
public void setLeaf(final Object handle, final boolean isLeaf) {
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java 2010-03-28 07:20:44-0700
@@ -1,13 +1,13 @@
/* $Id$
*****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * 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:
- * thn
+ * Bob Tarling
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -466,17 +466,24 @@
}
public Collection<Collaboration> getCollaborations(Object handle) {
- if (!(handle instanceof Classifier)) {
- throw new IllegalArgumentException();
- }
- Set<Collaboration> result = new HashSet<Collaboration>();
if (handle instanceof Classifier) {
+ Set<Collaboration> result = new HashSet<Collaboration>();
for (CollaborationUse cu : ((Classifier) handle)
.getCollaborationUses()) {
result.add(cu.getType());
}
+ return result;
}
- return result;
+ if (handle instanceof Operation) {
+ List<Collaboration> result = new ArrayList<Collaboration>();
+ for( RedefinableElement re : ((Operation)handle).getRedefinedElements()) {
+ if( re instanceof Collaboration) {
+ result.add( (Collaboration)re);
+ }
+ }
+ return result;
+ }
+ throw new IllegalArgumentException();
}
public Collection<Comment> getComments(Object handle) {
@@ -621,12 +628,33 @@
}
return ((Namespace) handle).getElementImports();
}
-
+
+ /**
+ * Get all the relationsships, that represent
+ * an import of this element.
+ *
+ * @param handle The imported model element
+ *
+ * @return A collection of ElementImport object, that represent imports of this object.
+ */
public Collection getElementImports2(Object handle) {
if (!(handle instanceof Element)) {
throw new IllegalArgumentException();
}
- throw new NotYetImplementedException();
+
+ Collection result = new ArrayList();
+
+ // Get all the relationships, that this model element has.
+ // and filter everything, that is not an import.
+ for( Relationship rel : ((Element)handle).getRelationships()) {
+ if( (rel instanceof ElementImport)
+ && ((ElementImport)rel).getImportedElement() == handle) {
+
+ result.add( rel);
+ }
+ }
+ return result;
+ // throw new NotYetImplementedException();
}
public Collection getElementResidences(Object handle) {
@@ -1119,7 +1147,7 @@
}
public Collection getRaisedSignals(Object handle) {
- throw new NotYetImplementedException();
+ return getRaisedExceptions(handle);
}
public Collection getRaisedExceptions( Object handle) {
@@ -1213,8 +1241,13 @@
}
public Object getSignal(Object handle) {
- throw new NotYetImplementedException();
-
+ if (handle instanceof SignalEvent) {
+ return ((SignalEvent) handle).getSignal();
+ }
+ if (handle instanceof Reception) {
+ return ((Reception) handle).getSignal();
+ }
+ throw new IllegalArgumentException("handle should be a SignalEvent or Reception!"); //$NON-NLS-<n>$
}
public Vertex getSource(Object handle) {
@@ -1261,7 +1294,7 @@
// return ((Property) handle).gets
return Collections.EMPTY_SET;
} else if (handle instanceof org.eclipse.uml2.uml.Class) {
- ((org.eclipse.uml2.uml.Class) handle).getInterfaceRealizations();
+ return ((org.eclipse.uml2.uml.Class) handle).getInterfaceRealizations();
}
throw new NotYetImplementedException();
@@ -2167,6 +2200,12 @@
}
public boolean isQuery(Object handle) {
+ if (handle instanceof Reception) {
+ // Even though this is not relevant for UML2 we have
+ // code calling this that expects it for UML1.4
+ // and we must handle it gracefully.
+ return false;
+ }
return ((Operation) handle).isQuery();
}
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java 2010-03-28 07:20:44-0700
@@ -351,6 +351,12 @@
o = modelImpl.getCommonBehaviorFactory().createException();
} else if (elementType == metaTypes.getTransition()) {
o = modelImpl.getStateMachinesFactory().createTransition();
+ } else if (elementType == metaTypes.getParameter()) {
+ o = modelImpl.getCoreFactory().createParameter();
+ } else if (elementType == metaTypes.getExtensionPoint()) {
+ o = modelImpl.getUseCasesFactory().createExtensionPoint();
+ } else if (elementType == metaTypes.getReception()) {
+ o = modelImpl.getCommonBehaviorFactory().createReception();
}
if (!(o instanceof EObject)) {
throw new IllegalArgumentException(
@@ -580,6 +586,7 @@
// specifies valid elements for an Actor to contain
validContainmentMap.put(Actor.class,
new Class<?>[] {
+ Operation.class,
Reception.class
});
@@ -590,15 +597,23 @@
Operation.class, Reception.class
});
+ // specifies valid elements for a Use Case to contain
+ validContainmentMap.put(Extend.class,
+ new Class<?>[] {
+ ExtensionPoint.class
+ });
+
// specifies valid elements for a Component to contain
validContainmentMap.put(Component.class,
new Class<?>[] {
+ Operation.class,
Reception.class
});
// specifies valid elements for a Node to contain
validContainmentMap.put(Node.class,
new Class<?>[] {
+ Operation.class,
Reception.class
});
@@ -611,7 +626,8 @@
// specifies valid elements for a DataType to contain
validContainmentMap.put(DataType.class,
new Class<?>[] {
- Operation.class
+ Operation.class,
+ Reception.class
});
// specifies valid elements for an Operation to contain
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CommonBehaviorFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CommonBehaviorFactoryMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CommonBehaviorFactoryMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CommonBehaviorFactoryMDRImpl.java 2010-03-28 07:20:44-0700
@@ -350,7 +350,7 @@
((SignalEvent) element).setSignal(signal);
return signal;
}
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Can't build a signal for a " + element);
}
/**
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreFactoryMDRImpl.java 2010-03-28 07:20:44-0700
@@ -50,6 +50,7 @@
import org.argouml.model.CoreFactory;
import org.argouml.model.ModelCommand;
import org.argouml.model.ModelManagementHelper;
+import org.omg.uml.behavioralelements.activitygraphs.ObjectFlowState;
import org.omg.uml.behavioralelements.commonbehavior.Reception;
import org.omg.uml.behavioralelements.commonbehavior.Signal;
import org.omg.uml.behavioralelements.statemachines.Event;
@@ -1100,15 +1101,29 @@
Parameter res = buildParameter((Classifier) type, event);
res.setKind(ParameterDirectionKindEnum.PDK_IN);
event.getParameter().add(res);
+ res.setName("arg" + event.getParameter().size());
+ return res;
+ } else if (o instanceof ObjectFlowState) {
+ ObjectFlowState ofs = (ObjectFlowState) o;
+ Parameter res = buildParameter((Classifier) type, ofs);
+ res.setKind(ParameterDirectionKindEnum.PDK_IN);
+ ofs.getParameter().add(res);
+ res.setName("arg" + ofs.getParameter().size());
return res;
} else if (o instanceof BehavioralFeature) {
BehavioralFeature oper = (BehavioralFeature) o;
Parameter res = buildParameter((Classifier) type, oper);
+ res.setKind(ParameterDirectionKindEnum.PDK_IN);
oper.getParameter().add(res);
res.setName("arg" + oper.getParameter().size());
return res;
+ } else if (o == null) {
+ throw new IllegalArgumentException(
+ "A containing element must be supplied for the parameter");
} else {
- throw new IllegalArgumentException("Unsupported object type");
+ throw new IllegalArgumentException(
+ "Unsupported contining element for parameter "
+ + o.getClass().getName());
}
}
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java 2010-03-28 07:20:44-0700
@@ -3204,6 +3204,10 @@
((Operation) operation).setSpecification(specification);
return;
}
+ if (operation instanceof Reception) {
+ ((Reception) operation).setSpecification(specification);
+ return;
+ }
throw new IllegalArgumentException("operation: " + operation);
}
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java 2010-03-28 07:20:44-0700
@@ -3006,16 +3006,7 @@
public Collection getRaisedSignals(Object handle) {
- try {
- if (handle instanceof BehavioralFeature) {
- return getRefOutermostPackage(handle).getCommonBehavior()
- .getAContextRaisedSignal().getRaisedSignal(
- (BehavioralFeature) handle);
- }
- } catch (InvalidObjectException e) {
- throw new InvalidElementException(e);
- }
- return illegalArgumentCollection(handle);
+ return getRaisedExceptions(handle);
}
/**
@@ -3026,9 +3017,14 @@
* @see org.argouml.model.Facade#getRaisedExceptions(java.lang.Object)
*/
public Collection getRaisedExceptions(Object handle) {
- if (handle instanceof Operation) {
- throw new NotImplementedException(
- "There are no exceptions in UML 1.x operations");
+ try {
+ if (handle instanceof BehavioralFeature) {
+ return getRefOutermostPackage(handle).getCommonBehavior()
+ .getAContextRaisedSignal().getRaisedSignal(
+ (BehavioralFeature) handle);
+ }
+ } catch (InvalidObjectException e) {
+ throw new InvalidElementException(e);
}
return illegalArgumentCollection(handle);
}
@@ -4452,6 +4448,8 @@
try {
if (handle instanceof Binding) {
return ((Binding) handle).getArgument();
+ } else if (handle instanceof Action) {
+ return ((Action) handle).getActualArgument();
}
} catch (InvalidObjectException e) {
throw new InvalidElementException(e);
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java 2010-03-28 07:20:44-0700
@@ -474,34 +474,34 @@
throw new InvalidElementException(e);
}
throw new IllegalArgumentException(
- "There must be a Package and a ModelElement");
+ "There must be a Package and a ModelElement we got " + pack + " and " + me);
}
public void setImportedElements(Object pack, Collection imports) {
if (pack instanceof UmlPackage) {
- Collection eis = ((UmlPackage) pack).getElementImport();
- Collection toRemove = new ArrayList();
+ Collection<ElementImport> currentImports =
+ ((UmlPackage) pack).getElementImport();
+ Collection<ElementImport> toRemove =
+ new ArrayList<ElementImport>();
Collection toAdd = new ArrayList(imports);
- Iterator i = eis.iterator();
- while (i.hasNext()) {
- ElementImport ei = (ElementImport) i.next();
+ for (final ElementImport ei : currentImports) {
if (imports.contains(ei.getImportedElement())) {
- toAdd.remove(ei);
+ toAdd.remove(ei.getImportedElement());
} else {
toRemove.add(ei);
}
}
- eis.removeAll(toRemove); // Should these also be deleted?
+ currentImports.removeAll(toRemove); // Should these also be deleted?
Collection toAddEIs = new ArrayList();
- i = toAdd.iterator();
+ Iterator i = toAdd.iterator();
while (i.hasNext()) {
ModelElement me = (ModelElement) i.next();
toAddEIs.add(modelImpl.getModelManagementFactory()
.buildElementImport(pack, me));
}
- eis.addAll(toAddEIs);
+ currentImports.addAll(toAddEIs);
return;
}
throw new IllegalArgumentException(
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java 2010-03-28 07:20:44-0700
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * bobtarling
+ * Bob Tarling
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -72,6 +72,7 @@
import org.omg.uml.behavioralelements.collaborations.Message;
import org.omg.uml.behavioralelements.commonbehavior.Action;
import org.omg.uml.behavioralelements.commonbehavior.ActionSequence;
+import org.omg.uml.behavioralelements.commonbehavior.Argument;
import org.omg.uml.behavioralelements.commonbehavior.AttributeLink;
import org.omg.uml.behavioralelements.commonbehavior.CallAction;
import org.omg.uml.behavioralelements.commonbehavior.ComponentInstance;
@@ -92,10 +93,14 @@
import org.omg.uml.behavioralelements.commonbehavior.TerminateAction;
import org.omg.uml.behavioralelements.commonbehavior.UmlException;
import org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction;
+import org.omg.uml.behavioralelements.statemachines.CallEvent;
+import org.omg.uml.behavioralelements.statemachines.ChangeEvent;
import org.omg.uml.behavioralelements.statemachines.CompositeState;
+import org.omg.uml.behavioralelements.statemachines.Event;
import org.omg.uml.behavioralelements.statemachines.FinalState;
import org.omg.uml.behavioralelements.statemachines.Guard;
import org.omg.uml.behavioralelements.statemachines.Pseudostate;
+import org.omg.uml.behavioralelements.statemachines.SignalEvent;
import org.omg.uml.behavioralelements.statemachines.SimpleState;
import org.omg.uml.behavioralelements.statemachines.State;
import org.omg.uml.behavioralelements.statemachines.StateMachine;
@@ -103,6 +108,7 @@
import org.omg.uml.behavioralelements.statemachines.StubState;
import org.omg.uml.behavioralelements.statemachines.SubmachineState;
import org.omg.uml.behavioralelements.statemachines.SynchState;
+import org.omg.uml.behavioralelements.statemachines.TimeEvent;
import org.omg.uml.behavioralelements.statemachines.Transition;
import org.omg.uml.behavioralelements.usecases.Actor;
import org.omg.uml.behavioralelements.usecases.Extend;
@@ -381,6 +387,7 @@
// specifies valid elements for an Actor to contain
validContainmentMap.put(Actor.class,
new Class<?>[] {
+ Operation.class,
Reception.class
});
@@ -391,15 +398,23 @@
Operation.class, Reception.class
});
+ // specifies valid elements for a Use Case to contain
+ validContainmentMap.put(Extend.class,
+ new Class<?>[] {
+ ExtensionPoint.class
+ });
+
// specifies valid elements for a Component to contain
validContainmentMap.put(Component.class,
new Class<?>[] {
- Reception.class
+ Reception.class,
+ Operation.class
});
// specifies valid elements for a Node to contain
validContainmentMap.put(Node.class,
new Class<?>[] {
+ Operation.class,
Reception.class
});
@@ -412,16 +427,88 @@
// specifies valid elements for a DataType to contain
validContainmentMap.put(DataType.class,
new Class<?>[] {
- Operation.class
+ Operation.class,
+ Reception.class
});
- // specifies valid elements for a Attribute to contain
+ // specifies valid elements for a Operation to contain
validContainmentMap.put(Operation.class,
new Class<?>[] {
+ Parameter.class,
+ Signal.class,
+ Method.class
+ });
+
+ // specifies valid elements for an Event to contain
+ validContainmentMap.put(Event.class,
+ new Class<?>[] {
Parameter.class
});
- }
+ // specifies valid elements for an ObjectFlowState to contain
+ validContainmentMap.put(ObjectFlowState.class,
+ new Class<?>[] {
+ Parameter.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(AssociationRole.class,
+ new Class<?>[] {
+ Message.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(CallAction.class,
+ new Class<?>[] {
+ Argument.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(UninterpretedAction.class,
+ new Class<?>[] {
+ Argument.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(ReturnAction.class,
+ new Class<?>[] {
+ Argument.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(DestroyAction.class,
+ new Class<?>[] {
+ Argument.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(SendAction.class,
+ new Class<?>[] {
+ Argument.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(TerminateAction.class,
+ new Class<?>[] {
+ Argument.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(ActionSequence.class,
+ new Class<?>[] {
+ Argument.class
+ });
+
+ // specifies valid elements for an AssociationRole to contain
+ validContainmentMap.put(Transition.class,
+ new Class<?>[] {
+ Guard.class,
+ CallAction.class, ReturnAction.class,
+ CreateAction.class, DestroyAction.class, SendAction.class, TerminateAction.class, UninterpretedAction.class, ActionSequence.class,
+ CallEvent.class, ChangeEvent.class, SignalEvent.class, TimeEvent.class
+ });
+ }
+
public Object buildConnection(Object elementType, Object fromElement,
Object fromStyle, Object toElement, Object toStyle,
Object unidirectional, Object namespace)
@@ -576,6 +663,8 @@
return getCommonBehavior().createException();
} else if (elementType == metaTypes.getTransition()) {
return getStateMachines().createTransition();
+ } else if (elementType == metaTypes.getTransition()) {
+ return getStateMachines().createTransition();
}
throw new IllegalArgumentException(
@@ -588,7 +677,12 @@
Object element = null;
// if this is a feature get the owner of that feature
- if (this.modelImpl.getFacade().isAFeature(container)) {
+ // TODO: Does anything actually make use of this? It can
+ // cause unexpected behaviour.
+ if (this.modelImpl.getFacade().isAFeature(container)
+ && elementType != metaTypes.getParameter()
+ && elementType != metaTypes.getMethod()
+ && elementType != metaTypes.getSignal()) {
container = this.modelImpl.getFacade().getOwner(container);
}
@@ -599,10 +693,7 @@
} else if (elementType == this.metaTypes.getOperation()) {
element = getCore().buildOperation(container, null);
} else if (elementType == this.metaTypes.getReception()) {
- element = this.modelImpl.getCommonBehaviorFactory().
- createReception();
-
- this.modelImpl.getCoreHelper().addOwnedElement(container, element);
+ element = this.modelImpl.getCommonBehaviorFactory().buildReception(container);
} else if (elementType == this.metaTypes.getEnumerationLiteral()) {
element = getCore().buildEnumerationLiteral(null, container);
} else if (elementType == this.metaTypes.getExtensionPoint()) {
@@ -618,7 +709,63 @@
param.setName("T"); // default parameter name
element =
modelImpl.getCoreFactory().buildTemplateParameter(container,
- param, null);
+ param, null);
+ } else if (elementType == metaTypes.getParameter()) {
+ element = getCore().buildParameter(container, null);
+ } else if (elementType == metaTypes.getSignal()) {
+ element = modelImpl.getCommonBehaviorFactory().buildSignal(container);
+ } else if (elementType == metaTypes.getMethod()) {
+ final Operation op = (Operation) container;
+ element = getCore().buildMethod(op.getName());
+ modelImpl.getCoreHelper().addMethod(op, element);
+ modelImpl.getCoreHelper().addFeature(
+ modelImpl.getFacade().getOwner(op), element);
+ } else if (elementType == metaTypes.getMessage()) {
+ Object collaboration = Model.getFacade().getNamespace(container);
+ element =
+ Model.getCollaborationsFactory()
+ .buildMessage(collaboration, container);
+ } else if (elementType == metaTypes.getArgument()) {
+ element = Model.getCommonBehaviorFactory().createArgument();
+ Model.getCommonBehaviorHelper().addActualArgument(container, element);
+ } else if (elementType == metaTypes.getGuard()) {
+ element = Model.getStateMachinesFactory().buildGuard(container);
+ } else if (elementType == metaTypes.getCreateAction()) {
+ element = Model.getCommonBehaviorFactory().createCreateAction();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getCallAction()) {
+ element = Model.getCommonBehaviorFactory().createCallAction();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getReturnAction()) {
+ element = Model.getCommonBehaviorFactory().createReturnAction();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getDestroyAction()) {
+ element = Model.getCommonBehaviorFactory().createDestroyAction();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getSendAction()) {
+ element = Model.getCommonBehaviorFactory().createSendAction();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getTerminateAction()) {
+ element = Model.getCommonBehaviorFactory().createTerminateAction();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getUninterpretedAction()) {
+ element = Model.getCommonBehaviorFactory().createUninterpretedAction();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getActionSequence()) {
+ element = Model.getCommonBehaviorFactory().createActionSequence();
+ ((Transition) container).setEffect((Action) element);
+ } else if (elementType == metaTypes.getCallEvent()) {
+ element = Model.getStateMachinesFactory().createCallEvent();
+ setNewTrigger((Transition) container, (Event) element);
+ } else if (elementType == metaTypes.getChangeEvent()) {
+ element = Model.getStateMachinesFactory().createChangeEvent();
+ setNewTrigger((Transition) container, (Event) element);
+ } else if (elementType == metaTypes.getSignalEvent()) {
+ element = Model.getStateMachinesFactory().createSignalEvent();
+ setNewTrigger((Transition) container, (Event) element);
+ } else if (elementType == metaTypes.getTimeEvent()) {
+ element = Model.getStateMachinesFactory().createTimeEvent();
+ setNewTrigger((Transition) container, (Event) element);
} else {
// build all other elements using existing buildNode
element = buildNode(elementType);
@@ -635,6 +782,19 @@
return element;
}
+ /**
+ * Add a newly created event to a trigger
+ * @param transition
+ * @param event
+ */
+ private void setNewTrigger(Transition transition, Event event) {
+ transition.setTrigger(event);
+ event.setName("");
+ final StateMachine statemachine = transition.getStateMachine();
+ final Namespace namespace = statemachine.getNamespace();
+ event.setNamespace(namespace);
+ }
+
public boolean isConnectionType(Object connectionType) {
// If our map has any entries for this type, it's a connection type
return (validConnectionMap.get(connectionType) != null);
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesFactoryMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesFactoryMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesFactoryMDRImpl.java 2010-03-28 07:20:44-0700
@@ -153,15 +153,20 @@
public ExtensionPoint buildExtensionPoint(Object modelElement) {
- if (!(modelElement instanceof UseCase)) {
+ final ExtensionPoint extensionPoint;
+ if (modelElement instanceof UseCase) {
+ UseCase useCase = (UseCase) modelElement;
+ extensionPoint = createExtensionPoint();
+ extensionPoint.setUseCase(useCase);
+ } else if (modelElement instanceof Extend) {
+ Extend extend = (Extend) modelElement;
+ extensionPoint = createExtensionPoint();
+ extend.getExtensionPoint().add(extensionPoint);
+ } else {
throw new IllegalArgumentException("An extension point can only "
- + "be built on a use case");
+ + "be built on a use case or an Extend");
}
- UseCase useCase = (UseCase) modelElement;
- ExtensionPoint extensionPoint = createExtensionPoint();
- extensionPoint.setUseCase(useCase);
-
// For consistency with attribute and operation, give it a default
// name and location
extensionPoint.setName("newEP");
Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesHelperMDRImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesHelperMDRImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UseCasesHelperMDRImpl.java 2010-03-28 07:20:44-0700
@@ -394,7 +394,8 @@
public void setCondition(Object handle, Object booleanExpression) {
if (handle instanceof Extend
- && booleanExpression instanceof BooleanExpression) {
+ && (booleanExpression == null
+ || booleanExpression instanceof BooleanExpression)) {
((Extend) handle)
.setCondition((BooleanExpression) booleanExpression);
return;
Modified: branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/Facade.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/Facade.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/Facade.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/Facade.java 2010-03-28 07:20:44-0700
@@ -2492,6 +2492,8 @@
*
* @param handle the operation
* @return raised signals
+ * @deprecated by Bob Tarling in 0.30.1 use the UML2 replacement
+ * of getRaisedExceptions
*/
Collection getRaisedSignals(Object handle);
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PanelMetaCache.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PanelMetaCache.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PanelMetaCache.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PanelMetaCache.java 2010-03-28 07:20:44-0700
@@ -42,6 +42,7 @@
import java.util.HashMap;
import java.util.Map;
+import org.argouml.model.Model;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
@@ -66,14 +67,20 @@
}
private void parseXML() throws Exception {
- String file = "org/argouml/core/propertypanels/meta/panels.xml";
- XMLReader parser = XMLReaderFactory.createXMLReader();
+ final String file;
+ if (Model.getFacade().getUmlVersion().charAt(0) == '2') {
+ file = "org/argouml/core/propertypanels/meta/panels2.xml";
+ } else {
+ file = "org/argouml/core/propertypanels/meta/panels.xml";
+ }
+ final XMLReader parser = XMLReaderFactory.createXMLReader();
parser.setContentHandler(new XmlSinglePanelHandler(cache));
- InputStream stream = this.getClass().getClassLoader().
- getResourceAsStream(file);
+ final InputStream stream =
+ this.getClass().getClassLoader().getResourceAsStream(file);
if (stream != null) {
- InputSource source = new InputSource(stream);
- parser.parse(source);
+ final InputSource source = new InputSource(stream);
+ parser.parse(source);
+ stream.close();
} else {
throw new IllegalStateException("Failed to find the panel XML");
}
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml 2010-03-28 07:20:44-0700
@@ -174,7 +174,7 @@
<separator />
<list name="specialization" type="GeneralizableElement" />
<list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
- <list name="feature" type="Feature" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" />
<list name="powertypeRange" type="Generalization" />
<list name="typedFeature" type="Classifier" />
<list name="typedParameter" type="Classifier" />
@@ -205,9 +205,9 @@
<list name="specialization" type="GeneralizableElement" />
<separator />
<list name="feature" type="org.omg.uml.foundation.core.Attribute" label="label.attributes" />
- <list name="feature" type="org.omg.uml.foundation.core.Operation" label="label.operations" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<list name="association" type="Classifier" />
- <list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
+ <list name="ownedElement" type="org.omg.uml.foundation.core.UmlClass" label="label.owned-elements"/>
<debug />
<attribute name="targetFlow" type="Flow" />
@@ -250,7 +250,7 @@
<list name="generalization" type="Generalization" />
<list name="specialization" type="GeneralizableElement" />
<separator />
- <list name="feature" type="org.omg.uml.foundation.core.Operation" label="label.operations" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<debug />
<attribute name="targetFlow" type="Flow" />
<attribute name="sourceFlow" type="Flow" />
@@ -403,7 +403,7 @@
<list name="specialization" type="GeneralizableElement" />
<separator />
<list name="association" type="Classifier" />
- <list name="feature" type="org.omg.uml.foundation.core.Operation" label="label.operations" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<debug />
<attribute name="clientDependency" type="Dependency" />
@@ -598,14 +598,14 @@
<list name="elementImport" type="ModelElement" label="label.element-import" />
<attribute name="ownerScope" type="ScopeKind" />
<attribute name="owner" type="Classifier" />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<separator />
- <list name="raisedSignal" type="BehavioralFeature" label="label.raisedsignals" />
+ <list name="raisedSignal" type="org.omg.uml.behavioralelements.commonbehavior.Signal" label="label.raisedsignals" />
</panel>
<panel name="Operation">
<text name="name" type="Name" />
<singlerow name="owner" type="Classifier" />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<separator />
<optionbox name="visibility" type="VisibilityKind" />
<checkgroup name="modifiers">
@@ -618,8 +618,8 @@
</checkgroup>
<optionbox name="concurrency" type="CallConcurrencyKind" />
<separator />
- <list name="raisedSignal" type="BehavioralFeature" label="label.raisedsignals" />
- <list name="method" type="Operation" />
+ <list name="raisedSignal" type="org.omg.uml.behavioralelements.commonbehavior.Signal" label="label.raisedsignals" />
+ <list name="method" type="org.omg.uml.foundation.core.Method" />
<textarea name="specification" type="String" />
<debug />
@@ -773,7 +773,7 @@
<list name="connection" type="AssociationEnd" label="label.connections" />
<separator />
<list name="feature" type="org.omg.uml.foundation.core.Attribute" label="label.attributes" />
- <list name="feature" type="org.omg.uml.foundation.core.Operation" label="label.operations" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<list name="association" type="Classifier" />
<list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
@@ -945,9 +945,10 @@
<separator />
<list name="generalization" type="Generalization" />
<list name="specialization" type="GeneralizableElement" />
- <separator />
<list name="clientDependency" type="Dependency" label="label.client-dependencies" />
<list name="supplierDependency" type="ModelElement" label="label.supplier-dependencies" />
+ <separator />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<list name="residentElement" type="ElementResidence" label="label.residents" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -993,7 +994,10 @@
<separator />
<list name="generalization" type="Generalization" />
<list name="specialization" type="GeneralizableElement" />
+ <list name="clientDependency" type="Dependency" label="label.client-dependencies" />
+ <list name="supplierDependency" type="ModelElement" label="label.supplier-dependencies" />
<separator />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<list name="deployedComponent" type="Component" label="label.deployedcomponents" />
<debug />
@@ -1163,7 +1167,7 @@
<separator />
<list name="specialization" type="GeneralizableElement" />
<list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
- <list name="feature" type="Feature" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" />
<list name="powertypeRange" type="Generalization" />
<list name="typedFeature" type="Classifier" />
<list name="typedParameter" type="Classifier" />
@@ -1191,7 +1195,7 @@
<list name="generalization" type="Generalization" />
<list name="specialization" type="GeneralizableElement" />
<separator />
- <list name="feature" type="org.omg.uml.foundation.core.Operation" label="label.operations" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<list name="literal" type="EnumerationLiteral" label="label.literals" />
<debug />
@@ -1384,7 +1388,7 @@
<separator />
<list name="specialization" type="GeneralizableElement" />
<list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
- <list name="feature" type="Feature" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" />
<list name="powertypeRange" type="Generalization" />
<list name="typedFeature" type="Classifier" />
<list name="typedParameter" type="Classifier" />
@@ -1431,7 +1435,7 @@
<separator />
<list name="specialization" type="GeneralizableElement" />
<list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
- <list name="feature" type="Feature" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" />
<list name="powertypeRange" type="Generalization" />
<list name="typedFeature" type="Classifier" />
<list name="typedParameter" type="Classifier" />
@@ -1586,7 +1590,7 @@
<textarea name="recurrence" type="IterationExpression" />
<separator />
<list name="instantiation" type="Classifier" />
- <list name="actualArgument" type="Argument" label="label.arguments" />
+ <list name="actualArgument" type="org.omg.uml.behavioralelements.commonbehavior.Argument" label="label.arguments" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -1625,7 +1629,7 @@
<textarea name="script" type="ActionExpression" />
<textarea name="recurrence" type="IterationExpression" />
<separator />
- <list name="actualArgument" type="Argument" label="label.arguments" />
+ <list name="actualArgument" type="org.omg.uml.behavioralelements.commonbehavior.Argument" label="label.arguments" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -1664,7 +1668,7 @@
<textarea name="script" type="ActionExpression" />
<textarea name="recurrence" type="IterationExpression" />
<separator />
- <list name="actualArgument" type="Argument" label="label.arguments" />
+ <list name="actualArgument" type="org.omg.uml.behavioralelements.commonbehavior.Argument" label="label.arguments" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -1890,8 +1894,8 @@
<textarea name="script" type="ActionExpression" />
<textarea name="recurrence" type="IterationExpression" />
<separator />
- <combo name="operation" type="Operation" />
- <list name="actualArgument" type="Argument" label="label.arguments" />
+ <combo name="operation" type="Operation" />
+ <list name="actualArgument" type="org.omg.uml.behavioralelements.commonbehavior.Argument" label="label.arguments" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -1931,8 +1935,7 @@
<textarea name="recurrence" type="IterationExpression" />
<separator />
<list name="signal" type="Signal" />
- <list name="actualArgument" type="Argument" label="label.arguments" />
-
+ <list name="actualArgument" type="org.omg.uml.behavioralelements.commonbehavior.Argument" label="label.arguments" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
<attribute name="namespace" type="Namespace" />
@@ -2032,6 +2035,7 @@
</panel>
<panel name="Reception">
<text name="name" type="Name" />
+ <singlerow name="owner" type="Classifier" />
<optionbox name="visibility" type="VisibilityKind" />
<checkgroup name="modifiers">
<checkbox name="isSpecification" type="Boolean" />
@@ -2040,13 +2044,12 @@
<checkbox name="isLeaf" type="Boolean" />
<checkbox name="isAbstract" type="Boolean" />
</checkgroup>
- <combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" label="label.client-dependencies" />
<list name="targetFlow" type="Flow" label="label.target-flows" />
<list name="sourceFlow" type="Flow" label="label.source-flows" />
<list name="comment" type="Comment" />
<separator />
<list name="templateParameter" type="TemplateParameter" label="label.template-parameters" />
+ <list name="clientDependency" type="Dependency" label="label.client-dependencies" />
<list name="supplierDependency" type="ModelElement" label="label.supplier-dependencies" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
@@ -2059,15 +2062,15 @@
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
- <list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" label="label.element-import" />
+ <!-- list name="partition" type="ModelElement" / -->
+ <!-- list name="elementImport" type="ModelElement" label="label.element-import" / -->
<attribute name="ownerScope" type="ScopeKind" />
<attribute name="owner" type="Classifier" />
- <list name="parameter" type="Parameter" />
- <separator />
- <list name="raisedSignal" type="BehavioralFeature" label="label.raisedsignals" />
- <attribute name="specification" type="String" />
- <attribute name="signal" type="Signal" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
+ <combo name="signal" type="Signal" />
+ <textarea name="specification" type="String" />
+ <!-- separator / -->
+ <!-- list name="raisedSignal" type="BehavioralFeature" label="label.raisedsignals" / -->
</panel>
<panel name="LinkEnd">
<text name="name" type="Name" />
@@ -2100,7 +2103,7 @@
<list name="qualifiedValue" type="AttributeLink" />
</panel>
<panel name="ReturnAction">
- <text name="name" type="Name" />
+ <text name="name" type="Name" />
<checkgroup name="modifiers">
<checkbox name="isSpecification" type="Boolean" />
<checkbox name="isAsynchronous" type="Boolean" />
@@ -2108,8 +2111,7 @@
<textarea name="script" type="ActionExpression" />
<textarea name="recurrence" type="IterationExpression" />
<separator />
- <list name="actualArgument" type="Argument" label="label.arguments" />
-
+ <list name="actualArgument" type="org.omg.uml.behavioralelements.commonbehavior.Argument" label="label.arguments" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
<attribute name="namespace" type="Namespace" />
@@ -2147,7 +2149,7 @@
<textarea name="script" type="ActionExpression" />
<textarea name="recurrence" type="IterationExpression" />
<separator />
- <list name="actualArgument" type="Argument" label="label.arguments" />
+ <list name="actualArgument" type="org.omg.uml.behavioralelements.commonbehavior.Argument" label="label.arguments" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -2400,10 +2402,9 @@
<list name="include" type="Include" />
<separator />
<list name="feature" type="org.omg.uml.foundation.core.Attribute" label="label.attributes" />
- <list name="feature" type="org.omg.uml.foundation.core.Operation" label="label.operations" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<list name="association" type="Classifier" />
- <list name="extensionPoint" type="ExtensionPoint" label="label.extension-points" />
-
+ <list name="extensionPoint" type="org.omg.uml.behavioralelements.usecases.ExtensionPoint" label="label.extension-points" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
<attribute name="targetFlow" type="Flow" />
@@ -2448,6 +2449,7 @@
<list name="specialization" type="GeneralizableElement" />
<separator />
<list name="association" type="Classifier" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -2525,7 +2527,7 @@
<separator />
<singlerow name="base" type="UseCase" />
<singlerow name="extension" type="UseCase" />
- <list name="extensionPoint" type="ExtensionPoint" label="label.extension-points" />
+ <list name="extensionPoint" type="org.omg.uml.behavioralelements.usecases.ExtensionPoint" label="label.extension-points" />
<separator />
<textarea name="condition" type="BooleanExpression" />
@@ -2676,7 +2678,7 @@
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
<list name="elementImport" type="ModelElement" label="label.element-import" />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<list name="state" type="Event" />
<list name="transition" type="Event" />
</panel>
@@ -2754,7 +2756,7 @@
<text name="name" type="Name" />
<combo name="namespace" type="Namespace" />
<separator />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<list name="transition" type="Event" />
<separator />
<textarea name="when" type="TimeExpression" />
@@ -2788,7 +2790,7 @@
<text name="name" type="Name" />
<combo name="namespace" type="Namespace" />
<separator />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<list name="transition" type="Event" />
<separator />
<combo name="operation" type="Operation" />
@@ -2822,7 +2824,7 @@
<text name="name" type="Name" />
<combo name="namespace" type="Namespace" />
<separator />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<list name="transition" type="Event" />
<separator />
<list name="signal" type="Signal" />
@@ -2859,10 +2861,9 @@
<separator />
<singlerow name="source" type="StateVertex" />
<singlerow name="target" type="StateVertex" />
- <singlerow name="guard" type="Guard" />
- <singlerow name="effect" type="Action" />
- <singlerow name="trigger" type="Event" />
-
+ <singlerow name="guard" type="org.omg.uml.behavioralelements.statemachines.Guard" />
+ <singlerow name="effect" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" />
+ <combo name="trigger" type="org.omg.uml.behavioralelements.statemachines.CallEvent,org.omg.uml.behavioralelements.statemachines.ChangeEvent,org.omg.uml.behavioralelements.statemachines.SignalEvent,org.omg.uml.behavioralelements.statemachines.TimeEvent" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
<attribute name="modifiers">
@@ -2934,7 +2935,7 @@
<text name="name" type="Name" />
<combo name="namespace" type="Namespace" />
<separator />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<list name="transition" type="Event" />
<separator />
<textarea name="changeExpression" type="BooleanExpression" />
@@ -3329,7 +3330,7 @@
<list name="collaborationInstanceSet" type="ModelElement" />
<separator />
<list name="connection" type="AssociationEnd" label="label.connections" />
- <list name="message" type="Message" />
+ <list name="message" type="org.omg.uml.behavioralelements.collaborations.Message" />
<list name="conformingLink" type="Link" />
</panel>
<panel name="AssociationEndRole">
@@ -3425,7 +3426,7 @@
<combo name="namespace" type="Namespace" />
<singlerow name="context" type="Collaboration" />
<separator />
- <list name="message" type="Message" />
+ <list name="message" type="org.omg.uml.behavioralelements.collaborations.Message" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -3722,7 +3723,7 @@
<separator />
<list name="outgoing" type="Transition" />
<list name="incoming" type="Transition" />
- <list name="parameter" type="Parameter" />
+ <list name="parameter" type="org.omg.uml.foundation.core.Parameter" />
<debug />
<attribute name="visibility" type="VisibilityKind" />
@@ -3786,7 +3787,7 @@
<separator />
<list name="specialization" type="GeneralizableElement" />
<list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
- <list name="feature" type="Feature" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" />
<list name="powertypeRange" type="Generalization" />
<list name="typedFeature" type="Classifier" />
<list name="typedParameter" type="Classifier" />
@@ -3814,8 +3815,8 @@
<list name="generalization" type="Generalization" />
<list name="specialization" type="GeneralizableElement" />
<separator />
- <list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
- <list name="elementImport" type="ModelElement" label="label.element-import" />
+ <list name="ownedElement" type="org.omg.uml.modelmanagement.UmlPackage,org.omg.uml.foundation.core.DataType,org.omg.uml.foundation.core.Enumeration" label="label.owned-elements"/>
+ <list name="elementImport" type="ModelElement" label="label.element-import" />
<attribute name="clientDependency" type="Dependency" />
<attribute name="supplierDependency" type="ModelElement" />
<attribute name="targetFlow" type="Flow" />
@@ -3904,7 +3905,7 @@
<separator />
<list name="specialization" type="GeneralizableElement" />
<list name="ownedElement" type="ModelElement" label="label.owned-elements"/>
- <list name="feature" type="Feature" />
+ <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" />
<list name="powertypeRange" type="Generalization" />
<list name="typedFeature" type="Classifier" />
<list name="typedParameter" type="Classifier" />
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManager.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManager.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManager.java 2010-03-28 07:20:44-0700
@@ -17,6 +17,10 @@
import java.util.HashMap;
import java.util.Map;
+import javax.swing.Action;
+
+import org.argouml.kernel.Command;
+
public abstract class GetterSetterManager {
/**
@@ -50,6 +54,15 @@
public abstract boolean isValidElement(String propertyName, String type, Object umlElement);
+ public abstract Command getRemoveCommand(String propertyName, Object umlElement, Object objectToRemove);
+
+ public abstract Command getAddCommand(String propertyName, Object umlElement);
+
+ /** This forces component to fully rebuild when items are added and removed
+ * Used for pragmatic purposes but not advised long term we should remove this in time
+ */
+ public abstract boolean isFullBuildOnly(String propertyName);
+
public boolean contains(String propertyName) {
return getterSetterByPropertyName.containsKey(propertyName);
}
@@ -86,6 +99,15 @@
protected abstract class ListGetterSetter extends OptionGetterSetter {
abstract boolean isValidElement(Object modelElement, String type);
abstract Object getMetaType();
+ Action getAddAction(Object modelElement) {
+ return null;
+ }
+ Action getRemoveAction(Object modelElement) {
+ return null;
+ }
+ boolean isFullBuildOnly() {
+ return false;
+ }
}
}
\ No newline at end of file
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java 2010-03-28 07:20:44-0700
@@ -13,11 +13,22 @@
package org.argouml.core.propertypanels.model;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.List;
+import java.util.StringTokenizer;
+import javax.swing.JOptionPane;
+
+import org.apache.log4j.Logger;
+import org.argouml.i18n.Translator;
+import org.argouml.kernel.Command;
+import org.argouml.kernel.NonUndoableCommand;
import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLAddDialog;
+import org.argouml.util.ArgoFrame;
/**
* Property getters and setters for UML1.4
@@ -25,6 +36,9 @@
*/
class GetterSetterManagerImpl extends GetterSetterManager {
+ private static final Logger LOG =
+ Logger.getLogger(GetterSetterManagerImpl.class);
+
/**
* The constructor
*/
@@ -54,10 +68,25 @@
addGetterSetter("kind", new ParameterDirectionGetterSetter());
addGetterSetter("changeability", new ChangeabilityGetterSetter());
addGetterSetter("concurrency", new ConcurrencyGetterSetter());
- addGetterSetter("feature", new FeatureGetterSetter(type));
+ addGetterSetter("feature", new FeatureGetterSetter());
+ addGetterSetter("parameter", new ParameterGetterSetter());
addGetterSetter("receiver", new ReceiverGetterSetter());
addGetterSetter("sender", new SenderGetterSetter());
addGetterSetter("body", new MethodExpressionGetterSetter());
+ addGetterSetter("ownedElement", new OwnedElementGetterSetter());
+ addGetterSetter("raisedSignal", new RaisedExceptionGetterSetter());
+ addGetterSetter("raisedException", new RaisedExceptionGetterSetter());
+ addGetterSetter("method", new MethodGetterSetter());
+ addGetterSetter("message", new MessageGetterSetter());
+ addGetterSetter("actualArgument", new ArgumentGetterSetter());
+ addGetterSetter("extensionPoint", new ExtensionPointGetterSetter());
+ addGetterSetter("guard", new GuardGetterSetter());
+ addGetterSetter("effect", new EffectGetterSetter());
+ addGetterSetter("trigger", new TriggerGetterSetter());
+ addGetterSetter("elementImport", new ElementImportGetterSetter());
+
+ // UML2 only
+ addGetterSetter("ownedOperation", new FeatureGetterSetter());
}
/**
@@ -97,7 +126,10 @@
return null;
}
- public Collection getOptions(Object umlElement, String propertyName, String type) {
+ public Collection getOptions(
+ final Object umlElement,
+ final String propertyName,
+ final String type) {
BaseGetterSetter bgs = getterSetterByPropertyName.get(propertyName);
if (bgs instanceof OptionGetterSetter) {
return ((OptionGetterSetter) bgs).getOptions(umlElement, type);
@@ -106,6 +138,16 @@
return null;
}
+ public boolean isFullBuildOnly(
+ final String propertyName) {
+ BaseGetterSetter bgs = getterSetterByPropertyName.get(propertyName);
+ if (bgs instanceof ListGetterSetter) {
+ return ((ListGetterSetter) bgs).isFullBuildOnly();
+ }
+
+ return false;
+ }
+
public Object create(String propertyName, String language, String body) {
BaseGetterSetter bgs = getterSetterByPropertyName.get(propertyName);
@@ -116,7 +158,10 @@
return null;
}
- public boolean isValidElement(String propertyName, String type, Object element) {
+ public boolean isValidElement(
+ final String propertyName,
+ final String type,
+ final Object element) {
BaseGetterSetter bgs = getterSetterByPropertyName.get(propertyName);
if (bgs instanceof ListGetterSetter) {
return ((ListGetterSetter) bgs).isValidElement(element, type);
@@ -131,9 +176,37 @@
return ((ListGetterSetter) bgs).getMetaType();
}
- return false;
+ return null;
}
+
+ @Override
+ public Command getAddCommand(String propertyName, Object umlElement) {
+ BaseGetterSetter bgs = getterSetterByPropertyName.get(propertyName);
+ if (bgs instanceof Addable) {
+ return ((Addable) bgs).getAddCommand(umlElement);
+ }
+ return null;
+ }
+
+ @Override
+ public Command getRemoveCommand(String propertyName, Object umlElement, Object objectToRemove) {
+ BaseGetterSetter bgs = getterSetterByPropertyName.get(propertyName);
+ if (bgs instanceof Removeable) {
+ return ((Removeable) bgs).getRemoveCommand(umlElement, objectToRemove);
+ }
+ return null;
+ }
+
+ private interface Addable {
+ Command getAddCommand(Object umlElement);
+ }
+
+ private interface Removeable {
+ Command getRemoveCommand(Object umlElement, Object objectToRemove);
+ }
+
+
/**
* The getter/setter for the Absrtact property
* @author Bob Tarling
@@ -554,26 +627,388 @@
}
}
}
-
+
private class FeatureGetterSetter extends ListGetterSetter {
- private Class metaType;
-
- public FeatureGetterSetter(String type) {
+ /**
+ * Get all the features for the model
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type /* TODO: change this to a metatype */ ) {
+
+ StringTokenizer st = new StringTokenizer(type, ",");
try {
- metaType = Class.forName(type);
+ Class metaType = Class.forName(st.nextToken());
+ if (Model.getMetaTypes().getAttribute().equals(metaType)) {
+ return Model.getFacade().getAttributes(modelElement);
+ } else if (Model.getMetaTypes().getOperation().equals(metaType)) {
+ return Model.getFacade().getOperationsAndReceptions(modelElement);
+ } else {
+ return Collections.EMPTY_LIST;
+ }
} catch (ClassNotFoundException e) {
- // ignore
+ LOG.error("Exception", e);
+ return Collections.EMPTY_LIST;
}
}
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getOperation();
+ }
+ }
+
+
+
+ private class OwnedElementGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the owned elements for the namespace
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+
+ return Model.getFacade().getOwnedElements(modelElement);
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getOperation();
+ }
+ }
+
+
+ private class RaisedExceptionGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the owned elements for the namespace
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ return Model.getFacade().getRaisedExceptions(modelElement);
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getSignal();
+ }
+ }
+
+ private class MethodGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the method for the operation
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ return Model.getFacade().getMethods(modelElement);
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getMethod();
+ }
+ }
+
+
+ private class MessageGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the method for the operation
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ return Model.getFacade().getMessages(modelElement);
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getMessage();
+ }
+ }
+
+
+ private class ArgumentGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the method for the operation
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ return Model.getFacade().getArguments(modelElement);
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getArgument();
+ }
+ }
+
+
+ private class ExtensionPointGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the extension points
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ return Model.getFacade().getExtensionPoints(modelElement);
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getExtensionPoint();
+ }
+ }
+
+ private class GuardGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the guards
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ final ArrayList l = new ArrayList(1);
+ l.add(Model.getFacade().getGuard(modelElement));
+ return l;
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getGuard();
+ }
+ }
+
+ private class EffectGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the effects
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ final ArrayList l = new ArrayList(1);
+ l.add(Model.getFacade().getEffect(modelElement));
+ return l;
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getAction();
+ }
+ }
+
+ private class TriggerGetterSetter extends ListGetterSetter {
+
+ /**
+ * Get all the effects
+ * @param modelElement
+ * @param type
+ * @return
+ * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+ */
+ public Collection getOptions(
+ final Object modelElement,
+ final String type) {
+ final ArrayList l = new ArrayList(1);
+ l.add(Model.getFacade().getTrigger(modelElement));
+ return l;
+ }
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(
+ final Object element,
+ final String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getEvent();
+ }
+ }
+
+ private class ParameterGetterSetter extends ListGetterSetter {
+
public Collection getOptions(Object modelElement, String type) {
- if (Model.getMetaTypes().getAttribute().equals(metaType)) {
- return Model.getFacade().getAttributes(modelElement);
- } else if (Model.getMetaTypes().getOperation().equals(metaType)) {
- return Model.getFacade().getOperations(modelElement);
- } else {
- return Collections.EMPTY_LIST;
- }
+ return Model.getFacade().getParameters(modelElement);
}
public Object get(Object modelElement, String type) {
@@ -585,13 +1020,226 @@
// not needed
}
- protected boolean isValidElement(Object element, String type) {
+ public boolean isValidElement(Object element, String type) {
return getOptions(element, type).contains(element);
}
public Object getMetaType() {
- return metaType;
+ return Model.getMetaTypes().getParameter();
+ }
+ }
+
+ private class ElementImportGetterSetter extends ListGetterSetter implements Addable, Removeable {
+
+ public Collection getOptions(Object modelElement, String type) {
+ return Model.getFacade().getImportedElements(modelElement);
}
+
+ public Object get(Object modelElement, String type) {
+ // not needed
+ return null;
+ }
+
+ public boolean isFullBuildOnly() {
+ return true;
+ }
+
+ public void set(Object element, Object x) {
+ // not needed
+ }
+
+ public boolean isValidElement(Object element, String type) {
+ return getOptions(element, type).contains(element);
+ }
+
+ public Object getMetaType() {
+ return Model.getMetaTypes().getModelElement();
+ }
+
+ public Command getAddCommand(Object modelElement) {
+ return new AddElementImportCommand(modelElement);
+ }
+
+ public Command getRemoveCommand(Object modelElement, Object objectToRemove) {
+ return new RemoveElementImportCommand(modelElement, objectToRemove);
+ }
+
+ private class AddElementImportCommand extends AddModelElementCommand {
+
+ final Object target;
+
+ /**
+ * Constructor for ActionAddPackageImport.
+ */
+ public AddElementImportCommand(Object target) {
+ super();
+ this.target = target;
+ }
+
+
+ protected List getChoices() {
+ List list = new ArrayList();
+ /* TODO: correctly implement next function
+ * in the model subsystem for
+ * issue 1942: */
+ list.addAll(Model.getModelManagementHelper()
+ .getAllPossibleImports(target));
+ return list;
+ }
+
+
+ protected List getSelected() {
+ List list = new ArrayList();
+ list.addAll(Model.getFacade().getImportedElements(target));
+ return list;
+ }
+
+
+ protected String getDialogTitle() {
+ return Translator.localize("dialog.title.add-imported-elements");
+ }
+
+
+ @Override
+ protected void doIt(Collection selected) {
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Setting " + selected.size() + "imported elements");
+ }
+ Model.getModelManagementHelper().setImportedElements(target, selected);
+ }
+ }
+
+ private class RemoveElementImportCommand
+ extends NonUndoableCommand {
+
+ private final Object target;
+ private final Object objectToRemove;
+
+ /**
+ * Constructor for ActionRemovePackageImport.
+ */
+ public RemoveElementImportCommand(final Object target, final Object objectToRemove) {
+ this.target = target;
+ this.objectToRemove = objectToRemove;
+ }
+
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ public Object execute() {
+ Model.getModelManagementHelper()
+ .removeImportedElement(target, objectToRemove);
+ return null;
+ }
+ }
+
+ public abstract class AddModelElementCommand extends NonUndoableCommand {
+
+ private Object target;
+ private boolean multiSelect = true;
+ private boolean exclusive = true;
+
+ /**
+ * Construct a command to add a model element to some list.
+ */
+ protected AddModelElementCommand() {
+ }
+
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ public Object execute() {
+ UMLAddDialog dialog =
+ new UMLAddDialog(getChoices(), getSelected(), getDialogTitle(),
+ isMultiSelect(),
+ isExclusive());
+ int result = dialog.showDialog(ArgoFrame.getFrame());
+ if (result == JOptionPane.OK_OPTION) {
+ doIt(dialog.getSelected());
+ }
+ return null;
+ }
+
+ /**
+ * 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);
+
+ /**
+ * 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;
+ }
+
+ }
+
+
}
@@ -608,7 +1256,7 @@
}
@Override
- Object create(final String language, final String body) {
+ public Object create(final String language, final String body) {
return Model.getDataTypesFactory().createProcedureExpression(language, body);
}
}
@@ -628,7 +1276,7 @@
// not needed
}
- protected boolean isValidElement(Object element, String type) {
+ public boolean isValidElement(Object element, String type) {
return getOptions(element, type).contains(element);
}
@@ -653,7 +1301,7 @@
// not needed
}
- protected boolean isValidElement(Object element, String type) {
+ public boolean isValidElement(Object element, String type) {
return getOptions(element, type).contains(element);
}
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java 2010-03-28 07:20:44-0700
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * bobtarling
+ * Bob Tarling
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -43,10 +43,6 @@
import javax.swing.JList;
import org.argouml.core.propertypanels.model.GetterSetterManager;
-import org.argouml.model.Model;
-import org.argouml.uml.ui.behavior.use_cases.ActionAddExtendExtensionPoint;
-import org.argouml.uml.ui.behavior.use_cases.ActionNewExtendExtensionPoint;
-import org.argouml.uml.ui.behavior.use_cases.ActionNewUseCaseExtensionPoint;
/**
* Creates the XML Property panels
@@ -67,16 +63,12 @@
if ("action".equals(propName)) {
model = new UMLActionSequenceActionListModel(modelElement);
list = new OldScrollList(new UMLActionSequenceActionList((UMLModelElementListModel) model));
- } else if ("actualArgument".equals(propName)) {
- model = new UMLActionArgumentListModel(modelElement, propName);
} else if ("annotatedElement".equals(propName)) {
model = new UMLCommentAnnotatedElementListModel(modelElement);
} else if ("association".equals(propName)) {
model = new UMLClassifierAssociationEndListModel(modelElement);
} else if ("associationRole".equals(propName)) {
model = new UMLAssociationAssociationRoleListModel(modelElement);
-// } else if ("attribute".equals(propName)) {
-// model = new UMLClassAttributeListModel(modelElement);
} else if ("availableContents".equals(propName)) {
model = new UMLClassifierRoleAvailableContentsListModel(modelElement);
} else if ("availableFeature".equals(propName)) {
@@ -113,8 +105,6 @@
model = new UMLStateDoActivityListModel(modelElement);
JList l = new UMLStateDoActivityList((UMLModelElementListModel) model);
list = new OldScrollList(l);
- } else if ("elementImport".equals(propName)) {
- model = new UMLClassifierPackageImportsListModel(modelElement);
} else if ("entry".equals(propName)) {
model = new UMLStateEntryListModel(modelElement);
JList l = new UMLStateEntryList((UMLModelElementListModel) model);
@@ -127,14 +117,6 @@
model = new UMLUseCaseExtendListModel(modelElement);
} else if ("extended_elements".equals(propName)) {
model = new UMLExtendedElementsListModel(modelElement);
- } else if ("extensionPoint".equals(propName)) {
- if (Model.getFacade().isAUseCase(modelElement)) {
- model = new UMLUseCaseExtensionPointListModel(modelElement, propName);
- } else {
- model = new UMLExtendExtensionPointListModel(modelElement, propName);
- }
-// } else if ("feature".equals(propName)) {
-// model = new UMLClassifierFeatureListModel(modelElement);
} else if ("generalization".equals(propName)) {
model = new UMLGeneralizableElementGeneralizationListModel(modelElement);
} else if ("include".equals(propName)) {
@@ -149,30 +131,14 @@
model = new UMLAssociationLinkListModel(modelElement);
} else if ("literal".equals(propName)) {
model = new UMLEnumerationLiteralsListModel(modelElement);
- } else if ("message".equals(propName)) {
- model = new UMLInteractionMessagesListModel(modelElement);
- } else if ("method".equals(propName)) {
- model = new UMLOperationMethodsListModel(modelElement);
-// } else if ("operation".equals(propName)) {
-// model = new UMLClassOperationListModel(modelElement);
- } else if ("ownedElement".equals(propName)) {
- model = new UMLNamespaceOwnedElementListModel(modelElement);
} else if ("outgoing".equals(propName)) {
model = new UMLStateVertexOutgoingListModel(modelElement);
- } else if ("parameter".equals(propName)) {
- if (Model.getFacade().isAObjectFlowState(modelElement)) {
- model = new UMLObjectFlowStateParameterListModel(modelElement, propName);
- } else {
- model = new UMLClassifierParameterListModel(modelElement, propName);
- }
} else if ("partition".equals(propName)) {
model = new UMLActivityGraphPartitionListModel(modelElement);
} else if ("predecessor".equals(propName)) {
model = new UMLMessagePredecessorListModel(modelElement);
} else if ("qualifier".equals(propName)) {
model = new UMLAssociationEndQualifiersListModel(modelElement);
- } else if ("raisedSignal".equals(propName)) {
- model = new UMLOperationRaisedSignalsListModel(modelElement);
} else if ("reception".equals(propName)) {
model = new UMLSignalReceptionListModel(modelElement);
} else if ("resident".equals(propName)) {
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java 2010-03-28 07:20:44-0700
@@ -47,6 +47,9 @@
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
import javax.swing.Action;
import javax.swing.DefaultListModel;
@@ -72,6 +75,7 @@
import org.apache.log4j.Logger;
import org.argouml.application.helpers.ResourceLoaderWrapper;
import org.argouml.i18n.Translator;
+import org.argouml.kernel.Command;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
@@ -82,6 +86,7 @@
import org.tigris.swidgets.FlexiGridLayout;
import org.tigris.toolbar.ToolBar;
import org.tigris.toolbar.ToolBarFactory;
+import org.tigris.toolbar.toolbutton.PopupToolBoxButton;
/**
* A control for displaying the contents of a list model elements in a panel
@@ -92,7 +97,7 @@
* @since 0.29.2
*/
class RowSelector extends JPanel
- implements MouseListener, ListDataListener {
+ implements MouseListener, ListDataListener, ListSelectionListener {
/**
* The logger
@@ -124,6 +129,8 @@
*/
private final boolean readonly;
+ private static final Set<String> EXPANDED_CONTROLS = new TreeSet<String>();
+
static {
// Extract the icon that is used by the tree control
// for the current look and feel
@@ -197,7 +204,12 @@
* The delete action that we must enable/disable
*/
private final DeleteAction deleteAction;
-
+
+ /**
+ * The remove action that we must enable/disable
+ */
+ private final Action removeAction;
+
/**
* The delete action that we must enable/disable
*/
@@ -237,6 +249,8 @@
this.expandable = expandable;
Object metaType = null;
+ List metaTypes = null;
+ final Action addAction;
if (model instanceof UMLModelElementListModel) {
// Temporary until SimpleListModel is used for all
@@ -247,6 +261,7 @@
} else if (model instanceof org.argouml.core.propertypanels.ui.SimpleListModel) {
target = ((org.argouml.core.propertypanels.ui.SimpleListModel) model).getUmlElement();
metaType = ((org.argouml.core.propertypanels.ui.SimpleListModel) model).getMetaType();
+ metaTypes = ((org.argouml.core.propertypanels.ui.SimpleListModel) model).getMetaTypes();
scroll = new ScrollListImpl(model, 1);
readonly = Model.getModelManagementHelper().isReadOnly(target);
} else {
@@ -257,11 +272,17 @@
assert (target != null);
- LOG.info("Creating list for " + target);
+ if (metaTypes == null) {
+ metaTypes = new ArrayList();
+ metaTypes.add(metaType);
+ }
- LOG.info("model = " + model.getClass().getName());
- LOG.info("metatype = " + metaType);
- LOG.info("target = " + target);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Creating list for " + target);
+ LOG.debug("model = " + model.getClass().getName());
+ LOG.debug("metatype = " + metaType);
+ LOG.debug("target = " + target);
+ }
add((JComponent) scroll);
@@ -278,6 +299,16 @@
jscroll.setHorizontalScrollBarPolicy(
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+
+ if (model instanceof SimpleListModel
+ && ((SimpleListModel) model).getAddCommand() != null) {
+ removeAction = new RemoveAction(scroll.getList(), ((SimpleListModel) model));
+ addAction = new AddAction(((SimpleListModel) model).getAddCommand());
+ } else {
+ removeAction = null;
+ addAction = null;
+ }
+
if (!expandable && !expanded) {
jscroll.setVerticalScrollBarPolicy(
@@ -289,22 +320,60 @@
moveDownAction = null;
moveTopAction = null;
moveBottomAction = null;
+ if (!readonly) {
+ // Create popup toolbutton if we have a single row
+ final ArrayList<Action> actions = new ArrayList<Action>(6);
+
+ for (Object meta : metaTypes) {
+ if (Model.getUmlFactory().isContainmentValid(meta, target)) {
+ final String label =
+ "button.new-" + Model.getMetaTypes().getName(meta).toLowerCase();
+ final Action createAction = new ActionCreateContainedModelElement(
+ meta,
+ target,
+ label);
+ actions.add(createAction);
+ }
+ }
+ if (!actions.isEmpty()) {
+ PopupToolBoxButton tb = new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
+ for (Action action : actions) {
+ tb.add(action);
+ }
+ JPanel buttonPanel =
+ new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
+ buttonPanel.add(tb);
+ add(buttonPanel, BorderLayout.WEST);
+ }
+ }
} else {
- if (!readonly) {
- // TODO: Lets build this into a separate buildToolbar method
+ if (!readonly) {
+ // TODO: Lets build this into a separate buildToolbar method
// Create actions and expander if we have multiple rows
final ArrayList<Action> actions = new ArrayList<Action>(6);
- if (Model.getUmlFactory().isContainmentValid(metaType, target)) {
- final Action createAction = new ActionCreateContainedModelElement(
- metaType,
- target,
- "button.new-" + Model.getMetaTypes().getName(metaType).toLowerCase());
- actions.add(createAction);
+ for (Object meta : metaTypes) {
+ if (Model.getUmlFactory().isContainmentValid(meta, target)) {
+ final String label =
+ "button.new-" + Model.getMetaTypes().getName(meta).toLowerCase();
+ final Action createAction = new ActionCreateContainedModelElement(
+ meta,
+ target,
+ label);
+ actions.add(createAction);
+ }
+ }
+ if (addAction != null) {
+ actions.add(addAction);
+ }
+ if (removeAction != null) {
+ actions.add(removeAction);
+ deleteAction = null;
+ } else {
+ deleteAction = new DeleteAction();
+ actions.add(deleteAction);
}
- deleteAction = new DeleteAction();
- actions.add(deleteAction);
if (Model.getUmlHelper().isMovable(metaType)) {
moveUpAction = new MoveUpAction();
@@ -326,7 +395,7 @@
toolbar = tbf.createToolBar();
toolbar.setRollover(true);
toolbar.setOrientation(ToolBar.VERTICAL);
- } else {
+ } else {
final ToolBarFactory tbf = new ToolBarFactory(new Object[] {});
toolbar = tbf.createToolBar();
toolbar.setRollover(true);
@@ -336,7 +405,7 @@
moveTopAction = null;
moveBottomAction = null;
deleteAction = null;
- }
+ }
JPanel buttonPanel =
new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));
@@ -344,28 +413,39 @@
this.addMouseListener(this);
setIcon();
buttonPanel.add(expander);
+ // TODO: In think this will always be true
if (toolbar != null) {
toolbar.setVisible(false);
buttonPanel.add(toolbar);
}
add(buttonPanel, BorderLayout.WEST);
- if (!Model.getModelManagementHelper().isReadOnly(target)) {
- getList().addListSelectionListener(deleteAction);
- // TODO: We should really test the model instead for this
- // but we have no API yet.
- // Can we just check if the collection to build the JList
- // control implements the List interface?
- if (Model.getUmlHelper().isMovable(metaType)) {
- getList().addListSelectionListener(moveUpAction);
- getList().addListSelectionListener(moveDownAction);
- getList().addListSelectionListener(moveTopAction);
- getList().addListSelectionListener(moveBottomAction);
- }
- }
+ if (!Model.getModelManagementHelper().isReadOnly(target)) {
+ if (deleteAction != null) {
+ getList().addListSelectionListener(deleteAction);
+ }
+ if (removeAction != null) {
+ getList().addListSelectionListener(this);
+ }
+ // TODO: We should really test the model instead for this
+ // but we have no API yet.
+ // Can we just check if the collection to build the JList
+ // control implements the List interface?
+ if (Model.getUmlHelper().isMovable(metaType)) {
+ getList().addListSelectionListener(moveUpAction);
+ getList().addListSelectionListener(moveDownAction);
+ getList().addListSelectionListener(moveTopAction);
+ getList().addListSelectionListener(moveBottomAction);
+ }
+ }
getModel().addListDataListener(this);
}
+
+ if (EXPANDED_CONTROLS.contains(getId())) {
+ toggleExpansion();
+ }
+
}
/**
@@ -431,6 +511,12 @@
*/
private void toggleExpansion() {
expanded = !expanded;
+
+ if (expanded) {
+ EXPANDED_CONTROLS.add(getId());
+ } else {
+ EXPANDED_CONTROLS.remove(getId());
+ }
setIcon();
if (toolbar != null) {
@@ -438,8 +524,23 @@
}
// Force the parent to redraw
- getParent().invalidate();
- getParent().validate();
+ Component c = getParent();
+ if (c != null) {
+ c.invalidate();
+ c.validate();
+ }
+ }
+
+ private String getId() {
+ final String id;
+ ListModel model = getList().getModel();
+ if (model instanceof SimpleListModel) {
+ SimpleListModel slm = (SimpleListModel) model;
+ id = slm.getPropertyName() + ":" + slm.getMetaType();
+ } else {
+ id = model.getClass().getName();
+ }
+ return id;
}
/**
@@ -457,8 +558,8 @@
* Remove all the listeners that were added in the constructor
*/
public void removeNotify() {
- LOG.info("The RowSelector is being removed from a panel");
if (!readonly) {
+ getList().removeListSelectionListener(this);
getList().removeListSelectionListener(deleteAction);
if (moveUpAction != null) {
getList().removeListSelectionListener(moveUpAction);
@@ -540,6 +641,14 @@
public void intervalRemoved(ListDataEvent e) {
}
+
+
+ public void valueChanged(ListSelectionEvent e) {
+ if (removeAction != null) {
+ removeAction.setEnabled(getList().getSelectedIndex() > -1);
+ }
+ }
+
/**
* This action deletes the model elements that are selected in the JList
@@ -788,4 +897,44 @@
this.element = element;
}
}
+
+ private static class AddAction extends UndoableAction {
+
+ private Command command;
+
+ public AddAction(Command command) {
+ super("", ResourceLoaderWrapper.lookupIcon("Add"));
+ this.command = command;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ command.execute();
+ }
+ }
+
+ private static class RemoveAction extends UndoableAction {
+
+ private final SimpleListModel simpleListModel;
+ private final JList list;
+
+ public RemoveAction(JList list, SimpleListModel model) {
+ super("", ResourceLoaderWrapper.lookupIcon("Remove"));
+ this.simpleListModel = model;
+ this.list = list;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ final Object objectToRemove = list.getSelectedValue();
+ if (objectToRemove!= null) {
+ Command command = simpleListModel.getRemoveCommand(objectToRemove);
+ command.execute();
+ } else {
+ LOG.warn("No selcted object was found in the list control - we shouldn't be able to get here");
+ }
+ }
+ }
}
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SimpleListModel.java 2010-03-28 07:20:44-0700
@@ -15,14 +15,17 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.StringTokenizer;
import javax.swing.DefaultListModel;
import javax.swing.SwingUtilities;
import org.apache.log4j.Logger;
import org.argouml.core.propertypanels.model.GetterSetterManager;
+import org.argouml.kernel.Command;
import org.argouml.model.AddAssociationEvent;
import org.argouml.model.InvalidElementException;
import org.argouml.model.Model;
@@ -47,6 +50,11 @@
*/
private final String type;
+ /**
+ * The metatypes to provide buttons to create
+ */
+ private final ArrayList metaTypes;
+
private final Object umlElement;
private final String propertyName;
@@ -60,6 +68,20 @@
super();
this.getterSetterManager = getterSetterManager;
this.type = type;
+ metaTypes = new ArrayList(2);
+ try {
+ final StringTokenizer st = new StringTokenizer(type, ",");
+ while (st.hasMoreTokens()) {
+ String className = st.nextToken();
+ if (className.contains(".")) {
+ metaTypes.add(Class.forName(className));
+ } else {
+ //LOG.debug(className + " is not recognised as a class name");
+ }
+ }
+ } catch (ClassNotFoundException e) {
+ LOG.warn("Exception building model for " + propertyName, e);
+ }
this.propertyName = propertyName;
this.umlElement = umlElement;
@@ -73,41 +95,80 @@
}
public Object getMetaType() {
- return getterSetterManager.getMetaType(propertyName);
+ if (metaTypes.size() > 0) {
+ return metaTypes.get(0);
+ }
+ return getterSetterManager.getMetaType(propertyName);
+ }
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public List getMetaTypes() {
+ return metaTypes;
+ }
+
+ public Command getRemoveCommand(Object objectToRemove) {
+ return getterSetterManager.getRemoveCommand(propertyName, umlElement, objectToRemove);
+ }
+
+ public Command getAddCommand() {
+ return getterSetterManager.getAddCommand(propertyName, umlElement);
}
/*
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
public void propertyChange(final PropertyChangeEvent e) {
- Runnable doWorkRunnable = new Runnable() {
- public void run() {
- try {
- if (e instanceof RemoveAssociationEvent) {
- removeElement(
- ((RemoveAssociationEvent) e).getChangedValue());
- } else if (e instanceof AddAssociationEvent) {
- Object newElement = ((AddAssociationEvent) e).getChangedValue();
-
- if (Model.getUmlHelper().isMovable(getMetaType())) {
- final Collection c =
- (Collection) getterSetterManager.getOptions(
- umlElement,
- propertyName,
- type);
- final int index =
- CollectionUtil.indexOf(c, newElement);
- add(index, newElement);
- } else {
- addElement(newElement);
- }
- }
- } catch (InvalidElementException e) {
- LOG.debug("propertyChange accessed a deleted element ", e);
- }
- }
- };
- SwingUtilities.invokeLater(doWorkRunnable);
+ if (e instanceof RemoveAssociationEvent
+ || e instanceof AddAssociationEvent) {
+ Runnable doWorkRunnable = new Runnable() {
+ public void run() {
+ try {
+ if (getterSetterManager.isFullBuildOnly(propertyName)) {
+ removeAllElements();
+ build();
+ } else {
+ if (e instanceof RemoveAssociationEvent) {
+ final Object objectToRemove =
+ ((RemoveAssociationEvent) e).getChangedValue();
+ removeElement(objectToRemove);
+ } else if (e instanceof AddAssociationEvent) {
+ Object newElement = ((AddAssociationEvent) e).getChangedValue();
+
+ if (Model.getUmlHelper().isMovable(getMetaType())) {
+ final Collection c =
+ (Collection) getterSetterManager.getOptions(
+ umlElement,
+ propertyName,
+ type);
+ final int index =
+ CollectionUtil.indexOf(c, newElement);
+ if (index < 0 || index > getSize() - 1) {
+ LOG.warn(
+ "Unable to add element at correct position "
+ + index + " added to end instead");
+ addElement(newElement);
+ } else {
+ add(index, newElement);
+ }
+ } else {
+ addElement(newElement);
+ }
+ }
+ }
+ } catch (InvalidElementException e) {
+ LOG.debug("propertyChange accessed a deleted element ", e);
+ }
+ }
+ };
+ SwingUtilities.invokeLater(doWorkRunnable);
+ } else {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("We are listening for too much here. An event we don't need " + e);
+ }
+ }
}
/**
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java 2010-03-28 07:20:44-0700
@@ -104,12 +104,6 @@
model = new UMLTransitionSourceListModel(modelElement, propName);
} else if ("target".equals(propName)) {
model = new UMLTransitionTargetListModel(modelElement, propName);
- } else if ("guard".equals(propName)) {
- model = new UMLTransitionGuardListModel(modelElement, propName);
- } else if ("effect".equals(propName)) {
- model = new UMLTransitionEffectListModel(modelElement, propName);
- } else if ("trigger".equals(propName)) {
- model = new UMLTransitionTriggerListModel(modelElement, propName);
} else if ("transition".equals(propName)) {
model = new UMLGuardTransitionListModel(modelElement, propName);
} else if ("container".equals(propName)) {
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java 2010-03-28 07:20:44-0700
@@ -56,7 +56,7 @@
import org.argouml.core.propertypanels.model.GetterSetterManager;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.UMLComboBoxNavigator;
+import org.argouml.uml.ui.ActionDeleteModelElements;
import org.argouml.uml.ui.foundation.extension_mechanisms.ActionNewStereotype;
import org.tigris.swidgets.GridLayout2;
import org.tigris.toolbar.ToolBarFactory;
@@ -118,6 +118,17 @@
JToolBar tb = tbf.createToolBar();
tb.add(new JLabel(metaTypeName, ResourceLoaderWrapper.lookupIconResource(metaTypeName), JLabel.LEFT));
if (!Model.getModelManagementHelper().isReadOnly(target)) {
+ tb.add(new NavigateUpAction(target));
+
+ if (Model.getFacade().isAAttribute(target)
+ || Model.getFacade().isAOperation(target)
+ || Model.getFacade().isAReception(target)
+ || Model.getFacade().isAParameter(target)) {
+ tb.add(new NavigatePreviousAction(target));
+ tb.add(new NavigateNextAction(target));
+ }
+
+ tb.add(new ActionDeleteModelElements());
// We only have this here until we have stereotypes
// list on property panel
tb.add(new ActionNewStereotype());
@@ -331,7 +342,7 @@
if ("namespace".equals(prop.getName())) {
final UMLComboBoxModel model =
new UMLModelElementNamespaceComboBoxModel(propertyName, target);
- final JComboBox combo = new UMLSearchableComboBox(
+ final UMLComboBox combo = new UMLSearchableComboBox(
model,
model.getAction(), true);
comp = new UMLComboBoxNavigator(
@@ -354,7 +365,7 @@
if (Model.getFacade().isAAssociationRole(target)) {
final UMLComboBoxModel model =
new UMLAssociationRoleBaseComboBoxModel(propertyName, target);
- final JComboBox combo = new UMLSearchableComboBox(
+ final UMLComboBox combo = new UMLSearchableComboBox(
model,
model.getAction(), true);
comp = new UMLComboBoxNavigator(Translator.localize(
@@ -366,7 +377,7 @@
} else if ("powertype".equals(prop.getName())) {
final UMLComboBoxModel model =
new UMLGeneralizationPowertypeComboBoxModel(propertyName, target);
- final JComboBox combo = new UMLComboBox(
+ final UMLComboBox combo = new UMLComboBox(
model);
comp = combo;
} else if ("multiplicity".equals(prop.getName())) {
@@ -382,7 +393,7 @@
if (Model.getFacade().isACallEvent(target)) {
UMLComboBoxModel model =
new UMLCallEventOperationComboBoxModel(propertyName, target);
- JComboBox combo = new UMLCallEventOperationComboBox(model);
+ UMLComboBox combo = new UMLCallEventOperationComboBox(model);
comp = new UMLComboBoxNavigator(Translator.localize(
"label.operation.navigate.tooltip"),
combo);
@@ -433,19 +444,19 @@
} else if ("submachine".equals(prop.getName())) {
final UMLComboBoxModel model =
new UMLSubmachineStateComboBoxModel(propertyName, target);
- final JComboBox submachineBox = new UMLComboBox(model);
+ final UMLComboBox submachineBox = new UMLComboBox(model);
comp = new UMLComboBoxNavigator(Translator.localize(
"tooltip.nav-submachine"), submachineBox);
} else if ("referenceState".equals(prop.getName())) {
final UMLComboBoxModel model =
new UMLStubStateComboBoxModel(propertyName, target);
- final JComboBox referencestateBox =
+ final UMLComboBox referencestateBox =
new UMLComboBox(model);
comp = new UMLComboBoxNavigator(Translator.localize(
"tooltip.nav-stubstate"), referencestateBox);
} else if ("tagType".equals(prop.getName())) {
UMLComboBoxModel model = new UMLMetaClassComboBoxModel(propertyName, target);
- final JComboBox typeComboBox = new UMLComboBox(model);
+ final UMLComboBox typeComboBox = new UMLComboBox(model);
comp = new UMLComboBoxNavigator(
Translator.localize("label.type.navigate.tooltip"),
typeComboBox);
@@ -454,21 +465,35 @@
} else if ("parameter".equals(prop.getName())) {
final UMLComboBoxModel model =
new UMLTemplateParameterParameterComboBoxModel(target);
- final JComboBox combo = new UMLComboBox(model);
+ final UMLComboBox combo = new UMLComboBox(model);
comp = new UMLComboBoxNavigator(
Translator.localize("label.type.navigate.tooltip"),
combo);
} else if ("defaultElement".equals(prop.getName())) {
final UMLComboBoxModel model =
new UMLTemplateParameterDefaultElementComboBoxModel(propertyName, target);
- final JComboBox combo = new UMLComboBox(model);
+ final UMLComboBox combo = new UMLComboBox(model);
+ comp = new UMLComboBoxNavigator(
+ Translator.localize("label.type.navigate.tooltip"),
+ combo);
+ } else if ("signal".equals(prop.getName())) {
+ final UMLComboBoxModel model =
+ new UMLReceptionSignalComboBoxModel(propertyName, target);
+ final UMLComboBox combo = new UMLComboBox(model);
+ comp = new UMLComboBoxNavigator(
+ Translator.localize("label.type.navigate.tooltip"),
+ combo);
+ } else if ("trigger".equals(prop.getName())) {
+ final UMLComboBoxModel model =
+ new UMLTransitionTriggerComboBoxModel(propertyName, target);
+ final UMLComboBox combo = new UMLComboBox(model);
comp = new UMLComboBoxNavigator(
Translator.localize("label.type.navigate.tooltip"),
combo);
} else if ("specification".equals(prop.getName())) {
final UMLComboBoxModel model =
new UMLMethodSpecificationComboBoxModel(propertyName, target);
- final JComboBox combo = new UMLComboBox(model);
+ final UMLComboBox combo = new UMLComboBox(model);
comp = new UMLComboBoxNavigator(
Translator.localize("label.type.navigate.tooltip"),
combo);
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionArgumentListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActionArgumentListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleMessageListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleMessageListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierPackageImportsListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierPackageImportsListModel.java?view=markup&pathrev=18180
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java 2010-03-28 07:20:44-0700
@@ -42,6 +42,7 @@
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -743,4 +744,8 @@
}
abstract public Action getAction();
+
+ public List<Action> getActions() {
+ return Collections.emptyList();
+ }
}
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendExtensionPointListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendExtensionPointListModel.java?view=markup&pathrev=18180
Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java?view=diff&pathrev=18181&r1=18180&r2=18181
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java (original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInitialValueExpressionModel.java 2010-03-28 07:20:44-0700
@@ -7,7 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * mvw
+ * Michiel van der Wulp
+ * Bob Tarling
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -52,6 +53,10 @@
public UMLInitialValueExpressionModel(Object target) {
super(target, "initialValue");
+ if (!Model.getFacade().isAAttribute(target)) {
+ throw new IllegalArgumentException(
+ "The target must be an attribute we got a " + target.getClass().getName());
+ }
}
/**
@@ -60,12 +65,7 @@
*/
@Override
public Object getExpression() {
- Object target = getTarget();
- if (target == null) {
- return null;
- }
- assert Model.getFacade().isAAttribute(target);
- return Model.getFacade().getInitialValue(target);
+ return Model.getFacade().getInitialValue(getTarget());
}
@Override
@@ -80,7 +80,6 @@
@Override
public void setExpression(Object expression) {
Object target = getTarget();
- assert Model.getFacade().isAAttribute(target);
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);
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInteractionMessagesListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLInteractionMessagesListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLNamespaceOwnedElementListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLNamespaceOwnedElementListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionEffectListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionEffectListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionGuardListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionGuardListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerListModel.java?view=markup&pathrev=18180
Removed: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLUseCaseExtensionPointListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLUseCaseExtensionPointListModel.java?view=markup&pathrev=18180
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2466225
To unsubscribe from this discussion, e-mail: [[email protected]].