6.3. How are modules organized in the java code

The previous section describes how modules and plug-ins are connected on the java level totally independent of how they are actually linked into ArgoUML.

Within the ArgoUML project some parts of the code are for different reasons developed and kept separate from the main ArgoUML source code. These parts can be modules or plug-ins on the java level but on the source code level they are called modules. This section describes how they are organized and how you create such source-code modules.

6.3.1. Requirements on modules

New modules that are added to ArgoUML shall reside in whole new packages. Either you put your module classes in your.own.domain.your.package.name or if you want to emphasize the connection to ArgoUML you can use org.argouml.your.package.name where your.package.name is the name of your addition.

6.3.2. How do I ...?

  • ...create a new source-code module.

    Suggestion, copy from the menutest module as described here.

    Make a copy of argouml/modules/menutest into argouml/modules/your name.

    Add any jar you need to argouml/modules/your name/lib and add references to each of the jars in argouml/modules/your name/build.xml.

    Edit argouml/modules/your name/module.properties

    Edit argouml/modules/your name/src/org/manifest.mf.

    Reorganize the source files as necessary. Remove the directory argouml/modules/your name/src/org/argouml/ui and create your own classes like org.argouml.your package name in argouml/modules/your name/src/org/argouml/your package name.

  • ...get Argo to use a plug-in?

    [Note]Note

    This description is for the old module loader.

    Once you've created a jar file with a plug-in in it, you need to make sure that Argo can find the jar to be able to execute it.

    If you are using a "standard" ArgoUML source structure, then you should be able to execute build install or ant install in the source directory of the plug-in. This will copy the jar file to the proper directory in the main ArgoUML build target. You can test your plug-in by running build run in the src_new directory.

    If you need to install the jar "the hard way", try the following steps.

    • Start up ArgoUML.

    • Go to the menu Edit->Settings and look at the Environment tab. Find the entry labeled ${argo.ext.dir}. Create that directory if it does not already exist.

    • Copy the plug-in jar and any other jars required by it into that directory.

    • Start up ArgoUML again, and you should see the plug-in's startup banner (if it has one, of course).