Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 21:48 Go to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore model?

Oxygen 3a
Windows 10
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 09:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
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?


Ed Merks
Professional Support: https://www.macromodeling.com/
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 10:42 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
Encode the bytes for the image's representation into the model's serialized data.

Oxygen 3a
Windows 10
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 11:34 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:IFileStore for my EMF Resource
Next Topic:Read-only properties without ItemPropertyDescriptor
Goto Forum:
  


Current Time: Sun May 12 18:15:53 GMT 2024

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

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

Back to the top