Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Mouse events in an IFigure
Mouse events in an IFigure [message #193417] Fri, 26 August 2005 07:47 Go to next message
Eclipse UserFriend
Originally posted by: dan.nicolici.nexource.ro

This is a multi-part message in MIME format.

------=_NextPart_000_002E_01C5AA2B.86F3D6D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Is it possible for an IFigure of an EditPart to intercept Mouse Events? =
If I add a MouseListener to the figure, it does not work, instead the =
EditPart gets these events.
What I want to achieve with this is the abillity to move IFigures =
contained in the EditPart's main IFigure with the mouse.

Thank you!
------=_NextPart_000_002E_01C5AA2B.86F3D6D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Is it possible for an IFigure of an =
EditPart to=20
intercept Mouse Events? If I&nbsp;add a MouseListener to the figure, it =
does not=20
work, instead the EditPart gets these events.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I want to achieve with this is the =
abillity to=20
move IFigures contained in the EditPart's main IFigure with the=20
mouse.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank you!</FONT></DIV></BODY></HTML>

------=_NextPart_000_002E_01C5AA2B.86F3D6D0--
Re: Mouse events in an IFigure [message #193446 is a reply to message #193417] Fri, 26 August 2005 08:21 Go to previous messageGo to next message
hanys is currently offline hanysFriend
Messages: 188
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_004C_01C5AA27.DCF4E2D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

all of the figures are moving with mouse :)
But the moving of figures is not done by mouse listener attached to the =
figure.

You must do this:
at your editpart you must install editpolicy which implements =
createChangeConstraintCommand, and byexecuting that command, the model =
of corresponding figure and editpart is changed and via listeners the =
figure position is changed by refreshVisuals called from editpart to =
that FIGURE :)

If you want know how to implement it
Look at the code located at:
http://www13.plala.or.jp/observe/GEF/

Here is gradually evolved example which can do moving with figures. :)
In the first example is error in plugin.xml file - there is one chineese =
character before the first character of the file.

Best Regards,
John Cage

------=_NextPart_000_004C_01C5AA27.DCF4E2D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>all of the figures are moving with =
mouse=20
:)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>But the moving of figures is not done =
by mouse=20
listener attached to the figure.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>You must do this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>at your editpart you must install =
editpolicy which=20
implements createChangeConstraintCommand, and byexecuting that command, =
the=20
model of corresponding figure and editpart is changed and via listeners =
the=20
figure position is changed by refreshVisuals called from editpart to =
that FIGURE=20
:)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If you want know how to implement =
it</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Look at the code located =
at:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"http://www13.plala.or.jp/observe/GEF/">http://www13.plala.or.jp/o=
bserve/GEF/</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here is <SPAN class=3Dvcb_rt><FONT=20
face=3D"Times New Roman" size=3D3>gradually evolved example which can do =
moving with=20
figures. :)</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=3Dvcb_rt>In the first example is error in =
plugin.xml file -=20
there is one chineese character before the first character of the=20
file.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3Dvcb_rt></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3Dvcb_rt>Best=20
Regards,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3Dvcb_rt>John =
Cage</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3Dvcb_rt></SPAN></FONT>&nbsp;</DIV></BODY></HTML >

