Author: tfmorris
Date: 2007-11-20 01:03:47-0800
New Revision: 13799
Added:
trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java
Modified:
trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java
trunk/src_new/org/argouml/uml/ui/UMLMutableLinkedList.java
trunk/src_new/org/argouml/uml/ui/behavior/activity_graphs/PropPanelClassifierInState.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelComponentInstance.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelCreateAction.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelNodeInstance.java
trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelObject.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/foundation/extension_mechanisms/PropPanelStereotype.java
Log:
Refactor AbstractActionAddModelElement to allow things that depend on it to migrate from Vectors to Lists
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=13799&p1=trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java&p2=trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java&r1=13798&r2=13799
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java (original)
+++ trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement.java 2007-11-20 01:03:47-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,31 +24,32 @@
package org.argouml.uml.ui;
-import java.awt.event.ActionEvent;
import java.util.Vector;
import javax.swing.Action;
-import javax.swing.JOptionPane;
import org.argouml.i18n.Translator;
-import org.argouml.ui.ArgoFrame;
-import org.tigris.gef.undo.UndoableAction;
/**
* Abstract action that is the parent to all add actions that add the
- * modelelements via the UMLAddDialog.
+ * modelelements via the UMLAddDialog. This is the original form the API which
+ * being preserved just long enough to migrate everyone to the List-based API.
+ *
* @since Oct 2, 2002
* @author [email protected]
+ * @deprecated for 0.25.4 by tfmorris. Use
+ * {@link AbstractActionAddModelElement2#}.
*/
-public abstract class AbstractActionAddModelElement extends UndoableAction {
-
- private Object target;
- private boolean multiSelect = true;
- private boolean exclusive = true;
+public abstract class AbstractActionAddModelElement extends
+ AbstractActionAddModelElement2 {
/**
- * The constructor.
+ * Construct an action to add a model element to some list.
+ *
+ * @deprecated for 0.25.4 by tfmorris. Use
+ * {@link AbstractActionAddModelElement2#AbstractActionAddModelElement2()}.
*/
+ @Deprecated
protected AbstractActionAddModelElement() {
super(Translator.localize("menu.popup.add-modelelement"),
null);
@@ -59,104 +60,36 @@
/**
- * 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;
- }
-
- /*
- * @see
- * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e) {
- super.actionPerformed(e);
- UMLAddDialog dialog =
- new UMLAddDialog(getChoices(), getSelected(), getDialogTitle(),
- isMultiSelect(),
- isExclusive());
- int result = dialog.showDialog(ArgoFrame.getInstance());
- if (result == JOptionPane.OK_OPTION) {
- doIt(dialog.getSelected());
- }
- }
-
- /**
* Returns the choices the user has in the UMLAddDialog. The choices are
* depicted on the left side of the UMLAddDialog (sorry Arabic users) and
* can be moved via the buttons on the dialog to the right side. On the
* right side are the selected modelelements.
+ *
* @return Vector
+ * @deprecated for 0.25.4 by tfmorris. Use
+ * {@link AbstractActionAddModelElement2#getChoices()).
*/
+ @Deprecated
protected abstract Vector getChoices();
/**
* The modelelements already selected BEFORE the dialog is shown.
* @return Vector
+ * @deprecated for 0.25.4 by tfmorris. Use
+ * {@link AbstractActionAddModelElement2#getSelected()).
*/
+ @Deprecated
protected abstract Vector getSelected();
/**
- * Returns the title of the dialog.
- * @return String
- */
- protected abstract String getDialogTitle();
-
- /**
* 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
+ * @deprecated for 0.25.4 by tfmorris. Use
+ * {@link AbstractActionAddModelElement2#doIt(java.util.List)).
*/
+ @Deprecated
protected abstract void doIt(Vector selected);
- /**
- * 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;
- }
-
- /*
- * @see javax.swing.Action#isEnabled()
- */
- @Override
- public boolean isEnabled() {
- return !getChoices().isEmpty();
- }
}
Added: 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=auto&rev=13799
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/uml/ui/AbstractActionAddModelElement2.java 2007-11-20 01:03:47-0800
@@ -0,0 +1,171 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $
+// Copyright (c) 2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.uml.ui;
+
+import java.awt.event.ActionEvent;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.Icon;
+import javax.swing.JOptionPane;
+
+import org.argouml.i18n.Translator;
+import org.argouml.ui.ArgoFrame;
+import org.tigris.gef.undo.UndoableAction;
+
+/**
+ * Abstract action that is the parent to all add actions that add the
+ * modelelements via the UMLAddDialog.
+ *
+ * @since Oct 2, 2002
+ * @author [email protected]
+ */
+public abstract class AbstractActionAddModelElement2 extends UndoableAction {
+
+ private Object target;
+ private boolean multiSelect = true;
+ private boolean exclusive = true;
+
+ public AbstractActionAddModelElement2() {
+ super(Translator.localize("menu.popup.add"));
+ }
+
+ public AbstractActionAddModelElement2(String name) {
+ super(name);
+ }
+
+ public AbstractActionAddModelElement2(String name, Icon icon) {
+ super(name, icon);
+ }
+
+
+ /*
+ * @see
+ * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ UMLAddDialog dialog =
+ new UMLAddDialog(getChoices(), getSelected(), getDialogTitle(),
+ isMultiSelect(),
+ isExclusive());
+ int result = dialog.showDialog(ArgoFrame.getInstance());
+ if (result == JOptionPane.OK_OPTION) {
+ doIt(dialog.getSelectedList());
+ }
+ }
+
+ /**
+ * 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 Vector
+ */
+ 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 void doIt(List selected) {
+ if (this instanceof AbstractActionAddModelElement) {
+ ((AbstractActionAddModelElement) this).doIt((Vector) selected);
+ }
+ }
+
+ /*
+ * @see javax.swing.Action#isEnabled()
+ */
+ @Override
+ public boolean isEnabled() {
+ return !getChoices().isEmpty();
+ }
+
+
+ /**
+ * Returns the UML model target.
+ * @return UML ModelElement
+ */
+ protected Object getTarget() {
+ return target;
+ }
+
+ /**
+ * Sets the UML model target.
+ * @param theTarget The target to set
+ */
+ public void setTarget(Object theTarget) {
+ target = theTarget;
+ }
+
+ /**
+ * Returns the title of the dialog.
+ * @return String
+ */
+ protected abstract String getDialogTitle();
+
+ /**
+ * Returns the exclusive.
+ * @return boolean
+ */
+ public boolean isExclusive() {
+ return exclusive;
+ }
+
+ /**
+ * Returns the multiSelect.
+ * @return boolean
+ */
+ public boolean isMultiSelect() {
+ return multiSelect;
+ }
+
+ /**
+ * Sets the exclusive.
+ * @param theExclusive The exclusive to set
+ */
+ public void setExclusive(boolean theExclusive) {
+ exclusive = theExclusive;
+ }
+
+ /**
+ * Sets the multiSelect.
+ * @param theMultiSelect The multiSelect to set
+ */
+ public void setMultiSelect(boolean theMultiSelect) {
+ multiSelect = theMultiSelect;
+ }
+
+}
\ No newline at end of file
Modified: trunk/src_new/org/argouml/uml/ui/UMLMutableLinkedList.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/UMLMutableLinkedList.java?view=diff&rev=13799&p1=trunk/src_new/org/argouml/uml/ui/UMLMutableLinkedList.java&p2=trunk/src_new/org/argouml/uml/ui/UMLMutableLinkedList.java&r1=13798&r2=13799
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/UMLMutableLinkedList.java (original)
+++ trunk/src_new/org/argouml/uml/ui/UMLMutableLinkedList.java 2007-11-20 01:03:47-0800
@@ -65,7 +65,7 @@
private JPopupMenu popupMenu;
- private AbstractActionAddModelElement addAction = null;
+ private AbstractActionAddModelElement2 addAction = null;
private AbstractActionNewModelElement newAction = null;
@@ -108,7 +108,7 @@
* @param showIcon true if an icon should be shown
*/
public UMLMutableLinkedList(UMLModelElementListModel2 dataModel,
- AbstractActionAddModelElement theAddAction,
+ AbstractActionAddModelElement2 theAddAction,
AbstractActionNewModelElement theNewAction,
AbstractActionRemoveElement theDeleteAction, boolean showIcon) {
super(dataModel, showIcon);
@@ -127,7 +127,7 @@
* @param theNewAction the action for new
*/
public UMLMutableLinkedList(UMLModelElementListModel2 dataModel,
- AbstractActionAddModelElement theAddAction,
+ AbstractActionAddModelElement2 theAddAction,
AbstractActionNewModelElement theNewAction) {
this(dataModel, theAddAction, theNewAction, null, true);
}
@@ -139,7 +139,7 @@
* @param theAddAction the action for adding
*/
public UMLMutableLinkedList(UMLModelElementListModel2 dataModel,
- AbstractActionAddModelElement theAddAction) {
+ AbstractActionAddModelElement2 theAddAction) {
this(dataModel, theAddAction, null, null, true);
}
@@ -233,7 +233,7 @@
*
* @return UMLChangeAction
*/
- public AbstractActionAddModelElement getAddAction() {
+ public AbstractActionAddModelElement2 getAddAction() {
return addAction;
}
@@ -252,7 +252,7 @@
* @param action
* The addAction to set
*/
- public void setAddAction(AbstractActionAddModelElement action) {
+ public void setAddAction(AbstractActionAddModelElement2 action) {
if (action != null)
addPossible = true;
addAction = action;
@@ -340,7 +340,8 @@
*
* This allows to replace the complete default menu with a custom menu.
* If nobody is using this, then we better remove this functionality, and
- * just return a new menu all the time - that would simplify initialising it.
+ * just return a new menu all the time - that would simplify initializing
+ * it.
*
* @param menu
* The popupMenu to set
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=13799&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=13798&r2=13799
==============================================================================
--- 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-20 01:03:47-0800
@@ -40,6 +40,7 @@
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;
import org.argouml.uml.ui.UMLComboBox2;
@@ -88,7 +89,7 @@
getClassifierInStateTypeSelector()));
// field for States
- AbstractActionAddModelElement actionAdd =
+ AbstractActionAddModelElement2 actionAdd =
new ActionAddCISState();
AbstractActionRemoveElement actionRemove =
new ActionRemoveCISState();
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelComponentInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelComponentInstance.java?view=diff&rev=13799&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelComponentInstance.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelComponentInstance.java&r1=13798&r2=13799
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelComponentInstance.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelComponentInstance.java 2007-11-20 01:03:47-0800
@@ -29,7 +29,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.UMLLinkedList;
import org.argouml.uml.ui.UMLMutableLinkedList;
@@ -69,7 +69,7 @@
new JScrollPane(resList));
addSeparator();
- AbstractActionAddModelElement action =
+ AbstractActionAddModelElement2 action =
new ActionAddInstanceClassifier(
Model.getMetaTypes().getComponent());
JScrollPane classifierScroll =
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelCreateAction.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelCreateAction.java?view=diff&rev=13799&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelCreateAction.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelCreateAction.java&r1=13798&r2=13799
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelCreateAction.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelCreateAction.java 2007-11-20 01:03:47-0800
@@ -27,7 +27,7 @@
import javax.swing.JScrollPane;
import org.argouml.i18n.Translator;
-import org.argouml.uml.ui.AbstractActionAddModelElement;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
import org.argouml.uml.ui.UMLMutableLinkedList;
/**
@@ -44,7 +44,7 @@
public PropPanelCreateAction() {
super("label.create-action", lookupIcon("CreateAction"));
- AbstractActionAddModelElement action =
+ AbstractActionAddModelElement2 action =
new ActionAddCreateActionInstantiation();
UMLMutableLinkedList list =
new UMLMutableLinkedList(
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelNodeInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelNodeInstance.java?view=diff&rev=13799&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelNodeInstance.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelNodeInstance.java&r1=13798&r2=13799
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelNodeInstance.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelNodeInstance.java 2007-11-20 01:03:47-0800
@@ -29,7 +29,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.UMLLinkedList;
import org.argouml.uml.ui.UMLMutableLinkedList;
@@ -72,7 +72,7 @@
new JScrollPane(resList));
addSeparator();
- AbstractActionAddModelElement a =
+ AbstractActionAddModelElement2 a =
new ActionAddInstanceClassifier(Model.getMetaTypes().getNode());
JScrollPane classifierScroll =
new JScrollPane(new UMLMutableLinkedList(
Modified: trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelObject.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelObject.java?view=diff&rev=13799&p1=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelObject.java&p2=trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelObject.java&r1=13798&r2=13799
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelObject.java (original)
+++ trunk/src_new/org/argouml/uml/ui/behavior/common_behavior/PropPanelObject.java 2007-11-20 01:03:47-0800
@@ -28,7 +28,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.ActionNavigateNamespace;
import org.argouml.uml.ui.UMLMutableLinkedList;
import org.argouml.uml.ui.foundation.extension_mechanisms.ActionNewStereotype;
@@ -60,7 +60,7 @@
addSeparator();
- AbstractActionAddModelElement action =
+ AbstractActionAddModelElement2 action =
new ActionAddInstanceClassifier(
Model.getMetaTypes().getClassifier());
JScrollPane classifierScroll =
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=13799&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=13798&r2=13799
==============================================================================
--- 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-20 01:03:47-0800
@@ -24,7 +24,8 @@
package org.argouml.uml.ui.behavior.common_behavior;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
import javax.swing.JScrollPane;
@@ -32,7 +33,7 @@
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;
import org.argouml.uml.ui.UMLModelElementListModel2;
import org.argouml.uml.ui.UMLMutableLinkedList;
@@ -48,7 +49,7 @@
public PropPanelSendAction() {
super("label.send-action", lookupIcon("SendAction"));
- AbstractActionAddModelElement action =
+ AbstractActionAddModelElement2 action =
new ActionAddSendActionSignal();
UMLMutableLinkedList list =
new UMLMutableLinkedList(
@@ -77,13 +78,12 @@
/**
* This action binds Instances to one Classifiers,
- * which declare its structure and behaviour.
+ * which declare its structure and behavior.
*/
-class ActionAddSendActionSignal extends AbstractActionAddModelElement {
+class ActionAddSendActionSignal extends AbstractActionAddModelElement2 {
private Object choiceClass = Model.getMetaTypes().getSignal();
-
/**
* Constructor.
*/
@@ -93,11 +93,8 @@
}
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(
- * java.util.Vector)
- */
- protected void doIt(Vector selected) {
+ @Override
+ protected void doIt(List selected) {
if (selected != null && selected.size() >= 1) {
Model.getCommonBehaviorHelper().setSignal(
getTarget(),
@@ -107,11 +104,8 @@
}
}
- /*
- * @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();
@@ -120,19 +114,15 @@
}
return ret;
}
+
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getDialogTitle()
- */
protected String getDialogTitle() {
return Translator.localize("dialog.title.add-signal");
}
+
- /*
- * @see org.argouml.uml.ui.AbstractActionAddModelElement#getSelected()
- */
- protected Vector getSelected() {
- Vector ret = new Vector();
+ protected List getSelected() {
+ List ret = new ArrayList();
Object signal = Model.getFacade().getSignal(getTarget());
if (signal != null) {
ret.add(signal);
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=13799&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=13798&r2=13799
==============================================================================
--- 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-20 01:03:47-0800
@@ -26,14 +26,15 @@
import java.awt.event.ActionEvent;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
import javax.swing.JScrollPane;
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;
import org.argouml.uml.ui.AbstractActionRemoveElement;
import org.argouml.uml.ui.ActionNavigateNamespace;
import org.argouml.uml.ui.UMLModelElementListModel2;
@@ -92,7 +93,7 @@
addSeparator();
- AbstractActionAddModelElement actionAddContext =
+ AbstractActionAddModelElement2 actionAddContext =
new ActionAddContextSignal();
AbstractActionRemoveElement actionRemoveContext =
new ActionRemoveContextSignal();
@@ -103,7 +104,7 @@
actionRemoveContext, true));
addField(Translator.localize("label.contexts"),
operationScroll);
- AbstractActionAddModelElement actionAddReception =
+ AbstractActionAddModelElement2 actionAddReception =
new ActionAddReceptionSignal();
AbstractActionRemoveElement actionRemoveReception =
new ActionRemoveReceptionSignal();
@@ -173,7 +174,7 @@
*
* @author Michiel
*/
-class ActionAddReceptionSignal extends AbstractActionAddModelElement {
+class ActionAddReceptionSignal extends AbstractActionAddModelElement2 {
/**
* The serial version.
@@ -190,8 +191,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) {
@@ -205,8 +206,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().getReceptions(getTarget()));
return ret;
}
@@ -221,7 +222,7 @@
/*
* @see org.argouml.uml.ui.AbstractActionAddModelElement#doIt(java.util.Vector)
*/
- protected void doIt(Vector selected) {
+ protected void doIt(List selected) {
Model.getCommonBehaviorHelper().setReception(getTarget(), selected);
}
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=13799&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=13798&r2=13799
==============================================================================
--- 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-20 01:03:47-0800
@@ -25,13 +25,13 @@
package org.argouml.uml.ui.foundation.extension_mechanisms;
import java.awt.event.ActionEvent;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
-import java.util.Vector;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
@@ -40,7 +40,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.AbstractActionRemoveElement;
import org.argouml.uml.ui.ActionNavigateNamespace;
import org.argouml.uml.ui.UMLLinkedList;
@@ -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,11 +255,11 @@
*
* @author Michiel
*/
- class ActionAddStereotypeBaseClass extends AbstractActionAddModelElement {
-
+ class ActionAddStereotypeBaseClass extends AbstractActionAddModelElement2 {
+
@Override
- protected Vector getChoices() {
- return new Vector<String>(metaClasses);
+ protected List getChoices() {
+ return metaClasses;
}
@Override
@@ -268,18 +268,18 @@
}
@Override
- protected Vector getSelected() {
- Vector vec = new Vector();
+ protected List getSelected() {
+ List result = new ArrayList();
if (Model.getFacade().isAStereotype(getTarget())) {
- Collection bases =
- Model.getFacade().getBaseClasses(getTarget());
- vec.addAll(bases);
+ Collection bases =
+ Model.getFacade().getBaseClasses(getTarget());
+ result.addAll(bases);
}
- return vec;
+ return result;
}
@Override
- protected void doIt(Vector selected) {
+ protected void doIt(List selected) {
Object stereo = getTarget();
Set<Object> oldSet = new HashSet<Object>(getSelected());
Set toBeRemoved = new HashSet<Object>(oldSet);
@@ -289,7 +289,7 @@
toBeRemoved.remove(o);
} else {
Model.getExtensionMechanismsHelper()
- .addBaseClass(stereo, o);
+ .addBaseClass(stereo, o);
}
}
for (Object o : toBeRemoved) {
@@ -317,8 +317,8 @@
if (baseclass != null) {
Object st = getTarget();
if (Model.getFacade().isAStereotype(st)) {
- Model.getExtensionMechanismsHelper()
- .removeBaseClass(st, baseclass);
+ Model.getExtensionMechanismsHelper().removeBaseClass(st,
+ baseclass);
}
}
}
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.