Skip to main content



      Home
Home » Modeling » EMF » What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore model?
What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore model? [message #1728615] Tue, 05 April 2016 17:48 Go to next message
Eclipse UserFriend
What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore model?
Re: What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore mo [message #1728649 is a reply to message #1728615] Wed, 06 April 2016 05:00 Go to previous messageGo to next message
Eclipse UserFriend
Paul,

It depends on what you're trying to accomplish. So you really want a
reference to an image? Or do you want to encode the bytes for the
image's representation into the model's serialized data?


On 05.04.2016 23:48, Paul Roubekas wrote:
> What is best practice for referencing an external graphic (pjeg, jif,
> etc...) in a EMF .ecore model?
Re: What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore mo [message #1728659 is a reply to message #1728649] Wed, 06 April 2016 06:42 Go to previous messageGo to next message
Eclipse UserFriend
Encode the bytes for the image's representation into the model's serialized data.
Re: What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore mo [message #1728668 is a reply to message #1728659] Wed, 06 April 2016 07:34 Go to previous message
Eclipse UserFriend
Paul,

I think how you do represent will depend on how you intend to use the
image data later on in the application. Certainly all image formats can
be represented as bytes in a file so you could just use EByteArray. Of
course you'd want a nice cell editor that would would let you load an
image from the file system and to show the image represented by the data
type.

https://wiki.eclipse.org/EMF/Recipes#Recipe:_Create_your_own_property_editor_in_a_generated_application

As an example, if the goal is to create an SWT image, it has this
constructor:

org.eclipse.swt.graphics.Image.Image(Device, InputStream)

So you could use
java.io.ByteArrayInputStream.ByteArrayInputStream(byte[]) to wrap the
bytes stored by the data type into an input stream that could in turn be
used to create an Image when needed.


On 06.04.2016 12:42, Paul Roubekas wrote:
> Encode the bytes for the image's representation into the model's
> serialized data.
Previous Topic:IFileStore for my EMF Resource
Next Topic:Read-only properties without ItemPropertyDescriptor
Goto Forum:
  


Current Time: Tue Jul 08 09:55:40 EDT 2025

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

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

Back to the top