Hello,
when implementing the C++ notation I had a similar problem to load the icon
for the C++ notation.
I couldn't reuse the ArgoUML resource loader, but, it is something very easy
to do:
ImageIcon loadIcon() {
URL iconUrl = NotationModuleCpp.class.getClassLoader().getResource(
"org/argouml/Images/CppNotation.gif");
assert iconUrl != null;
ImageIcon icon = new ImageIcon(iconUrl);
assert icon != null;
return icon;
}
// org/argouml/Images/CppNotation.gif is contained in the C++ module jar.
(from
http://argouml-cpp.tigris.org/source/browse/argouml-cpp/trunk/src/org/argouml/language/cpp/notation/NotationModuleCpp.java?view=markup
and http://argonauts-life.blogspot.com/2007/04/making-icons-for-argouml.html
)
Hope it helps,
Luis
PS: anyway, raising an issue might be good to avoid code duplication - DRY
principle (http://c2.com/xp/OnceAndOnlyOnce.html).
On 7/19/07, David Orejuela <[EMAIL PROTECTED]> wrote:
ok very thanks
2007/7/19, Bob Tarling <[EMAIL PROTECTED]>:
>
> I would suggest that, just for the moment you share the ArgoUML
> namespace just for your icons.
>
> Then raise an issue to try and get this resolved in the long term.
>
> Bob.
>
>
> On 19/07/07, David Orejuela < [EMAIL PROTECTED]> wrote:
> > It's true, in ResourceLoaderWrapper is the code that defines the
> resource
> > locations (initResourceLoader,
> > ResourceLoader.addResourceLocation).
> >
> > But in my plugin I have my own wrapper, MacmasResouceLoaderWrapper,
> that
> > adds extra locations. The code is executed, but it has no effect, but
> if I
> > get the line of code and move to the ResourceLoaderWrapper all works
> fine.
> >
> >
> >
> > 2007/7/19, Bob Tarling <[EMAIL PROTECTED]>:
> > >
> > > I don't have the code available to check right now but purely from
> > memory....
> > >
> > > Look for a class named something like ResourceLoader (there may be a
> > > few of these, the one required is in one of the ArgoUML packages). I
>
> > > can't remeber if this is a singleton but you need to find where
> > > ArgoUML gets its single instance.
> > >
> > > There should be a method on there something like addDirectory or
> > > addLocation where you can specify an extra path of your own to scan
> > > for icons.
> > >
> > > Bob
> > >
> > >
> > >
> > > On 19/07/07, David Orejuela
> > < [EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > > I'm developing a plugin for ArgoUML, when I launched it with
> argouml
> > binary
> > > > files I had problems with the plugin package names so I
> refactored the
> > > > plugin and changued the package names.
> > > >
> > > > Now I have some problems with the images. I have changed the
> Resource
> > Loader
> > > > references to the new location of the images, but they don't
> appear. If
> > I
> > > > put them in the original location they are shown correctly. I
> don't find
> > > > other references in the project to this images.
> > > >
> > > > The questions are:
> > > > Is there any restriction with the icon package location?
> > > >
> > > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>