Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Re: Connection figure display translated
Re: Connection figure display translated [message #225120] Wed, 25 October 2006 12:16 Go to next message
Eclipse UserFriend
Originally posted by: honza.vitasek.seznam.cz

Hello,

what do you mean with: getOwner()?
Whats the type of it?
Is it editpart?
Re: Connection figure display translated [message #225125 is a reply to message #225120] Wed, 25 October 2006 12:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nferry32.gmail.com

GetOwner() return the figure of the port connection.

I choice to attached the GEF Anchor concept to my ports figures.
My Anchor is saved in float in the model because I choice
relative coord. based on [0-1] x and y positionning related to the parent objet (like shape). So I can have
dynamic ports positionning.

public Point getLocation(Point ref) {
Rectangle bounds = getOwner().getBounds().getCopy();
getOwner().translateToAbsolute( bounds );
Point pos = new Point();
pos.x = (int)(bounds.x + bounds.width * anc.preciseX);
pos.y = (int)(bounds.y + bounds.height * anc.preciseY);

if( Math.abs( pos.getDistance2( ref ) - 10 ) < 0.001 )
return ref;
else
return pos;
}

This function return the position of the anchor if user click around 10 units distance.
Re: Connection figure display translated [message #225131 is a reply to message #225125] Wed, 25 October 2006 12:44 Go to previous message
Eclipse UserFriend
Originally posted by: nferry32.gmail.com

Well sqrt(10) units distance
Previous Topic:Connection creation coordinates problem
Next Topic:How to get zoom effect using GEF?
Goto Forum:
  


Current Time: Thu Apr 25 07:06:55 GMT 2024

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

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

Back to the top