------=_NextPart_000_004C_01C5AA27.DCF4E2D0--
Re: Mouse events in an IFigure [message #193454 is a reply to message #193417] Fri, 26 August 2005 08:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sgplkrsh.uiuc.edu

This is a multi-part message in MIME format.

------=_NextPart_000_016F_01C5AA45.51F9ADF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I think it's easier than that.=20

In the container's editpart, install a XYLayoutPolicy and override =
createChangeConstraintCommand(). This will kick in each time a child's =
bounds are adjusted (figure is moved). I haven't tried this specific =
case, but I suspect it'll work.

Subhash
"Dan Nicolici" <dan.nicolici@nexource.ro> wrote in message =
news:demhe2$9ib$1@news.eclipse.org...
Is it possible for an IFigure of an EditPart to intercept Mouse =
Events? If I add a MouseListener to the figure, it does not work, =
instead the EditPart gets these events.
What I want to achieve with this is the abillity to move IFigures =
contained in the EditPart's main IFigure with the mouse.

Thank you!
------=_NextPart_000_016F_01C5AA45.51F9ADF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I think it's easier than that. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In the container's editpart, install a=20
XYLayoutPolicy and override createChangeConstraintCommand(). This will =
kick in=20
each time a child's bounds are adjusted (figure is moved). I haven't =
tried this=20
specific case, but I suspect it'll work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Subhash</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Dan Nicolici" &lt;<A=20
=
href=3D"mailto:dan.nicolici@nexource.ro">dan.nicolici@nexource.ro</A>&gt;=
wrote=20
in message <A=20
=
href=3D"news:demhe2$9ib$1@news.eclipse.org">news:demhe2$9ib$1@news.eclips=
e.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Is it possible for an IFigure of an =
EditPart to=20
intercept Mouse Events? If I&nbsp;add a MouseListener to the figure, =
it does=20
not work, instead the EditPart gets these events.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I want to achieve with this is =
the abillity=20
to move IFigures contained in the EditPart's main IFigure with the=20
mouse.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank =
you!</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_016F_01C5AA45.51F9ADF0--
Re: Mouse events in an IFigure [message #193462 is a reply to message #193454] Fri, 26 August 2005 08:46 Go to previous messageGo to next message
Martijn van Steenbergen is currently offline Martijn van SteenbergenFriend
Messages: 16
Registered: July 2009
Junior Member
This only works if these child figures are actually EditParts on their
own. Every object you want the user to interact with (drag around, for
example), should probably correspond to its own EditPart.

The following links might be of help:

http://www-128.ibm.com/developerworks/opensource/library/os- gef/

http://publib.boulder.ibm.com/infocenter/wsad512/topic/org.e clipse.gef.doc.isv/reference/api/overview-summary.html
(scroll down a bit to see the article)

Good luck,

Martijn.

Subhash Gopalakrishnan wrote:
> In the container's editpart, install a XYLayoutPolicy and override
> createChangeConstraintCommand(). This will kick in each time a child's
> bounds are adjusted (figure is moved). I haven't tried this specific
> case, but I suspect it'll work.
Re: Mouse events in an IFigure [message #193470 is a reply to message #193417] Fri, 26 August 2005 09:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dan.nicolici.nexource.ro

This is a multi-part message in MIME format.

------=_NextPart_000_0081_01C5AA39.21B2C930
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I may have (may!) been missunderstood. Martijn has spoted what I wanted.
I want to move "child" figures contained in a "parent" IFigure. The =
child figures do not have EditParts of their own, but are part of the =
parent figure wich is returned in the EditPart's createFigure() method.
Pretty confusing, huh... I hope I could provide some more information =
regarding my question. Still looking for solutions...

Thank you!
------=_NextPart_000_0081_01C5AA39.21B2C930
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I may have (may!) been missunderstood. =
Martijn has=20
spoted what I wanted.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I want to move <STRONG>"child"</STRONG> =
figures=20
contained in a <STRONG>"parent"</STRONG>&nbsp;IFigure. The child figures =
do not=20
have EditParts of their own, but are part of the parent figure wich is =
returned=20
in the EditPart's createFigure() method.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Pretty confusing, huh... I&nbsp;hope I =
could=20
provide some more information regarding my question. Still looking for=20
solutions...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank you!</FONT></DIV></BODY></HTML>

------=_NextPart_000_0081_01C5AA39.21B2C930--
Re: Mouse events in an IFigure [message #193478 is a reply to message #193470] Fri, 26 August 2005 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sgplkrsh.uiuc.edu

This is a multi-part message in MIME format.

------=_NextPart_000_01C5_01C5AA55.996EE190
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

In my understanding, the edit parts are the UI elements that you can =
touch, feel and manipulate. The figures are only display structures =
which have no UI handling hooks. So, if the child figures do not have =
edit parts, what you are designing for is non-editable drawings within =
an editable drawing. Given that, you cannot move these non-editable =
drawings independant of the parent drawing. If you wanted that, you need =
to create edit-parts for them and install appropriate edit-policies in =
their parent's edit-part.

Subhash
"Dan Nicolici" <dan.nicolici@nexource.ro> wrote in message =
news:demn4l$h30$1@news.eclipse.org...
I may have (may!) been missunderstood. Martijn has spoted what I =
wanted.
I want to move "child" figures contained in a "parent" IFigure. The =
child figures do not have EditParts of their own, but are part of the =
parent figure wich is returned in the EditPart's createFigure() method.
Pretty confusing, huh... I hope I could provide some more information =
regarding my question. Still looking for solutions...

Thank you!
------=_NextPart_000_01C5_01C5AA55.996EE190
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>In my understanding, the edit parts are =
the UI=20
elements that you can touch, feel and manipulate. The figures are only =
display=20
structures which have no UI handling hooks. So, if the child figures do =
not have=20
edit parts, what you are designing for is non-editable drawings within =
an=20
editable drawing. Given that, you cannot move these non-editable =
drawings=20
independant of the parent drawing. If you wanted that, you need to =
create=20
edit-parts for them and install appropriate edit-policies in their =
parent's=20
edit-part.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Subhash</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Dan Nicolici" &lt;<A=20
=
href=3D"mailto:dan.nicolici@nexource.ro">dan.nicolici@nexource.ro</A>&gt;=
wrote=20
in message <A=20
=
href=3D"news:demn4l$h30$1@news.eclipse.org">news:demn4l$h30$1@news.eclips=
e.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>I may have (may!) been =
missunderstood. Martijn=20
has spoted what I wanted.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I want to move =
<STRONG>"child"</STRONG> figures=20
contained in a <STRONG>"parent"</STRONG>&nbsp;IFigure. The child =
figures do=20
not have EditParts of their own, but are part of the parent figure =
wich is=20
returned in the EditPart's createFigure() method.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Pretty confusing, huh... I&nbsp;hope =
I could=20
provide some more information regarding my question. Still looking for =

solutions...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank =
you!</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_01C5_01C5AA55.996EE190--
Re: Mouse events in an IFigure [message #193485 is a reply to message #193478] Fri, 26 August 2005 11:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dan.nicolici.nexource.ro

This is a multi-part message in MIME format.

------=_NextPart_000_0098_01C5AA4A.FD8D39C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I understand... Hmmm... I don't know why I am so cheap in implementing =
some corresponding EditParts, but it buzzes me that the child figures =
that I am talking about respond to Mouse Moving Events (i. e. =
mouseHover() ). Then why not to click events? Maybe I am trying to =
reinvent the wheel here and should stick to creating new EditParts. =
Please tell me if this is the case :)

Thanx!
------=_NextPart_000_0098_01C5AA4A.FD8D39C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I understand... Hmmm... I don't know =
why I am so=20
cheap in implementing some corresponding EditParts, but it buzzes me =
that the=20
child figures that I am talking about respond to Mouse Moving Events (i. =
e.=20
mouseHover() ). Then why not to click events? Maybe I am trying to =
reinvent the=20
wheel here and should stick to creating new EditParts. Please tell me if =
this is=20
the case :)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanx!</FONT></DIV></BODY></HTML>

------=_NextPart_000_0098_01C5AA4A.FD8D39C0--
Re: Mouse events in an IFigure [message #193545 is a reply to message #193417] Fri, 26 August 2005 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is a multi-part message in MIME format.

------=_NextPart_000_00F8_01C5AA23.87668F70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

After reading the other posts, it sounds like you need to do one of the =
following:

1) Return a custom drag tracker for this non-editpart child when the =
mouse clicks on that child. You have all of the info you need in the =
SelectionRequest when getDragTracker is called

2) Use figure listeners. I don't recommend this approach, but it is =
designed to work as well. You simply need to consume the Draw2d =
MouseEvent to prevent the GEF tool from also processing the mousedown.

The primary reason for a child not to be an editpart is that it can't be =
deleted. If this isn't true for your scenario you should reconsider =
making them parts.
"Dan Nicolici" <dan.nicolici@nexource.ro> wrote in message =
news:demhe2$9ib$1@news.eclipse.org...
Is it possible for an IFigure of an EditPart to intercept Mouse =
Events? If I add a MouseListener to the figure, it does not work, =
instead the EditPart gets these events.
What I want to achieve with this is the abillity to move IFigures =
contained in the EditPart's main IFigure with the mouse.

Thank you!
------=_NextPart_000_00F8_01C5AA23.87668F70
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>After reading the other posts, it =
sounds like you=20
need to do one of the following:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1) Return a custom drag tracker for =
this=20
non-editpart child when the mouse clicks on that child. You have all of =
the info=20
you need in the SelectionRequest when getDragTracker is =
called</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>2) Use figure listeners. I don't =
recommend this=20
approach, but it is designed to work as well. You simply need to consume =
the=20
Draw2d MouseEvent to prevent the GEF tool from also processing the=20
mousedown.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The primary reason for a child not to =
be an=20
editpart is that it can't be deleted. If this isn't true for your =
scenario you=20
should reconsider making them parts.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Dan Nicolici" &lt;<A=20
=
href=3D"mailto:dan.nicolici@nexource.ro">dan.nicolici@nexource.ro</A>&gt;=
wrote=20
in message <A=20
=
href=3D"news:demhe2$9ib$1@news.eclipse.org">news:demhe2$9ib$1@news.eclips=
e.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Is it possible for an IFigure of an =
EditPart to=20
intercept Mouse Events? If I&nbsp;add a MouseListener to the figure, =
it does=20
not work, instead the EditPart gets these events.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I want to achieve with this is =
the abillity=20
to move IFigures contained in the EditPart's main IFigure with the=20
mouse.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank =
you!</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00F8_01C5AA23.87668F70--
Re: Mouse events in an IFigure [message #193567 is a reply to message #193545] Fri, 26 August 2005 14:27 Go to previous message
Eclipse UserFriend
Originally posted by: dan.nicolici.nexource.ro

This is a multi-part message in MIME format.

------=_NextPart_000_0063_01C5AA63.6B9B47F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thank you for the suggestion. I learned something from all this, but =
finally I decided to create parts for the children as well.

Dan
"Randy Hudson" <none@us.ibm.com> wrote in message =
news:den6m7$5oi$1@news.eclipse.org...
After reading the other posts, it sounds like you need to do one of =
the following:

1) Return a custom drag tracker for this non-editpart child when the =
mouse clicks on that child. You have all of the info you need in the =
SelectionRequest when getDragTracker is called

