Skip to main content



      Home
Home » Eclipse Projects » GEF » Relative bendpoint positioning
Relative bendpoint positioning [message #135307] Tue, 01 June 2004 06:58 Go to next message
Eclipse UserFriend
In my diagram I have a container akin to "circuits" in the logic example.
When I add nodes to the container I store in the model the relative
positioning of the nodes using:

parent.getFigure().translateToRelative(location);

Assuming that parent always return the container. This works well - when
I move the container, the contents remain relative.

I now wish to be able to add edges and waypoints (connections and anchors)
into the container. While edges are straightfoward, waypoints are posing
some difficulty. Unfortunately I cannot use the same approach as nodes
above to find the relative positioning of waypoints since editparts for
edges are parented by the connection layer and not their logical container.

Looking at the logic example I see that RelativeBendpoint is used (whereas
I'm using AbsoluteBendpoint). However, in order to use this I would need
to change my model in order to accomodate the storing of the two
dimensions. I would really like to avoid changing the model at all costs.
Does anyone have any suggestion to how I might solve this problem?

James
Re: Relative bendpoint positioning [message #135384 is a reply to message #135307] Tue, 01 June 2004 14:21 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You could make the bendpoints relative to the "lowest-common-ancestor". So
if two parts have the same "circuit" parent, the bendpoints could be stored
relative to that circuit. If they have nothing in common, the bendpoint is
relative to the diagram. However, reparenting of nodes would become tricky.
Also, how would you migrate existing documents to this new convention?

"James Willans" <jwillans@cs.york.ac.uk> wrote in message
news:c9hngu$7e2$1@eclipse.org...
> In my diagram I have a container akin to "circuits" in the logic example.
> When I add nodes to the container I store in the model the relative
> positioning of the nodes using:
>
> parent.getFigure().translateToRelative(location);
>
> Assuming that parent always return the container. This works well - when
> I move the container, the contents remain relative.
>
> I now wish to be able to add edges and waypoints (connections and anchors)
> into the container. While edges are straightfoward, waypoints are posing
> some difficulty. Unfortunately I cannot use the same approach as nodes
> above to find the relative positioning of waypoints since editparts for
> edges are parented by the connection layer and not their logical
container.
>
> Looking at the logic example I see that RelativeBendpoint is used (whereas
> I'm using AbsoluteBendpoint). However, in order to use this I would need
> to change my model in order to accomodate the storing of the two
> dimensions. I would really like to avoid changing the model at all costs.
> Does anyone have any suggestion to how I might solve this problem?
>
> James
>
>
Previous Topic:Selectable but not movable
Next Topic:Retargeted connections problem
Goto Forum:
  


Current Time: Fri May 09 22:56:45 EDT 2025

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

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

Back to the top