Home » Eclipse Projects » GEF » Problem with connection
Problem with connection [message #14967] |
Tue, 23 July 2002 09:33  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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, progress ... [message #15877 is a reply to message #15859] |
Fri, 26 July 2002 04:23   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #15983 is a reply to message #15969] |
Fri, 26 July 2002 13:27  |
Eclipse User |
|
|
|
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> </DIV>
<DIV><FONT face=3DArial size=3D2>"Pierre Queinnec" <</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>> =
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>> Salut Joel,<BR>> In fact I've =
experienced=20
the exact same problem, and here's what i added to<BR>> make it work=20
properly.<BR>> You need to make sure that you do something with the =
SOURCE=20
and TARGET<BR>> PropertyChangeEvents (in the logic example, they're =
called=20
INPUTS and<BR>> OUTPUTS). This "something" consists in calling=20
refreshSourceConnections and<BR>> refreshTargetConnections. In these =
methods,=20
the getSourceConnections and<BR>> getTargetConnections methods are =
called, so=20
you need to override them in</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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>> their respective implementation classes (see =
the logic=20
example). If you do<BR>> not override them, then nothing is visually =
updated=20
(see the default<BR>> implementations). After that, it works =
fine...<BR>>=20
Pierre.<BR>> <BR>> "vennin joel" <</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>> a =
=E9crit dans le=20
message news:<BR>> </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>> ><BR>> > "Randy Hudson" <</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>> a =
=E9crit dans le=20
message news:<BR>> > </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>>=20
> > The connection is never being added to the Source node =
editpart. =20
When<BR>> you<BR>> > > command adds the connection to the =
source=20
node, the source node should<BR>> > >=20
refreshSourceConnections().<BR>> > > If this isn't happening, =
you have=20
a<BR>> > > notification problem.<BR>> > ><BR>> > =
In the=20
command i'm sure that the connection added Source node model and<BR>> =
>=20
target node model.<BR>> > You're right the =
refreshSourceConnections source=20
node EditPart is never<BR>> > called.<BR>> > So where and =
how add=20
connection EditPart in the Source and Target Nodes<BR>> edit<BR>> =
>=20
Part.<BR>> ><BR>> > So the really problem is here, i think =
i've not=20
understart how can i add<BR>> the<BR>> > wire in the source and =
the=20
target node Edit Part<BR>> ><BR>> > So how can i do =
?<BR>>=20
><BR>> ><BR>> > Thanks very very much !<BR>> =
><BR>> >=20
Jol<BR>> ><BR>> ><BR>> ><BR>> > > "vennin =
joel"=20
<</FONT><A href=3D"mailto:jol@linuxgames.com"><FONT face=3DArial=20
size=3D2>jol@linuxgames.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in=20
message<BR>> > > </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>> > > > "Randy Hudson" <</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>> a =E9crit dans le message news:<BR>> > =
> >=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>>=20
> > > > The wire you see is being added by the Tool, and not =
your=20
EditPart.<BR>> > > Just<BR>> > > > > put a =
breakpoint in=20
your Command's run() method, and step through<BR>> the<BR>> > =
> >=20
code.<BR>> > > > > It is only a few methods to get =
to<BR>>=20
> > > > AbstractConnectionEditPart.activateFigure().<BR>> =
>=20
> > I must forgot something, because the<BR>> > > >=20
AbstractConnectionEditPart.activateFigure is never called.<BR>> > =
>=20
><BR>> > > > Any idea ?<BR>> > > ><BR>> =
> >=20
><BR>> > > > Thanks again<BR>> > > ><BR>> =
>=20
> > Jol<BR>> > > ><BR>> > > ><BR>> > =
>=20
><BR>> > > ><BR>> > ><BR>> > ><BR>>=20
><BR>> ><BR>> <BR>> </FONT></DIV></BODY></HTML>
------=_NextPart_000_002F_01C234A8.31FB7B70--
|
|
|
Goto Forum:
Current Time: Sun May 25 05:39:51 EDT 2025
Powered by FUDForum. Page generated in 0.04949 seconds
|