Skip to main content



      Home
Home » Eclipse Projects » GEF » position/size of rectangle
position/size of rectangle [message #117558] Fri, 13 February 2004 06:09 Go to next message
Eclipse UserFriend
Originally posted by: nospam.gmx.net

Hello Guys!

Simple question:
i have little problem with a feedback rectangle, shown on add request.
the rectangle paints, but when i have a zoom level != 1.00
the rectangle paints in the position and in the size as if zoom level was
1.00.

feedback = new RectangleFigure();
Rectangle r = getHostFigure().getBounds().getCopy().getExpanded(5,5);

feedback.setBounds(r);

addFeedback(feedback);

So how do i use translateToAbsolute / translateToRelative to fix this?

Regards, Ingo
Re: position/size of rectangle [message #117578 is a reply to message #117558] Fri, 13 February 2004 10:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Take a look at NonResizableEditPolicy -> showChangeBoundsFeedback.

"Ingo Koch" <nospam@gmx.net> wrote in message
news:c0ib38$anb$1@eclipse.org...
> Hello Guys!
>
> Simple question:
> i have little problem with a feedback rectangle, shown on add request.
> the rectangle paints, but when i have a zoom level != 1.00
> the rectangle paints in the position and in the size as if zoom level was
> 1.00.
>
> feedback = new RectangleFigure();
> Rectangle r = getHostFigure().getBounds().getCopy().getExpanded(5,5);
>
> feedback.setBounds(r);
>
> addFeedback(feedback);
>
> So how do i use translateToAbsolute / translateToRelative to fix this?
>
> Regards, Ingo
>
>
Re: position/size of rectangle [message #118007 is a reply to message #117578] Tue, 17 February 2004 09:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nospam.gmx.net

"Whitney Sorenson" <none@us.ibm.com> wrote in message
news:c0iqt5$vih$1@eclipse.org...
> Take a look at NonResizableEditPolicy -> showChangeBoundsFeedback.


I had a look a look at it.

what i want is rectangle with the same size (or a little bigger) of the
target figure resting over the target figure.

what i have:

feedback = getFeedbackRectangle();
Rectangle r = getHostFigure().getBounds().getCopy();
getHostFigure().translateToAbsolute(r);
feedback.setBounds(r);
addFeedback(feedback);

The size is ok now.
But not the position, when the editor is scrolled to the right.


And another (i admit, stupid, but simple) question :
why can
Re: position/size of rectangle [message #118057 is a reply to message #118007] Tue, 17 February 2004 10:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Ingo Koch" <nospam@gmx.net> wrote in message
news:c0t7uf$khf$1@eclipse.org...
> "Whitney Sorenson" <none@us.ibm.com> wrote in message
> news:c0iqt5$vih$1@eclipse.org...
> > Take a look at NonResizableEditPolicy -> showChangeBoundsFeedback.
>
>
> I had a look a look at it.
>
> what i want is rectangle with the same size (or a little bigger) of the
> target figure resting over the target figure.
>
> what i have:
>
> feedback = getFeedbackRectangle();
> Rectangle r = getHostFigure().getBounds().getCopy();
> getHostFigure().translateToAbsolute(r);

need to call:
feedback.translateToRelative(r);
> why can
Re: position/size of rectangle [message #118236 is a reply to message #118057] Wed, 18 February 2004 04:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nospam.gmx.net

Works fine now but only, when the feedback is added first,
then the rectangle gets transleted and the bounds are set.
The problem was, that at the time before the feedback is added,
it has no parent and the rectangle can
Re: position/size of rectangle [message #118372 is a reply to message #118236] Wed, 18 February 2004 14:47 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Works fine now but only, when the feedback is added first,

Yes, if the feedback is not on the feedback layer, then it will not work.
What happens is both the primary and feedback layer are shifted upwards.
So, when you translate from the original figure, you are shifting the point
one way. When yo utranslate back to the feedback, it un-shifts the point.

> then the rectangle gets transleted and the bounds are set.
> The problem was, that at the time before the feedback is added,
> it has no parent and the rectangle can
Previous Topic:pop up dialog
Next Topic:Actions & multi page editor
Goto Forum:
  


Current Time: Thu May 08 16:06:03 EDT 2025

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

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

Back to the top