Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Creating connections - help
Creating connections - help [message #157221] Mon, 08 November 2004 11:35 Go to next message
WojT is currently offline WojTFriend
Messages: 11
Registered: July 2009
Junior Member
Hi!
I am a polish programmer. So I am sorry for my English.
I am working around project in Eclipse 3.0 using GEF 3.0.
What am I supposed to do is to create connections between my figures all
over the figure (in any point at figure bounds).
Using simple ConnectionAnchors - like ChopboxAnchor it is impossible -
because my connection always is pointed to center of figure.
I want to be able move anchor in any place on figure bound.

I have written my own class of anchor. It's seems to work.. cause when I
create connections anchors are in good place... but... everythings goes bad
when i am doing any translations :(
Any zooming, scrolling my view brokes connections.

What i am doing is - creating an anchor and setting him an offset - X and Y
from top-left corner of figure.
I think that problems are in overrided methods - getLocation(),
getReferencePoint().

Is there any _good_ reference for this methods? And _good_ exmplain of
translations ? How to do them and how they works?
I am trying to solve my problem for about two weeks and its very hard to me
:(

I will be very gracefull if You can help me or show me an working example of
code which i am talking about.

(If there are problems to understand me, what am i talking about - i will
post two example pictures - with good connections - and the same after
translation)

...::WojT::..
Re: Creating connections - help [message #157275 is a reply to message #157221] Mon, 08 November 2004 15:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

In my opinion, once the user moves the connection anchor, it will become a
maintenance nuisance. If you then go back and move nodes, the anchors need
to be cleaned-up by the user. An alternative would be to create a smarter
connection router which considers all connections for a given node, and
distributes them automatically around the bounds of the figure, considering
the locations of the destination nodes.

If we had some use cases, we could begin to make these type of router
improvements.

But, to solve your problem, you just need an anchor class with parameters
describing the relative attachment point on the target node.

"WojT" <wjancz@wasko.pl> wrote in message news:cmnlm2$3kp$1@eclipse.org...
> Hi!
> I am a polish programmer. So I am sorry for my English.
> I am working around project in Eclipse 3.0 using GEF 3.0.
> What am I supposed to do is to create connections between my figures all
> over the figure (in any point at figure bounds).
> Using simple ConnectionAnchors - like ChopboxAnchor it is impossible -
> because my connection always is pointed to center of figure.
> I want to be able move anchor in any place on figure bound.
>
> I have written my own class of anchor. It's seems to work.. cause when I
> create connections anchors are in good place... but... everythings goes
bad
> when i am doing any translations :(
> Any zooming, scrolling my view brokes connections.
>
> What i am doing is - creating an anchor and setting him an offset - X and
Y
> from top-left corner of figure.
> I think that problems are in overrided methods - getLocation(),
> getReferencePoint().
>
> Is there any _good_ reference for this methods? And _good_ exmplain of
> translations ? How to do them and how they works?
> I am trying to solve my problem for about two weeks and its very hard to
me
> :(
>
> I will be very gracefull if You can help me or show me an working example
of
> code which i am talking about.
>
> (If there are problems to understand me, what am i talking about - i will
> post two example pictures - with good connections - and the same after
> translation)
>
> ..::WojT::..
>
>
>
>
Re: Creating connections - help [message #157367 is a reply to message #157275] Tue, 09 November 2004 07:31 Go to previous message
WojT is currently offline WojTFriend
Messages: 11
Registered: July 2009
Junior Member
> In my opinion, once the user moves the connection anchor, it will become a
> maintenance nuisance. If you then go back and move nodes, the anchors
need
> to be cleaned-up by the user.

That is no problem, because when I make a connection, then its allright, and
I can move my figure with these connection and the connection is moving with
the figure...

> An alternative would be to create a smarter
> connection router which considers all connections for a given node, and
> distributes them automatically around the bounds of the figure,
considering
> the locations of the destination nodes.

I can't do this like that, because I don't know how many connections user
will make.
So to solve it, I need to calculate anchor at time when user makes a
connection.

> If we had some use cases, we could begin to make these type of router
> improvements.

I will be gracefull.

> But, to solve your problem, you just need an anchor class with parameters
> describing the relative attachment point on the target node.

I have class of my own anchor. There is an offset X and Y which describes
position of anchor offseted from top-left corner of figure.

The main problem is in translations. After setting zoom to value other than
100%, or when I scroll my view I am not able to make connection.
Because I cannot calculate good position of my anchor.
I think that it will be helpfull when I know how the getLocation(),
getReferencePoint() method works.
And if it is possible please describe me basics about translations - when is
need to do translations.
From absolute to relative, or relative to absolute. Using any translatable
figure in methods: translateToAbsolute(),. translateToRelative().
Please give me some examples of basic and complex translations - i spent
about two weeks trying to understand this issue - and still i don't know how
it works.

Thank You very much for your answer.

P.S. sorry for my english.

...::WojT::..
Previous Topic:how to fillGradient in shapes other than rectangle
Next Topic:How to use Markers in GEF
Goto Forum:
  


Current Time: Thu Apr 25 05:43:41 GMT 2024

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

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

Back to the top