Author: bobtarling Date: 2011-03-25 10:11:22-0700 New Revision: 19137 Added: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java Modified: trunk/src/argouml-app/tests/org/argouml/model/MockModelImplementation.java trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/UMLSequenceDiagram.java trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java trunk/src/argouml-core-model/src/org/argouml/model/Model.java trunk/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java
Log: First movement toward UML2 sequence diagrams Modified: trunk/src/argouml-app/tests/org/argouml/model/MockModelImplementation.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/model/MockModelImplementation.java?view=diff&pathrev=19137&r1=19136&r2=19137 ============================================================================== --- trunk/src/argouml-app/tests/org/argouml/model/MockModelImplementation.java (original) +++ trunk/src/argouml-app/tests/org/argouml/model/MockModelImplementation.java 2011-03-25 10:11:22-0700 @@ -187,6 +187,11 @@ * Control object. */ private MockControl controlMT; + + /** + * Control object. + */ + private MockControl controlMS; /** * Control object. @@ -578,6 +583,13 @@ } /* + * @see org.argouml.model.ModelImplementation#getMessageSort() + */ + public MessageSort getMessageSort() { + return (MessageSort) controlMS.getMock(); + } + + /* * @see org.argouml.model.ModelImplementation#getMetaTypes() */ public MetaTypes getMetaTypes() { Modified: trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/UMLSequenceDiagram.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/UMLSequenceDiagram.java?view=diff&pathrev=19137&r1=19136&r2=19137 ============================================================================== --- trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/UMLSequenceDiagram.java (original) +++ trunk/src/argouml-core-diagrams-sequence2/src/org/argouml/sequence2/diagram/UMLSequenceDiagram.java 2011-03-25 10:11:22-0700 @@ -41,6 +41,7 @@ import java.awt.Point; import java.awt.Rectangle; import java.beans.PropertyVetoException; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -153,31 +154,39 @@ @Override protected Object[] getUmlActions() { if (actions == null) { + List actionList = new ArrayList(); + actionList.add(new RadioAction(new ActionAddClassifierRole())); + getMessageActions(actionList); + actionList.add(new RadioAction(new ActionSetMode( + ModeBroomMessages.class, + "button.broom-messages"))); actions = new Object[8]; int i = 0; - actions[i++] = new RadioAction(new ActionAddClassifierRole()); - actions[i++] = new RadioAction(new ActionSetAddMessageMode( - Model.getMetaTypes().getCallAction(), - "button.new-callaction")); - actions[i++] = new RadioAction(new ActionSetAddMessageMode( - Model.getMetaTypes().getSendAction(), - "button.new-sendaction")); - actions[i++] = new RadioAction(new ActionSetAddMessageMode( - Model.getMetaTypes().getReturnAction(), - "button.new-returnaction")); - actions[i++] = new RadioAction(new ActionSetAddMessageMode( - Model.getMetaTypes().getCreateAction(), - "button.new-createaction")); - actions[i++] = new RadioAction(new ActionSetAddMessageMode( - Model.getMetaTypes().getDestroyAction(), - "button.new-destroyaction")); - actions[i++] = new RadioAction(new ActionSetMode( - ModeBroomMessages.class, - "button.broom-messages")); + actions = actionList.toArray(); + } return actions; } + private List getMessageActions(List actions) { + actions.add(new RadioAction(new ActionSetAddMessageMode( + Model.getMessageSort().getSynchCall(), + "button.new-callaction"))); + actions.add(new RadioAction(new ActionSetAddMessageMode( + Model.getMessageSort().getASynchCall(), + "button.new-sendaction"))); + actions.add(new RadioAction(new ActionSetAddMessageMode( + Model.getMessageSort().getReply(), + "button.new-returnaction"))); + actions.add(new RadioAction(new ActionSetAddMessageMode( + Model.getMessageSort().getCreateMessage(), + "button.new-createaction"))); + actions.add(new RadioAction(new ActionSetAddMessageMode( + Model.getMessageSort().getDeleteMessage(), + "button.new-destroyaction"))); + return actions; + } + /** * Get the localized label name for the diagram * @return The localized label name for the diagram Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java?view=diff&pathrev=19137&r1=19136&r2=19137 ============================================================================== --- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java (original) +++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java 2011-03-25 10:11:22-0700 @@ -31,6 +31,7 @@ import org.apache.log4j.Logger; import org.argouml.model.DiagramInterchangeModel; +import org.argouml.model.MessageSort; import org.argouml.model.ModelImplementation; import org.argouml.model.UmlException; import org.eclipse.emf.common.command.BasicCommandStack; @@ -119,6 +120,8 @@ private FacadeEUMLImpl theFacade; + private MessageSort theMessageSort; + private MetaTypesEUMLImpl theMetaTypes; private ModelEventPumpEUMLImpl theModelEventPump; @@ -456,6 +459,13 @@ return theOrderingKind; } + public MessageSort getMessageSort() { + if (theMessageSort == null) { + theMessageSort = new MessageSortEUMLImpl(); + } + return theMessageSort; + } + public PseudostateKindEUMLImpl getPseudostateKind() { if (thePseudostateKind == null) { thePseudostateKind = new PseudostateKindEUMLImpl(); Added: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java?view=markup&pathrev=19137 ============================================================================== --- (empty file) +++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MessageSortEUMLImpl.java 2011-03-25 10:11:22-0700 @@ -0,0 +1,43 @@ +// $Id: MessageSortEUMLImpl.java 18220 2010-04-08 20:37:15Z bobtarling $ +/******************************************************************************* + * Copyright (c) 2011 Contributors - see below + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Bob Tarling + *******************************************************************************/ + +package org.argouml.model.euml; + +import org.argouml.model.MessageSort; + +/** + * The implementation of the OrderingKindEUMLImpl.java for EUML2. + */ +class MessageSortEUMLImpl implements MessageSort { + + public Object getASynchCall() { + return org.eclipse.uml2.uml.MessageSort.ASYNCH_CALL; + } + + public Object getCreateMessage() { + return org.eclipse.uml2.uml.MessageSort.CREATE_MESSAGE; + } + + public Object getDeleteMessage() { + return org.eclipse.uml2.uml.MessageSort.DELETE_MESSAGE; + } + + public Object getReply() { + return org.eclipse.uml2.uml.MessageSort.REPLY; + } + + public Object getSynchCall() { + return org.eclipse.uml2.uml.MessageSort.SYNCH_CALL; + } + + +} Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java?view=diff&pathrev=19137&r1=19136&r2=19137 ============================================================================== --- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java (original) +++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java 2011-03-25 10:11:22-0700 @@ -61,6 +61,7 @@ import org.eclipse.uml2.uml.Interaction; import org.eclipse.uml2.uml.InteractionConstraint; import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Lifeline; import org.eclipse.uml2.uml.Message; import org.eclipse.uml2.uml.Model; import org.eclipse.uml2.uml.MultiplicityElement; @@ -232,10 +233,7 @@ } public Object getClassifierRole() { - // TODO: In UML 2.0, ClassifierRole, AssociationRole, and - // AssociationEndRole have been replaced by the internal - // structure of the Collaboration - return Classifier.class; + return Lifeline.class; } public Object getCollaboration() { Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java?view=diff&pathrev=19137&r1=19136&r2=19137 ============================================================================== --- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java (original) +++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java 2011-03-25 10:11:22-0700 @@ -75,6 +75,7 @@ import org.argouml.model.ExtensionMechanismsFactory; import org.argouml.model.ExtensionMechanismsHelper; import org.argouml.model.Facade; +import org.argouml.model.MessageSort; import org.argouml.model.MetaTypes; import org.argouml.model.ModelEventPump; import org.argouml.model.ModelImplementation; @@ -94,6 +95,7 @@ import org.argouml.model.VisibilityKind; import org.argouml.model.XmiReader; import org.argouml.model.XmiWriter; +import org.argouml.model.MessageSort; import org.netbeans.api.mdr.CreationFailedException; import org.netbeans.api.mdr.MDRManager; import org.netbeans.api.mdr.MDRepository; @@ -121,6 +123,8 @@ private ActivityGraphsHelper theActivityGraphsHelper; private CoreHelper theCoreHelper; + + private MessageSort theMessageSort; private MetaTypes theMetaTypes = new MetaTypesMDRImpl(); @@ -526,6 +530,7 @@ theDataTypesHelper = new DataTypesHelperMDRImpl(this); theKindsObject = new KindsMDRImpl(this); + theMessageSort = new MessageSortMDRImpl(); theModelManagementFactory = new ModelManagementFactoryMDRImpl(this); theExtensionMechanismsHelper = new ExtensionMechanismsHelperMDRImpl(this); @@ -837,6 +842,13 @@ return theKindsObject; } + /* + * @see org.argouml.model.ModelImplementation#getMessageSort() + */ + public MessageSort getMessageSort() { + return theMessageSort; + } + public VisibilityKind getVisibilityKind() { return theKindsObject; Added: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java?view=markup&pathrev=19137 ============================================================================== --- (empty file) +++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MessageSortMDRImpl.java 2011-03-25 10:11:22-0700 @@ -0,0 +1,47 @@ +// $Id: MessageSortEUMLImpl.java 18220 2010-04-08 20:37:15Z bobtarling $ +/******************************************************************************* + * Copyright (c) 2011 Contributors - see below + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Bob Tarling + *******************************************************************************/ + +package org.argouml.model.mdr; + +import org.argouml.model.MessageSort; +import org.argouml.model.NotImplementedException; +import org.omg.uml.behavioralelements.commonbehavior.CallAction; +import org.omg.uml.behavioralelements.commonbehavior.CreateAction; +import org.omg.uml.behavioralelements.commonbehavior.DestroyAction; +import org.omg.uml.behavioralelements.commonbehavior.ReturnAction; +import org.omg.uml.behavioralelements.commonbehavior.SendAction; + +/** + * The implementation of the OrderingKindEUMLImpl.java for EUML2. + */ +class MessageSortMDRImpl implements MessageSort { + + public Object getASynchCall() { + return SendAction.class; + } + + public Object getCreateMessage() { + return CreateAction.class; + } + + public Object getDeleteMessage() { + return DestroyAction.class; + } + + public Object getReply() { + return ReturnAction.class; + } + + public Object getSynchCall() { + return CallAction.class; + } +} Added: trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java?view=markup&pathrev=19137 ============================================================================== --- (empty file) +++ trunk/src/argouml-core-model/src/org/argouml/model/MessageSort.java 2011-03-25 10:11:22-0700 @@ -0,0 +1,45 @@ +/* $Id: MessageKind.java 17747 2010-01-10 21:16:51Z linus $ + ******************************************************************************* + * Copyright (c) 2011 Contributors - see below + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Bob Tarling + ******************************************************************************* + */ + +package org.argouml.model; + +/** + * The different AggregationKinds. + */ +public interface MessageSort { + + /** + * @return Returns the SynchCall MessageSort + */ + Object getSynchCall(); + + /** + * @return Returns the ASynchCall MessageSort + */ + Object getASynchCall(); + + /** + * @return Returns the CreateMessage MessageSort + */ + Object getCreateMessage(); + + /** + * @return Returns the DeleteMessage MessageSort + */ + Object getDeleteMessage(); + + /** + * @return Returns the Reply MessageSort + */ + Object getReply(); +} Modified: trunk/src/argouml-core-model/src/org/argouml/model/Model.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/Model.java?view=diff&pathrev=19137&r1=19136&r2=19137 ============================================================================== --- trunk/src/argouml-core-model/src/org/argouml/model/Model.java (original) +++ trunk/src/argouml-core-model/src/org/argouml/model/Model.java 2011-03-25 10:11:22-0700 @@ -363,6 +363,15 @@ } /** + * Getter for the ConcurrencyKind object. + * + * @return The object implementing the interface. + */ + public static MessageSort getMessageSort() { + return impl.getMessageSort(); + } + + /** * Getter for the MetaTypes object. * * @return the MetaTypes object. Modified: trunk/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java?view=diff&pathrev=19137&r1=19136&r2=19137 ============================================================================== --- trunk/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java (original) +++ trunk/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java 2011-03-25 10:11:22-0700 @@ -208,7 +208,13 @@ */ UseCasesHelper getUseCasesHelper(); - + /** + * Getter for MessageSort + * + * @return the MessageSort object. + */ + MessageSort getMessageSort(); + /** * Getter for the MetaTypes object. * ------------------------------------------------------ http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2714192 To unsubscribe from this discussion, e-mail: [[email protected]].
