Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Layout policy with non-resizeable children
Layout policy with non-resizeable children [message #247566] Mon, 02 March 2009 18:51 Go to next message
Colin Sharples is currently offline Colin SharplesFriend
Messages: 96
Registered: July 2009
Location: Wellington, New Zealand
Member

I am working on an application that is similar to the Shapes example, so I
have been basing my code on that. The child figures of my container
(corresponding to the Ellipse and Rectangle shapes in the example) can be
moved around the container, but I don't want them to be resizeable. When I
add the LayoutEditPolicy, it creates resize handles on the children when
they are selected. I can't work out where exactly it does that, and
whether I can tell it just to use drag handles.

I tried adding a NonResizeableEditPolicy to the child edit parts, but that
didn't help - in fact, when I did that, the ghost figure no longer
appeared when dragging the children. I then tried removing the
LayoutEditPolicy from the container. This gave me the drag handles and
ghost figure on the child again, but now the move command wouldn't work.
It always thought I was trying to do an orphan request, not a move,
because it couldn't find the target (i.e.
DragEditPartsTracker.targetEditPart was always null). What edit policy do
I need to put on the container so that it can be the target edit part?


Colin Sharples
CTG Games Ltd
Wellington, New Zealand
Re: Layout policy with non-resizeable children [message #247581 is a reply to message #247566] Tue, 03 March 2009 18:20 Go to previous messageGo to next message
Colin Sharples is currently offline Colin SharplesFriend
Messages: 96
Registered: July 2009
Location: Wellington, New Zealand
Member

Found it - my XYLayoutPolicy needed to override createChildEditPolicy() to
return a NonResizeableEditPolicy.


Colin Sharples
CTG Games Ltd
Wellington, New Zealand
Re: Layout policy with non-resizeable children [message #247600 is a reply to message #247581] Wed, 04 March 2009 15:25 Go to previous message
Eclipse UserFriend
Originally posted by: bruno.pereira.alert.pt

Thanks,
I was looking for the same thing.

"Colin Sharples" <ctg@ctg.co.nz> wrote in message
news:50d786769ee2723c7f3b416a659e7018$1@www.eclipse.org...
> Found it - my XYLayoutPolicy needed to override createChildEditPolicy() to
> return a NonResizeableEditPolicy.
>
Previous Topic:FigureCanvas/Viewport size remains (0.0) when view is created
Next Topic:Questions about ConnectionAnchors
Goto Forum:
  


Current Time: Tue Oct 01 10:37:41 GMT 2024

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

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

Back to the top