loading my icons ....

loading my icons ....

Postby cdbirge » Wed Oct 27, 2004 11:35 pm

I have some troubles loading my icons.
I define my resource boundle class and the properties files and this work fine. But the icon with i define, can´t be loaded. I add the directory with my images too : PoseidonResourceConnector.addResourceLocation(...) pointing to my icon´s folder.

ie: i define in my property file this:
(my icon´s name is createDiagram.png)
but i got this error:
Cannot find icon: createDiagram

what step i miss? how i do to load my icons?

I define a new SimpleInfoType too, to create my own diagram type, extending ActionNewDiagram, but i have a similar error, can load my icon, and trows this warm too:
WARN [main]: Unknown typeInfo for SimpleSemanticModelElement: MY_DIAGRAM

what i have to do?

thanks in advance!!
Christian Birgé
Posts: 1
Joined: Sat Oct 16, 2004 6:26 pm
Location: Argentina

Re: loading my icons ....

Postby beth » Thu Oct 28, 2004 10:16 am

You have to use a method of PoseidonResourceConnector, to make you image package known to Poseidon:
PoseidonResourceConnector.addResourceLocation(String filepath, ClassLoader loader)

E.g. our requirements plugin uses this call to register its images:
PoseidonResourceConnector.addResourceLocation("com/gentleware/requirements/images", RequirementsInstall.class.getClassLoader());

After than you can reference an icon com/gentleware/requirements/images/Foo.png by just referencing its name without path and extension in the properties file:

Sorry, for the bad API documentation...

I think you can safely ignore the warning about the unknown type info. It's just a safety measure to alert that a non-standard type info is used.
Site Admin
Posts: 0
Joined: Tue Feb 20, 2007 3:39 pm

Return to Plug-Ins

Who is online

Users browsing this forum: No registered users and 1 guest