Author: bobtarling
Date: 2007-06-14 13:27:54-0700
New Revision: 12836
Added:
trunk/src_new/org/argouml/uml/diagram/ui/ActionSetAddMessageMode.java (contents, props changed)
Modified:
trunk/src_new/org/argouml/uml/diagram/sequence/ui/ModeCreateMessage.java
trunk/src_new/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java
Log:
Fix drawing of messages between lifelines
Modified: trunk/src_new/org/argouml/uml/diagram/sequence/ui/ModeCreateMessage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/sequence/ui/ModeCreateMessage.java?view=diff&rev=12836&p1=trunk/src_new/org/argouml/uml/diagram/sequence/ui/ModeCreateMessage.java&p2=trunk/src_new/org/argouml/uml/diagram/sequence/ui/ModeCreateMessage.java&r1=12835&r2=12836
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/sequence/ui/ModeCreateMessage.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/sequence/ui/ModeCreateMessage.java 2007-06-14 13:27:54-0700
@@ -30,6 +30,7 @@
import org.apache.log4j.Logger;
import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Globals;
import org.tigris.gef.base.ModeCreate;
@@ -203,12 +204,8 @@
if (foundPort != null && foundPort != startPort) {
Fig destPortFig = destFigClassifierRole.getPortFig(foundPort);
- Object edgeType = getArg("edgeClass");
- if (edgeType != null) {
- message = mgm.connect(startPort, foundPort, edgeType);
- } else {
- message = mgm.connect(startPort, foundPort);
- }
+ Object edgeType = Model.getMetaTypes().getMessage();
+ message = mgm.connect(startPort, foundPort, edgeType);
// Calling connect() will add the edge to the GraphModel and
// any LayerPersectives on that GraphModel will get a
Modified: trunk/src_new/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java?view=diff&rev=12836&p1=trunk/src_new/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java&r1=12835&r2=12836
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/sequence/ui/UMLSequenceDiagram.java 2007-06-14 13:27:54-0700
@@ -27,11 +27,11 @@
import java.beans.PropertyVetoException;
import java.util.Hashtable;
-import org.argouml.application.helpers.ResourceLoaderWrapper;
import org.argouml.i18n.Translator;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
import org.argouml.uml.diagram.sequence.SequenceDiagramGraphModel;
+import org.argouml.uml.diagram.ui.ActionSetAddMessageMode;
import org.argouml.uml.diagram.ui.ActionSetMode;
import org.argouml.uml.diagram.ui.RadioAction;
import org.argouml.uml.diagram.ui.UMLDiagram;
@@ -136,36 +136,23 @@
protected Object[] getUmlActions() {
if (actions == null) {
actions = new Object[7];
- actions[0] =
- new ActionAddClassifierRole();
- int offset = 1;
-
- Object[][] actionList = {
- {Model.getMetaTypes().getCallAction(),
- "button.new-callaction", },
- {Model.getMetaTypes().getReturnAction(),
- "button.new-returnaction", },
- {Model.getMetaTypes().getCreateAction(),
- "button.new-createaction", },
- {Model.getMetaTypes().getDestroyAction(),
- "button.new-destroyaction", },
- };
+ actions[0] = new RadioAction(new ActionAddClassifierRole());
+
+ actions[1] = new RadioAction(new ActionSetAddMessageMode(
+ Model.getMetaTypes().getCallAction(),
+ "button.new-callaction"));
+ actions[2] = new RadioAction(new ActionSetAddMessageMode(
+ Model.getMetaTypes().getReturnAction(),
+ "button.new-returnaction"));
+ actions[3] = new RadioAction(new ActionSetAddMessageMode(
+ Model.getMetaTypes().getCreateAction(),
+ "button.new-createaction"));
+ actions[4] = new RadioAction(new ActionSetAddMessageMode(
+ Model.getMetaTypes().getDestroyAction(),
+ "button.new-destroyaction"));
Hashtable<String, Object> args = new Hashtable<String, Object>();
- for (int i = 0; i < actionList.length; i++) {
- args.clear();
- args.put("edgeClass", Model.getMetaTypes().getMessage());
- args.put("action", actionList[i][0]);
- args.put("actionName",
- ResourceLoaderWrapper
- .getImageBinding((String) actionList[i][1]));
- actions[i + offset] =
- new RadioAction(new ActionSetMode(
- ModeCreateMessage.class, args,
- (String) actionList[i][1]));
- }
- args.clear();
args.put("name", SEQUENCE_EXPAND_BUTTON);
actions[5] =
new RadioAction(new ActionSetMode(ModeChangeHeight.class,
Added: trunk/src_new/org/argouml/uml/diagram/ui/ActionSetAddMessageMode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/ActionSetAddMessageMode.java?view=auto&rev=12836
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/uml/diagram/ui/ActionSetAddMessageMode.java 2007-06-14 13:27:54-0700
@@ -0,0 +1,57 @@
+// $Id$
+// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+/*
+ * ActionAddAssociation.java
+ *
+ * Created on 15 February 2003, 01:01
+ */
+package org.argouml.uml.diagram.ui;
+
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.sequence.ui.ModeCreateMessage;
+
+/**
+ * An extension of ActionSetMode to set the parameters for an association.
+ *
+ * @author Bob Tarling
+ */
+
+public class ActionSetAddMessageMode extends ActionSetMode {
+
+ /**
+ * Construct a new ActionSetAddMessageMode<p>
+ *
+ * @param action the UML meta type of the UML action to associate
+ * to the new message
+ * @param name the i18n code for the action name
+ */
+ public ActionSetAddMessageMode(Object action, String name) {
+ super(ModeCreateMessage.class, "edgeClass",
+ Model.getMetaTypes().getMessage(), name);
+ modeArgs.put("action", action);
+ }
+}
+
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.