Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » png icons
png icons [message #513598] Wed, 10 February 2010 16:36 Go to next message
Martin Tauber is currently offline Martin TauberFriend
Messages: 122
Registered: July 2009
Senior Member
Hurray I'm moving forward. I asked my designer to create some fancy
icons for my model so that I can replace the default icons provided by
emf. Now this guy delivered png icons instead of gifs. I didn't find a
way to tell the emf.edit code generator or the resourceLocator to search
for png icons?

Thanks
Martin
Re: png icons [message #513603 is a reply to message #513598] Wed, 10 February 2010 16:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080601060705080206010104
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Martin,

If the image name includes and extension we won't automatically add the
".gif" extension. I.e., we do this in DelegatingResourceLocator.

protected static String extensionFor(String key)
{
String result = ".gif";
int index = key.lastIndexOf('.');
if (index != -1)
{
String extension = key.substring(index + 1);
if ("png".equalsIgnoreCase(extension) ||
"gif".equalsIgnoreCase(extension) ||
"bmp".equalsIgnoreCase(extension) ||
"ico".equalsIgnoreCase(extension) ||
"jpg".equalsIgnoreCase(extension) ||
"jpeg".equalsIgnoreCase(extension) ||
"tif".equalsIgnoreCase(extension) ||
"tiff".equalsIgnoreCase(extension))
{
result = "";
}
}
return result;
}


Martin Tauber wrote:
> Hurray I'm moving forward. I asked my designer to create some fancy
> icons for my model so that I can replace the default icons provided by
> emf. Now this guy delivered png icons instead of gifs. I didn't find a
> way to tell the emf.edit code generator or the resourceLocator to
> search for png icons?
>
> Thanks
> Martin

--------------080601060705080206010104
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Martin,<br>
<br>
If the image name includes and extension we won't automatically add the
".gif" extension.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: png icons [message #513608 is a reply to message #513598] Wed, 10 February 2010 16:46 Go to previous message
Martin Tauber is currently offline Martin TauberFriend
Messages: 122
Registered: July 2009
Senior Member
ok found it, you just have to override the getImage method in the
itemProvider and add the appropriate file extension.

Am 10.02.10 17:36, schrieb Martin Tauber:
> Hurray I'm moving forward. I asked my designer to create some fancy
> icons for my model so that I can replace the default icons provided by
> emf. Now this guy delivered png icons instead of gifs. I didn't find a
> way to tell the emf.edit code generator or the resourceLocator to search
> for png icons?
>
> Thanks
> Martin
Previous Topic:[Teneo, GMF] Notes from hibernate have model element attached
Next Topic:[Announce] Eclipse/OMG Symposium 2010
Goto Forum:
  


Current Time: Mon Sep 23 15:50:38 GMT 2024

Powered by FUDForum. Page generated in 0.04273 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top