Hi Fabrice,

in the C++ module there are 2 types of resources added:
 * within the argo_cpp.jar - image files, one properties file and one 
XMI file;
 * a dependency on the anarres-cpp library which is added as an 
extension to ArgoUML.

Depending on what you want to do - adding resources within the 
argopdf.jar or on its own jar, you will have to do things differently.

anarres-cpp.jar is loaded first than argo_cpp.jar because the module 
loader does it in ascending alphabetic order (for now and AFAIK this 
isn't guaranteed to continue to be as such).

For the other resources, they should be placed in a directory within 
your sources ("src") and then you can use something like (see 
FigNodeStrategyCpp.java):
    /**
     * @param name of the icon file without path and without extension -
     *        will be loaded from "org/argouml/Images/<name>.gif".
     * @return the ImageIcon with the icon of null if a file with the given
     *         name isn't found.
     */
    private ImageIcon loadIcon(String name) {
        URL imagePath = NormalProfileCpp.class.getClassLoader()
            .getResource("org/argouml/Images/" + name + ".gif");
        ImageIcon icon = null;
        if (imagePath != null)
            icon = new ImageIcon(imagePath);
        return icon;
    }

Luis Sergio Oliveira

Fabrice PIERRE wrote:
> It is hard to test. All that follows is unfortunately a guess (I do 
> not know enough on manifests usage).
>
> In my argouml distribution, in the argoUML jar file, the manifest 
> contains :
>
> Manifest-Version: 1.0
> Ant-Version: Apache Ant 1.7.0
> Created-By: 1.2 (Sun Microsystems Inc.)
> Main-Class: org.argouml.application.Main
> Class-Path: antlr-2.7.7.jar argouml-mdr.jar argouml-model.jar argouml.
>  jar commons-logging-1.0.2.jar ext/anarres-cpp-no-dependencies-1.2.3.j
>  ar ext/antlr-2.7.7.jar ext/antlr-runtime-3.1.1.jar ext/argo_cpp.jar e
>  xt/argo_idl.jar ext/argo_java.jar ext/argo_php.jar ext/argouml-csharp
>  .jar ext/argouml-diagrams-sequence.jar ext/argouml-i18n-de.jar ext/ar
>  gouml-i18n-en_GB.jar ext/argouml-i18n-es.jar ext/argouml-i18n-fr.jar
>  ext/argouml-i18n-it.jar ext/argouml-i18n-nb.jar ext/argouml-i18n-pt.j
>  ar ext/argouml-i18n-pt_BR.jar ext/argouml-i18n-ru.jar ext/argouml-i18
>  n-zh.jar ext/argouml-sql.jar gef-0.13.jar java-interfaces.jar jmi.jar
>   jmiutils.jar log4j-1.2.6.jar mdrapi.jar mof.jar nbmdr.jar ocl-argo-1
>  .1.jar openide-util.jar swidgets-0.1.4.jar toolbar-1.4.1-20071227.jar
>
> The "argo_cpp.jar" is known in the classpath, the property file in 
> this jar can be loaded.
> The "cpp_de.properties" file is in the "i18n-de" jar file, also in the 
> classpath.
>
> I can try to modify dynamically the classpath during loadmodule 
> operation (using code or the module manifest file).
> Do you think it is a good thing ?
>
> Thanks,
> Fabrice.
>
> ------------------------------------------------------------------------
> *De :* Bob Tarling <[email protected]>
> *À :* [email protected]
> *Envoyé le :* Lundi, 14 Septembre 2009, 11h44mn 41s
> *Objet :* Re: Re : [argouml-dev] Help on argopdf module
>
> Please get back to us if you can't work this out from the examples there.
>
> Regards
>
> Bob.
>
>
> 2009/9/14 Fabrice PIERRE <[email protected] <mailto:[email protected]>>:
> > Thank you.
> > I'm going to build the cpp dll on my environment to check what happends.
> >
> > Fabrice.
> >
> > ________________________________
> > De : Linus Tolke <[email protected] <mailto:[email protected]>>
> > À : [email protected] <mailto:[email protected]>
> > Envoyé le : Lundi, 14 Septembre 2009, 7h00mn 51s
> > Objet : Re: [argouml-dev] Help on argopdf module
> >
> > This is done by the argouml-cpp module.
> >
> >         /Linus
> >
> > 2009/9/13 Bob Tarling <[email protected] 
> <mailto:[email protected]>>
> >>
> >> I assume there is some way for module writers to add their own
> >> resource files. I'm not familiar off hand though.
> >>
> >> Do we have any other module writers on the list who have done this 
> before?
> >>
> >> Bob
> >>
> >> 2009/9/7 Fabrice PIERRE <[email protected] 
> <mailto:[email protected]>>:
> >> > Hello.
> >> >
> >> > I'm working on ArgoPDF module for ArgoUML 0.28.1.
> >> > I encounter a big problem with the bundle file. It may be due to my
> >> > development  environment (bad manifest file or so on).
> >> >
> >> > If someone can help me...
> >> > Thank you very much.
> >> > Fabrice.
> >> >
> >> > Here is the stack trace :
> >> >
> >> > 2009-09-02 16:50:22,914  INFO: Loading module
> >> > org.argouml.ui.argopdf.ArgoPDFMenuPlugin (ModuleLoader2.java:693)
> >> > 2009-09-02 16:50:22,930 DEBUG: Loading org.argouml.i18n.argopdf
> >> > (Translator.java:251)
> >> > 2009-09-02 16:50:22,930 DEBUG: Resource org.argouml.i18n.argopdf not
> >> > found in the default class loader. (Translator.java:255)
> >> > 2009-09-02 16:50:22,930 DEBUG: Loading org.argouml.i18n.argopdf from
> >> > java.net.urlclassloa...@39bf12 (Translator.java:262)
> >> > 2009-09-02 16:50:22,945 DEBUG: Resource org.argouml.i18n.argopdf not
> >> > found in java.net.urlclassloa...@39bf12 (Translator.java:269)
> >> > 2009-09-02 16:50:22,945 DEBUG: Loading org.argouml.i18n.argopdf from
> >> > java.net.urlclassloa...@9c6201 (Translator.java:262)
> >> > 2009-09-02 16:50:22,945 DEBUG: Resource org.argouml.i18n.argopdf not
> >> > found in java.net.urlclassloa...@9c6201 (Translator.java:269)
> >> > 2009-09-02 16:50:22,945 DEBUG: Loading org.argouml.i18n.argopdf from
> >> > java.net.urlclassloa...@d713fe (Translator.java:262)
> >> > 2009-09-02 16:50:22,945 DEBUG: Resource org.argouml.i18n.argopdf not
> >> > found in java.net.urlclassloa...@d713fe (Translator.java:269)
> >> > 2009-09-02 16:50:22,945 DEBUG: Bundle (argopdf) for resource
> >> > argopdf.dialog.top.panel.path.label not found. (Translator.java:336)
> >> > 2009-09-02 16:50:22,945 DEBUG: Bundle (argopdf) for resource
> >> > argopdf.dialog.tab.general.name not found. (Translator.java:336)

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

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