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

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-04-01 17:23:12-0700
New Revision: 17018

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/ScrollList.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassAttributeListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierFeatureListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementOrderedListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java

Log:
Begin moving behaviour variables from components to swing model. This should eventually result in a single generic component adapting its behaviour according to its model.

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=17018&r1=17017&r2=17018
==============================================================================
--- 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-01 17:23:12-0700
@@ -28,7 +28,6 @@
 import javax.swing.JComponent;
 import javax.swing.JList;
 import org.argouml.model.Model;
-import org.argouml.uml.ui.ScrollList;
 import org.argouml.uml.ui.UMLLinkedList;
 import org.argouml.uml.ui.behavior.collaborations.ActionAddClassifierRoleBase;
 import org.argouml.uml.ui.behavior.collaborations.ActionAddMessagePredecessor;
@@ -81,14 +80,10 @@
             model = new UMLGeneralizableElementSpecializationListModel();
         } else if ("attribute".equals(propName)) {
             model = new UMLClassAttributeListModel();
-            model.setTarget(modelElement);
-            list = new ScrollList(model, true, false);
         } else if ("association".equals(propName)) {
             model = new UMLClassifierAssociationEndListModel();
         } else if ("feature".equals(propName)) {
             model = new UMLClassifierFeatureListModel();
-            model.setTarget(modelElement);
-            list = new ScrollList(model, true, false);
         } else if ("operation".equals(propName)) {
             model = new UMLClassOperationListModel();
         } else if ("ownedElement".equals(propName)) {
@@ -121,19 +116,10 @@
             }
         } else if ("raisedSignal".equals(propName)) {
             model = new UMLOperationRaisedSignalsListModel();
-            model.setTarget(modelElement);
-            list = new ScrollList(new UMLLinkedList(model, 
-                    true, false));
         } else if ("method".equals(propName)) {
             model = new UMLOperationMethodsListModel();
-            model.setTarget(modelElement);
-            list = new ScrollList(new UMLLinkedList(model, 
-                    true, false));
         } else if ("definedTag".equals(propName)) {
             model = new UMLStereotypeTagDefinitionListModel();
-            model.setTarget(modelElement);
-            list = new ScrollList(new UMLLinkedList(model,
-                    true, false));
         } else if ("baseClass".equals(propName)) {
             model = new UMLStereotypeBaseClassListModel();
             model.setTarget(modelElement);
@@ -147,9 +133,6 @@
             list = new ScrollList(l);
         } else if ("extended_elements".equals(propName)) {
             model = new UMLExtendedElementsListModel();
-            model.setTarget(modelElement);
-            list = new ScrollList( new UMLLinkedList(model, 
-                    true, true));
         } else if ("literal".equals(propName)) {
             model = new UMLEnumerationLiteralsListModel();
         } else if ("supplier".equals(propName)) {
@@ -227,14 +210,8 @@
             list = new ScrollList(l);
         } else if ("availableFeature".equals(propName)) {
             model = new UMLClassifierRoleAvailableFeaturesListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("availableContents".equals(propName)) {
             model = new UMLClassifierRoleAvailableContentsListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("predecessor".equals(propName)) {
             model = new UMLMessagePredecessorListModel();
             model.setTarget(modelElement);
@@ -244,9 +221,6 @@
             list = new ScrollList(l);
         } else if ("actualArgument".equals(propName)) {
             model = new UMLActionArgumentListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("instantiation".equals(propName)) {
             model = new UMLCreateActionClassifierListModel();
             model.setTarget(modelElement);
@@ -256,44 +230,20 @@
             list = new ScrollList(l);
         } else if ("constrainingElement".equals(propName)) {
             model = new UMLCollaborationConstrainingElementListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("top".equals(propName)) {
             model = new UMLStateMachineTopListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("transitions".equals(propName)) {
             model = new UMLStateMachineTransitionListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("transition".equals(propName)) {
             model = new UMLEventTransitionListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("submachineState".equals(propName)) {
             model = new UMLStateMachineSubmachineStateListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("message".equals(propName)) {
             model = new UMLInteractionMessagesListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("deployedComponent".equals(propName)) {
             model = new UMLNodeDeployedComponentListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("residentElement".equals(propName)) {
             model = new UMLComponentResidentListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("classifier".equals(propName)) {
             model = new UMLInstanceClassifierListModel();
             model.setTarget(modelElement);
@@ -304,9 +254,6 @@
             list = new ScrollList(l);
         } else if ("resident".equals(propName)) {
             model = new UMLContainerResidentListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);
         } else if ("entry".equals(propName)) {
             model = new UMLStateEntryListModel();
             model.setTarget(modelElement);
@@ -329,14 +276,8 @@
             list = new ScrollList(l);
         } else if ("outgoing".equals(propName)) {
             model = new UMLStateVertexOutgoingListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);                    
         } else if ("incoming".equals(propName)) {
             model = new UMLStateVertexIncomingListModel();
-            model.setTarget(modelElement);
-            JList l = new UMLLinkedList(model);
-            list = new ScrollList(l);                    
         } else if ("classifierInState".equals(propName)) {
             model = new UMLOFSStateListModel();
             model.setTarget(modelElement);
@@ -366,8 +307,6 @@
             list = new ScrollList(l);
         } else if ("partition".equals(propName)) {
             model = new UMLActivityGraphPartitionListModel();
-            model.setTarget(modelElement);
-            list = new ScrollList(new UMLLinkedList(model));
         } else if ("signal".equals(propName)) {
             model = new UMLSignalEventSignalListModel();
             model.setTarget(modelElement);

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ScrollList.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ScrollList.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ScrollList.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ScrollList.java	2009-04-01 17:23:12-0700
@@ -58,8 +58,12 @@
      * in a scrollable view.
      * @param listModel The model from which to build the list
      */
-    public ScrollList(ListModel listModel) {
-        this(listModel, true, true);
+    public ScrollList(UMLModelElementListModel listModel) {
+        setHorizontalScrollBarPolicy(
+                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+        list = new UMLLinkedList(listModel, listModel.isShowIcon(), listModel.isShowPath());
+        setViewportView(list);
+        
     }
 
     /**
@@ -78,20 +82,6 @@
     }
 
     /**
-     * Builds a JList from a given list model and wraps
-     * in a scrollable view.
-     * @param listModel The model from which to build the list
-     * @param showIcon show an icon with elements in the list
-     * @param showPath show containment path for elements in list
-     */
-    public ScrollList(ListModel listModel, boolean showIcon, boolean showPath) {
-        setHorizontalScrollBarPolicy(
-                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-        list = new UMLLinkedList(listModel, showIcon, showPath);
-        setViewportView(list);
-    }
-    
-    /**
      * Builds a ScrollList from a given list model and wraps
      * in a scrollable view.
      * @param list The JList to wrap in a scroll

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassAttributeListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassAttributeListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassAttributeListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassAttributeListModel.java	2009-04-01 17:23:12-0700
@@ -41,7 +41,7 @@
      * Constructor for UMLClassifierStructuralFeatureListModel.
      */
     public UMLClassAttributeListModel() {
-        super("feature");
+        super("feature", true, false);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierFeatureListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierFeatureListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierFeatureListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLClassifierFeatureListModel.java	2009-04-01 17:23:12-0700
@@ -41,7 +41,7 @@
      * Constructor for UMLClassifierFeatureListModel.
      */
     public UMLClassifierFeatureListModel() {
-        super("feature");
+        super("feature", true, false);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java	2009-04-01 17:23:12-0700
@@ -38,7 +38,7 @@
      * Constructor for UMLExtendedElementsListModel.
      */
     public UMLExtendedElementsListModel() {
-        super("extendedElement");
+        super("extendedElement", true, false);
     }
     
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java	2009-04-01 17:23:12-0700
@@ -84,12 +84,27 @@
     private boolean reverseDropConnection;
 
     /**
+     * True if the icon for the modelelement should be shown. The icon is, for
+     * instance, a small class symbol for a class.
+     */
+    final private boolean showIcon;
+
+    /**
+     * True if the containment path should be shown 
+     * (to help the user disambiguate elements with the same name);
+     */
+    final private boolean showPath;
+
+    
+    /**
      * Constructor to be used if the subclass does not depend on the
      * MELementListener methods and setTarget method implemented in this
      * class.
      */
     public UMLModelElementListModel() {
         super();
+        showIcon = true;
+        showPath = true;
     }
 
     /**
@@ -101,6 +116,8 @@
     public UMLModelElementListModel(String name) {
         super();
         eventName = name;
+        showIcon = true;
+        showPath = true;
     }
     
     /**
@@ -115,6 +132,8 @@
         super();
         this.metaType = theMetaType;
         eventName = name;
+        showIcon = true;
+        showPath = true;
     }
     
     /**
@@ -135,6 +154,8 @@
         this.metaType = theMetaType;
         eventName = name;
         this.reverseDropConnection = reverseTheDropConnection;
+        showIcon = true;
+        showPath = true;
     }
     
     /**
@@ -519,4 +540,11 @@
         return false;
     }
 
+    boolean isShowIcon() {
+        return showIcon;
+    }
+
+    boolean isShowPath() {
+        return showIcon;
+    }
 }

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementOrderedListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementOrderedListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementOrderedListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementOrderedListModel.java	2009-04-01 17:23:12-0700
@@ -55,6 +55,19 @@
         super(name);
     }
 
+    /**
+     * The constructor.
+     *
+     * @param name
+     *            the name
+     */
+    public UMLModelElementOrderedListModel(
+            final String name,
+            final boolean showIcon,
+            final boolean showPath) {
+        super(name, showIcon, showPath);
+    }
+
     /*
      * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
      */

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationMethodsListModel.java	2009-04-01 17:23:12-0700
@@ -42,7 +42,7 @@
      * The constructor.
      */
     public UMLOperationMethodsListModel() {
-        super("method");
+        super("method", true, false);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLOperationRaisedSignalsListModel.java	2009-04-01 17:23:12-0700
@@ -42,7 +42,7 @@
      * The constructor.
      */
     public UMLOperationRaisedSignalsListModel() {
-        super("signal");
+        super("signal", true, false);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java?view=diff&pathrev=17018&r1=17017&r2=17018
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java	2009-04-01 17:23:12-0700
@@ -40,7 +40,7 @@
      * Constructor for UMLStereotypeTagDefinitionListModel.
      */
     public UMLStereotypeTagDefinitionListModel() {
-        super("definedTag");
+        super("definedTag", true, false);
         // TODO: Add referenceValue for tagged values 
         // which have a non-primitive type
     }

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

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.