I've put the foundations in place to now start creating whatever Figs
are needed.

We have the new eclipse project argouml-core-diagrams-activity2

This will now be included when launching with the launcher "ArgoUML
UML2-EUML debug"

You must first create a package, select it and then hit the New
Activity Diagram tool as UML2 only allows an activity on a model

When an activity diagram is created UML1.4 creates an ActivityGraph.

UML2 instead creates an Activity.

As some code outside of the diagrams already expects an ActivityGraph
I've done my implementation for creating an Activity in the EUML
implementation of buidlActivityGraph

I confess this was rather - "monkey see, monkey do". I followed an
example elsewhere and this seems to work.See below for my first
attempt to implement a build method in EUML

Bob

    /**
     * ActivityGraph is a UML1.x element that has been dropped in UML2.
     * For convenience and prevent changes to interfaces this is currently
     * being used to build an Activity for UML2
     * @param theContext the package the activity is to be contained inside
     * @return the Activity created
     * @see 
org.argouml.model.ActivityGraphsFactory#buildActivityGraph(java.lang.Object)
     */
    public Object buildActivityGraph(final Object theContext) {
        if (!(theContext instanceof org.eclipse.uml2.uml.Package)) {
            throw new IllegalArgumentException("Didn't expect a " + theContext);
        }
        RunnableClass run = new RunnableClass() {
            public void run() {
                Activity activity = UMLFactory.eINSTANCE.createActivity();
                activity.setPackage((org.eclipse.uml2.uml.Package)theContext);
                getParams().add(activity);
            }
        };
        ChangeCommand cmd = new ChangeCommand(
                modelImpl, run,
                "Create the activity # in the package #");
        modelImpl.getEditingDomain().getCommandStack().execute(cmd);
        cmd.setObjects(run.getParams().get(0), theContext);

        return (Activity) run.getParams().get(0);
    }

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

To unsubscribe from this discussion, e-mail: 
[[email protected]].
To be allowed to post to the list contact the mailing list moderator, email: 
[[email protected]]

Reply via email to