Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Using SWT control as figure in GEF editor
Using SWT control as figure in GEF editor [message #212514] Fri, 24 March 2006 15:53 Go to next message
Eclipse UserFriend
Originally posted by: gflower.bk.ru

Hi,

How to paint a figure containing SWT control (for example button) for using
in graphical editor based on GEF?

Thanks in advance,
George
Re: Using SWT control as figure in GEF editor [message #212522 is a reply to message #212514] Fri, 24 March 2006 18:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

George Meringov <gflower@bk.ru> wrote:
> Hi,
>
> How to paint a figure containing SWT control (for example button) for
> using in graphical editor based on GEF?
>
See how VE does it.

--
Sunil
Re: Using SWT control as figure in GEF editor [message #212861 is a reply to message #212522] Thu, 30 March 2006 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mateu.yabar.justinmind.com

Hi,

I'm also interested in this topic, but I've been looking at VE, but I
haven't found how it is done. Could any one be more specific?

Thanks


"Sunil Kamath" <sunil_kamath@nohotspammail.com> escribi
Re: Using SWT control as figure in GEF editor [message #212974 is a reply to message #212861] Fri, 31 March 2006 13:14 Go to previous messageGo to next message
Sebastian Gurin is currently offline Sebastian GurinFriend
Messages: 1
Registered: July 2009
Junior Member
Hi,

First of all, excuse me for my bad english.

Well, I'm also interested in putting GUI Widgets in the canvas of the
editor. I'm not concerned if they are swing or swt widgets. I looked in VE
source but couldn't find anything. Also, I don't want to ask this in the VE
newsgroup, since this is not a VE topic.

somebody has some idea/tips/docs/anything on how to do this?

Thanks on advance.

"exquisitus" <mateu.yabar@justinmind.com> wrote in news:e0g66i$b9$1
@utils.eclipse.org:

> Hi,
>
> I'm also interested in this topic, but I've been looking at VE, but I
> haven't found how it is done. Could any one be more specific?
>
> Thanks
>
>
> "Sunil Kamath" <sunil_kamath@nohotspammail.com> escribi
Re: Using SWT control as figure in GEF editor [message #212990 is a reply to message #212974] Fri, 31 March 2006 18:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

Sebasti
Re: Using SWT control as figure in GEF editor [message #212997 is a reply to message #212974] Fri, 31 March 2006 18:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adisesha.j.gmail.com

Sebastián Gurin wrote:
> Hi,
>
> First of all, excuse me for my bad english.
>
> Well, I'm also interested in putting GUI Widgets in the canvas of the
> editor. I'm not concerned if they are swing or swt widgets. I looked in VE
> source but couldn't find anything. Also, I don't want to ask this in the VE
> newsgroup, since this is not a VE topic.
>
> somebody has some idea/tips/docs/anything on how to do this?
>
> Thanks on advance.
>
> "exquisitus" <mateu.yabar@justinmind.com> wrote in news:e0g66i$b9$1
> @utils.eclipse.org:
>
>> Hi,
>>
>> I'm also interested in this topic, but I've been looking at VE, but I
>> haven't found how it is done. Could any one be more specific?
>>
>> Thanks
>>
>>
>> "Sunil Kamath" <sunil_kamath@nohotspammail.com> escribió en el mensaje
>> news:e01cco$6bf$1@utils.eclipse.org...
>>> George Meringov <gflower@bk.ru> wrote:
>>>> Hi,
>>>>
>>>> How to paint a figure containing SWT control (for example button) for
>>>> using in graphical editor based on GEF?
>>>>
>>> See how VE does it.
>>>
>>> --
>>> Sunil
>>>
>>
>
Have you looked at draw2d figures?. It has figures like 'Button' etc
which can be drawn on GEF editor.
regards,
Adi.
Re: Using SWT control as figure in GEF editor [message #214472 is a reply to message #212522] Mon, 17 April 2006 15:54 Go to previous messageGo to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
On Fri, 24 Mar 2006 13:05:08 -0500
"Sunil Kamath" <sunil_kamath@nohotspammail.com> wrote:

> George Meringov <gflower@bk.ru> wrote:
> > Hi,
> >
> > How to paint a figure containing SWT control (for example button) for
> > using in graphical editor based on GEF?
> >
> See how VE does it.

this is what Rich Kulp from eclipse.tools.ve newgroup tell me about how VE "puts"
swt and swing widgets in a GEF editor:

The VE doesn't add Swing/SWT to GEF. It uses IFigures and gets a
snapshot image of the Swing/SWT component and gives it to an IFigure
that takes an Image.

Greetings


>
> --
> Sunil
>
>
Re: Using SWT control as figure in GEF editor [message #214489 is a reply to message #214472] Tue, 18 April 2006 01:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

Sebastian Gurin <sgurin@montevideo.com.uy> wrote:
> On Fri, 24 Mar 2006 13:05:08 -0500
> "Sunil Kamath" <sunil_kamath@nohotspammail.com> wrote:
>
>> George Meringov <gflower@bk.ru> wrote:
>>> Hi,
>>>
>>> How to paint a figure containing SWT control (for example button)
>>> for using in graphical editor based on GEF?
>>>
>> See how VE does it.
>
> this is what Rich Kulp from eclipse.tools.ve newgroup tell me about
> how VE "puts" swt and swing widgets in a GEF editor:
>
> The VE doesn't add Swing/SWT to GEF. It uses IFigures and gets a
> snapshot image of the Swing/SWT component and gives it to an IFigure
> that takes an Image.
>
To be precise, it uses JNI to generate the control images.

--
Sunil
Re: Using SWT control as figure in GEF editor [message #214750 is a reply to message #212514] Fri, 21 April 2006 14:00 Go to previous messageGo to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
Hi. I have plublished in http://cancerbero.0moola.com/source/swingInGEF.zip
some classes that will allow you to show swing components (not swt yet) in a
GEF editor.

With the static prucedures in the class utils.swingInGEF.SwingSnapshoter
you can generate a SWT image or a GEF IFigure that is a snapshot of any swing
component. Then you can construct an IFigure that represent a swing component
in an editPart.

Notes: the proccess for generating a swtImage is:

JComponent --> awt.BufferedImage --> PNG memory stream --> swt Image

so it uses png as an intermediary (comon format) between awt and swt
this has the consecuence that the "snapshot" can be VERY INEFFICIENT
in cases where performance is important. So you should call this
"swing component snapshot" only when the contents of the swing control
changes, not even if size change (there you simply can redimension
the swt image itself: that would be speedy).

VE does something like that but with the diference that the transition
between the AWT BufferedImage and the SWT Image is more direct using
raster at byte level. So it is much more efficient. Lamentably, I
couldn't extract the part of VE that "take the snapshot".

hope be useful. this is free software. Use it as you whish



On Fri, 24 Mar 2006 18:53:06 +0300
"George Meringov" <gflower@bk.ru> wrote:

> Hi,
>
> How to paint a figure containing SWT control (for example button) for using
> in graphical editor based on GEF?
>
> Thanks in advance,
> George
>
>
Re: Using SWT control as figure in GEF editor [message #214766 is a reply to message #214750] Fri, 21 April 2006 21:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

Sebastian Gurin <sgurin@montevideo.com.uy> wrote:
> Hi. I have plublished in
> http://cancerbero.0moola.com/source/swingInGEF.zip some classes that
> will allow you to show swing components (not swt yet) in a GEF editor.
>
> With the static prucedures in the class
> utils.swingInGEF.SwingSnapshoter
> you can generate a SWT image or a GEF IFigure that is a snapshot of
> any swing component. Then you can construct an IFigure that represent
> a swing component in an editPart.
>
> Notes: the proccess for generating a swtImage is:
>
> JComponent --> awt.BufferedImage --> PNG memory stream --> swt Image
>
> so it uses png as an intermediary (comon format) between awt and swt
> this has the consecuence that the "snapshot" can be VERY INEFFICIENT
> in cases where performance is important. So you should call this
> "swing component snapshot" only when the contents of the swing control
> changes, not even if size change (there you simply can redimension
> the swt image itself: that would be speedy).
>
> VE does something like that but with the diference that the transition
> between the AWT BufferedImage and the SWT Image is more direct using
> raster at byte level. So it is much more efficient. Lamentably, I
> couldn't extract the part of VE that "take the snapshot".
>

VE uses JNI to take the snapshot. Look at the ImageCapture classes in
jbcfswtvmsrc.zip in the source plugin for VE. (This is in VE 1.1- it may
have changed in 1.2).
---
Sunil

> hope be useful. this is free software. Use it as you whish
>
>
>
> On Fri, 24 Mar 2006 18:53:06 +0300
> "George Meringov" <gflower@bk.ru> wrote:
>
>> Hi,
>>
>> How to paint a figure containing SWT control (for example button)
>> for using in graphical editor based on GEF?
>>
>> Thanks in advance,
>> George

--
Sunil
Re: Using SWT control as figure in GEF editor [message #214821 is a reply to message #212514] Mon, 24 April 2006 07:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mateu.yabar.justinmind.com

A way to do this is by implementing a editPart which, insted of returning
figures returns Widgets. You will have to implement also the viewer, and
rooteditPart, but with compy/paste from the original cose it woun't be much
work. I have done it and is working.

"George Meringov" <gflower@bk.ru> escribi
Re: Using SWT control as figure in GEF editor [message #214828 is a reply to message #214821] Mon, 24 April 2006 13:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

exquisitus <mateu.yabar@justinmind.com> wrote:
> A way to do this is by implementing a editPart which, insted of
> returning figures returns Widgets. You will have to implement also
> the viewer, and rooteditPart, but with compy/paste from the original
> cose it woun't be much work. I have done it and is working.
>

All very well, but GEF is supposed to be a lightweight editor. Creating
Widgets on the FigureCanvas makes it heavyweight.
And these heavyweight widgets are actually live- i.e., the Combos will drop
down when selected, Text controls can be typed into, Buttons can be clicked
or selected, etc.

> "George Meringov" <gflower@bk.ru> escribi
Re: Using SWT control as figure in GEF editor [message #215170 is a reply to message #214828] Thu, 27 April 2006 08:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mateu.yabar.justinmind.com

I don't know the diference between hevy and light, sorry. But the widgets
are live, exaclty as I wanted! If you only want the image, make a snapshot!
If you want the whole functionality this is a way.

"Sunil Kamath" <sunil_kamath@nohotspammail.com> escribi
Re: Using SWT control as figure in GEF editor [message #215273 is a reply to message #215170] Fri, 28 April 2006 17:10 Go to previous message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

exquisitus <mateu.yabar@justinmind.com> wrote:
> I don't know the diference between hevy and light, sorry. But the
> widgets are live, exaclty as I wanted! If you only want the image,
> make a snapshot! If you want the whole functionality this is a way.
>

What "whole functionality" do you get by adding heavyweight widgets to your
figure canvas?
The widgets don't actually do anything, do they?
Also, GEF will not be able to draw on top of the heavyweight widgets.
e.g., if there is a guide line, it will pass behind the widget.
When you are dragging a figure and it passes over a heavywieght widget, the
selection feedback will not be seen.
If that's what you want, then you have the right strategy.
Excuse me for thinking that it defeats the whole purpose of a graphical
editing environment.

--
Sunil
Previous Topic:How to implement complex selections?
Next Topic:Problem with Child creation using the palette
Goto Forum:
  


Current Time: Fri Apr 26 23:52:43 GMT 2024

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

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

Back to the top