Re: Programmatic manipulation of "live" models in ArgoUML

Dimitrios Kolovos <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.user
Message-ID <[email protected]>
Hi Tom,

It didn't require changing the Java source files but is not a plugin 
either. I've modified the argouml.ini to add another details tab through 
which I've then able to access the RootPane and then used something as 
ugly as

BorderSplitPane root = (BorderSplitPane) getComponent(getRootPane(),new 
int[]{1,0,0,4},0);
root.add(titlePanel, BorderLayout.EAST);

to add the "Wizards" panel on the right side

I've also had to use reflection to access the UmlPackage implementation:

    protected UmlPackage getInternalUmlPackage() throws Exception {
       
        Facade facade = Model.getFacade();
       
        Field[] fields = facade.getClass().getDeclaredFields();
        Field implField = null;
       
        for (int i=0;i<fields.length;i++){
            if(fields[i].getName().equals("implementation")){
                implField = fields[i];
                break;
            }
        }
       
        AccessibleObject.setAccessible(new 
AccessibleObject[]{implField}, true);
       
        ModelImplementation implementation =  (ModelImplementation) 
implField.get(facade);
       
        fields = implementation.getClass().getDeclaredFields();
        Field implUmlPackage = null;
       
        for (int i=0;i<fields.length;i++){
            if(fields[i].getName().equals("umlPackage")){
                implUmlPackage = fields[i];
                break;
            }
        }
       
        AccessibleObject.setAccessible(new 
AccessibleObject[]{implUmlPackage}, true);
       
        return (UmlPackage) implUmlPackage.get(implementation);
   
    }

Finally, I had to modify the meta-inf/manifest.mf in argouml-mdr.jar to 
prepend argoumlepsilon.jar (the implementation of EWL and the 
integration classes) and antlr-2.7.5.jar (as ArgoUML ships with an older 
version of Antlr than the one I need for EWL)

Is there a way to accomplish the above and deliver this extension as a 
proper plugin?

Cheers,
Dimitrios

Tom Morris wrote:
> On Tue, May 13, 2008 at 2:18 PM, Dimitrios Kolovos <[email protected]> wrote:
>
>   
>>  We have made available an extended version of ArgoUML (based on v0.20)
>> which provides support for programmatic manipulation of "live" ArgoUML
>> models using a dedicated OCL-based executable language (EWL).  A Flash
>> screencast is available at www.kolovos.eu/epsilon/argouml/screencast.php.
>> Instructions on obtaining this extended version and learning more about EWL
>> are available at www.kolovos.eu/epsilon/argouml/. For now, only a binary
>> version has been released - however if this is of interest to the community,
>> we are happy to release the source code as well.
>>     
>
> Cool.  Is this packaged as a plugin that is usable with other versions
> of ArgoUML or have you modified the core sources?
>
> If you were forced to modify the core, it would be useful to know what
> extension points were missing (presuming you haven't already requested
> them as enhancements in the issue database).
>
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, 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.