Author: penyaskito
Date: 2008-07-09 10:47:13-0700
New Revision: 15219
Added:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddReceptionSignal.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveContextSignal.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveReceptionSignal.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLSignalReceptionListModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Exception.xml (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Signal.xml (contents, props changed)
Modified:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
Log:
Panels for Signal and Exception.
Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java?view=diff&rev=15219&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&r1=15218&r2=15219
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java (original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java 2008-07-09 10:47:13-0700
@@ -37,9 +37,12 @@
import javax.swing.border.TitledBorder;
import org.apache.log4j.Logger;
+import org.argouml.core.propertypanels.ui.ActionAddReceptionSignal;
import org.argouml.core.propertypanels.ui.ActionAddStereotypeBaseClass;
import org.argouml.core.propertypanels.ui.ActionDeleteAnnotatedElement;
import org.argouml.core.propertypanels.ui.ActionDeleteStereotypeBaseClass;
+import org.argouml.core.propertypanels.ui.ActionRemoveContextSignal;
+import org.argouml.core.propertypanels.ui.ActionRemoveReceptionSignal;
import org.argouml.core.propertypanels.ui.EnumerationListModel;
import org.argouml.core.propertypanels.ui.UMLClassifierPackageImportsListModel;
import org.argouml.core.propertypanels.ui.UMLCommentBodyDocument;
@@ -49,6 +52,7 @@
import org.argouml.core.propertypanels.ui.UMLExtendedElementsListModel;
import org.argouml.core.propertypanels.ui.UMLInitialValueExpressionModel;
import org.argouml.core.propertypanels.ui.UMLMultiplicityPanel;
+import org.argouml.core.propertypanels.ui.UMLSignalReceptionListModel;
import org.argouml.core.propertypanels.ui.UMLStereotypeBaseClassListModel;
import org.argouml.core.propertypanels.ui.UMLStereotypeTagDefinitionListModel;
import org.argouml.core.propertypanels.xml.XMLPropertyPanelsData;
@@ -71,6 +75,8 @@
import org.argouml.uml.ui.UMLSingleRowSelector;
import org.argouml.uml.ui.UMLTextArea2;
import org.argouml.uml.ui.UMLTextField2;
+import org.argouml.uml.ui.behavior.common_behavior.ActionAddContextSignal;
+import org.argouml.uml.ui.behavior.common_behavior.UMLSignalContextListModel;
import org.argouml.uml.ui.foundation.core.ActionAddAssociationSpecification;
import org.argouml.uml.ui.foundation.core.ActionAddClientDependencyAction;
import org.argouml.uml.ui.foundation.core.ActionAddSupplierDependencyAction;
@@ -469,6 +475,24 @@
l.setDeleteAction(new ActionDeleteAnnotatedElement());
list = new ScrollList(l);
}
+ else if ("contexts".equals(prop.getName())) {
+ model = new UMLSignalContextListModel();
+ model.setTarget(target);
+ UMLMutableLinkedList l = new UMLMutableLinkedList(
+ model,
+ new ActionAddContextSignal(), null,
+ new ActionRemoveContextSignal(), true);
+ list = new ScrollList(l);
+ }
+ else if ("receptions".equals(prop.getName())) {
+ model = new UMLSignalReceptionListModel();
+ model.setTarget(target);
+ UMLMutableLinkedList l = new UMLMutableLinkedList(
+ model,
+ new ActionAddReceptionSignal(), null,
+ new ActionRemoveReceptionSignal(), true);
+ list = new ScrollList(l);
+ }
if (list != null) {
String name = prop.getName();
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddReceptionSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddReceptionSignal.java?view=auto&rev=15219
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddReceptionSignal.java 2008-07-09 10:47:13-0700
@@ -0,0 +1,81 @@
+// $Id$
+// Copyright (c) 2008 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.core.propertypanels.ui;
+
+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.AbstractActionAddModelElement2;
+
+/**
+ * This Action adds a Reception to a Signal.
+ *
+ * @author Michiel
+ */
+public class ActionAddReceptionSignal extends AbstractActionAddModelElement2 {
+
+ /**
+ * Construct an Action which adds a Reception to a Signal.
+ */
+ public ActionAddReceptionSignal() {
+ super();
+ }
+
+
+ protected List getChoices() {
+ List ret = new ArrayList();
+ Object model =
+ ProjectManager.getManager().getCurrentProject().getModel();
+ if (getTarget() != null) {
+ ret.addAll(Model.getModelManagementHelper()
+ .getAllModelElementsOfKind(model,
+ Model.getMetaTypes().getReception()));
+ }
+ return ret;
+ }
+
+
+ protected List getSelected() {
+ List ret = new ArrayList();
+ ret.addAll(Model.getFacade().getReceptions(getTarget()));
+ return ret;
+ }
+
+
+ protected String getDialogTitle() {
+ return Translator.localize("dialog.title.add-receptions");
+ }
+
+
+ @Override
+ protected void doIt(Collection selected) {
+ Model.getCommonBehaviorHelper().setReception(getTarget(), selected);
+ }
+
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveContextSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveContextSignal.java?view=auto&rev=15219
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveContextSignal.java 2008-07-09 10:47:13-0700
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 2008 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.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.AbstractActionRemoveElement;
+
+/**
+ * This Action removes a Context from a Signal.
+ *
+ * @author Michiel
+ */
+public class ActionRemoveContextSignal extends AbstractActionRemoveElement {
+
+ /**
+ * The serial version.
+ */
+ private static final long serialVersionUID = -3345844954130000669L;
+
+ /**
+ * Construct an Action which removes a Context from a Signal.
+ */
+ public ActionRemoveContextSignal() {
+ super(Translator.localize("menu.popup.remove"));
+ }
+
+ /*
+ * @see org.tigris.gef.undo.UndoableAction#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ Object context = getObjectToRemove();
+ if (context != null) {
+ Object signal = getTarget();
+ if (Model.getFacade().isASignal(signal)) {
+ Model.getCommonBehaviorHelper().removeContext(signal, context);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveReceptionSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveReceptionSignal.java?view=auto&rev=15219
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionRemoveReceptionSignal.java 2008-07-09 10:47:13-0700
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 2008 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.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.AbstractActionRemoveElement;
+
+/**
+ * This Action removes a Reception from a Signal.
+ *
+ * @author Michiel
+ */
+public class ActionRemoveReceptionSignal extends AbstractActionRemoveElement {
+
+ /**
+ * Construct an Action which removes a Reception from a Signal.
+ */
+ public ActionRemoveReceptionSignal() {
+ super(Translator.localize("menu.popup.remove"));
+ }
+
+ /*
+ * @see org.tigris.gef.undo.UndoableAction#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ Object reception = getObjectToRemove();
+ if (reception != null) {
+ Object signal = getTarget();
+ if (Model.getFacade().isASignal(signal)) {
+ // TODO: Should we delete the Reception? A Reception
+ // without a Signal violates the cardinality of 1 in
+ // the metamodel - tfm - 20070308
+ Model.getCommonBehaviorHelper().removeReception(signal,
+ reception);
+ }
+ }
+ }
+
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLSignalReceptionListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLSignalReceptionListModel.java?view=auto&rev=15219
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLSignalReceptionListModel.java 2008-07-09 10:47:13-0700
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 2008 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.core.propertypanels.ui;
+
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLModelElementListModel2;
+
+/**
+ * The model for the listbox showing the receptions of a signal.
+ *
+ * @author Michiel
+ */
+public class UMLSignalReceptionListModel extends UMLModelElementListModel2 {
+
+ /**
+ * Construct a list model showing the receptions of a signal.
+ */
+ public UMLSignalReceptionListModel() {
+ /*
+ * The event to listen to is "reception", so that model updates
+ * get shown in the list. Reproduce this by adding a new reception,
+ * and see the result displayed in the list.
+ */
+ super("reception");
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+ */
+ protected void buildModelList() {
+ if (getTarget() != null) {
+ setAllElements(Model.getFacade().getReceptions(getTarget()));
+ }
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(java.lang.Object)
+ */
+ protected boolean isValidElement(Object element) {
+ return Model.getFacade().isAReception(element)
+ && Model.getFacade().getReceptions(getTarget()).contains(element);
+ }
+
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Exception.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Exception.xml?view=auto&rev=15219
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Exception.xml 2008-07-09 10:47:13-0700
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<panel>
+ <text name='name' />
+ <combo name='namespace' />
+ <optionbox name='visibility' />
+ <checkgroup name='modifiers'>
+ <checkbox name='abstract' />
+ <checkbox name='leaf' />
+ <checkbox name='root' />
+ <checkbox name='derived' />
+ </checkgroup>
+ <separator />
+ <list name="generalizations" />
+ <list name="specializations" />
+ <separator />
+ <list name="contexts" />
+ <list name="receptions" />
+</panel>
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Signal.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Signal.xml?view=auto&rev=15219
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Signal.xml 2008-07-09 10:47:13-0700
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<panel>
+ <text name='name' />
+ <combo name='namespace' />
+ <optionbox name='visibility' />
+ <checkgroup name='modifiers'>
+ <checkbox name='abstract' />
+ <checkbox name='leaf' />
+ <checkbox name='root' />
+ <checkbox name='derived' />
+ </checkgroup>
+ <separator />
+ <list name="generalizations" />
+ <list name="specializations" />
+ <separator />
+ <list name="contexts" />
+ <list name="receptions" />
+</panel>
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.