svn commit: r17098 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels: ui xml

Christian López Espínola <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2009-04-11 16:30:06-0700
New Revision: 17098

Added:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTagDefinitionTypedValuesListModel.java
Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/xml/panels.xml

Log:
Panel for tag definition.

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java?view=diff&pathrev=17098&r1=17097&r2=17098
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java	2009-04-11 16:30:06-0700
@@ -192,7 +192,9 @@
         } else if ("action".equals(propName)) {
             model = new UMLActionSequenceActionListModel();
             model.setTarget(modelElement);
-            list = new ScrollList(new UMLActionSequenceActionList(model));
+            list = new ScrollList(new UMLActionSequenceActionList(model));     
+        } else if ("typedValue".equals(propName)) {
+            model = new UMLTagDefinitionTypedValuesListModel(); 
         }
         
         if (model != null && list == null) {

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java?view=diff&pathrev=17098&r1=17097&r2=17098
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java	2009-04-11 16:30:06-0700
@@ -48,7 +48,6 @@
 import org.argouml.uml.ui.UMLPlainTextDocument;
 import org.argouml.uml.ui.UMLRadioButtonPanel;
 import org.argouml.uml.ui.UMLSearchableComboBox;
-import org.argouml.uml.ui.UMLSingleRowSelector;
 import org.argouml.uml.ui.UMLTextArea2;
 import org.argouml.uml.ui.UMLTextField2;
 import org.argouml.uml.ui.behavior.activity_graphs.ActionSetObjectFlowStateClassifier;
@@ -89,6 +88,8 @@
 import org.argouml.uml.ui.foundation.core.UMLParameterDirectionKindRadioButtonPanel;
 import org.argouml.uml.ui.foundation.core.UMLStructuralFeatureChangeabilityRadioButtonPanel;
 import org.argouml.uml.ui.foundation.core.UMLStructuralFeatureTypeComboBoxModel;
+import org.argouml.uml.ui.foundation.extension_mechanisms.ActionSetTagDefinitionType;
+import org.argouml.uml.ui.foundation.extension_mechanisms.UMLMetaClassComboBoxModel;
 import org.tigris.swidgets.GridLayout2;
 
 /**
@@ -511,7 +512,17 @@
                         ActionSetStubStateReferenceState.getInstance());
             comp = new UMLComboBoxNavigator(Translator.localize(
                     "tooltip.nav-stubstate"), referencestateBox);            
-        }
+        } else if ("tagType".equals(prop.getName())) {
+            UMLComboBoxModel2 model = new UMLMetaClassComboBoxModel();
+            model.setTarget(target);
+            final JComboBox typeComboBox = new UMLComboBox2(model, 
+                    ActionSetTagDefinitionType.getInstance());
+            comp = new UMLComboBoxNavigator(
+                   Translator.localize("label.type.navigate.tooltip"),
+                   typeComboBox);
+            // TODO: Why is this disabled always?
+            comp.setEnabled(false);
+       }
         
         if (comp != null) {
             String name = prop.getName();

Added: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTagDefinitionTypedValuesListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTagDefinitionTypedValuesListModel.java?view=markup&pathrev=17098
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTagDefinitionTypedValuesListModel.java	2009-04-11 16:30:06-0700
@@ -0,0 +1,78 @@
+// $Id: UMLTagDefinitionTypedValuesListModel.java 11516 2006-11-25 04:30:15Z tfmorris $
+// 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.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.argouml.model.Model;
+
+/**
+ * A model for all TaggedValues typed by a TagDefinition
+ *
+ * @author tfmorris
+ * @since 12 Jan 2005
+ */
+class UMLTagDefinitionTypedValuesListModel
+    extends UMLModelElementListModel {
+
+    /**
+     * Constructor for UMLTagDefinitionTypeValueListModel.
+     */
+    public UMLTagDefinitionTypedValuesListModel() {
+        super("typedValue");
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+     */
+    protected void buildModelList() {
+        if (getTarget() != null) {
+            Collection typedValues = Model.getFacade().getTypedValues(
+                    getTarget());
+            Collection taggedValues = new HashSet();
+            for (Iterator i = typedValues.iterator(); i.hasNext();) {
+                taggedValues.add(Model.getFacade().getModelElementContainer(
+                        i.next()));
+            }
+            setAllElements(taggedValues);
+        }
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(Object)
+     */
+    protected boolean isValidElement(Object element) {
+        Iterator i = Model.getFacade().getTypedValues(getTarget()).iterator();
+        while (i.hasNext()) {
+            if (element.equals(Model.getFacade().getModelElementContainer(
+                    i.next())))
+                return true;
+        }
+        return false;
+    }
+
+}

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/xml/panels.xml
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/xml/panels.xml?view=diff&pathrev=17098&r1=17097&r2=17098
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/xml/panels.xml	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/xml/panels.xml	2009-04-11 16:30:06-0700
@@ -1290,34 +1290,34 @@
   </panel>
   <panel name="TagDefinition">
     <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" />
-    <list name="targetFlow" type="Flow" />
-    <list name="sourceFlow" type="Flow" />
-    <list name="comment" type="Comment" />
+    <combo name="multiplicity" type="Multiplicity" />
+    <optionbox name="visibility" type="VisibilityKind" />
     <separator />
-    <list name="templateParameter" type="TemplateParameter" />
-    <list name="supplierDependency" type="ModelElement" />
-    <list name="presentation" type="ModelElement" />
-    <list name="defaultedParameter" type="ModelElement" />
-    <list name="elementResidence" type="ModelElement" />
+    <combo name="tagType" type="Name" />
+	<list name="typedValue" type="TagDefinition" />
+	
+    <attribute name="modifiers">
+      <attribute name="isSpecification" type="Boolean" />
+    </attribute>
+    <attribute name="clientDependency" type="Dependency" />
+    <attribute name="targetFlow" type="Flow" />
+    <attribute name="sourceFlow" type="Flow" />
+    <attribute name="comment" type="Comment" />    
+    <attribute name="templateParameter" type="TemplateParameter" />
+    <attribute name="supplierDependency" type="ModelElement" />
+    <attribute name="presentation" type="ModelElement" />
+    <attribute name="defaultedParameter" type="ModelElement" />
+    <attribute 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" />
-    <text name="tagType" type="Name" />
-    <attribute name="multiplicity" type="Multiplicity" />
-    <list name="typedValue" type="TagDefinition" />
+    <attribute name="referenceTag" type="ModelElement" />
+    <attribute name="templateArgument" type="ModelElement" />
+    <attribute name="behavior" type="ModelElement" />
+    <attribute name="classifierRole" type="ModelElement" />
+    <attribute name="collaboration" type="ModelElement" />
+    <attribute name="collaborationInstanceSet" type="ModelElement" />
+    <attribute name="partition" type="ModelElement" />
+    <attribute name="elementImport" type="ModelElement" />
   </panel>
   <panel name="TaggedValue">
     <text name="name" type="Name" />

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1657371

To unsubscribe from this discussion, e-mail: [[email protected]].
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.