Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Copy GEF diagram as WMF?
Copy GEF diagram as WMF? [message #194961] Tue, 06 September 2005 19:42 Go to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Does the GEF have support to copy a diagram as a WMF (Windows Meta File) via
the clipboard to another application? Or maybe this is part of SWT?
Re: Copy GEF diagram as WMF? [message #195205 is a reply to message #194961] Thu, 08 September 2005 17:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

Sorry, no.

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dfkr6e$qs$1@news.eclipse.org...
> Does the GEF have support to copy a diagram as a WMF (Windows Meta File)
via
> the clipboard to another application? Or maybe this is part of SWT?
>
>
Re: Copy GEF diagram as WMF? [message #195388 is a reply to message #195205] Fri, 09 September 2005 17:40 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Is that no to both questions or just the first one?

"Pratik Shah" <none@unknown.com> wrote in message
news:dfpr3h$juj$1@news.eclipse.org...
> Sorry, no.
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:dfkr6e$qs$1@news.eclipse.org...
>> Does the GEF have support to copy a diagram as a WMF (Windows Meta File)
> via
>> the clipboard to another application? Or maybe this is part of SWT?
>>
>>
>
>
Re: Copy GEF diagram as WMF? [message #195433 is a reply to message #195388] Fri, 09 September 2005 18:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

I think SWT is irrelevant since you're trying to capture Draw2d figures.
You can ask on the SWT newsgroup to be sure, but AFAIK there's no such
support in SWT either.

You can, however, capture the GEF diagram as an Image. So you might want to
see if you can find a converter that can convert the image into the WMF
format.

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dfsh6f$gl$1@news.eclipse.org...
> Is that no to both questions or just the first one?
>
> "Pratik Shah" <none@unknown.com> wrote in message
> news:dfpr3h$juj$1@news.eclipse.org...
> > Sorry, no.
> >
> > "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> > news:dfkr6e$qs$1@news.eclipse.org...
> >> Does the GEF have support to copy a diagram as a WMF (Windows Meta
File)
> > via
> >> the clipboard to another application? Or maybe this is part of SWT?
> >>
> >>
> >
> >
>
>
Re: Copy GEF diagram as WMF? [message #195448 is a reply to message #195433] Fri, 09 September 2005 19:06 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
An image would be better than nothing, could you point me to the right
place?

The nice thing about WMF is that it is a vector-based format, so conversion
of an image to WMF should not be possible.

"Pratik Shah" <none@unknown.com> wrote in message
news:dfsjqj$3u1$1@news.eclipse.org...
>I think SWT is irrelevant since you're trying to capture Draw2d figures.
> You can ask on the SWT newsgroup to be sure, but AFAIK there's no such
> support in SWT either.
>
> You can, however, capture the GEF diagram as an Image. So you might want
> to
> see if you can find a converter that can convert the image into the WMF
> format.
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:dfsh6f$gl$1@news.eclipse.org...
>> Is that no to both questions or just the first one?
>>
>> "Pratik Shah" <none@unknown.com> wrote in message
>> news:dfpr3h$juj$1@news.eclipse.org...
>> > Sorry, no.
>> >
>> > "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
>> > news:dfkr6e$qs$1@news.eclipse.org...
>> >> Does the GEF have support to copy a diagram as a WMF (Windows Meta
> File)
>> > via
>> >> the clipboard to another application? Or maybe this is part of SWT?
>> >>
>> >>
>> >
>> >
>>
>>
>
>
Re: Copy GEF diagram as WMF? [message #195716 is a reply to message #195448] Tue, 13 September 2005 07:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: markus.nosse.gmx.net

Hi,

I have implemented a function to save a gef viewer as an image. One
possibility is to create an (SWT) image in memory and paint the figure you
want into this image. Here is how I did it:

ScrollingGraphicalViewer viewer = ...;
// get printable layers, only those will be included in the image
LayerManager lm =
(LayerManager)viewer.getEditPartRegistry().get(LayerManager. ID);
IFigure f = lm.getLayer(LayerConstants.PRINTABLE_LAYERS);

// use SWT features to capture the image
Image capture = new Image(viewer.getControl().getDisplay(),
f.getBounds().width, f.getBounds().height);
GC imageGC = new GC(capture);
Graphics graphics = new SWTGraphics(imageGC);
f.paint(graphics);

// save captured image to a file. again, this is SWT.
// Note that in v2.1 not too many graphic formats are supported.
// Refer to the ImageLoader source code to learn more
try {
ImageLoader imageloader = new ImageLoader();
imageloader.data = new ImageData[1];
imageloader.data[0] = capture.getImageData();
imageloader.save(filename, SWT.IMAGE_BMP);
} finally {
graphics.dispose();
imageGC.dispose();
capture.dispose();
}

-- markus
Re: Copy GEF diagram as WMF? [message #195753 is a reply to message #195716] Tue, 13 September 2005 13:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Markus" <markus.nosse@gmx.net> wrote in message
news:575e57d9bd925b92558b042a83a09ced$1@www.eclipse.org...
> Hi,
>
> I have implemented a function to save a gef viewer as an image. One
> possibility is to create an (SWT) image in memory and paint the figure you
> want into this image. Here is how I did it:
>
[snip]

GEF already does this.
See org.eclipse.draw2d.parts.ScrollableThumbnal, specifically the
SelectorFigure inner class.
---
Sunil
Re: Copy GEF diagram as WMF? [message #201333 is a reply to message #195753] Mon, 31 October 2005 16:51 Go to previous messageGo to next message
benedict heal is currently offline benedict healFriend
Messages: 28
Registered: July 2009
Junior Member
For saving the image to the clipboard in BMP format, there is a very
useful data transfer class written by Philip Schatz at:

http://www.philschatz.com/space/ImageDataTransfer/

Benedict



Sunil Kamath wrote:
> "Markus" <markus.nosse@gmx.net> wrote in message
> news:575e57d9bd925b92558b042a83a09ced$1@www.eclipse.org...
>
>>Hi,
>>
>>I have implemented a function to save a gef viewer as an image. One
>>possibility is to create an (SWT) image in memory and paint the figure you
>>want into this image. Here is how I did it:
>>
>
> [snip]
>
> GEF already does this.
> See org.eclipse.draw2d.parts.ScrollableThumbnal, specifically the
> SelectorFigure inner class.
> ---
> Sunil
>
>
Re: Copy GEF diagram as WMF? [message #202428 is a reply to message #194961] Wed, 09 November 2005 16:21 Go to previous messageGo to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 313
Registered: July 2009
Senior Member
Maybe you'll find this useful:

http://sourceforge.net/projects/tritos

It's not WMF but its successor EMF (not to be mistaken with Eclipse
Modeling Framework ;) ). Of course, it's only working with Win32.

Jens
Re: Copy GEF diagram as WMF? [message #243415 is a reply to message #201333] Fri, 06 June 2008 03:51 Go to previous message
Eclipse UserFriend
Originally posted by: nhadt.cybersoft-vn.com

Dear all,

Does someone know what is the license for Image data transfer written by
Philip Schatz?

Thanks a lot,
Nha Dang

benedict heal wrote:
>
> For saving the image to the clipboard in BMP format, there is a very
> useful data transfer class written by Philip Schatz at:
>
> http://www.philschatz.com/space/ImageDataTransfer/
>
> Benedict
>
>
>
> Sunil Kamath wrote:
>> "Markus" <markus.nosse@gmx.net> wrote in message
>> news:575e57d9bd925b92558b042a83a09ced$1@www.eclipse.org...
>>
>>> Hi,
>>>
>>> I have implemented a function to save a gef viewer as an image. One
>>> possibility is to create an (SWT) image in memory and paint the
>>> figure you want into this image. Here is how I did it:
>>>
>>
>> [snip]
>>
>> GEF already does this.
>> See org.eclipse.draw2d.parts.ScrollableThumbnal, specifically the
>> SelectorFigure inner class.
>> ---
>> Sunil
>>
Previous Topic:Zest's GraphNode#initFigure() and Graph#registerItem() called twice unnecessarily?
Next Topic:Problems with GEF diagram editor in a ViewPart
Goto Forum:
  


Current Time: Tue Apr 23 17:04:33 GMT 2024

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

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

Back to the top