Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsUsing SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/212514/#msg_212514
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]]>2006-03-24T15:53:06-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/212522/#msg_212522
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]]>2006-03-24T18:05:08-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/212861/#msg_212861
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]]>2006-03-30T08:51:48-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/212974/#msg_212974
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?
> 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]]>Sebastian Gurin2006-03-31T13:14:18-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/212990/#msg_212990
Originally posted by: sunil_kamath.nohotspammail.com
Sebasti]]>2006-03-31T18:29:10-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/212997/#msg_212997
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.]]>2006-03-31T18:38:42-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/214472/#msg_214472
"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
>
>]]>Sebastián Gurin2006-04-17T15:54:48-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/214489/#msg_214489
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]]>2006-04-18T01:47:35-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/214750/#msg_214750
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.
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
>
>]]>Sebastián Gurin2006-04-21T14:00:33-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/214766/#msg_214766
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]]>2006-04-21T21:26:20-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/214821/#msg_214821
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]]>2006-04-24T07:25:14-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/214828/#msg_214828
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]]>2006-04-24T13:58:32-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/215170/#msg_215170
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]]>2006-04-27T08:31:57-00:00Re: Using SWT control as figure in GEF editor
https://www.eclipse.org/forums/index.php/mv/msg/67733/215273/#msg_215273
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.