Feature
---------------------------
Add the ability for users to create all model elements using the Explorer.

Objective
---------------------------
The objective of this feature is to enhance the user's ability to
create UML objects via the Explorer.  This provides users that prefer
the Explorer interface more flexibility and adds consistency to the
overall user interface thereby making the application more intuitive
and user-friendly.

History
---------------------------
Thierry Lach proposed this enhancement in 2002 and Tom Morris and Bob
Tarling have shown their support for the feature within the Bug
Tracker.  Bob Tarling has previously implemented aspects of this
feature (e.g. Create Diagrams, Create Relationships).  This proposal
is about the functionality needed to implement the remaining model
elements (e.g. Class, Interface, Actor, etc.).  This enhancement is
tracked at this link:
http://argouml.tigris.org/issues/show_bug.cgi?id=1009

Approach
---------------------------
This enhancement should be straightforward once we determine the ideal
menu structure and behavior needed to provide this functionality.  My
proposal is as follows:

- Currently there is a menu called 'Create Model Element' that is only
visible when a user has multiple items selected in the Explorer and
they right-click.  This menu allows the user to create the different
relationships between model elements (relationship-elements-menu.png).
- My proposal is to enhance this menu so that it is also visible when
the user right-clicks the model, a package, or a diagram.  However,
instead of offering relationships, which do not directly apply to
those objects, the menu offers the following:
     Create Model Element >>
          Create Activity Element >>
               Action State; Call State; Final State; Fork; Initial
State; Join; Junction; Object Flow State; Swimlane; Transition;
          Create Collaboration Element >>
               Classifier Role
          Create Class Element >>
               Class; Datatype; Interface; Package
          Create Deployment Element >>
               Component; Component Instance; Node; Node Instance;
          Create Sequence Element >>
               Call Action; Classifier Role; Create Action; Destroy
Action; Return Action
          Create Statechart Element >>
               Choice; Composite State; Final State; Fork; Initial
State; Join; Junction; Simple State; Submachine State; Stub State;
Synch State; Transition;
          Create Use Case Element >>
               Actor; Use Case

I realize this is hard to read in this format so I have attached two
images relationships-elements-menu.png and proposed-elements-menu.png.
 The first image shows the current menu structure that allows the
creation of relationships between elements.  The second image shows
the proposed menu structure that allows for the creation of all the
other model elements.  I have also attached a patch called
create-elements.patch that you can apply to your local build to see
what the proposed change would look like.  The create-elements.patch
is just a UI mock-up; it is not the actual implementation and doesn't
follow project standards so you'll want to reverse it when you're
done.

Once we make the decision on the menu, the actual implementation will
include the following steps:
1) Add approximately 50 new entries to
org/argouml/il8n/menu.properties for all of the new menu items.
2) Rename to be org.argouml.ui.explorer.initMenuCreateModelElements()
to be org.argouml.ui.explorer.
initMenuCreateModelRelationshipElements().
3) Create a new method
org.argouml.ui.explorer.initMenuCreateModelElements() that has the
logic to create all of the new menu items with the appropriate
actions.
4) Add logic to the org.argouml.ui.explorer.ExplorerPopup constructor
to call org.argouml.ui.explorer.initMenuCreateModelElements() when the
model, diagram, or package is selected.
5) Add approximately 50 new classes that extend AbstractAction and
create the appropriate model element when triggered.  I could make
these private classes within ExplorerPopup or put them in a new file
since there are so many classes.

Verification
-----------------------------
This feature will make use of the same code used by the buttons on all
of the corresponding diagrams.  To verify this new feature is working
correctly I will perform a manual test to ensure the menus are
presented correctly and that each menu item performs the expected
action.  If anyone has any ideas for automated tests that could verify
this new functionality, let me know.

Dependencies
---------------------------
It seems like ArgoUML supports il8n, so the new menu items added by
this feature will need translating.

Work Estimate
---------------------------
Once we reach a consensus on this new functionality, I estimate it
will take me 5-7 days to complete the code and to perform all manual
testing.  Once that effort is complete, I will submit a candidate
patch to the mailing list for review.

<<attachment: relationships-elements-menu.png>>

<<attachment: proposed-elements-menu.png>>

Index: src/org/argouml/ui/explorer/ExplorerPopup.java
===================================================================
--- src/org/argouml/ui/explorer/ExplorerPopup.java      (revision 14338)
+++ src/org/argouml/ui/explorer/ExplorerPopup.java      (working copy)
@@ -147,6 +147,69 @@
         if (modelElementsOnly) {
             initMenuCreateModelElements();
         }
+        else
+        {   // mockup of solution for issue# 1009 - for demonstration purposes 
only
+            JMenu mockup1 = new JMenu("Create Model Elements");
+            this.add(mockup1);
+            JMenu mockup2 = new JMenu("Create Activity Element");
+            mockup2.add("Action State");
+            mockup2.add("Call State"); 
+            mockup2.add("Final State"); 
+            mockup2.add("Fork");         
+            mockup2.add("Initial State"); 
+            mockup2.add("Join"); 
+            mockup2.add("Junction"); 
+            mockup2.add("Object Flow State"); 
+            mockup2.add("Swimlane"); 
+            mockup2.add("Transition");            
+            mockup1.add(mockup2);
+           
+            mockup2 = new JMenu("Create Collaboration Element");
+            mockup2.add("Classifier Role");
+            mockup1.add(mockup2);
+            
+            mockup2 = new JMenu("Create Class Element");
+            mockup2.add("Class");
+            mockup2.add("Datatype");
+            mockup2.add("Interface");
+            mockup2.add("Package");
+            mockup1.add(mockup2);
+           
+            mockup2 = new JMenu("Create Deployment Element");
+            mockup2.add("Component");
+            mockup2.add("Component Instance");
+            mockup2.add("Node");
+            mockup2.add("Node Instance");
+            mockup1.add(mockup2);
+           
+            mockup2 = new JMenu("Create Sequence Element");            
+            mockup2.add("Call Action");
+            mockup2.add("Classifier Role");
+            mockup2.add("Create Action");
+            mockup2.add("Destroy Action");
+            mockup2.add("Return Action");            
+            mockup1.add(mockup2);
+           
+            mockup2 = new JMenu("Create Statechart Element");
+            mockup2.add("Choice");
+            mockup2.add("Composite State");
+            mockup2.add("Final State");
+            mockup2.add("Fork");
+            mockup2.add("Initial State");
+            mockup2.add("Join");
+            mockup2.add("Junction");
+            mockup2.add("Simple State");
+            mockup2.add("Submachine State");
+            mockup2.add("Stub State");
+            mockup2.add("Synch State");
+            mockup2.add("Transition");            
+            mockup1.add(mockup2);
+            
+            mockup2 = new JMenu("Create Use Case Element");
+            mockup2.add("Actor");
+            mockup2.add("Use Case");
+            mockup1.add(mockup2);
+        }
 
         final Object projectModel = currentProject.getModel();
         final boolean modelElementSelected = Model.getFacade().isAUMLElement(
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to