Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Absolute position of a Point
Absolute position of a Point [message #176769] Wed, 12 March 2008 06:10 Go to next message
Eclipse UserFriend
Hi all,

I just begin to work with draw2d.geometry and I need some help:

In a sequence diagram, I know the relative position of a Point doing this:

GraphConnector connector = (GraphConnector) ((GraphEdge)
childElement).getAnchor().get(numanchor);
org.eclipse.draw2d.geometry.Point pos = new Point(connector.getPosition());

I would like to know the absolute position of this point in the diagram.
Thanks for your help.

Regards,

Emilien
Re: Absolute position of a Point [message #176883 is a reply to message #176769] Wed, 12 March 2008 10:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi Emilien,

IFigure defines methods translateToAbsolute(Translatable) and
translateToRelative(Translatable).

Translating a point to absolute coordinates should be easy if you know
the figure whose coordinate system in used by your point. Typically it
takes several guesses to get the correct transformation :)

Best regards,
Boris

Emilien Perico wrote:
> Hi all,
>
> I just begin to work with draw2d.geometry and I need some help:
>
> In a sequence diagram, I know the relative position of a Point doing this:
>
> GraphConnector connector = (GraphConnector) ((GraphEdge)
> childElement).getAnchor().get(numanchor);
> org.eclipse.draw2d.geometry.Point pos = new Point(connector.getPosition());
>
> I would like to know the absolute position of this point in the diagram.
> Thanks for your help.
>
> Regards,
>
> Emilien
>
Re: Absolute position of a Point [message #177729 is a reply to message #176769] Mon, 17 March 2008 13:10 Go to previous message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. draw2d.doc.isv/guide/coordinates.html

Emilien Perico wrote:
> Hi all,
>
> I just begin to work with draw2d.geometry and I need some help:
>
> In a sequence diagram, I know the relative position of a Point doing this:
>
> GraphConnector connector = (GraphConnector) ((GraphEdge)
> childElement).getAnchor().get(numanchor);
> org.eclipse.draw2d.geometry.Point pos = new Point(connector.getPosition());
>
> I would like to know the absolute position of this point in the diagram.
> Thanks for your help.
>
> Regards,
>
> Emilien
>
Previous Topic:Label disappears
Next Topic:Set default position of node at creation time
Goto Forum:
  


Current Time: Fri May 09 06:42:03 EDT 2025

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

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

Back to the top