Skip to main content



      Home
Home » Eclipse Projects » GEF » Problem with connection
Problem with connection [message #14967] Tue, 23 July 2002 09:33 Go to next message
Eclipse UserFriend
Originally posted by: jol.linuxgames.com

Hello,

I'm trying to create connection between some EditPart but it's fail. I've
try to understand Connection in the LogicExample but some parts are very
obscur for me.

Can you post an example (documented if it's possible) where it's possible to
create connection, easier to understand than the Logic example.

Thank you very much !

Jol
Re: Problem with connection [message #14973 is a reply to message #14967] Tue, 23 July 2002 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

Connections are tricky, but there is a reason for this.

Basically, connections are similar to children editparts, except they are in
a shared aggregation with both the source and target nodes. You never know
if the source was created before the target, or vice versa. Therefore,
either node could initialize itself first, and then construct its
source/target connections. When the second node is created, it must first
check to see whether an EditPart for that connection already exists, and
"hook up" with that existing editpart instead of creating a second editpart
for the connection.

Hope this helps.

"vennin joel" <jol@linuxgames.com> wrote in message
news:ahjjuu$qlk$1@rogue.oti.com...
> Hello,
>
> I'm trying to create connection between some EditPart but it's fail. I've
> try to understand Connection in the LogicExample but some parts are very
> obscur for me.
>
> Can you post an example (documented if it's possible) where it's possible
to
> create connection, easier to understand than the Logic example.
>
> Thank you very much !
>
> Jol
>
>
Re: Problem with connection [message #15570 is a reply to message #14967] Wed, 24 July 2002 11:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: queinnec.essi.fr

Hi, i agree, it'd be a great idea if someone could extend the shapes example
with the ability of creating connections.
Pierre.
Re: Problem with connection, progress ... [message #15820 is a reply to message #14973] Thu, 25 July 2002 11:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jol.linuxgames.com

Thanks for your advice.

I've progress in the connection handling, but i've another problem !

I've 2 editpart and i try to connect this 2 editparts with a wire.

So i'm clicking on the first EditPart and i've a wire which start at the
editpart clicked and stop at the mouse location (it's normal for now), next
i'm clicking on the other editPart. The problem is here, i'm testing if the
connection is done, and the connection is done, but on the screen the wire
is not drawn.

If you know what , i forgot some thing but what ?

Thanks a lot !


Jol
Re: Problem with connection, progress ... [message #15839 is a reply to message #15820] Thu, 25 July 2002 12:50 Go to previous messageGo to next message
Eclipse UserFriend
Does your target EditPart overide the AbstractEditPart implementation of
createConnection() ?

Guy
Re: Problem with connection, progress ... [message #15859 is a reply to message #15839] Thu, 25 July 2002 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

Wow, thinks for reminding me of that. I need to make sure the abstract
implementation defers to the Viewer's EditPartFactory somehow.
"Guy Slade" <gslade@us.ibm.com> wrote in message
news:ahp8bm$tif$1@rogue.oti.com...
> Does your target EditPart overide the AbstractEditPart implementation of
> createConnection() ?
>
> Guy
>
>
Re: Problem with connection, progress ... [message #15877 is a reply to message #15859] Fri, 26 July 2002 04:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jol.linuxgames.com

Hello,

Explain my example step by step

--- LAYER -
for the layer just a ManhattanConnectionRouter is setting


--- WIRE PART -
class WireEditPart extends AbstractConnectionEditPart implements
PropertyChangeListener

I've redefine activate, activateFigure, deactivate, deactivateFigure like
Logic example.
createFigure return just a PolylineConnection.
I've define not specific policy


--- EDIT PART -
At the first i've a class BaseEditPart extends AbstractGraphicalEditPart
implements PropertyChangeListener, NodeEditPart

In this class i redefine some method ( include getModelTargetConnections,
getModelSourceConnections, createConnection)

I've installed COMPONENT_ROLE, GRAPHICAL_NODE_ROLE and NODE_ROLE policies.

In the GRAPHICAL_NODE_ROLE policy i've redefine createDummyConnection,
getConnectionCompleteCommand, getConnectionCreateCommand.
So when the getConnectionCompleteCommand executed, i'm sure that the wire
model contain 2 base model.


-- Problem
During the creation of wire, the wire figure is visible, but when i've
finish the creation of wire, the wire figure is not visible.


I've not redefine in the WireEditPart class : getSourceConnectionAnchor() ,
getTargetConnectionAnchor(), refreshSourceAnchor and refreshTargetAnchor



Have you any idea,

Thanks again

Jol
Re: Problem with connection, progress ... [message #15896 is a reply to message #15877] Fri, 26 July 2002 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

The wire you see is being added by the Tool, and not your EditPart. Just
put a breakpoint in your Command's run() method, and step through the code.
It is only a few methods to get to
AbstractConnectionEditPart.activateFigure().

"vennin joel" <jol@linuxgames.com> wrote in message
news:ahqusv$jms$1@rogue.oti.com...
> Hello,
>
> Explain my example step by step
>
> --- LAYER -
> for the layer just a ManhattanConnectionRouter is setting
>
>
> --- WIRE PART -
> class WireEditPart extends AbstractConnectionEditPart implements
> PropertyChangeListener
>
> I've redefine activate, activateFigure, deactivate, deactivateFigure like
> Logic example.
> createFigure return just a PolylineConnection.
> I've define not specific policy
>
>
> --- EDIT PART -
> At the first i've a class BaseEditPart extends AbstractGraphicalEditPart
> implements PropertyChangeListener, NodeEditPart
>
> In this class i redefine some method ( include getModelTargetConnections,
> getModelSourceConnections, createConnection)
>
> I've installed COMPONENT_ROLE, GRAPHICAL_NODE_ROLE and NODE_ROLE policies.
>
> In the GRAPHICAL_NODE_ROLE policy i've redefine createDummyConnection,
> getConnectionCompleteCommand, getConnectionCreateCommand.
> So when the getConnectionCompleteCommand executed, i'm sure that the wire
> model contain 2 base model.
>
>
> -- Problem
> During the creation of wire, the wire figure is visible, but when i've
> finish the creation of wire, the wire figure is not visible.
>
>
> I've not redefine in the WireEditPart class : getSourceConnectionAnchor()
,
> getTargetConnectionAnchor(), refreshSourceAnchor and refreshTargetAnchor
>
>
>
> Have you any idea,
>
> Thanks again
>
> Jol
>
>
>
Re: Problem with connection, progress ... [message #15914 is a reply to message #15896] Fri, 26 July 2002 10:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jol.linuxgames.com

"Randy Hudson" <none@ibm.com> a
Re: Problem with connection, progress ... [message #15932 is a reply to message #15914] Fri, 26 July 2002 11:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.spam.com

The connection is never being added to the Source node editpart. When you
command adds the connection to the source node, the source node should
refreshSourceConnections(). If this isn't happening, you have a
notification problem.

"vennin joel" <jol@linuxgames.com> wrote in message
news:ahrje1$u6p$1@rogue.oti.com...
> "Randy Hudson" <none@ibm.com> a
Re: Problem with connection, progress ... [message #15950 is a reply to message #15932] Fri, 26 July 2002 12:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jol.linuxgames.com

"Randy Hudson" <hudsonr@spam.com> a
Re: Problem with connection, progress ... [message #15969 is a reply to message #15950] Fri, 26 July 2002 12:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: queinnec.essi.fr

Salut Joel,
In fact I've experienced the exact same problem, and here's what i added to
make it work properly.
You need to make sure that you do something with the SOURCE and TARGET
PropertyChangeEvents (in the logic example, they're called INPUTS and
OUTPUTS). This "something" consists in calling refreshSourceConnections and
refreshTargetConnections. In these methods, the getSourceConnections and
getTargetConnections methods are called, so you need to override them in
their respective implementation classes (see the logic example). If you do
not override them, then nothing is visually updated (see the default
implementations). After that, it works fine...
Pierre.

"vennin joel" <jol@linuxgames.com> a
Re: Problem with connection, progress ... [message #15983 is a reply to message #15969] Fri, 26 July 2002 13:27 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.spam.com

This is a multi-part message in MIME format.

------=_NextPart_000_002F_01C234A8.31FB7B70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


"Pierre Queinnec" <queinnec@essi.fr> wrote in message =
news:ahrsaq$54e$1@rogue.oti.com...
> Salut Joel,
> In fact I've experienced the exact same problem, and here's what i =
added to
> make it work properly.
> You need to make sure that you do something with the SOURCE and TARGET
> PropertyChangeEvents (in the logic example, they're called INPUTS and
> OUTPUTS). This "something" consists in calling =
refreshSourceConnections and
> refreshTargetConnections. In these methods, the getSourceConnections =
and
> getTargetConnections methods are called, so you need to override them =
in

you meant getModelSourceConnections(), etc.

> their respective implementation classes (see the logic example). If =
you do
> not override them, then nothing is visually updated (see the default
> implementations). After that, it works fine...
> Pierre.
>=20
> "vennin joel" <jol@linuxgames.com> a =E9crit dans le message news:
> ahrpsj$3ig$1@rogue.oti.com...
> >
> > "Randy Hudson" <hudsonr@spam.com> a =E9crit dans le message news:
> > ahrndg$1v6$1@rogue.oti.com...
> > > The connection is never being added to the Source node editpart. =
When
> you
> > > command adds the connection to the source node, the source node =
should
> > > refreshSourceConnections().
> > > If this isn't happening, you have a
> > > notification problem.
> > >
> > In the command i'm sure that the connection added Source node model =
and
> > target node model.
> > You're right the refreshSourceConnections source node EditPart is =
never
> > called.
> > So where and how add connection EditPart in the Source and Target =
Nodes
> edit
> > Part.
> >
> > So the really problem is here, i think i've not understart how can i =
add
> the
> > wire in the source and the target node Edit Part
> >
> > So how can i do ?
> >
> >
> > Thanks very very much !
> >
> > Jol
> >
> >
> >
> > > "vennin joel" <jol@linuxgames.com> wrote in message
> > > news:ahrje1$u6p$1@rogue.oti.com...
> > > > "Randy Hudson" <none@ibm.com> a =E9crit dans le message news:
> > > > ahrhas$stj$1@rogue.oti.com...
> > > > > The wire you see is being added by the Tool, and not your =
EditPart.
> > > Just
> > > > > put a breakpoint in your Command's run() method, and step =
through
> the
> > > > code.
> > > > > It is only a few methods to get to
> > > > > AbstractConnectionEditPart.activateFigure().
> > > > I must forgot something, because the
> > > > AbstractConnectionEditPart.activateFigure is never called.
> > > >
> > > > Any idea ?
> > > >
> > > >
> > > > Thanks again
> > > >
> > > > Jol
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>=20
>=20

------=_NextPart_000_002F_01C234A8.31FB7B70
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.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Pierre Queinnec" &lt;</FONT><A=20
href=3D"mailto:queinnec@essi.fr"><FONT face=3DArial=20
size=3D2>queinnec@essi.fr</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in message=20
</FONT><A href=3D"news:ahrsaq$54e$1@rogue.oti.com"><FONT face=3DArial=20
size=3D2>news:ahrsaq$54e$1@rogue.oti.com</FONT></A><FONT face=3DArial=20
size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt; Salut Joel,<BR>&gt; In fact I've =
experienced=20
the exact same problem, and here's what i added to<BR>&gt; make it work=20
properly.<BR>&gt; You need to make sure that you do something with the =
SOURCE=20
and TARGET<BR>&gt; PropertyChangeEvents (in the logic example, they're =
called=20
INPUTS and<BR>&gt; OUTPUTS). This "something" consists in calling=20
refreshSourceConnections and<BR>&gt; refreshTargetConnections. In these =
methods,=20
the getSourceConnections and<BR>&gt; getTargetConnections methods are =
called, so=20
you need to override them in</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>you meant=20
get<STRONG>Model</STRONG>SourceConnections(), etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT><BR><FONT=20
face=3DArial size=3D2>&gt; their respective implementation classes (see =
the logic=20
example). If you do<BR>&gt; not override them, then nothing is visually =
updated=20
(see the default<BR>&gt; implementations). After that, it works =
fine...<BR>&gt;=20
Pierre.<BR>&gt; <BR>&gt; "vennin joel" &lt;</FONT><A=20
href=3D"mailto:jol@linuxgames.com"><FONT face=3DArial=20
size=3D2>jol@linuxgames.com</FONT></A><FONT face=3DArial size=3D2>&gt; a =
=E9crit dans le=20
message news:<BR>&gt; </FONT><A =
href=3D"mailto:ahrpsj$3ig$1@rogue.oti.com"><FONT=20
face=3DArial size=3D2>ahrpsj$3ig$1@rogue.oti.com</FONT></A><FONT =
face=3DArial=20
size=3D2>...<BR>&gt; &gt;<BR>&gt; &gt; "Randy Hudson" &lt;</FONT><A=20
href=3D"mailto:hudsonr@spam.com"><FONT face=3DArial=20
size=3D2>hudsonr@spam.com</FONT></A><FONT face=3DArial size=3D2>&gt; a =
=E9crit dans le=20
message news:<BR>&gt; &gt; </FONT><A=20
href=3D"mailto:ahrndg$1v6$1@rogue.oti.com"><FONT face=3DArial=20
size=3D2>ahrndg$1v6$1@rogue.oti.com</FONT></A><FONT face=3DArial =
size=3D2>...<BR>&gt;=20
&gt; &gt; The connection is never being added to the Source node =
editpart.&nbsp;=20
When<BR>&gt; you<BR>&gt; &gt; &gt; command adds the connection to the =
source=20
node, the source node should<BR>&gt; &gt; &gt;=20
refreshSourceConnections().<BR>&gt; &gt; &gt; If this isn't happening, =
you have=20
a<BR>&gt; &gt; &gt; notification problem.<BR>&gt; &gt; &gt;<BR>&gt; &gt; =
In the=20
command i'm sure that the connection added Source node model and<BR>&gt; =
&gt;=20
target node model.<BR>&gt; &gt; You're right the =
refreshSourceConnections source=20
node EditPart is never<BR>&gt; &gt; called.<BR>&gt; &gt; So where and =
how add=20
connection EditPart in the Source and Target Nodes<BR>&gt; edit<BR>&gt; =
&gt;=20
Part.<BR>&gt; &gt;<BR>&gt; &gt; So the really problem is here, i think =
i've not=20
understart how can i add<BR>&gt; the<BR>&gt; &gt; wire in the source and =
the=20
target node Edit Part<BR>&gt; &gt;<BR>&gt; &gt; So how can i do =
?<BR>&gt;=20
&gt;<BR>&gt; &gt;<BR>&gt; &gt; Thanks very very much !<BR>&gt; =
&gt;<BR>&gt; &gt;=20
Jol<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; &gt; "vennin =
joel"=20
&lt;</FONT><A href=3D"mailto:jol@linuxgames.com"><FONT face=3DArial=20
size=3D2>jol@linuxgames.com</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in=20
message<BR>&gt; &gt; &gt; </FONT><A =
href=3D"news:ahrje1$u6p$1@rogue.oti.com"><FONT=20
face=3DArial size=3D2>news:ahrje1$u6p$1@rogue.oti.com</FONT></A><FONT =
face=3DArial=20
size=3D2>...<BR>&gt; &gt; &gt; &gt; "Randy Hudson" &lt;</FONT><A=20
href=3D"mailto:none@ibm.com"><FONT face=3DArial =
size=3D2>none@ibm.com</FONT></A><FONT=20
face=3DArial size=3D2>&gt; a =E9crit dans le message news:<BR>&gt; &gt; =
&gt; &gt;=20
</FONT><A href=3D"mailto:ahrhas$stj$1@rogue.oti.com"><FONT face=3DArial=20
size=3D2>ahrhas$stj$1@rogue.oti.com</FONT></A><FONT face=3DArial =
size=3D2>...<BR>&gt;=20
&gt; &gt; &gt; &gt; The wire you see is being added by the Tool, and not =
your=20
EditPart.<BR>&gt; &gt; &gt; Just<BR>&gt; &gt; &gt; &gt; &gt; put a =
breakpoint in=20
your Command's run() method, and step through<BR>&gt; the<BR>&gt; &gt; =
&gt; &gt;=20
code.<BR>&gt; &gt; &gt; &gt; &gt; It is only a few methods to get =
to<BR>&gt;=20
&gt; &gt; &gt; &gt; AbstractConnectionEditPart.activateFigure().<BR>&gt; =
&gt;=20
&gt; &gt; I must forgot something, because the<BR>&gt; &gt; &gt; &gt;=20
AbstractConnectionEditPart.activateFigure is never called.<BR>&gt; &gt; =
&gt;=20
&gt;<BR>&gt; &gt; &gt; &gt; Any idea ?<BR>&gt; &gt; &gt; &gt;<BR>&gt; =
&gt; &gt;=20
&gt;<BR>&gt; &gt; &gt; &gt; Thanks again<BR>&gt; &gt; &gt; &gt;<BR>&gt; =
&gt;=20
&gt; &gt; Jol<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; =
&gt;=20
&gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt;=20
&gt;<BR>&gt; &gt;<BR>&gt; <BR>&gt; </FONT></DIV></BODY></HTML>

------=_NextPart_000_002F_01C234A8.31FB7B70--
Previous Topic:Creating a connection between NodeEP and ConnectionEP
Next Topic:TransferDropTargetListener
Goto Forum:
  


Current Time: Sun May 25 05:52:48 EDT 2025

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

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

Back to the top