Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF @ distributed app
GEF @ distributed app [message #216430] Thu, 18 May 2006 11:44 Go to next message
Eclipse UserFriend
Originally posted by: caxqueiroz.gmail.com

I am trying to extend a GEF based diagram app to work between peers. Two
users working simultaneously thru a network connection.
Anyone knows how can I capture events like, position, which figure is
selected, etc?

I am using FigureListener to capture figure moving changes, but I still
need get in which position it is, to serialise and send thru network.
Even though I am getting moving changes, for each movement I do using
mouse, I get five events, I have added FigureListener when figure is
created (inside correspondent EditPart) is it right?

are There others ways to do it?


thx,

cax
Re: GEF @ distributed app [message #216444 is a reply to message #216430] Thu, 18 May 2006 07:47 Go to previous messageGo to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
Well, I don't know if it is the best solution but, I think you can capture the
changes of your model elements in the implementation of

protected void firePropertyChange(String property, Object oldValue, Object newValue)

(in the gef diagram example, it would be ModelElement.firePropertyChange(...).
There you can notify all changes that occurs in the editor to other "users".

(very well design GEF has! congratulations to authors!)

On Thu, 18 May 2006 21:44:09 +1000
cax <caxqueiroz@gmail.com> wrote:

> I am trying to extend a GEF based diagram app to work between peers. Two
> users working simultaneously thru a network connection.
> Anyone knows how can I capture events like, position, which figure is
> selected, etc?
>
> I am using FigureListener to capture figure moving changes, but I still
> need get in which position it is, to serialise and send thru network.
> Even though I am getting moving changes, for each movement I do using
> mouse, I get five events, I have added FigureListener when figure is
> created (inside correspondent EditPart) is it right?
>
> are There others ways to do it?
>
>
> thx,
>
> cax
Re: GEF @ distributed app [message #216466 is a reply to message #216444] Thu, 18 May 2006 14:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: caxqueiroz.gmail.com

Sebastian Gurin wrote:
> Well, I don't know if it is the best solution but, I think you can capture the
> changes of your model elements in the implementation of
>
> protected void firePropertyChange(String property, Object oldValue, Object newValue)
>
> (in the gef diagram example, it would be ModelElement.firePropertyChange(...).
> There you can notify all changes that occurs in the editor to other "users".
>
> (very well design GEF has! congratulations to authors!)
>
> On Thu, 18 May 2006 21:44:09 +1000
> cax <caxqueiroz@gmail.com> wrote:
>
>> I am trying to extend a GEF based diagram app to work between peers. Two
>> users working simultaneously thru a network connection.
>> Anyone knows how can I capture events like, position, which figure is
>> selected, etc?
>>
>> I am using FigureListener to capture figure moving changes, but I still
>> need get in which position it is, to serialise and send thru network.
>> Even though I am getting moving changes, for each movement I do using
>> mouse, I get five events, I have added FigureListener when figure is
>> created (inside correspondent EditPart) is it right?
>>
>> are There others ways to do it?
>>
>>
>> thx,
>>
>> cax
Thx for replying, very useful info.
But I still need capture when users is moving figures or lines, is it
possible?
Using that method I only get when change is done, not when is in progress.

thx,

cax
Re: GEF @ distributed app [message #216474 is a reply to message #216466] Thu, 18 May 2006 10:34 Go to previous messageGo to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
On Fri, 19 May 2006 00:11:12 +1000
cax <caxqueiroz@gmail.com> wrote:

> Sebastian Gurin wrote:
> > Well, I don't know if it is the best solution but, I think you can capture the
> > changes of your model elements in the implementation of
> >
> > protected void firePropertyChange(String property, Object oldValue, Object newValue)
> >
> > (in the gef diagram example, it would be ModelElement.firePropertyChange(...).
> > There you can notify all changes that occurs in the editor to other "users".
> >
> > (very well design GEF has! congratulations to authors!)
> >
> > On Thu, 18 May 2006 21:44:09 +1000
> > cax <caxqueiroz@gmail.com> wrote:
> >
> >> I am trying to extend a GEF based diagram app to work between peers. Two
> >> users working simultaneously thru a network connection.
> >> Anyone knows how can I capture events like, position, which figure is
> >> selected, etc?
> >>
> >> I am using FigureListener to capture figure moving changes, but I still
> >> need get in which position it is, to serialise and send thru network.
> >> Even though I am getting moving changes, for each movement I do using
> >> mouse, I get five events, I have added FigureListener when figure is
> >> created (inside correspondent EditPart) is it right?
> >>
> >> are There others ways to do it?
> >>
> >>
> >> thx,
> >>
> >> cax
> Thx for replying, very useful info.
> But I still need capture when users is moving figures or lines, is it
> possible?
> Using that method I only get when change is done, not when is in progress.
>

You are right. I think you can capture this events in your LayoutEditPolicy
(the layout role installed in your contents edit part). In the shapes gef
example this class is
org.eclipse.gef.examples.shapes.parts.DiagramEditPart.Shapes XYLayoutEditPolicy

in the methods createChangeConstraintCommand(...) you can obtain the new
component's position with request.getLocation()

also, you can obtain many other changes of your editor elements in
other EditPolicies

hope this will be useful.

> thx,
>
> cax
Re: GEF @ distributed app [message #216490 is a reply to message #216430] Thu, 18 May 2006 23:32 Go to previous message
Eclipse UserFriend
Originally posted by: zx.us.ibm.com

http://www.eclipse.org/ecf has an example that uses a shared graphical
editor.

Cheers,

~ Chris
Previous Topic:Is GEF the right framework for us?
Next Topic:Keybinding in GEF ContentOutlinePage
Goto Forum:
  


Current Time: Mon Jan 20 05:37:50 GMT 2025

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

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

Back to the top