Author: tfmorris
Date: 2007-11-23 15:53:04-0800
New Revision: 13828
Modified:
trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java
trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java
trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/ActionAddEventAsTrigger.java
trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java
trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelObjectFlowState.java
trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelPartition.java
trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddClassifierRoleBase.java
trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddMessagePredecessor.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddContextSignal.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddCreateActionInstantiation.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddInstanceClassifier.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSendAction.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSignal.java
trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddEventAsDeferrableEvent.java
trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddSignalsToSignalEvent.java
trunk/src_new/org/argouml/uml/ui/behavior/state_machines/UMLSignalEventSignalList.java
trunk/src_new/org/argouml/uml/ui/behavior/use_cases/ActionAddExtendExtensionPoint.java
trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddAssociationSpecification.java
trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddClientDependencyAction.java
trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddSupplierDependencyAction.java
trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelStereotype.java
trunk/src_new/org/argouml/uml/ui/model_management/ActionAddPackageImport.java
Log:
Switch add actions to use AbstractActionAddModelElement2
Modified: trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java&p2=trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java (original)
+++ trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java 2007-11-23 15:53:04-0800
@@ -38,7 +38,7 @@
* @since Oct 2, 2002
* @author [email protected]
* @deprecated for 0.25.4 by tfmorris. Use
- * {@link AbstractActionAddModelElement2#}.
+ * {@link AbstractActionAddModelElement2}.
*/
public abstract class AbstractActionAddModelElement extends
AbstractActionAddModelElement2 {
@@ -51,8 +51,7 @@
*/
@Deprecated
protected AbstractActionAddModelElement() {
- super(Translator.localize("menu.popup.add-modelelement"),
- null);
+ super(Translator.localize("menu.popup.add-modelelement"), null);
// Set the tooltip string:
putValue(Action.SHORT_DESCRIPTION,
Translator.localize("menu.popup.add-modelelement"));
@@ -67,7 +66,7 @@
*
* @return Vector
* @deprecated for 0.25.4 by tfmorris. Use
- * {@link AbstractActionAddModelElement2#getChoices()).
+ * {@link AbstractActionAddModelElement2#getChoices()}.
*/
@Deprecated
protected abstract Vector getChoices();
@@ -76,7 +75,7 @@
* The modelelements already selected BEFORE the dialog is shown.
* @return Vector
* @deprecated for 0.25.4 by tfmorris. Use
- * {@link AbstractActionAddModelElement2#getSelected()).
+ * {@link AbstractActionAddModelElement2#getSelected()}.
*/
@Deprecated
protected abstract Vector getSelected();
@@ -86,7 +85,7 @@
* UMLAddDialog.
* @param selected The choices the user has selected in the UMLAddDialog
* @deprecated for 0.25.4 by tfmorris. Use
- * {@link AbstractActionAddModelElement2#doIt(java.util.List)).
+ * {@link AbstractActionAddModelElement2#doIt(java.util.List)}.
*/
@Deprecated
protected abstract void doIt(Vector selected);
Modified: trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java&p2=trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java (original)
+++ trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java 2007-11-23 15:53:04-0800
@@ -25,6 +25,7 @@
package org.argouml.uml.ui;
import java.awt.event.ActionEvent;
+import java.util.Collection;
import java.util.List;
import java.util.Vector;
@@ -53,8 +54,7 @@
* Construct an action to add a model element to some list.
*/
protected AbstractActionAddModelElement2() {
- super(Translator.localize("menu.popup.add-modelelement"),
- null);
+ super(Translator.localize("menu.popup.add-modelelement"), null);
// Set the tooltip string:
putValue(Action.SHORT_DESCRIPTION,
Translator.localize("menu.popup.add-modelelement"));
@@ -107,7 +107,9 @@
* UMLAddDialog.
* @param selected The choices the user has selected in the UMLAddDialog
*/
- protected void doIt(List selected) {
+ protected void doIt(Collection selected) {
+ // TODO: This is for backward compatibility. It can be removed after
+ // the deprecation period for AbstractActionAddModelElement has lapsed
if (this instanceof AbstractActionAddModelElement) {
((AbstractActionAddModelElement) this).doIt((Vector) selected);
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/ActionAddEventAsTrigger.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/ActionAddEventAsTrigger.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/ActionAddEventAsTrigger.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/ActionAddEventAsTrigger.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/ActionAddEventAsTrigger.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/ActionAddEventAsTrigger.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -24,11 +24,13 @@
package org.argouml.uml.ui.behavior.activity_graphs;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* Provide a dialog which helps the user to select one event out of an existing
@@ -37,7 +39,7 @@
* @author MarkusK
*
*/
-public class ActionAddEventAsTrigger extends AbstractActionAddModelElement {
+public class ActionAddEventAsTrigger extends AbstractActionAddModelElement2 {
/**
* The one and only instance of this class.
@@ -53,11 +55,9 @@
setMultiSelect(false);
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector vec = new Vector();
+
+ protected List getChoices() {
+ List vec = new ArrayList();
// TODO: the namespace of created events is currently the model.
// I think this is wrong, they should be
// in the namespace of the activitygraph!
@@ -71,34 +71,29 @@
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector vec = new Vector();
+
+ protected List getSelected() {
+ List vec = new ArrayList();
Object trigger = Model.getFacade().getTrigger(getTarget());
if (trigger != null)
vec.add(trigger);
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-events");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ @Override
+ protected void doIt(Collection selected) {
Object trans = getTarget();
if (selected == null || selected.size() == 0) {
Model.getStateMachinesHelper().setEventAsTrigger(trans, null);
} else {
Model.getStateMachinesHelper().setEventAsTrigger(trans,
- selected.get(0));
+ selected.iterator().next());
}
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java 2007-11-23 15:53:04-0800
@@ -28,8 +28,8 @@
import java.beans.PropertyChangeEvent;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
+import java.util.Collections;
+import java.util.List;
import javax.swing.JComboBox;
import javax.swing.JScrollPane;
@@ -39,7 +39,6 @@
import org.argouml.model.AttributeChangeEvent;
import org.argouml.model.InvalidElementException;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
import org.argouml.uml.ui.AbstractActionAddModelElement2;
import org.argouml.uml.ui.AbstractActionRemoveElement;
import org.argouml.uml.ui.ActionNavigateNamespace;
@@ -196,12 +195,10 @@
protected void buildModelList() {
Object model =
ProjectManager.getManager().getCurrentProject().getModel();
- Collection c =
+ Collection classifiers =
new ArrayList(Model.getCoreHelper().getAllClassifiers(model));
Collection newList = new ArrayList();
- Iterator i = c.iterator();
- while (i.hasNext()) {
- Object classifier = i.next();
+ for (Object classifier : classifiers) {
if (!Model.getFacade().isAClassifierInState(classifier)) {
newList.add(classifier);
}
@@ -249,7 +246,7 @@
}
}
-class ActionAddCISState extends AbstractActionAddModelElement {
+class ActionAddCISState extends AbstractActionAddModelElement2 {
/**
* The serial version.
@@ -269,7 +266,7 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
*/
- protected void doIt(Vector selected) {
+ protected void doIt(Collection selected) {
Object cis = getTarget();
if (Model.getFacade().isAClassifierInState(cis)) {
Model.getActivityGraphsHelper().setInStates(cis, selected);
@@ -279,8 +276,8 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
*/
- protected Vector getChoices() {
- Vector ret = new Vector();
+ protected List getChoices() {
+ List ret = new ArrayList();
Object cis = getTarget();
Object classifier = Model.getFacade().getType(cis);
if (Model.getFacade().isAClassifier(classifier)) {
@@ -301,12 +298,12 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
*/
- protected Vector getSelected() {
+ protected List getSelected() {
Object cis = getTarget();
if (Model.getFacade().isAClassifierInState(cis)) {
- return new Vector(Model.getFacade().getInStates(cis));
+ return new ArrayList(Model.getFacade().getInStates(cis));
}
- return new Vector();
+ return Collections.EMPTY_LIST;
}
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelObjectFlowState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelObjectFlowState.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelObjectFlowState.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelObjectFlowState.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelObjectFlowState.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelObjectFlowState.java 2007-11-23 15:53:04-0800
@@ -29,8 +29,7 @@
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
+import java.util.List;
import javax.swing.Action;
import javax.swing.Icon;
@@ -40,7 +39,7 @@
import org.argouml.application.helpers.ResourceLoaderWrapper;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
import org.argouml.uml.ui.AbstractActionNewModelElement;
import org.argouml.uml.ui.AbstractActionRemoveElement;
import org.argouml.uml.ui.UMLComboBoxNavigator;
@@ -174,10 +173,8 @@
* @param ret a collection of states
*/
static void removeTopStateFrom(Collection ret) {
- Iterator i = ret.iterator();
Collection tops = new ArrayList();
- while (i.hasNext()) {
- Object state = i.next();
+ for (Object state : ret) {
if (Model.getFacade().isACompositeState(state)
&& Model.getFacade().isTop(state)) {
tops.add(state);
@@ -244,7 +241,7 @@
private static final long serialVersionUID = -7742772495832660119L;
}
- static class ActionAddOFSState extends AbstractActionAddModelElement {
+ static class ActionAddOFSState extends AbstractActionAddModelElement2 {
private Object choiceClass = Model.getMetaTypes().getState();
@@ -256,11 +253,8 @@
setMultiSelect(true);
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(
- * java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ protected void doIt(Collection selected) {
Object t = getTarget();
if (Model.getFacade().isAObjectFlowState(t)) {
Object type = Model.getFacade().getType(t);
@@ -282,11 +276,9 @@
}
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector ret = new Vector();
+
+ protected List getChoices() {
+ List ret = new ArrayList();
Object t = getTarget();
if (Model.getFacade().isAObjectFlowState(t)) {
Object classifier = getType(t);
@@ -300,25 +292,21 @@
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-state");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
+
+ protected List getSelected() {
Object t = getTarget();
if (Model.getFacade().isAObjectFlowState(t)) {
Object type = Model.getFacade().getType(t);
if (Model.getFacade().isAClassifierInState(type)) {
- return new Vector(Model.getFacade().getInStates(type));
+ return new ArrayList(Model.getFacade().getInStates(type));
}
}
- return new Vector();
+ return new ArrayList();
}
/**
@@ -401,7 +389,7 @@
}
- static class ActionAddOFSParameter extends AbstractActionAddModelElement {
+ static class ActionAddOFSParameter extends AbstractActionAddModelElement2 {
private Object choiceClass = Model.getMetaTypes().getParameter();
/**
@@ -412,22 +400,17 @@
setMultiSelect(true);
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(
- * java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ protected void doIt(Collection selected) {
Object t = getTarget();
if (Model.getFacade().isAObjectFlowState(t)) {
Model.getActivityGraphsHelper().setParameters(t, selected);
}
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector ret = new Vector();
+
+ protected List getChoices() {
+ List ret = new ArrayList();
Object t = getTarget();
if (Model.getFacade().isAObjectFlowState(t)) {
Object classifier = getType(t);
@@ -452,22 +435,18 @@
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-state");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
+
+ protected List getSelected() {
Object t = getTarget();
if (Model.getFacade().isAObjectFlowState(t)) {
- return new Vector(Model.getFacade().getParameters(t));
+ return new ArrayList(Model.getFacade().getParameters(t));
}
- return new Vector();
+ return new ArrayList();
}
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelPartition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelPartition.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelPartition.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelPartition.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelPartition.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelPartition.java 2007-11-23 15:53:04-0800
@@ -25,7 +25,9 @@
package org.argouml.uml.ui.behavior.activity_graphs;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import javax.swing.JComponent;
import javax.swing.JList;
@@ -33,7 +35,7 @@
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
import org.argouml.uml.ui.ActionNavigateContainerElement;
import org.argouml.uml.ui.UMLModelElementListModel2;
import org.argouml.uml.ui.UMLMutableLinkedList;
@@ -108,14 +110,15 @@
return activityGraphScroll;
}
- class ActionAddPartitionContent extends AbstractActionAddModelElement {
+ class ActionAddPartitionContent extends AbstractActionAddModelElement2 {
public ActionAddPartitionContent() {
super();
setMultiSelect(true);
}
- protected void doIt(Vector selected) {
+ @Override
+ protected void doIt(Collection selected) {
Object partition = getTarget();
if (Model.getFacade().isAPartition(partition)) {
Model.getActivityGraphsHelper().setContents(
@@ -123,8 +126,8 @@
}
}
- protected Vector getChoices() {
- Vector ret = new Vector();
+ protected List getChoices() {
+ List ret = new ArrayList();
if (Model.getFacade().isAPartition(getTarget())) {
Object partition = getTarget();
Object ag = Model.getFacade().getActivityGraph(partition);
@@ -141,8 +144,8 @@
return Translator.localize("dialog.title.add-contents");
}
- protected Vector getSelected() {
- Vector ret = new Vector();
+ protected List getSelected() {
+ List ret = new ArrayList();
ret.addAll(Model.getFacade().getContents(getTarget()));
return ret;
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddClassifierRoleBase.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddClassifierRoleBase.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddClassifierRoleBase.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddClassifierRoleBase.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddClassifierRoleBase.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddClassifierRoleBase.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -24,18 +24,20 @@
package org.argouml.uml.ui.behavior.collaborations;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* @since Oct 3, 2002
* @author [email protected]
* @stereotype singleton
*/
-public class ActionAddClassifierRoleBase extends AbstractActionAddModelElement {
+public class ActionAddClassifierRoleBase extends AbstractActionAddModelElement2 {
/**
* The one and only instance of this class.
@@ -50,36 +52,28 @@
super();
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector vec = new Vector();
+
+ protected List getChoices() {
+ List vec = new ArrayList();
vec.addAll(Model.getCollaborationsHelper()
.getAllPossibleBases(getTarget()));
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector vec = new Vector();
+
+ protected List getSelected() {
+ List vec = new ArrayList();
vec.addAll(Model.getFacade().getBases(getTarget()));
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-bases");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ protected void doIt(Collection selected) {
Object role = getTarget();
Model.getCollaborationsHelper().setBases(role, selected);
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddMessagePredecessor.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddMessagePredecessor.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddMessagePredecessor.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddMessagePredecessor.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddMessagePredecessor.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/collaborations/ActionAddMessagePredecessor.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -22,14 +22,16 @@
// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-// $header$
package org.argouml.uml.ui.behavior.collaborations;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* Action to add a predecessor to some message.
@@ -37,7 +39,7 @@
* @author [email protected]
* @stereotype singleton
*/
-public class ActionAddMessagePredecessor extends AbstractActionAddModelElement {
+public class ActionAddMessagePredecessor extends AbstractActionAddModelElement2 {
private static final ActionAddMessagePredecessor SINGLETON =
new ActionAddMessagePredecessor();
@@ -49,40 +51,35 @@
super();
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- if (getTarget() == null) return new Vector();
- Vector vec = new Vector();
+
+ protected List getChoices() {
+ if (getTarget() == null) {
+ return Collections.EMPTY_LIST;
+ }
+ List vec = new ArrayList();
vec.addAll(Model.getCollaborationsHelper()
.getAllPossiblePredecessors(getTarget()));
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- if (getTarget() == null)
+
+ protected List getSelected() {
+ if (getTarget() == null) {
throw new IllegalStateException(
"getSelected may not be called with null target");
- Vector vec = new Vector();
+ }
+ List vec = new ArrayList();
vec.addAll(Model.getFacade().getPredecessors(getTarget()));
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.add-predecessors");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ protected void doIt(Collection selected) {
if (getTarget() == null)
throw new IllegalStateException(
"doIt may not be called with null target");
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddContextSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddContextSignal.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddContextSignal.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddContextSignal.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddContextSignal.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddContextSignal.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2004-2006 The Regents of the University of California. All
+// Copyright (c) 2004-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
@@ -24,19 +24,21 @@
package org.argouml.uml.ui.behavior.common_behavior;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* This action adds a context to a signal.
*
* @author [email protected]
*/
-public class ActionAddContextSignal extends AbstractActionAddModelElement {
+public class ActionAddContextSignal extends AbstractActionAddModelElement2 {
/**
* The constructor.
@@ -45,11 +47,8 @@
super();
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector ret = new Vector();
+ protected List getChoices() {
+ List ret = new ArrayList();
Object model =
ProjectManager.getManager().getCurrentProject().getModel();
if (getTarget() != null) {
@@ -59,26 +58,20 @@
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector ret = new Vector();
+
+ protected List getSelected() {
+ List ret = new ArrayList();
ret.addAll(Model.getFacade().getContexts(getTarget()));
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-contexts");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ protected void doIt(Collection selected) {
Model.getCommonBehaviorHelper().setContexts(getTarget(), selected);
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddCreateActionInstantiation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddCreateActionInstantiation.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddCreateActionInstantiation.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddCreateActionInstantiation.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddCreateActionInstantiation.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddCreateActionInstantiation.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -24,21 +24,23 @@
package org.argouml.uml.ui.behavior.common_behavior;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* This action binds Instances to one Classifiers,
- * which declare its structure and behaviour.
+ * which declare its structure and behavior.
*/
public class ActionAddCreateActionInstantiation
- extends AbstractActionAddModelElement {
+ extends AbstractActionAddModelElement2 {
private Object choiceClass = Model.getMetaTypes().getClassifier();
@@ -52,24 +54,19 @@
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+ protected void doIt(Collection selected) {
if (selected != null && selected.size() >= 1) {
Model.getCommonBehaviorHelper().setInstantiation(getTarget(),
- selected.get(0));
+ selected.iterator().next());
} else {
Model.getCommonBehaviorHelper().setInstantiation(getTarget(),
null);
}
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector ret = new Vector();
+
+ protected List getChoices() {
+ List ret = new ArrayList();
if (getTarget() != null) {
Project p = ProjectManager.getManager().getCurrentProject();
Object model = p.getRoot();
@@ -79,18 +76,14 @@
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-instantiation");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector ret = new Vector();
+
+ protected List getSelected() {
+ List ret = new ArrayList();
Object instantiation =
Model.getCommonBehaviorHelper().getInstantiation(getTarget());
if (instantiation != null) {
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddInstanceClassifier.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddInstanceClassifier.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddInstanceClassifier.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddInstanceClassifier.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddInstanceClassifier.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/ActionAddInstanceClassifier.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -24,13 +24,15 @@
package org.argouml.uml.ui.behavior.common_behavior;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
@@ -40,7 +42,7 @@
* the type of Classifier is parameter to one of this action's constructors.
*
*/
-public class ActionAddInstanceClassifier extends AbstractActionAddModelElement {
+public class ActionAddInstanceClassifier extends AbstractActionAddModelElement2 {
private Object choiceClass = Model.getMetaTypes().getClassifier();
@@ -64,18 +66,15 @@
choiceClass = choice;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ @Override
+ protected void doIt(Collection selected) {
Model.getCommonBehaviorHelper().setClassifiers(getTarget(), selected);
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector ret = new Vector();
+
+ protected List getChoices() {
+ List ret = new ArrayList();
if (getTarget() != null) {
Project p = ProjectManager.getManager().getCurrentProject();
Object model = p.getRoot();
@@ -85,18 +84,14 @@
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-specifications");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector ret = new Vector();
+
+ protected List getSelected() {
+ List ret = new ArrayList();
ret.addAll(Model.getFacade().getClassifiers(getTarget()));
return ret;
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSendAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSendAction.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSendAction.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSendAction.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSendAction.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSendAction.java 2007-11-23 15:53:04-0800
@@ -25,6 +25,7 @@
package org.argouml.uml.ui.behavior.common_behavior;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import javax.swing.JScrollPane;
@@ -37,7 +38,6 @@
import org.argouml.uml.ui.UMLModelElementListModel2;
import org.argouml.uml.ui.UMLMutableLinkedList;
-
/**
* The properties panel for a SendAction.
*/
@@ -94,11 +94,11 @@
@Override
- protected void doIt(List selected) {
+ protected void doIt(Collection selected) {
if (selected != null && selected.size() >= 1) {
Model.getCommonBehaviorHelper().setSignal(
getTarget(),
- selected.get(0));
+ selected.iterator().next());
} else {
Model.getCommonBehaviorHelper().setSignal(getTarget(), null);
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSignal.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSignal.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSignal.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSignal.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelSignal.java 2007-11-23 15:53:04-0800
@@ -27,6 +27,7 @@
import java.awt.event.ActionEvent;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import javax.swing.JScrollPane;
@@ -188,9 +189,7 @@
super();
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
+
protected List getChoices() {
List ret = new ArrayList();
Object model =
@@ -203,26 +202,21 @@
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
+
protected List getSelected() {
List ret = new ArrayList();
ret.addAll(Model.getFacade().getReceptions(getTarget()));
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-receptions");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(List selected) {
+
+ @Override
+ protected void doIt(Collection selected) {
Model.getCommonBehaviorHelper().setReception(getTarget(), selected);
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddEventAsDeferrableEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddEventAsDeferrableEvent.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddEventAsDeferrableEvent.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddEventAsDeferrableEvent.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddEventAsDeferrableEvent.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddEventAsDeferrableEvent.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -24,13 +24,13 @@
package org.argouml.uml.ui.behavior.state_machines;
+import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* Provide a dialog which helps the user to select events
@@ -40,7 +40,7 @@
* @author MarkusK
*/
public class ActionAddEventAsDeferrableEvent
- extends AbstractActionAddModelElement {
+ extends AbstractActionAddModelElement2 {
/**
* The one and only instance of this class.
@@ -56,11 +56,9 @@
setMultiSelect(true);
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector vec = new Vector();
+
+ protected List getChoices() {
+ List vec = new ArrayList();
// TODO: the namespace of created events is currently the model.
// I think this is wrong, they should be
// in the namespace of the activitygraph!
@@ -75,11 +73,9 @@
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector vec = new Vector();
+
+ protected List getSelected() {
+ List vec = new ArrayList();
Collection events = Model.getFacade().getDeferrableEvents(getTarget());
if (events != null) {
vec.addAll(events);
@@ -87,35 +83,27 @@
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-events");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(
- * java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ @Override
+ protected void doIt(Collection selected) {
Object state = getTarget();
if (!Model.getFacade().isAState(state)) return;
- Collection oldOnes = new Vector(Model.getFacade()
+ Collection oldOnes = new ArrayList(Model.getFacade()
.getDeferrableEvents(state));
- Collection toBeRemoved = new Vector(oldOnes);
- Iterator i = selected.iterator();
- while (i.hasNext()) {
- Object o = i.next();
+ Collection toBeRemoved = new ArrayList(oldOnes);
+ for (Object o : selected) {
if (oldOnes.contains(o)) {
toBeRemoved.remove(o);
} else {
Model.getStateMachinesHelper().addDeferrableEvent(state, o);
}
}
- i = toBeRemoved.iterator();
- while (i.hasNext()) {
- Object o = i.next();
+ for (Object o : toBeRemoved) {
Model.getStateMachinesHelper().removeDeferrableEvent(state, o);
}
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddSignalsToSignalEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddSignalsToSignalEvent.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddSignalsToSignalEvent.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddSignalsToSignalEvent.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddSignalsToSignalEvent.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/state_machines/ActionAddSignalsToSignalEvent.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -24,11 +24,13 @@
package org.argouml.uml.ui.behavior.state_machines;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* Provide a dialog which helps the user to select one event
@@ -38,7 +40,7 @@
* @author MarkusK
*
*/
-class ActionAddSignalsToSignalEvent extends AbstractActionAddModelElement {
+class ActionAddSignalsToSignalEvent extends AbstractActionAddModelElement2 {
/**
* The one and only instance of this class.
*/
@@ -53,11 +55,9 @@
setMultiSelect(false);
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector vec = new Vector();
+
+ protected List getChoices() {
+ List vec = new ArrayList();
vec.addAll(Model.getModelManagementHelper().getAllModelElementsOfKind(
Model.getFacade().getModel(getTarget()),
@@ -66,11 +66,9 @@
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector vec = new Vector();
+
+ protected List getSelected() {
+ List vec = new ArrayList();
Object signal = Model.getFacade().getSignal(getTarget());
if (signal != null) {
vec.add(signal);
@@ -78,23 +76,20 @@
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-signal");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ @Override
+ protected void doIt(Collection selected) {
Object event = getTarget();
if (selected == null || selected.size() == 0) {
Model.getCommonBehaviorHelper().setSignal(event, null);
} else {
Model.getCommonBehaviorHelper().setSignal(event,
- selected.get(0));
+ selected.iterator().next());
}
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/state_machines/UMLSignalEventSignalList.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/state_machines/UMLSignalEventSignalList.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/state_machines/UMLSignalEventSignalList.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/state_machines/UMLSignalEventSignalList.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/state_machines/UMLSignalEventSignalList.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/state_machines/UMLSignalEventSignalList.java 2007-11-23 15:53:04-0800
@@ -27,6 +27,7 @@
import javax.swing.JPopupMenu;
+import org.argouml.uml.ui.AbstractActionAddModelElement;
import org.argouml.uml.ui.UMLModelElementListModel2;
import org.argouml.uml.ui.UMLMutableLinkedList;
import org.argouml.uml.ui.behavior.common_behavior.ActionNewSignal;
@@ -44,7 +45,7 @@
*/
public UMLSignalEventSignalList(
UMLModelElementListModel2 dataModel) {
- super(dataModel, null, null, null, true);
+ super(dataModel, (AbstractActionAddModelElement) null, null, null, true);
setDelete(false);
setDeleteAction(null);
}
Modified: trunk/src_new/org/argouml/uml/ui/behavior/use_cases/ActionAddExtendExtensionPoint.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/use_cases/ActionAddExtendExtensionPoint.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/behavior/use_cases/ActionAddExtendExtensionPoint.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/use_cases/ActionAddExtendExtensionPoint.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/use_cases/ActionAddExtendExtensionPoint.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/use_cases/ActionAddExtendExtensionPoint.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -24,12 +24,13 @@
package org.argouml.uml.ui.behavior.use_cases;
+import java.util.ArrayList;
import java.util.Collection;
-import java.util.Vector;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* @since Oct 6, 2002
@@ -37,7 +38,7 @@
* @stereotype singleton
*/
public class ActionAddExtendExtensionPoint
- extends AbstractActionAddModelElement {
+ extends AbstractActionAddModelElement2 {
private static final ActionAddExtendExtensionPoint SINGLETON =
new ActionAddExtendExtensionPoint();
@@ -48,18 +49,15 @@
super();
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ @Override
+ protected void doIt(Collection selected) {
Model.getUseCasesHelper().setExtensionPoints(getTarget(), selected);
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector ret = new Vector();
+
+ protected List getChoices() {
+ List ret = new ArrayList();
if (getTarget() != null) {
Object extend = /*(MExtend)*/getTarget();
Collection c = Model.getFacade().getExtensionPoints(
@@ -69,19 +67,15 @@
return ret;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize(
"dialog.title.add-extensionpoints");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector ret = new Vector();
+
+ protected List getSelected() {
+ List ret = new ArrayList();
ret.addAll(Model.getFacade().getExtensionPoints(getTarget()));
return ret;
}
Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddAssociationSpecification.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddAssociationSpecification.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddAssociationSpecification.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddAssociationSpecification.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddAssociationSpecification.java (original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddAssociationSpecification.java 2007-11-23 15:53:04-0800
@@ -24,21 +24,23 @@
package org.argouml.uml.ui.foundation.core;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
*
* @author [email protected]
* @since Jan 4, 2003
*/
-public class ActionAddAssociationSpecification
- extends AbstractActionAddModelElement {
+public class ActionAddAssociationSpecification extends
+ AbstractActionAddModelElement2 {
private static final ActionAddAssociationSpecification SINGLETON =
new ActionAddAssociationSpecification();
@@ -52,15 +54,15 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
*/
- protected void doIt(Vector selected) {
+ protected void doIt(Collection selected) {
Model.getCoreHelper().setSpecifications(getTarget(), selected);
}
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
*/
- protected Vector getChoices() {
- Vector ret = new Vector();
+ protected List getChoices() {
+ List ret = new ArrayList();
if (getTarget() != null) {
Project p = ProjectManager.getManager().getCurrentProject();
Object model = p.getRoot();
@@ -81,8 +83,8 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
*/
- protected Vector getSelected() {
- Vector ret = new Vector();
+ protected List getSelected() {
+ List ret = new ArrayList();
ret.addAll(Model.getFacade().getSpecifications(getTarget()));
return ret;
}
Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddClientDependencyAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddClientDependencyAction.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddClientDependencyAction.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddClientDependencyAction.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddClientDependencyAction.java (original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddClientDependencyAction.java 2007-11-23 15:53:04-0800
@@ -27,14 +27,13 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Iterator;
+import java.util.List;
import java.util.Set;
-import java.util.Vector;
import org.argouml.i18n.Translator;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* An Action to add client dependencies to some modelelement.
@@ -42,7 +41,7 @@
* @author Michiel
*/
public class ActionAddClientDependencyAction extends
- AbstractActionAddModelElement {
+ AbstractActionAddModelElement2 {
/**
* The constructor.
@@ -56,13 +55,11 @@
* Constraint: This code only deals with 1 supplier per dependency!
* TODO: How to support more?
*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
+ * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.List)
*/
- protected void doIt(Vector selected) {
+ protected void doIt(Collection selected) {
Set oldSet = new HashSet(getSelected());
- Iterator i = selected.iterator();
- while (i.hasNext()) {
- Object client = i.next();
+ for (Object client : selected) {
if (oldSet.contains(client)) {
oldSet.remove(client); //to be able to remove dependencies later
} else {
@@ -71,12 +68,10 @@
}
Collection toBeDeleted = new ArrayList();
- Collection c = Model.getFacade().getClientDependencies(getTarget());
- i = c.iterator();
- while (i.hasNext()) {
- Object dependency = i.next();
- if (oldSet.containsAll(
- Model.getFacade().getSuppliers(dependency))) {
+ Collection dependencies = Model.getFacade().getClientDependencies(
+ getTarget());
+ for (Object dependency : dependencies) {
+ if (oldSet.containsAll(Model.getFacade().getSuppliers(dependency))) {
toBeDeleted.add(dependency);
}
}
@@ -87,8 +82,8 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
*/
- protected Vector getChoices() {
- Vector ret = new Vector();
+ protected List getChoices() {
+ List ret = new ArrayList();
Object model =
ProjectManager.getManager().getCurrentProject().getModel();
if (getTarget() != null) {
@@ -110,12 +105,11 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
*/
- protected Vector getSelected() {
- Vector v = new Vector();
+ protected List getSelected() {
+ List v = new ArrayList();
Collection c = Model.getFacade().getClientDependencies(getTarget());
- Iterator i = c.iterator();
- while (i.hasNext()) {
- v.addAll(Model.getFacade().getSuppliers(i.next()));
+ for (Object cd : c) {
+ v.addAll(Model.getFacade().getSuppliers(cd));
}
return v;
}
Modified: trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddSupplierDependencyAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddSupplierDependencyAction.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddSupplierDependencyAction.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddSupplierDependencyAction.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddSupplierDependencyAction.java (original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/core/ActionAddSupplierDependencyAction.java 2007-11-23 15:53:04-0800
@@ -27,14 +27,13 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Iterator;
+import java.util.List;
import java.util.Set;
-import java.util.Vector;
import org.argouml.i18n.Translator;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* An Action to add client dependencies to some modelelement.
@@ -42,7 +41,7 @@
* @author Michiel
*/
public class ActionAddSupplierDependencyAction extends
- AbstractActionAddModelElement {
+ AbstractActionAddModelElement2 {
/**
* The constructor.
@@ -56,13 +55,11 @@
* Constraint: This code only deals with 1 supplier per dependency!
* TODO: Do we need more?
*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
+ * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.List)
*/
- protected void doIt(Vector selected) {
+ protected void doIt(Collection selected) {
Set oldSet = new HashSet(getSelected());
- Iterator i = selected.iterator();
- while (i.hasNext()) {
- Object supplier = i.next();
+ for (Object supplier : oldSet) {
if (oldSet.contains(supplier)) {
oldSet.remove(supplier); //to be able to remove dep's later
} else {
@@ -72,9 +69,7 @@
Collection toBeDeleted = new ArrayList();
Collection c = Model.getFacade().getSupplierDependencies(getTarget());
- i = c.iterator();
- while (i.hasNext()) {
- Object dependency = i.next();
+ for (Object dependency : c) {
if (oldSet.containsAll(
Model.getFacade().getClients(dependency))) {
toBeDeleted.add(dependency);
@@ -87,8 +82,8 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
*/
- protected Vector getChoices() {
- Vector ret = new Vector();
+ protected List getChoices() {
+ List ret = new ArrayList();
Object model =
ProjectManager.getManager().getCurrentProject().getModel();
if (getTarget() != null) {
@@ -110,12 +105,11 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
*/
- protected Vector getSelected() {
- Vector v = new Vector();
+ protected List getSelected() {
+ List v = new ArrayList();
Collection c = Model.getFacade().getSupplierDependencies(getTarget());
- Iterator i = c.iterator();
- while (i.hasNext()) {
- v.addAll(Model.getFacade().getClients(i.next()));
+ for (Object supplierDependency : c) {
+ v.addAll(Model.getFacade().getClients(supplierDependency));
}
return v;
}
Modified: trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelStereotype.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelStereotype.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelStereotype.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelStereotype.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelStereotype.java (original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/PropPanelStereotype.java 2007-11-23 15:53:04-0800
@@ -199,8 +199,8 @@
* sorted list of strings.
*/
void initMetaClasses() {
- Collection<String> tmpMetaClasses =
- Model.getCoreHelper().getAllMetatypeNames();
+ Collection<String> tmpMetaClasses =
+ Model.getCoreHelper().getAllMetatypeNames();
if (tmpMetaClasses instanceof List) {
metaClasses = (List<String>) tmpMetaClasses;
} else {
@@ -255,8 +255,8 @@
*
* @author Michiel
*/
- class ActionAddStereotypeBaseClass extends AbstractActionAddModelElement2 {
-
+ class ActionAddStereotypeBaseClass extends AbstractActionAddModelElement2{
+
@Override
protected List getChoices() {
return metaClasses;
@@ -271,15 +271,15 @@
protected List getSelected() {
List result = new ArrayList();
if (Model.getFacade().isAStereotype(getTarget())) {
- Collection bases =
- Model.getFacade().getBaseClasses(getTarget());
+ Collection bases =
+ Model.getFacade().getBaseClasses(getTarget());
result.addAll(bases);
}
return result;
}
@Override
- protected void doIt(List selected) {
+ protected void doIt(Collection selected) {
Object stereo = getTarget();
Set<Object> oldSet = new HashSet<Object>(getSelected());
Set toBeRemoved = new HashSet<Object>(oldSet);
Modified: trunk/src_new/org/argouml/uml/ui/model_management/ActionAddPackageImport.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/model_management/ActionAddPackageImport.java?view=diff&rev=13828&p1=trunk/src_new/org/argouml/uml/ui/model_management/ActionAddPackageImport.java&p2=trunk/src_new/org/argouml/uml/ui/model_management/ActionAddPackageImport.java&r1=13827&r2=13828
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/model_management/ActionAddPackageImport.java (original)
+++ trunk/src_new/org/argouml/uml/ui/model_management/ActionAddPackageImport.java 2007-11-23 15:53:04-0800
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2006 The Regents of the University of California. All
+// Copyright (c) 2006-2007 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -24,18 +24,20 @@
package org.argouml.uml.ui.model_management;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
/**
* Add an import to a package.
*
* @author Michiel
*/
-class ActionAddPackageImport extends AbstractActionAddModelElement {
+class ActionAddPackageImport extends AbstractActionAddModelElement2 {
/**
* Constructor for ActionAddPackageImport.
@@ -44,11 +46,9 @@
super();
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getChoices()
- */
- protected Vector getChoices() {
- Vector vec = new Vector();
+
+ protected List getChoices() {
+ List vec = new ArrayList();
/* TODO: correctly implement next function
* in the model subsystem for
* issue 1942: */
@@ -57,26 +57,21 @@
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector vec = new Vector();
+
+ protected List getSelected() {
+ List vec = new ArrayList();
vec.addAll(Model.getFacade().getImportedElements(getTarget()));
return vec;
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
+
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-imported-elements");
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
- */
- protected void doIt(Vector selected) {
+
+ @Override
+ protected void doIt(Collection selected) {
Object pack = getTarget();
Model.getModelManagementHelper().setImportedElements(pack, selected);
}
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.