Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Connection Anchor
Connection Anchor [message #225311] Mon, 30 October 2006 13:37 Go to next message
Eclipse UserFriend
Originally posted by: mounafeki.yahoo.fr

Hi,
I would like to define specific Connection Anchor for a Figure so that I
can connect my Figure only from these points.

I wanted first to take the example logic as a sample . But it was very
complicated and I have got wrong results (see my mail of 27.10 : Problem:
FixedConnectionAnchor).
which single steps (generally )must i follow to have the desired results?
Which Classes must i costumize?

Please i want your Help!
Thanks in Advance.
Re: Connection Anchor [message #225355 is a reply to message #225311] Mon, 30 October 2006 16:42 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
在 2006-10-30一的 13:37 +0000,Mouna写道:
> Hi,
> I would like to define specific Connection Anchor for a Figure so that I
> can connect my Figure only from these points.
>
> I wanted first to take the example logic as a sample . But it was very
> complicated and I have got wrong results (see my mail of 27.10 : Problem:
> FixedConnectionAnchor).
> which single steps (generally )must i follow to have the desired results?
> Which Classes must i costumize?
>
> Please i want your Help!
> Thanks in Advance.
>
Hi,

from statement before, there are 2 point A,B, and A for input just be
target anchor, B for output just be source anchor.
so this story get a right result, two connection from B output, not A
input. if A, it should not correct.

So you have no problems, just need a design: which for input, which for
output.

Hope I get you.

Regards,

Qinxian.
Re: Connection Anchor [message #225404 is a reply to message #225355] Mon, 30 October 2006 21:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mouna.feki.siemens.com

Hi Qinxian,
rear, perhaps you do not have my problem so well understood. For the
figure i would like define 2 Anchors Points A and B. A and B are output as
input Anchors at the same time. I.e. my goal is: If I connect Figure
GleisSegmentFigure as SOURCE with other Figure X , then I can
select/choose A or B as output points. And If I connect Figure
GleisSegmentFigure as Target with other Figure X , then I can
select/choose A or B as input points.
---> I would like that Figure GleisSegmentFigure a several output and Input
Anchors have. How can I realize that?

Thanks
Mouna
Re: Connection Anchor [message #225433 is a reply to message #225404] Tue, 31 October 2006 03:50 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
在 2006-10-30一的 21:08 +0000,Mouna写道:
> Hi Qinxian,
> rear, perhaps you do not have my problem so well understood. For the
> figure i would like define 2 Anchors Points A and B. A and B are output as
> input Anchors at the same time. I.e. my goal is: If I connect Figure
> GleisSegmentFigure as SOURCE with other Figure X , then I can
> select/choose A or B as output points. And If I connect Figure
> GleisSegmentFigure as Target with other Figure X , then I can
> select/choose A or B as input points.
> ---> I would like that Figure GleisSegmentFigure a several output and Input
> Anchors have. How can I realize that?
>
> Thanks
> Mouna
>
Hi,

just like logicdesigner, there can have a list for anchor terminals.

As long as the EditPart get a right Anchor, no matter little or few,
that's it.

Regards,

Qinxian
Re: Connection Anchor [message #225456 is a reply to message #225433] Tue, 31 October 2006 08:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mounafeki.yahoo.fr

Hi Qinxian,
Could you please explain the steps to define Anchor points. Whhich
classes or methods schould i insert or customize? The Logic example is
very complicated Thanks
Mouna.
Re: Connection Anchor [message #225464 is a reply to message #225456] Tue, 31 October 2006 09:04 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
在 2006-10-31二的 08:33 +0000,Mouna写道:
> Hi Qinxian,
> Could you please explain the steps to define Anchor points. Whhich
> classes or methods schould i insert or customize? The Logic example is
> very complicated Thanks
> Mouna.
>
Hi,
Depends on your design. if model need these anchor info, add into it.
Generally can declare integers or strings in model as anchor terminal,
but no matter how, should not declare GEF Anchor class in model.
then get anchors by given terminal, just like your code.

if model need not, just put these anchor info into editpart or figure.
then get anchors directly from editparts or figures.


GEF concert with getSource/TargetConnectionAnchor(...) methods.
regarding to how to provide these anchor, GEF don't take care of it.

if logic example others is complicated, its Gate class and GateEditPart
should be a simple case, pay more attention to it.

Regards,

Qinxian
Re: Connection Anchor [message #225505 is a reply to message #225464] Tue, 31 October 2006 10:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mounafeki.yahoo.fr

We assume that I would like to change the Schapes Diagramm Code so that I
may connect a rectangle only from the two upper corner (See Picture)
A X---------X B
| |
| |
-----------

Which Methods and/or Classes schould i customize? And How?
Please i want your Help!
Thanks
Mouna
Re: Connection Anchor [message #225513 is a reply to message #225505] Tue, 31 October 2006 11:50 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
在 2006-10-31二的 10:53 +0000,Mouna写道:
> We assume that I would like to change the Schapes Diagramm Code so that I
> may connect a rectangle only from the two upper corner (See Picture)
> A X---------X B
> | |
> | |
> -----------
>
> Which Methods and/or Classes schould i customize? And How?
> Please i want your Help!
> Thanks
> Mouna
>
Hi,

You can only handle this EditPart class, and implements all methods in
NodeEditPart inteface.
>From method name we know get*Anchor(Request) used for editor actions,
for example click figure, and dragdrop to another figure.
And get*Anchor(ConnectionEditPart) used for updating the figure and
draw.

Detailed anchor selection depends on designed model,for example,
database table foreign key connection, modeled ForeignKey with id, fk
members,
get*Anchor can perform a rule,
ForeignKey fk= connection.getModel();
if (fk.id=getModel().id) return anchorA,
if (fk.fk=getModel().id) return anchorB.

according to get request anchor, can do with samelike way.

As you known, my english is more strange and laughed, of cause, I'm a
china. my english is not brilliant as my china.:)
But if you have question, I would be happy to give a hand as possible.

Regards,

Qinxian
Re: Connection Anchor [message #225521 is a reply to message #225513] Tue, 31 October 2006 12:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mounafeki.yahoo.fr

Hi,

/++++++
get*Anchor can perform a rule,
ForeignKey fk= connection.getModel();
if (fk.id=getModel().id) return anchorA,
if (fk.fk=getModel().id) return anchorB.
/+++++++
I would have used this method if I had 2 kinds of connections. Then I
would have defined Anchor A for type Connection1 and AnchorB for type
Connection2. But I have only one single kind of connection. And I would
like to connect my Figure (means of this connection) of A as well as of B.

Regards
Mouna
Re: Connection Anchor [message #225536 is a reply to message #225521] Tue, 31 October 2006 12:37 Go to previous message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
Mouna 写道:
> Hi,
> /++++++
> get*Anchor can perform a rule,
> ForeignKey fk= connection.getModel();
> if (fk.id=getModel().id) return anchorA,
> if (fk.fk=getModel().id) return anchorB.
> /+++++++
> I would have used this method if I had 2 kinds of connections. Then I
> would have defined Anchor A for type Connection1 and AnchorB for type
> Connection2. But I have only one single kind of connection. And I would
> like to connect my Figure (means of this connection) of A as well as of B.
>
> Regards
> Mouna
>
Which anchor depends on user operate result, he can select A or B as a
anchor. if handler this, model need a anchor terminal info.
Letter above refer a model without anchor info.

Regards,

Qinxian
Previous Topic:Transparent figures
Next Topic:Global Copy Action not Working
Goto Forum:
  


Current Time: Thu Mar 28 09:01:03 GMT 2024

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

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

Back to the top