2) Use figure listeners. I don't recommend this approach, but it is =
designed to work as well. You simply need to consume the Draw2d =
MouseEvent to prevent the GEF tool from also processing the mousedown.

The primary reason for a child not to be an editpart is that it can't =
be deleted. If this isn't true for your scenario you should reconsider =
making them parts.
"Dan Nicolici" <dan.nicolici@nexource.ro> wrote in message =
news:demhe2$9ib$1@news.eclipse.org...
Is it possible for an IFigure of an EditPart to intercept Mouse =
Events? If I add a MouseListener to the figure, it does not work, =
instead the EditPart gets these events.
What I want to achieve with this is the abillity to move IFigures =
contained in the EditPart's main IFigure with the mouse.

Thank you!
------=_NextPart_000_0063_01C5AA63.6B9B47F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thank you for the suggestion. I learned =
something=20
from all this, but finally I decided to create parts for the children as =

well.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Dan</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Randy Hudson" &lt;<A=20
href=3D"mailto:none@us.ibm.com">none@us.ibm.com</A>&gt; wrote in =
message <A=20
=
href=3D"news:den6m7$5oi$1@news.eclipse.org">news:den6m7$5oi$1@news.eclips=
e.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>After reading the other posts, it =
sounds like you=20
need to do one of the following:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1) Return a custom drag tracker for =
this=20
non-editpart child when the mouse clicks on that child. You have all =
of the=20
info you need in the SelectionRequest when getDragTracker is=20
called</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>2) Use figure listeners. I don't =
recommend this=20
approach, but it is designed to work as well. You simply need to =
consume the=20
Draw2d MouseEvent to prevent the GEF tool from also processing the=20
mousedown.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The primary reason for a child not to =
be an=20
editpart is that it can't be deleted. If this isn't true for your =
scenario you=20
should reconsider making them parts.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Dan Nicolici" &lt;<A=20
=
href=3D"mailto:dan.nicolici@nexource.ro">dan.nicolici@nexource.ro</A>&gt;=
=20
wrote in message <A=20
=
href=3D"news:demhe2$9ib$1@news.eclipse.org">news:demhe2$9ib$1@news.eclips=
e.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Is it possible for an IFigure of an =
EditPart to=20
intercept Mouse Events? If I&nbsp;add a MouseListener to the figure, =
it does=20
not work, instead the EditPart gets these events.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I want to achieve with this is =
the=20
abillity to move IFigures contained in the EditPart's main IFigure =
with the=20
mouse.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank=20
you!</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML >

------=_NextPart_000_0063_01C5AA63.6B9B47F0--
Previous Topic:Invoking a GEF application / getSite
Next Topic:Flow Control plug-ins project
Goto Forum:
  


Current Time: Wed Feb 05 14:48:03 GMT 2025

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

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

Back to the top