Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Is it possible to provide a Screen Capture functionality in GEF editors?
Is it possible to provide a Screen Capture functionality in GEF editors? [message #245597] Thu, 18 September 2008 14:06 Go to next message
Eclipse UserFriend
Originally posted by: ashar.kpitcummins.com

Hi,

We have a graphical editor for our domain model. The user will be able to
draw some diagrams on it and he will be able to generate a screen. But
right now there is a requirement to provide this editor with a capability
to capture the currently drawn screen using a screen capture button added
on the workbench menu bar. Something similar to the Acrobat Reader's
Capture button.

Can anyone give me any clues as how to do this or is it possible to do in
Eclipse?

The requirement is something like capturing the currently active graphical
editor's contents as an image.

I have come across something called Screen Capture or Snaps in MyEclipse
and as I have not explored what exactly it is... am not sure whether that
is something similar to what I am looking for to give an example of it.

Thank you in advance.

Asha R.
Re: Is it possible to provide a Screen Capture functionality in GEF editors? [message #245611 is a reply to message #245597] Thu, 18 September 2008 18:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: felix.mayer.erdas.com

With GEF, you can paint your root figure into a GC and then convert the
image into a format which could be put on the clipboard or written to a
file:

Rectangle bounds = figure.getBounds();
Image image = new Image( Display.getDefault(), bounds.width,
bounds.height );
GC gc = new GC( image );
Graphics graphics = new SWTGraphics( gc );
figure.paint( graphics );
graphics.dispose();
gc.dispose();


"Asha R" <ashar@kpitcummins.com> wrote in message
news:b1b850445b30a3bf9120a71ad9140f79$1@www.eclipse.org...
> Hi,
>
> We have a graphical editor for our domain model. The user will be able to
> draw some diagrams on it and he will be able to generate a screen. But
> right now there is a requirement to provide this editor with a capability
> to capture the currently drawn screen using a screen capture button added
> on the workbench menu bar. Something similar to the Acrobat Reader's
> Capture button.
>
> Can anyone give me any clues as how to do this or is it possible to do in
> Eclipse?
>
> The requirement is something like capturing the currently active graphical
> editor's contents as an image.
>
> I have come across something called Screen Capture or Snaps in MyEclipse
> and as I have not explored what exactly it is... am not sure whether that
> is something similar to what I am looking for to give an example of it.
>
> Thank you in advance.
>
> Asha R.
>
Re: Is it possible to provide a Screen Capture functionality in GEF editors? [message #245619 is a reply to message #245611] Fri, 19 September 2008 07:57 Go to previous messageGo to next message
Richard Adams is currently offline Richard AdamsFriend
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
In our application we have an 'image export' functionality which saves the
figure
in the gef editor to svg, bmp, jpg, gif. The GMF project has this
functionality,
which uses the apache batik project to convert swt graphics to image
formats.

We ended up pulling out the relevant code from the gmf project as we
didn't want to bloat our app with all the gmf/emf plugins.

If this approach is of interest to you I can provide further details of
getting the code from GMF.

Cheers
Richard


Re: Is it possible to provide a Screen Capture functionality in GEF editors? [message #245623 is a reply to message #245619] Fri, 19 September 2008 10:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ashar.kpitcummins.com

Hi,

@Felix: Thank you very much for your inputs. Seeing that I planned to
write a Utility Class and wanted to search for something more and got to
see this post
http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg1 4680.html,
which was exactly how I wanted my Utility Class to be! So, that was useful.

Later I saw the latest reply from Richards.

@Richards,
Thank you very much for your inputs, as well. It will be great if you can
provide us with the details as we have implemented our editor using GMF to
generate the code.

Kindly let me know the further details.

Thank you in adavnce.

Asha R.
Re: Is it possible to provide a Screen Capture functionality in GEF editors? [message #245626 is a reply to message #245623] Fri, 19 September 2008 11:26 Go to previous message
Eclipse UserFriend
Originally posted by: ashar.kpitcummins.com

Hi,

@Richard,

I found this option 'Save As Image' on the editor we have generated using
GMF. As there was not much documentation available for that we were not
aware of what it does! :)).
I guess the same option can be provided on the workbench menu bar as an
option in case of our requirement to provide some functionality similar to
screen capture :-).
If you have more detail about this please let me know.
Like,
While googling I got to know that 'Save as HTML' generates a set of images
on the editor and also the diagram itself. But I did not find anything
like that on the editor we have generated.
A bug related to that #160386 [
https://bugs.eclipse.org/bugs/show_bug.cgi?id=160386&que ry_format=specific&order=relevance+desc&bug_status=_ _open__
] on bugzilla says something like this...
"Clients that override GMF's UI for exporting diagrams to images have to
write
support code for 'Export to HTML' on the UI side if they wish to have it"
I did not get what is this exactly.
If you have more clarity on this please let me know.

For the sake giving more information on the premises of the requirement to
implement this feature, I would like to add, going forward, we have a
requirement to generate a slideshow of such images, from with in the
editor, using the Screen Capture imeplmented. So, probably knowing more
about this 'Save As HTML' or 'Export as HTML' would help us.

Thank you in advance.

Asha R.
Previous Topic:Select Palette entry in code
Next Topic:strange zest rendering in RCP?
Goto Forum:
  


Current Time: Thu Apr 25 05:01:25 GMT 2024

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

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

Back to the top