Author: penyaskito
Date: 2008-08-15 09:05:51-0700
New Revision: 15573
Added:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedClassifierCollaboration.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedOperationCollaboration.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBox2.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBox3.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel3.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBox.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLRecurrenceExpressionModel.java (contents, props changed)
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLScriptExpressionModel.java (contents, props changed)
Modified:
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/panels.xml
Log:
Complete Sequence diagrams panels. Closes Issue 5312.
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedClassifierCollaboration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedClassifierCollaboration.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedClassifierCollaboration.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,73 @@
+// $Id$
+// Copyright (c) 2006 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.application.helpers.ResourceLoaderWrapper;
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLComboBox2;
+import org.tigris.gef.undo.UndoableAction;
+
+/**
+ * This Action sets the represented classifier
+ * of a collaboration.
+ *
+ * @author michiel
+ */
+class ActionSetRepresentedClassifierCollaboration extends UndoableAction {
+
+ /**
+ * Constructor for ActionSetCompositeStateConcurrent.
+ */
+ ActionSetRepresentedClassifierCollaboration() {
+ super(Translator.localize("action.set"),
+ ResourceLoaderWrapper.lookupIcon("action.set"));
+ }
+
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ if (e.getSource() instanceof UMLComboBox2) {
+ UMLComboBox2 source = (UMLComboBox2) e.getSource();
+ Object target = source.getTarget();
+ Object newValue = source.getSelectedItem();
+ /* The selected value may be "" to
+ * clear the represented classifier. */
+ if (!Model.getFacade().isAClassifier(newValue)) {
+ newValue = null;
+ }
+ if (Model.getFacade().getRepresentedClassifier(target)
+ != newValue) {
+ Model.getCollaborationsHelper().setRepresentedClassifier(
+ target, newValue);
+ }
+ }
+ }
+
+}
\ No newline at end of file
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedOperationCollaboration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedOperationCollaboration.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionSetRepresentedOperationCollaboration.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,73 @@
+// $Id$
+// Copyright (c) 2006 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.application.helpers.ResourceLoaderWrapper;
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLComboBox2;
+import org.tigris.gef.undo.UndoableAction;
+
+/**
+ * This Action sets the represented operation
+ * of a collaboration.
+ *
+ * @author michiel
+ */
+class ActionSetRepresentedOperationCollaboration extends UndoableAction {
+
+ /**
+ * Constructor.
+ */
+ ActionSetRepresentedOperationCollaboration() {
+ super(Translator.localize("action.set"),
+ ResourceLoaderWrapper.lookupIcon("action.set"));
+ }
+
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ if (e.getSource() instanceof UMLComboBox2) {
+ UMLComboBox2 source = (UMLComboBox2) e.getSource();
+ Object target = source.getTarget();
+ Object newValue = source.getSelectedItem();
+ /* The selected value may be "" to
+ * clear the represented operation. */
+ if (!Model.getFacade().isAOperation(newValue)) {
+ newValue = null;
+ }
+ if (Model.getFacade().getRepresentedOperation(target)
+ != newValue) {
+ Model.getCollaborationsHelper().setRepresentedOperation(
+ target, newValue);
+ }
+ }
+ }
+
+}
Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java?view=diff&rev=15573&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java&r1=15572&r2=15573
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java (original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java 2008-08-15 09:05:51-0700
@@ -57,8 +57,32 @@
import org.argouml.uml.ui.UMLSingleRowSelector;
import org.argouml.uml.ui.UMLTextArea2;
import org.argouml.uml.ui.UMLTextField2;
+import org.argouml.uml.ui.behavior.collaborations.ActionAddClassifierRoleBase;
+import org.argouml.uml.ui.behavior.collaborations.ActionAddMessagePredecessor;
+import org.argouml.uml.ui.behavior.collaborations.ActionRemoveClassifierRoleBase;
+import org.argouml.uml.ui.behavior.collaborations.UMLClassifierRoleAvailableContentsListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLClassifierRoleAvailableFeaturesListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLClassifierRoleBaseListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLCollaborationConstrainingElementListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLCollaborationInteractionListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLInteractionContextListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLInteractionMessagesListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLMessageActionListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLMessageInteractionListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLMessagePredecessorListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLMessageReceiverListModel;
+import org.argouml.uml.ui.behavior.collaborations.UMLMessageSenderListModel;
import org.argouml.uml.ui.behavior.common_behavior.ActionAddContextSignal;
+import org.argouml.uml.ui.behavior.common_behavior.ActionAddCreateActionInstantiation;
+import org.argouml.uml.ui.behavior.common_behavior.UMLActionArgumentListModel;
+import org.argouml.uml.ui.behavior.common_behavior.UMLActionAsynchronousCheckBox;
+import org.argouml.uml.ui.behavior.common_behavior.UMLCreateActionClassifierListModel;
import org.argouml.uml.ui.behavior.common_behavior.UMLSignalContextListModel;
+import org.argouml.uml.ui.behavior.state_machines.ActionSetContextStateMachine;
+import org.argouml.uml.ui.behavior.state_machines.UMLStateMachineContextComboBoxModel;
+import org.argouml.uml.ui.behavior.state_machines.UMLStateMachineSubmachineStateListModel;
+import org.argouml.uml.ui.behavior.state_machines.UMLStateMachineTopListModel;
+import org.argouml.uml.ui.behavior.state_machines.UMLStateMachineTransitionListModel;
import org.argouml.uml.ui.behavior.use_cases.ActionAddExtendExtensionPoint;
import org.argouml.uml.ui.behavior.use_cases.ActionNewExtendExtensionPoint;
import org.argouml.uml.ui.behavior.use_cases.ActionNewUseCaseExtensionPoint;
@@ -239,6 +263,18 @@
conditionArea.setRows(5);
control = new JScrollPane(conditionArea);
}
+ else if ("script".equals(prop.getName())) {
+ UMLExpressionModel3 scriptModel =
+ new UMLScriptExpressionModel();
+ p = new UMLExpressionPanel(scriptModel, prop.getName());
+ control = p;
+ }
+ else if ("recurrence".equals(prop.getName())) {
+ UMLExpressionModel3 recurrenceModel =
+ new UMLRecurrenceExpressionModel();
+ p = new UMLExpressionPanel(recurrenceModel, prop.getName());
+ control = p;
+ }
if (control != null) {
// if the control is a panel, add it
if (control == p) {
@@ -316,7 +352,36 @@
model.setTarget(target);
pane = new UMLSingleRowSelector(model);
}
-
+ else if ("interaction".equals(prop.getName())) {
+ if (Model.getFacade().isAMessage(target)) {
+ model = new UMLMessageInteractionListModel();
+ }
+ else {
+ model = new UMLCollaborationInteractionListModel();
+ }
+ model.setTarget(target);
+ pane = new UMLSingleRowSelector(model);
+ }
+ else if ("sender".equals(prop.getName())) {
+ model = new UMLMessageSenderListModel();
+ model.setTarget(target);
+ pane = new UMLSingleRowSelector(model);
+ }
+ else if ("receiver".equals(prop.getName())) {
+ model = new UMLMessageReceiverListModel();
+ model.setTarget(target);
+ pane = new UMLSingleRowSelector(model);
+ }
+ else if ("action".equals(prop.getName())) {
+ model = new UMLMessageActionListModel();
+ model.setTarget(target);
+ pane = new UMLSingleRowSelector(model);
+ }
+ else if ("context".equals(prop.getName())) {
+ model = new UMLInteractionContextListModel();
+ model.setTarget(target);
+ pane = new UMLSingleRowSelector(model);
+ }
if (pane != null) {
JLabel label = new JLabel(prop.getName());
label.setLabelFor(pane);
@@ -516,11 +581,6 @@
model.setTarget(target);
list = new ScrollList(model);
}
- else if ("extend".equals(prop.getName())) {
- model = new UMLUseCaseExtendListModel();
- model.setTarget(target);
- list = new ScrollList(model);
- }
else if ("extensionPoint".equals(prop.getName())) {
if (Model.getFacade().isAUseCase(target)) {
model = new UMLUseCaseIncludeListModel();
@@ -540,6 +600,81 @@
list = new ScrollList(l);
}
}
+ else if ("base".equals(prop.getName())) {
+ model = new UMLClassifierRoleBaseListModel();
+ model.setTarget(target);
+ JList l =
+ new UMLMutableLinkedList(model,
+ ActionAddClassifierRoleBase.SINGLETON,
+ null,
+ ActionRemoveClassifierRoleBase.getInstance(),
+ true);
+ list = new ScrollList(l);
+ }
+ else if ("availableFeature".equals(prop.getName())) {
+ model = new UMLClassifierRoleAvailableFeaturesListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
+ else if ("availableContents".equals(prop.getName())) {
+ model = new UMLClassifierRoleAvailableContentsListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
+ else if ("predecessor".equals(prop.getName())) {
+ model = new UMLMessagePredecessorListModel();
+ model.setTarget(target);
+ JList l = new UMLMutableLinkedList(model,
+ ActionAddMessagePredecessor.getInstance(),
+ null);
+ list = new ScrollList(l);
+ }
+ else if ("actualArgument".equals(prop.getName())) {
+ model = new UMLActionArgumentListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
+ else if ("instantiation".equals(prop.getName())) {
+ model = new UMLCreateActionClassifierListModel();
+ model.setTarget(target);
+ JList l = new UMLMutableLinkedList(model,
+ new ActionAddCreateActionInstantiation(),
+ null, null, true);
+ list = new ScrollList(l);
+ }
+ else if ("constrainingElement".equals(prop.getName())) {
+ model = new UMLCollaborationConstrainingElementListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
+ else if ("top".equals(prop.getName())) {
+ model = new UMLStateMachineTopListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
+ else if ("transitions".equals(prop.getName())) {
+ model = new UMLStateMachineTransitionListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
+ else if ("submachineState".equals(prop.getName())) {
+ model = new UMLStateMachineSubmachineStateListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
+ else if ("message".equals(prop.getName())) {
+ model = new UMLInteractionMessagesListModel();
+ model.setTarget(target);
+ JList l = new UMLLinkedList(model);
+ list = new ScrollList(l);
+ }
if (list != null) {
String name = prop.getName();
@@ -667,6 +802,9 @@
else if ("ordering".equals(p.getName())) {
checkbox = new UMLAssociationEndOrderingCheckBox();
}
+ else if ("isAsynchronous".equals(p.getName())) {
+ checkbox = new UMLActionAsynchronousCheckBox();
+ }
if (checkbox != null) {
checkbox.setTarget(target);
panel.add(checkbox);
@@ -720,6 +858,52 @@
mPanel.setTarget(target);
comp = mPanel;
}
+ else if ("activator".equals(prop.getName())) {
+ final UMLComboBoxModel3 model = new UMLMessageActivatorComboBoxModel();
+ model.setTarget(target);
+ final JComboBox combo = new UMLMessageActivatorComboBox(model);
+ comp = combo;
+ }
+ else if ("operation".equals(prop.getName())) {
+ final UMLComboBoxModel3 model = new UMLCallActionOperationComboBoxModel();
+ model.setTarget(target);
+ UMLComboBox3 operationComboBox =
+ new UMLCallActionOperationComboBox2(model);
+ comp = new UMLComboBoxNavigator(
+ Translator.localize("label.operation.navigate.tooltip"),
+ operationComboBox);
+ }
+ else if ("representedClassifier".equals(prop.getName())) {
+ final UMLComboBoxModel2 model =
+ new UMLCollaborationRepresentedClassifierComboBoxModel();
+ model.setTarget(target);
+ UMLComboBox2 combo =
+ new UMLComboBox2(model,
+ new ActionSetRepresentedClassifierCollaboration());
+ comp = new UMLComboBoxNavigator(Translator.localize(
+ "label.represented-classifier.navigate.tooltip"),
+ combo);
+ }
+ else if ("representedOperation".equals(prop.getName())) {
+ final UMLComboBoxModel2 model =
+ new UMLCollaborationRepresentedOperationComboBoxModel();
+ model.setTarget(target);
+ UMLComboBox2 combo = new UMLComboBox2(model,
+ new ActionSetRepresentedOperationCollaboration());
+ comp = new UMLComboBoxNavigator(Translator.localize(
+ "label.represented-operation.navigate.tooltip"),
+ combo);
+ }
+ else if ("context".equals(prop.getName())) {
+ final UMLComboBoxModel2 model = new UMLStateMachineContextComboBoxModel();
+ model.setTarget(target);
+ UMLComboBox2 combo = new UMLComboBox2(model,
+ ActionSetContextStateMachine.getInstance());
+ comp = new UMLComboBoxNavigator(Translator.localize(
+ "label.context.navigate.tooltip"),
+ combo);
+
+ }
if (comp != null) {
String name = prop.getName();
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBox2.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBox2.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBox2.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,85 @@
+//$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.model.Model;
+import org.argouml.uml.ui.UMLComboBox2;
+import org.argouml.uml.ui.UMLComboBoxModel2;
+import org.argouml.uml.ui.UMLSearchableComboBox;
+import org.tigris.gef.undo.UndoableAction;
+
+class UMLCallActionOperationComboBox2
+ extends UMLComboBox3 {
+ /**
+ * The constructor.
+ *
+ * @param arg0 the model
+ */
+ public UMLCallActionOperationComboBox2(UMLComboBoxModel3 arg0) {
+ super(arg0, new SetActionOperationAction());
+ setEditable(false);
+ }
+
+ /**
+ * The UID.
+ */
+ private static final long serialVersionUID = 1453984990567492914L;
+}
+
+class SetActionOperationAction extends UndoableAction {
+
+ /**
+ * The constructor.
+ */
+ public SetActionOperationAction() {
+ super("");
+ }
+
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ public void actionPerformed(ActionEvent e) {
+ super.actionPerformed(e);
+ Object source = e.getSource();
+ if (source instanceof UMLComboBox2) {
+ Object selected = ((UMLComboBox2) source).getSelectedItem();
+ Object target = ((UMLComboBox2) source).getTarget();
+ if (Model.getFacade().isACallAction(target)
+ && Model.getFacade().isAOperation(selected)) {
+ if (Model.getFacade().getOperation(target) != selected) {
+ Model.getCommonBehaviorHelper()
+ .setOperation(target, selected);
+ }
+ }
+ }
+ }
+
+ /**
+ * The UID.
+ */
+ private static final long serialVersionUID = -3574312020866131632L;
+}
\ No newline at end of file
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,145 @@
+// $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.beans.PropertyChangeEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.argouml.model.AttributeChangeEvent;
+import org.argouml.model.Model;
+import org.argouml.ui.targetmanager.TargetManager;
+
+class UMLCallActionOperationComboBoxModel extends UMLComboBoxModel3 {
+ /**
+ * The constructor.
+ */
+ public UMLCallActionOperationComboBoxModel() {
+ super("operation", true);
+ }
+
+ /**
+ * The list of operations shall contain
+ * all operations of all classifiers
+ * contained in the same package as the callaction itself. <p>
+ *
+ * TODO: In fact, we also should include operations of imported
+ * clasifiers.
+ *
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#buildModelList()
+ */
+ protected void buildModelList() {
+ Object target = TargetManager.getInstance().getModelTarget();
+ Collection ops = new ArrayList();
+ if (Model.getFacade().isACallAction(target)) {
+ Object ns = Model.getFacade().getModelElementContainer(target);
+ while (!Model.getFacade().isAPackage(ns)) {
+ ns = Model.getFacade().getModelElementContainer(ns);
+ if (ns == null) {
+ break;
+ }
+ }
+ if (Model.getFacade().isANamespace(ns)) {
+ Collection c =
+ Model.getModelManagementHelper()
+ .getAllModelElementsOfKind(
+ ns,
+ Model.getMetaTypes().getClassifier());
+ Iterator i = c.iterator();
+ while (i.hasNext()) {
+ ops.addAll(Model.getFacade().getOperations(i.next()));
+ }
+ }
+ /* To be really sure, let's add the operation
+ * that is linked to the action in the model,
+ * too - if it is not listed yet.
+ * We need this, incase an operation is moved
+ * out of the package,
+ * or maybe with imported XMI...
+ */
+ Object current = Model.getFacade().getOperation(target);
+ if (Model.getFacade().isAOperation(current)) {
+ if (!ops.contains(current)) {
+ ops.add(current);
+ }
+ }
+ }
+ setElements(ops);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()
+ */
+ protected Object getSelectedModelElement() {
+ Object target = TargetManager.getInstance().getModelTarget();
+ if (Model.getFacade().isACallAction(target)) {
+ return Model.getFacade().getOperation(target);
+ }
+ return null;
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(java.lang.Object)
+ */
+ protected boolean isValidElement(Object element) {
+ Object target = TargetManager.getInstance().getModelTarget();
+ if (Model.getFacade().isACallAction(target)) {
+ return element == Model.getFacade().getOperation(target);
+ }
+ return false;
+ }
+
+ /**
+ * The function in the parent removes items from the list
+ * when deselected. We do not need that here. <p>
+ *
+ * This function is only needed when another operation is connected to
+ * the action in the model, to select it in the combo. <p>
+ *
+ * It is e.g. not usefull to update the combo for removed operations,
+ * since you can only remove operations by changing the target,
+ * and selecting the action again re-generates the complete list.
+ *
+ * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+ */
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt instanceof AttributeChangeEvent) {
+ if (evt.getPropertyName().equals("operation")) {
+ if (evt.getSource() == getTarget()
+ && (getChangedElement(evt) != null)) {
+ Object elem = getChangedElement(evt);
+ setSelectedItem(elem);
+ }
+ }
+ }
+ }
+
+ /**
+ * The UID.
+ */
+ private static final long serialVersionUID = 7752478921939209157L;
+}
\ No newline at end of file
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,96 @@
+// $Id$
+// Copyright (c) 2006 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.beans.PropertyChangeEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLComboBoxModel2;
+
+/**
+ * The ComboBox model for the represented classifier
+ * of a collaboration.
+ *
+ * @author michiel
+ */
+class UMLCollaborationRepresentedClassifierComboBoxModel
+ extends UMLComboBoxModel2 {
+
+ /**
+ * Constructor for UMLCollaborationRepresentedClassifierComboBoxModel.
+ */
+ public UMLCollaborationRepresentedClassifierComboBoxModel() {
+ super("representedClassifier", true);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+ */
+ protected void buildModelList() {
+ Collection classifiers = new ArrayList();
+ Project p = ProjectManager.getManager().getCurrentProject();
+ for (Object model : p.getUserDefinedModelList()) {
+ Collection c = Model.getModelManagementHelper()
+ .getAllModelElementsOfKind(model,
+ Model.getMetaTypes().getClassifier());
+ for (Object cls : c) {
+ Collection s = Model.getModelManagementHelper()
+ .getAllSurroundingNamespaces(cls);
+ if (!s.contains(getTarget())) {
+ classifiers.add(cls);
+ }
+ }
+ }
+ setElements(classifiers);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)
+ */
+ protected boolean isValidElement(Object element) {
+ return Model.getFacade().isAClassifier(element)
+ && Model.getFacade().getRepresentedClassifier(getTarget())
+ == element;
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()
+ */
+ protected Object getSelectedModelElement() {
+ return Model.getFacade().getRepresentedClassifier(getTarget());
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#propertyChange(java.beans.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent evt) {
+ /* Do nothing by design. */
+ }
+}
+
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,92 @@
+// $Id$
+// Copyright (c) 2006 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.beans.PropertyChangeEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectManager;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLComboBoxModel2;
+
+/**
+ * The ComboBox model for the represented Operation
+ * of a Collaboration.
+ *
+ * @author michiel
+ */
+class UMLCollaborationRepresentedOperationComboBoxModel
+ extends UMLComboBoxModel2 {
+
+ /**
+ * Constructor for UMLCollaborationRepresentedOperationComboBoxModel.
+ */
+ public UMLCollaborationRepresentedOperationComboBoxModel() {
+ super("representedOperation", true);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+ */
+ protected void buildModelList() {
+ Collection operations = new ArrayList();
+ Project p = ProjectManager.getManager().getCurrentProject();
+ for (Object model : p.getUserDefinedModelList()) {
+ Collection c = Model.getModelManagementHelper()
+ .getAllModelElementsOfKind(model,
+ Model.getMetaTypes().getOperation());
+ for (Object oper : c) {
+ Object ns = Model.getFacade().getOwner(oper);
+ Collection s = Model.getModelManagementHelper()
+ .getAllSurroundingNamespaces(ns);
+ if (!s.contains(getTarget())) operations.add(oper);
+ }
+ }
+ setElements(operations);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)
+ */
+ protected boolean isValidElement(Object element) {
+ return Model.getFacade().isAOperation(element)
+ && Model.getFacade().getRepresentedOperation(getTarget())
+ == element;
+ }
+
+ protected Object getSelectedModelElement() {
+ return Model.getFacade().getRepresentedOperation(getTarget());
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#propertyChange(java.beans.PropertyChangeEvent)
+ */
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ /* Do nothing by design. */
+ }
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBox3.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBox3.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBox3.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,154 @@
+// $Id$
+// Copyright (c) 1996-2006 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 javax.swing.Action;
+import javax.swing.JComboBox;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
+
+import org.apache.log4j.Logger;
+import org.argouml.ui.LookAndFeelMgr;
+import org.argouml.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetListener;
+import org.argouml.ui.targetmanager.TargettableModelView;
+import org.argouml.uml.ui.UMLListCellRenderer2;
+
+
+/**
+ * ComboBox for UML modelelements. <p>
+ *
+ * This implementation does not use
+ * reflection and seperates Model, View and Controller better then does
+ * UMLComboBox. The ancient UMLComboBoxModel and UMLComboBox are
+ * replaced with this implementation to improve performance.
+ */
+public class UMLComboBox3
+ extends JComboBox
+ implements TargettableModelView, TargetListener {
+
+ private static final Logger LOG = Logger.getLogger(UMLComboBox3.class);
+
+ /**
+ * Constructor for UMLComboBox2.
+ * @deprecated As of ArgoUml version unknown (before 0.13.5),
+ * replaced by {@link #UMLComboBox2(UMLComboBoxModel2, Action, boolean)}
+ * @param model the ComboBoxModel
+ */
+ @Deprecated
+ protected UMLComboBox3(UMLComboBoxModel3 model) {
+ super(model);
+ setFont(LookAndFeelMgr.getInstance().getStandardFont());
+ addActionListener(this);
+ addPopupMenuListener(model);
+ }
+
+ /**
+ * Constructor for UMLComboBox2. Via the given action, the
+ * action for this combobox is done.
+ * @param model the ComboBoxModel
+ * @param action the action
+ * @param showIcon true if an icon should be shown in front of the items
+ */
+ public UMLComboBox3(UMLComboBoxModel3 model, Action action,
+ boolean showIcon) {
+ super(model);
+ //setFont(LookAndFeelMgr.getInstance().getStandardFont());
+ addActionListener(action);
+ // setDoubleBuffered(true);
+ setRenderer(new UMLListCellRenderer2(showIcon));
+ addPopupMenuListener(model);
+ }
+
+ /**
+ * The constructor.
+ *
+ * @param arg0 the ComboBoxModel
+ * @param action the action
+ */
+ public UMLComboBox3(UMLComboBoxModel3 arg0, Action action) {
+ this(arg0, action, true);
+ }
+
+ /*
+ * @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
+ */
+ public void actionPerformed(ActionEvent arg0) {
+ int i = getSelectedIndex();
+ if (i >= 0) {
+ doIt(arg0);
+ }
+ }
+
+ /**
+ * The 'body' of the actionPerformed method. Is only called if there is
+ * actually a selection made.
+ *
+ * @param event the event
+ */
+ protected void doIt(ActionEvent event) { }
+
+ /**
+ * Utility method to get the current target.
+ *
+ * @return Object
+ */
+ public Object getTarget() {
+ return ((UMLComboBoxModel3) getModel()).getTarget();
+ }
+
+
+ /*
+ * @see org.argouml.ui.targetmanager.TargettableModelView#getTargettableModel()
+ */
+ public TargetListener getTargettableModel() {
+ return (TargetListener) getModel();
+ }
+
+ /*
+ * @see org.argouml.ui.targetmanager.TargetListener#targetAdded(org.argouml.ui.targetmanager.TargetEvent)
+ */
+ public void targetAdded(TargetEvent e) {
+ if (e.getNewTarget() != getTarget()) {
+ removeActionListener(this);
+ }
+ }
+
+ /*
+ * @see org.argouml.ui.targetmanager.TargetListener#targetRemoved(org.argouml.ui.targetmanager.TargetEvent)
+ */
+ public void targetRemoved(TargetEvent e) {
+ removeActionListener(this);
+ }
+
+ /*
+ * @see org.argouml.ui.targetmanager.TargetListener#targetSet(org.argouml.ui.targetmanager.TargetEvent)
+ */
+ public void targetSet(TargetEvent e) {
+ addActionListener(this);
+ }
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel3.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel3.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel3.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,736 @@
+// $Id$
+// Copyright (c) 1996-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.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.swing.AbstractListModel;
+import javax.swing.ComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.AddAssociationEvent;
+import org.argouml.model.AssociationChangeEvent;
+import org.argouml.model.AttributeChangeEvent;
+import org.argouml.model.DeleteInstanceEvent;
+import org.argouml.model.InvalidElementException;
+import org.argouml.model.Model;
+import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetListener;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * ComboBox Model for UML modelelements. <p>
+ *
+ * This combobox allows selecting no value, if so indicated
+ * at construction time of this class. I.e. it is "clearable".
+ */
+public abstract class UMLComboBoxModel3 extends AbstractListModel
+ implements PropertyChangeListener,
+ ComboBoxModel, TargetListener, PopupMenuListener {
+ /**
+ * Logger.
+ */
+ private static final Logger LOG =
+ Logger.getLogger(UMLComboBoxModel3.class);
+
+ /**
+ * The target of the comboboxmodel. This is some UML modelelement
+ */
+ private Object comboBoxTarget = null;
+
+ /**
+ * The list with objects that should be shown in the combobox.
+ */
+ private List objects = new ArrayList();
+
+ /**
+ * The selected object.
+ */
+ private Object selectedObject = null;
+
+ /**
+ * Flag to indicate if the user may select the empty string ("") as value in
+ * the combobox. If true the attribute that is shown by this combobox may be
+ * set to null. Makes sure that there is always a "" in the list with
+ * objects so the user has the oportunity to select this to clear the
+ * attribute.
+ */
+ private boolean isClearable = false;
+
+ /**
+ * The name of the property that we will use to listen for change events
+ * associated with this model element.
+ */
+ private String propertySetName;
+
+ /**
+ * Flag to indicate whether list events should be fired.
+ */
+ private boolean fireListEvents = true;
+
+ /**
+ * Flag to indicate whether the model is being build.
+ */
+ protected boolean buildingModel = false;
+
+ /**
+ * Flag needed to prevent a loop during popup notification
+ */
+ private boolean willBecomeVisible = false;
+
+
+ /**
+ * Constructs a model for a combobox. The container given is used
+ * to retrieve the target that is manipulated through this
+ * combobox. If clearable is true, the user can select null in the
+ * combobox and thereby clear the attribute in the model.
+ *
+ * @param name The name of the property change event that must be
+ * fired to set the selected item programmatically (via changing
+ * the model)
+ * @param clearable Flag to indicate if the user may select ""
+ * as value in the combobox. If true the attribute that is shown
+ * by this combobox may be set to null.
+ * Makes sure that there is always a "" in the list with objects so the
+ * user has the opportunity to select this to clear the attribute.
+ * @throws IllegalArgumentException if one of the arguments is null
+ */
+ public UMLComboBoxModel3(String name, boolean clearable) {
+ super();
+ if (name == null || name.equals("")) {
+ throw new IllegalArgumentException("one of the arguments is null");
+ }
+ // It would be better if we didn't need the container to get
+ // the target. This constructor can have zero parameters as
+ // soon as we improve targetChanged.
+ isClearable = clearable;
+ propertySetName = name;
+ }
+
+ /**
+ * If the property that this comboboxmodel depicts is changed in the UML
+ * model, this method will make sure that the changes will be
+ * done in the combobox-model equally. <p>
+ * TODO: This function is not yet completely written!
+ *
+ * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent evt) {
+ buildingModel = true;
+ if (evt instanceof AttributeChangeEvent) {
+ if (evt.getPropertyName().equals(propertySetName)) {
+ if (evt.getSource() == getTarget()
+ && (isClearable || getChangedElement(evt) != null)) {
+ Object elem = getChangedElement(evt);
+ if (elem != null && !contains(elem)) {
+ addElement(elem);
+ }
+ setSelectedItem(elem);
+ }
+ }
+ } else if (evt instanceof DeleteInstanceEvent) {
+ if (contains(getChangedElement(evt))) {
+ Object o = getChangedElement(evt);
+ removeElement(o);
+ }
+ } else if (evt instanceof AddAssociationEvent) {
+ if (getTarget() != null && isValidEvent(evt)) {
+ if (evt.getPropertyName().equals(propertySetName)
+ && (evt.getSource() == getTarget())) {
+ Object elem = evt.getNewValue();
+ setSelectedItem(elem);
+ } else {
+ Object o = getChangedElement(evt);
+ addElement(o);
+ }
+ }
+ } else if (evt instanceof RemoveAssociationEvent && isValidEvent(evt)) {
+ if (evt.getPropertyName().equals(propertySetName)
+ && (evt.getSource() == getTarget())) {
+ if (evt.getOldValue() == getSelectedItem()) {
+ setSelectedItem(evt.getNewValue());
+ }
+ } else {
+ Object o = getChangedElement(evt);
+ if (contains(o)) {
+ removeElement(o);
+ }
+ }
+ }
+ else if (evt.getSource() instanceof ArgoDiagram
+ && evt.getPropertyName().equals(propertySetName)) {
+ /* This should not be necessary, but let's be sure: */
+ addElement(evt.getNewValue());
+ /* TODO: MVW: for this case, I have to move the
+ * call to setSelectedItem() outside the "buildingModel", otherwise
+ * the combo does not update with the new selection.
+ * Does the same not apply in the cases above? */
+ buildingModel = false;
+ setSelectedItem(evt.getNewValue());
+ }
+ buildingModel = false;
+ }
+
+ /**
+ * Returns true if the given element is valid.<p>
+ *
+ * It is valid if it may be added to the list of elements.
+ *
+ * @param element the given element
+ * @return true if the given element is valid
+ */
+ protected abstract boolean isValidElement(Object element);
+
+ /**
+ * Builds the list of elements and sets the selectedIndex to the currently
+ * selected item if there is one. Called from targetChanged every time the
+ * target of the proppanel is changed.
+ */
+ abstract protected void buildModelList();
+
+ /**
+ * @param obj an UML object
+ * @return its name or "" (if it was not named or deleted)
+ */
+ protected String getName(Object obj) {
+ try {
+ Object n = Model.getFacade().getName(obj);
+ String name = (n != null ? (String) n : "");
+ return name;
+ } catch (InvalidElementException e) {
+ return "";
+ }
+ }
+
+ /**
+ * Utility method to change all elements in the list with modelelements
+ * at once. A minimal update strategy is used to minimize event firing
+ * for unchanged elements.
+ *
+ * @param elements the given elements
+ */
+ protected void setElements(Collection elements) {
+ if (elements != null) {
+ ArrayList toBeRemoved = new ArrayList();
+ for (int i = 0; i < objects.size(); i++) {
+ Object o = objects.get(i);
+ if (!elements.contains(o) && !(isClearable && "".equals(o))) {
+ toBeRemoved.add(o);
+ }
+ }
+ removeAll(toBeRemoved);
+ addAll(elements);
+
+ if (!objects.contains(selectedObject)) {
+ selectedObject = null;
+ }
+ if (isClearable && !elements.contains("")) {
+ addElement("");
+ }
+ } else {
+ throw new IllegalArgumentException("In setElements: may not set "
+ + "elements to null collection");
+ }
+ }
+
+ /**
+ * Utility method to get the target.
+ *
+ * @return the ModelElement
+ */
+ protected Object getTarget() {
+ return comboBoxTarget;
+ }
+
+ /**
+ * Utility method to remove a collection of elements from the model.
+ *
+ * @param col the elements to be removed
+ */
+ protected void removeAll(Collection col) {
+ int first = -1;
+ int last = -1;
+ fireListEvents = false;
+ for (Object o : col) {
+ int index = getIndexOf(o);
+ removeElement(o);
+ if (first == -1) { // start of interval
+ first = index;
+ last = index;
+ } else {
+ if (index != last + 1) { // end of interval
+ fireListEvents = true;
+ fireIntervalRemoved(this, first, last);
+ fireListEvents = false;
+ first = index;
+ last = index;
+ } else { // in middle of interval
+ last++;
+ }
+ }
+ }
+ fireListEvents = true;
+ }
+
+ /**
+ * Utility method to add a collection of elements to the model.
+ *
+ * @param col the elements to be addd
+ */
+ protected void addAll(Collection col) {
+ Object o2 = getSelectedItem();
+ fireListEvents = false;
+ int oldSize = objects.size();
+ for (Object o : col) {
+ addElement(o);
+ }
+ if (o2 != null) {
+ setSelectedItem(o2);
+ }
+ fireListEvents = true;
+ if (objects.size() != oldSize) {
+ fireIntervalAdded(this, oldSize - 1, objects.size() - 1);
+ }
+ }
+
+ /**
+ * Utility method to get the changed element from some event e.
+ *
+ * @param e the given event
+ * @return Object the changed element
+ */
+ protected Object getChangedElement(PropertyChangeEvent e) {
+ if (e instanceof AssociationChangeEvent) {
+ return ((AssociationChangeEvent) e).getChangedValue();
+ }
+ return e.getNewValue();
+ }
+
+ /**
+ * Sets the target. If the old target is a ModelElement, it also removes
+ * the model from the element listener list of the target. If the new target
+ * is a ModelElement, the model is added as element listener to the new
+ * target. <p>
+ *
+ * This function is called when the user changes the target.
+ * Hence, this shall not result in any UML model changes.
+ * Hence, we block firing list events completely by setting
+ * buildingModel to true for the duration of this function. <p>
+ *
+ * This function looks a lot like the one in UMLModelElementListModel2.
+ *
+ * @param theNewTarget the target
+ */
+ public void setTarget(Object theNewTarget) {
+ if (theNewTarget != null && theNewTarget.equals(comboBoxTarget)) {
+ LOG.debug("Ignoring duplicate setTarget request " + theNewTarget);
+ return;
+ }
+ LOG.debug("setTarget target : " + theNewTarget);
+ theNewTarget = theNewTarget instanceof Fig
+ ? ((Fig) theNewTarget).getOwner() : theNewTarget;
+ if (Model.getFacade().isAModelElement(theNewTarget)
+ || theNewTarget instanceof ArgoDiagram) {
+
+ /* Remove old listeners: */
+ if (Model.getFacade().isAModelElement(comboBoxTarget)) {
+ Model.getPump().removeModelEventListener(this, comboBoxTarget,
+ propertySetName);
+ // Allow listening to other elements:
+ removeOtherModelEventListeners(comboBoxTarget);
+ } else if (comboBoxTarget instanceof ArgoDiagram) {
+ ((ArgoDiagram) comboBoxTarget).removePropertyChangeListener(
+ ArgoDiagram.NAMESPACE_KEY, this);
+ }
+
+ /* Add new listeners: */
+ if (Model.getFacade().isAModelElement(theNewTarget)) {
+ comboBoxTarget = theNewTarget;
+ Model.getPump().addModelEventListener(this, comboBoxTarget,
+ propertySetName);
+ // Allow listening to other elements:
+ addOtherModelEventListeners(comboBoxTarget);
+
+ buildingModel = true;
+ try {
+ LOG.info("Building the combo box model for " + this);
+ buildMinimalModelList();
+ // Do not set buildingModel = false here,
+ // otherwise the action for selection is performed.
+ setSelectedItem(getSelectedModelElement());
+ } catch (InvalidElementException e) {
+ LOG.warn("buildModelList attempted to operate on "
+ + "deleted element");
+ } finally {
+ buildingModel = false;
+ }
+
+ if (getSize() > 0) {
+ fireIntervalAdded(this, 0, getSize() - 1);
+ }
+ } else if (theNewTarget instanceof ArgoDiagram) {
+ comboBoxTarget = theNewTarget;
+ ArgoDiagram diagram = (ArgoDiagram) theNewTarget;
+ diagram.addPropertyChangeListener(
+ ArgoDiagram.NAMESPACE_KEY, this);
+ buildingModel = true;
+ LOG.info("Building the combo box model for " + this);
+ buildModelList();
+ setSelectedItem(getSelectedModelElement());
+ buildingModel = false;
+ if (getSize() > 0) {
+ fireIntervalAdded(this, 0, getSize() - 1);
+ }
+ } else { /* MVW: This can never happen, isn't it? */
+ comboBoxTarget = null;
+ removeAllElements();
+ }
+ if (getSelectedItem() != null && isClearable) {
+ addElement(""); // makes sure we can select 'none'
+ }
+ }
+ }
+
+ /**
+ * Build the minimal number of items in the model for the edit box
+ * to be populated. By default this calls buildModelList but it
+ * can be overridden in subclasses to delay population of the list
+ * till the list is displayed.
+ */
+ protected void buildMinimalModelList() {
+ buildModelList();
+ }
+
+ /**
+ * This function allows subclasses to listen to more modelelements.
+ * The given target is guaranteed to be a UML modelelement.
+ *
+ * @param oldTarget the UML modelelement
+ */
+ protected void removeOtherModelEventListeners(Object oldTarget) {
+ /* Do nothing by default. */
+ }
+
+ /**
+ * This function allows subclasses to listen to more modelelements.
+ * The given target is guaranteed to be a UML modelelement.
+ *
+ * @param newTarget the UML modelelement
+ */
+ protected void addOtherModelEventListeners(Object newTarget) {
+ /* Do nothing by default. */
+ }
+
+ /**
+ * Gets the modelelement that is selected in the UML model. For
+ * example, say that this ComboBoxmodel contains all namespaces
+ * (as in UMLNamespaceComboBoxmodel) , this method should return
+ * the namespace that owns the target then.
+ *
+ * @return Object
+ */
+ protected abstract Object getSelectedModelElement();
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ public Object getElementAt(int index) {
+ if (index >= 0 && index < objects.size()) {
+ return objects.get(index);
+ }
+ return null;
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ public int getSize() {
+ return objects.size();
+ }
+
+ /**
+ * @param o the given element
+ * @return the index of the given element
+ */
+ public int getIndexOf(Object o) {
+ return objects.indexOf(o);
+ }
+
+ /**
+ * @param o the element to be added
+ */
+ public void addElement(Object o) {
+ // TODO: For large lists, this is doing a linear search of literally thousands of elements
+ if (!objects.contains(o)) {
+ objects.add(o);
+ fireIntervalAdded(this, objects.size() - 1, objects.size() - 1);
+ }
+ }
+
+ /*
+ * @see javax.swing.ComboBoxModel#setSelectedItem(java.lang.Object)
+ */
+ public void setSelectedItem(Object o) {
+ if ((selectedObject != null && !selectedObject.equals(o))
+ || (selectedObject == null && o != null)) {
+ selectedObject = o;
+ fireContentsChanged(this, -1, -1);
+ }
+ }
+
+ /**
+ * @param o the element to be removed
+ */
+ public void removeElement(Object o) {
+ int index = objects.indexOf(o);
+ if (getElementAt(index) == selectedObject) {
+ if (!isClearable) {
+ if (index == 0) {
+ setSelectedItem(getSize() == 1
+ ? null
+ : getElementAt(index + 1));
+ } else {
+ setSelectedItem(getElementAt(index - 1));
+ }
+ }
+ }
+ if (index >= 0) {
+ objects.remove(index);
+ fireIntervalRemoved(this, index, index);
+ }
+ }
+
+ /**
+ * Remove all elements.
+ */
+ public void removeAllElements() {
+ int startIndex = 0;
+ int endIndex = Math.max(0, objects.size() - 1);
+ objects.clear();
+ selectedObject = null;
+ fireIntervalRemoved(this, startIndex, endIndex);
+ }
+
+ /*
+ * @see javax.swing.ComboBoxModel#getSelectedItem()
+ */
+ public Object getSelectedItem() {
+ return selectedObject;
+ }
+
+ /**
+ * Returns true if some object elem is contained by the list of choices.
+ *
+ * @param elem the given element
+ * @return boolean true if it is in the selection
+ */
+ public boolean contains(Object elem) {
+ if (objects.contains(elem)) {
+ return true;
+ }
+ if (elem instanceof Collection) {
+ for (Object o : (Collection) elem) {
+ if (!objects.contains(o)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns true if some event is valid. An event is valid if the
+ * element changed in the event is valid. This is determined via a
+ * call to isValidElement. This method can be overriden by
+ * subclasses if they cannot determine if it is a valid event just
+ * by checking the changed element.
+ *
+ * @param e the event
+ * @return boolean true if the event is valid
+ */
+ protected boolean isValidEvent(PropertyChangeEvent e) {
+ boolean valid = false;
+ if (!(getChangedElement(e) instanceof Collection)) {
+ if ((e.getNewValue() == null && e.getOldValue() != null)
+ // Don't try to test this if we're removing the element
+ || isValidElement(getChangedElement(e))) {
+ valid = true; // we tried to remove a value
+ }
+ } else {
+ Collection col = (Collection) getChangedElement(e);
+ if (!col.isEmpty()) {
+ valid = true;
+ for (Object o : col) {
+ if (!isValidElement(o)) {
+ valid = false;
+ break;
+ }
+ }
+ } else {
+ if (e.getOldValue() instanceof Collection
+ && !((Collection) e.getOldValue()).isEmpty()) {
+ valid = true;
+ }
+ }
+ }
+ return valid;
+ }
+
+ /*
+ * @see javax.swing.AbstractListModel#fireContentsChanged(
+ * Object, int, int)
+ */
+ @Override
+ protected void fireContentsChanged(Object source, int index0, int index1) {
+ if (fireListEvents && !buildingModel) {
+ super.fireContentsChanged(source, index0, index1);
+ }
+ }
+
+ /*
+ * @see javax.swing.AbstractListModel#fireIntervalAdded(
+ * Object, int, int)
+ */
+ @Override
+ protected void fireIntervalAdded(Object source, int index0, int index1) {
+ if (fireListEvents && !buildingModel) {
+ super.fireIntervalAdded(source, index0, index1);
+ }
+ }
+
+ /*
+ * @see javax.swing.AbstractListModel#fireIntervalRemoved(
+ * Object, int, int)
+ */
+ @Override
+ protected void fireIntervalRemoved(Object source, int index0, int index1) {
+ if (fireListEvents && !buildingModel) {
+ super.fireIntervalRemoved(source, index0, index1);
+ }
+ }
+
+ /*
+ * @see TargetListener#targetAdded(TargetEvent)
+ */
+ public void targetAdded(TargetEvent e) {
+ LOG.debug("targetAdded targetevent : " + e);
+ setTarget(e.getNewTarget());
+ }
+
+ /*
+ * @see TargetListener#targetRemoved(TargetEvent)
+ */
+ public void targetRemoved(TargetEvent e) {
+ LOG.info("targetRemoved targetevent : " + e);
+ Object currentTarget = comboBoxTarget;
+ Object oldTarget =
+ e.getOldTargets().length > 0
+ ? e.getOldTargets()[0] : null;
+ if (oldTarget instanceof Fig) {
+ oldTarget = ((Fig) oldTarget).getOwner();
+ }
+ if (oldTarget == currentTarget) {
+ if (Model.getFacade().isAModelElement(currentTarget)) {
+ Model.getPump().removeModelEventListener(this,
+ currentTarget, propertySetName);
+ }
+ comboBoxTarget = e.getNewTarget();
+ }
+ setTarget(e.getNewTarget());
+ }
+
+ /*
+ * @see TargetListener#targetSet(TargetEvent)
+ */
+ public void targetSet(TargetEvent e) {
+ LOG.debug("targetSet targetevent : " + e);
+ setTarget(e.getNewTarget());
+
+ }
+
+ /**
+ * Return boolean indicating whether combo allows empty string.
+ * @return state of isClearable flag
+ */
+ protected boolean isClearable() {
+ return isClearable;
+ }
+
+ /**
+ * @return name of property registered with event listener
+ */
+ protected String getPropertySetName() {
+ return propertySetName;
+ }
+
+ /**
+ * @return Returns the fireListEvents.
+ */
+ protected boolean isFireListEvents() {
+ return fireListEvents;
+ }
+
+ /**
+ * @param events The fireListEvents to set.
+ */
+ protected void setFireListEvents(boolean events) {
+ this.fireListEvents = events;
+ }
+
+ boolean isLazy() {
+ return false;
+ }
+
+ public void popupMenuCanceled(PopupMenuEvent e) {
+ }
+
+ public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+ }
+
+ public void popupMenuWillBecomeVisible(PopupMenuEvent ev) {
+ if (isLazy() && !willBecomeVisible) {
+ JComboBox list = (JComboBox) ev.getSource();
+
+ buildModelList();
+
+ willBecomeVisible = true; // the flag is needed to prevent a loop
+ try {
+ list.getUI().setPopupVisible( list, true );
+ } finally {
+ willBecomeVisible = false;
+ }
+ }
+ }
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBox.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBox.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBox.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 1996-2006 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.model.Model;
+import org.argouml.uml.ui.UMLComboBox2;
+import org.argouml.uml.ui.UMLComboBoxModel2;
+import org.argouml.uml.ui.UMLListCellRenderer2;
+import org.argouml.uml.ui.UMLUserInterfaceContainer;
+/**
+ * The combobox for activators on the message proppanel. The only reason this
+ * combobox implements melementlistener is to conform to UMLChangeDispatch. The
+ * combobox serves as a proxy for the
+ * model (UMLMessageActivatorComboBoxModel). Kind of strange...
+ */
+public class UMLMessageActivatorComboBox extends UMLComboBox3 {
+
+ /**
+ * Constructor for UMLMessageActivatorComboBox.
+ * @param container the UI container
+ * @param arg0 the model
+ */
+ public UMLMessageActivatorComboBox(
+ UMLComboBoxModel3 arg0) {
+ // TODO: This super constructor has been deprecated
+ super(arg0);
+ setRenderer(new UMLListCellRenderer2(true));
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBox2#doIt(ActionEvent)
+ */
+ protected void doIt(ActionEvent event) {
+ Object o = getModel().getElementAt(getSelectedIndex());
+ Object activator = o;
+ Object mes = getTarget();
+ if (activator != Model.getFacade().getActivator(mes)) {
+ Model.getCollaborationsHelper().setActivator(mes, activator);
+ }
+ }
+
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,104 @@
+// $Id$
+// Copyright (c) 1996-2006 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.UMLComboBoxModel2;
+
+/**
+ * The model behind the UMLMessageActivatorComboBox.
+ */
+public class UMLMessageActivatorComboBoxModel extends UMLComboBoxModel3 {
+
+ private Object interaction = null;
+
+ /**
+ * Constructor for UMLMessageActivatorComboBoxModel.
+ */
+ public UMLMessageActivatorComboBoxModel() {
+ super("activator", false);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#buildModelList()
+ */
+ protected void buildModelList() {
+ Object target = getTarget();
+ if (Model.getFacade().isAMessage(target)) {
+ Object mes = target;
+ removeAllElements();
+ // fill the list with items
+ setElements(Model.getCollaborationsHelper()
+ .getAllPossibleActivators(mes));
+ }
+ }
+
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#isValidElement(Object)
+ */
+ protected boolean isValidElement(Object m) {
+ return ((Model.getFacade().isAMessage(m))
+ && m != getTarget()
+ && !Model.getFacade().getPredecessors((getTarget())).contains(m)
+ && Model.getFacade().getInteraction(m)
+ == Model.getFacade().getInteraction((getTarget())));
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()
+ */
+ protected Object getSelectedModelElement() {
+ if (getTarget() != null) {
+ return Model.getFacade().getActivator(getTarget());
+ }
+ return null;
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLComboBoxModel2#setTarget(java.lang.Object)
+ */
+ public void setTarget(Object target) {
+ if (Model.getFacade().isAMessage(getTarget())) {
+ if (interaction != null) {
+ Model.getPump().removeModelEventListener(
+ this,
+ interaction,
+ "message");
+ }
+ }
+ super.setTarget(target);
+ if (Model.getFacade().isAMessage(target)) {
+ interaction = Model.getFacade().getInteraction(target);
+ if (interaction != null) {
+ Model.getPump().addModelEventListener(
+ this,
+ interaction,
+ "message");
+ }
+ }
+ }
+}
+
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLRecurrenceExpressionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLRecurrenceExpressionModel.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLRecurrenceExpressionModel.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,95 @@
+// $Id$
+// Copyright (c) 2003-2006 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.apache.log4j.Logger;
+import org.argouml.model.Model;
+import org.argouml.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetManager;
+
+/**
+ *
+ * @author mkl
+ *
+ */
+public class UMLRecurrenceExpressionModel extends UMLExpressionModel3 {
+
+ private static final Logger LOG =
+ Logger.getLogger(UMLRecurrenceExpressionModel.class);
+
+ /**
+ * The constructor.
+ *
+ * @param container the container of UML user interface components
+ * @param propertyName the name of the property
+ */
+ public UMLRecurrenceExpressionModel() {
+ super("recurrence");
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#getExpression()
+ */
+ public Object getExpression() {
+ return Model.getFacade().getRecurrence(
+ TargetManager.getInstance().getTarget());
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#setExpression(java.lang.Object)
+ */
+ public void setExpression(Object expression) {
+ Object target = TargetManager.getInstance().getTarget();
+
+ if (target == null) {
+ throw new IllegalStateException("There is no target");
+ }
+ Model.getCommonBehaviorHelper().setRecurrence(target, expression);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#newExpression()
+ */
+ public Object newExpression() {
+ LOG.debug("new boolean expression");
+ return Model.getDataTypesFactory().createIterationExpression("", "");
+ }
+
+ public void targetAdded(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+ public void targetRemoved(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+ public void targetSet(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+}
Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLScriptExpressionModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLScriptExpressionModel.java?view=auto&rev=15573
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLScriptExpressionModel.java 2008-08-15 09:05:51-0700
@@ -0,0 +1,86 @@
+// $Id$
+// Copyright (c) 2003-2006 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.ui.targetmanager.TargetEvent;
+import org.argouml.ui.targetmanager.TargetManager;
+
+/**
+ *
+ * @author mkl
+ *
+ */
+public class UMLScriptExpressionModel extends UMLExpressionModel3 {
+
+ /**
+ * The constructor.
+ *
+ * @param container the container of UML user interface components
+ * @param propertyName the name of the property
+ */
+ public UMLScriptExpressionModel() {
+ super("script");
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#getExpression()
+ */
+ public Object getExpression() {
+ return Model.getFacade().getScript(
+ TargetManager.getInstance().getTarget());
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#setExpression(java.lang.Object)
+ */
+ public void setExpression(Object expression) {
+ Model.getCommonBehaviorHelper()
+ .setScript(TargetManager.getInstance().getTarget(), expression);
+ }
+
+ /*
+ * @see org.argouml.uml.ui.UMLExpressionModel2#newExpression()
+ */
+ public Object newExpression() {
+ return Model.getDataTypesFactory().createActionExpression("", "");
+ }
+
+ public void targetAdded(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+ public void targetRemoved(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+ public void targetSet(TargetEvent e) {
+ // TODO: Auto-generated method stub
+
+ }
+
+}
Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/panels.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/panels.xml?view=diff&rev=15573&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/panels.xml&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/panels.xml&r1=15572&r2=15573
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/panels.xml (original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/panels.xml 2008-08-15 09:05:51-0700
@@ -1571,86 +1571,84 @@
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
+ <attribute name="message" type="Action" />
</panel>
<panel name="CreateAction">
<text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
<checkgroup name="modifiers">
<checkbox name="isSpecification" type="Boolean" />
<checkbox name="isAsynchronous" type="Boolean" />
- </checkgroup>
- <combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ </checkgroup>
+ <textarea name="script" type="ActionExpression" />
+ <textarea name="recurrence" type="IterationExpression" />
+ <separator />
+ <list name="instantiation" type="Classifier" />
+ <list name="actualArgument" type="Argument" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="namespace" type="Namespace" />
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <attribute name="recurrence" type="IterationExpression" />
+ <attribute name="elementImport" type="ModelElement" />
<attribute name="target" type="ObjectSetExpression" />
- <attribute name="script" type="ActionExpression" />
- <separator />
- <list name="actualArgument" type="Argument" />
<attribute name="actionSequence" type="ActionSequence" />
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
- <attribute name="instantiation" type="Classifier" />
+ <attribute name="message" type="Action" />
</panel>
<panel name="DestroyAction">
- <text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
+ <text name="name" type="Name" />
<checkgroup name="modifiers">
<checkbox name="isSpecification" type="Boolean" />
<checkbox name="isAsynchronous" type="Boolean" />
</checkgroup>
- <combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <textarea name="script" type="ActionExpression" />
+ <textarea name="recurrence" type="IterationExpression" />
+ <separator />
+ <list name="actualArgument" type="Argument" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="namespace" type="Namespace" />
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <attribute name="recurrence" type="IterationExpression" />
+ <attribute name="elementImport" type="ModelElement" />
<attribute name="target" type="ObjectSetExpression" />
- <attribute name="script" type="ActionExpression" />
- <separator />
- <list name="actualArgument" type="Argument" />
<attribute name="actionSequence" type="ActionSequence" />
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
+ <attribute name="message" type="Action" />
</panel>
<panel name="UninterpretedAction">
<text name="name" type="Name" />
@@ -1689,7 +1687,7 @@
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
+ <attribute name="message" type="Action" />
</panel>
<panel name="AttributeLink">
<text name="name" type="Name" />
@@ -1877,44 +1875,43 @@
<list name="playedRole" type="Instance" />
</panel>
<panel name="CallAction">
- <text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
+ <text name="name" type="Name" />
<checkgroup name="modifiers">
<checkbox name="isSpecification" type="Boolean" />
<checkbox name="isAsynchronous" type="Boolean" />
</checkgroup>
- <combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <textarea name="script" type="ActionExpression" />
+ <textarea name="recurrence" type="IterationExpression" />
+ <separator />
+ <combo name="operation" type="Operation" />
+ <list name="actualArgument" type="Argument" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="namespace" type="Namespace" />
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <attribute name="recurrence" type="IterationExpression" />
- <attribute name="target" type="ObjectSetExpression" />
- <attribute name="script" type="ActionExpression" />
- <separator />
- <list name="actualArgument" type="Argument" />
+ <attribute name="elementImport" type="ModelElement" />
+ <attribute name="target" type="ObjectSetExpression" />
<attribute name="actionSequence" type="ActionSequence" />
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
- <attribute name="operation" type="Operation" />
+ <attribute name="message" type="Action" />
</panel>
<panel name="SendAction">
<text name="name" type="Name" />
@@ -1953,7 +1950,7 @@
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
+ <attribute name="message" type="Action" />
<attribute name="signal" type="Signal" />
</panel>
<panel name="ActionSequence">
@@ -1993,7 +1990,7 @@
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
+ <attribute name="message" type="Action" />
<list name="action" type="Action" />
</panel>
<panel name="Argument">
@@ -2098,43 +2095,42 @@
<list name="qualifiedValue" type="AttributeLink" />
</panel>
<panel name="ReturnAction">
- <text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
+ <text name="name" type="Name" />
<checkgroup name="modifiers">
<checkbox name="isSpecification" type="Boolean" />
<checkbox name="isAsynchronous" type="Boolean" />
</checkgroup>
- <combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <textarea name="script" type="ActionExpression" />
+ <textarea name="recurrence" type="IterationExpression" />
+ <separator />
+ <list name="actualArgument" type="Argument" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="namespace" type="Namespace" />
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <attribute name="recurrence" type="IterationExpression" />
+ <attribute name="elementImport" type="ModelElement" />
<attribute name="target" type="ObjectSetExpression" />
- <attribute name="script" type="ActionExpression" />
- <separator />
- <list name="actualArgument" type="Argument" />
<attribute name="actionSequence" type="ActionSequence" />
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
+ <attribute name="message" type="Action" />
</panel>
<panel name="TerminateAction">
<text name="name" type="Name" />
@@ -2173,7 +2169,7 @@
<list name="stimulus" type="Action" />
<attribute name="state" type="Action" />
<attribute name="transition" type="Action" />
- <list name="message" type="Action" />
+ <attribute name="message" type="Action" />
</panel>
<panel name="Stimulus">
<text name="name" type="Name" />
@@ -2615,35 +2611,35 @@
</panel>
<panel name="StateMachine">
<text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
- <checkgroup name="modifiers">
- <checkbox name="isSpecification" type="Boolean" />
- </checkgroup>
<combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <combo name="context" type="ModelElement" />
+ <list name="top" type="State" />
+ <separator />
+ <list name="transitions" type="Transition" />
+ <list name="submachineState" type="SubmachineState" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="modifiers">
+ <attribute name="isSpecification" type="Boolean" />
+ </attribute>
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <attribute name="context" type="ModelElement" />
- <attribute name="top" type="State" />
- <list name="transitions" type="Transition" />
- <list name="submachineState" type="SubmachineState" />
+ <attribute name="elementImport" type="ModelElement" />
</panel>
<panel name="Event">
<text name="name" type="Name" />
@@ -3199,95 +3195,94 @@
</panel>
<panel name="Collaboration">
<text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
- <checkgroup name="modifiers">
- <checkbox name="isSpecification" type="Boolean" />
- <checkbox name="isRoot" type="Boolean" />
- <checkbox name="isLeaf" type="Boolean" />
- <checkbox name="isAbstract" type="Boolean" />
- </checkgroup>
<combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <combo name="representedClassifier" type="Classifier" />
+ <combo name="representedOperation" type="Operation" />
+ <separator />
+ <singlerow name="interaction" type="Interaction" />
+ <list name="constrainingElement" type="ModelElement" />
+ <separator />
+ <list name="ownedElement" type="ModelElement" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="modifiers">
+ <attribute name="isSpecification" type="Boolean" />
+ <attribute name="isRoot" type="Boolean" />
+ <attribute name="isLeaf" type="Boolean" />
+ <attribute name="isAbstract" type="Boolean" />
+ </attribute>
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <list name="generalization" type="Generalization" />
- <separator />
- <list name="specialization" type="GeneralizableElement" />
- <list name="ownedElement" type="ModelElement" />
- <list name="interaction" type="Interaction" />
- <attribute name="representedClassifier" type="Classifier" />
- <attribute name="representedOperation" type="Operation" />
- <list name="constrainingElement" type="ModelElement" />
+ <attribute name="elementImport" type="ModelElement" />
+ <attribute name="generalization" type="Generalization" />
+ <attribute name="specialization" type="GeneralizableElement" />
<list name="usedCollaboration" type="Collaboration" />
</panel>
<panel name="ClassifierRole">
<text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
- <checkgroup name="modifiers">
- <checkbox name="isSpecification" type="Boolean" />
- <checkbox name="isRoot" type="Boolean" />
- <checkbox name="isLeaf" type="Boolean" />
- <checkbox name="isAbstract" type="Boolean" />
- </checkgroup>
- <combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <combo name="namespace" type="Namespace" />
+ <combo name="multiplicity" type="Multiplicity" />
+ <list name="base" type="Classifier" />
+ <separator />
+ <list name="generalization" type="Generalization" />
+ <list name="specialization" type="GeneralizableElement" />
+ <list name="association" type="Classifier" />
+ <separator />
+ <list name="availableFeature" type="Feature" />
+ <list name="availableContents" type="ModelElement" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="modifiers">
+ <attribute name="isSpecification" type="Boolean" />
+ <attribute name="isRoot" type="Boolean" />
+ <attribute name="isLeaf" type="Boolean" />
+ <attribute name="isAbstract" type="Boolean" />
+ </attribute>
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <list name="generalization" type="Generalization" />
- <separator />
- <list name="specialization" type="GeneralizableElement" />
- <list name="ownedElement" type="ModelElement" />
- <list name="feature" type="Feature" />
+ <attribute name="elementImport" type="ModelElement" />
+ <attribute name="ownedElement" type="ModelElement" />
+ <attribute name="feature" type="Feature" />
<list name="powertypeRange" type="Generalization" />
<list name="typedFeature" type="Classifier" />
- <list name="typedParameter" type="Classifier" />
- <list name="association" type="Classifier" />
+ <list name="typedParameter" type="Classifier" />
<list name="specifiedEnd" type="Classifier" />
<list name="instance" type="Classifier" />
<list name="createAction" type="Classifier" />
- <separator />
<list name="classifierInState" type="Classifier" />
<list name="objectFlowState" type="Classifier" />
- <attribute name="multiplicity" type="Multiplicity" />
- <list name="base" type="Classifier" />
- <list name="availableFeature" type="Feature" />
- <list name="availableContents" type="ModelElement" />
<list name="conformingInstance" type="Instance" />
- <list name="message" type="ClassifierRole" />
+ <attribute name="message" type="ClassifierRole" />
</panel>
<panel name="AssociationRole">
<text name="name" type="Name" />
@@ -3327,7 +3322,7 @@
<list name="associationRole" type="Association" />
<attribute name="multiplicity" type="Multiplicity" />
<attribute name="base" type="Association" />
- <list name="message" type="Message" />
+ <attribute name="message" type="Message" />
<list name="conformingLink" type="Link" />
</panel>
<panel name="AssociationEndRole">
@@ -3377,72 +3372,71 @@
</panel>
<panel name="Message">
<text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
- <checkgroup name="modifiers">
- <checkbox name="isSpecification" type="Boolean" />
- </checkgroup>
- <combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <singlerow name="interaction" type="Interaction" />
+ <singlerow name="sender" type="ClassifierRole" />
+ <singlerow name="receiver" type="ClassifierRole" />
+ <separator />
+ <combo name="activator" type="Message" />
+ <singlerow name="action" type="Action" />
+ <list name="predecessor" type="Message" />
+ <list name="successor" type="Message" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="modifiers">
+ <attribute name="isSpecification" type="Boolean" />
+ </attribute>
+ <attribute name="namespace" type="Namespace" />
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <attribute name="interaction" type="Interaction" />
- <attribute name="activator" type="Message" />
- <attribute name="sender" type="ClassifierRole" />
- <attribute name="receiver" type="ClassifierRole" />
- <separator />
- <list name="predecessor" type="Message" />
+ <attribute name="elementImport" type="ModelElement" />
<attribute name="communicationConnection" type="AssociationRole" />
- <attribute name="action" type="Action" />
<list name="conformingStimulus" type="Stimulus" />
- <list name="message" type="Message" />
- <list name="successor" type="Message" />
+ <attribute name="message" type="Message" />
</panel>
<panel name="Interaction">
<text name="name" type="Name" />
- <optionbox name="visibility" type="VisibilityKind" />
- <checkgroup name="modifiers">
- <checkbox name="isSpecification" type="Boolean" />
- </checkgroup>
<combo name="namespace" type="Namespace" />
- <list name="clientDependency" type="Dependency" />
+ <singlerow name="context" type="Collaboration" />
+ <separator />
+ <list name="message" type="Message" />
+
+ <attribute name="visibility" type="VisibilityKind" />
+ <attribute name="modifiers">
+ <attribute name="isSpecification" type="Boolean" />
+ </attribute>
+ <attribute name="clientDependency" type="Dependency" />
<list name="targetFlow" type="Flow" />
<list name="sourceFlow" type="Flow" />
<list name="comment" type="Comment" />
- <separator />
<list name="templateParameter" type="TemplateParameter" />
- <list name="supplierDependency" type="ModelElement" />
+ <attribute name="supplierDependency" type="ModelElement" />
<list name="presentation" type="ModelElement" />
<list name="defaultedParameter" type="ModelElement" />
<list name="elementResidence" type="ModelElement" />
<attribute name="parameterTemplate" type="ModelElement" />
<list name="referenceTag" type="ModelElement" />
<list name="templateArgument" type="ModelElement" />
- <separator />
<list name="behavior" type="ModelElement" />
<list name="classifierRole" type="ModelElement" />
<list name="collaboration" type="ModelElement" />
<list name="collaborationInstanceSet" type="ModelElement" />
<list name="partition" type="ModelElement" />
- <list name="elementImport" type="ModelElement" />
- <list name="message" type="Message" />
- <attribute name="context" type="Collaboration" />
+ <attribute name="elementImport" type="ModelElement" />
<list name="interactionInstanceSet" type="Interaction" />
</panel>
<panel name="InteractionInstanceSet">
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.