preventing resize of ghost [message #122225] |
Sun, 14 March 2004 21:43  |
Eclipse User |
|
|
|
My GEF-based application successfully disallows resizing of parts but when a
part is selected, the resize handles still appear and they can be dragged
with the ghost being correspondingly resized.
When the button is released, the actual figure remains the same size. But
I'm wondering how I can prevent the selection handles from being draggable.
I have two edit parts, the overall DiagramPart and the individual NodeParts.
DiagramPart has a single policy in the LAYOUT_ROLE which implements
createChangeConstraintCommand (to handle moving) and getCreateCommand (to
handle creation from palette)
NodePart has a policy in the COMPONENT_ROLE which implements
createDeleteCommand and one in the DIRECT_EDIT_ROLE which implements
getDirectEditCommand.
Any help would be greatly appreciated.
James
|
|
|
|
|
|
|
|
|
|
Re: preventing resize of ghost [message #123072 is a reply to message #123061] |
Thu, 18 March 2004 23:21  |
Eclipse User |
|
|
|
PROBLEM FOUND!
By default, ConstrainedLayoutEditPolicy implements createChildEditPolicy()
to return a ResizableEditPolicy.
In other words, if a part has, in a LAYOUT_ROLE, a subclass of
ConstrainedLayoutEditPolicy, then children of that part will be resizable
even if the child parts themselves don't have a resizable policy.
The solution was to override createChildEditPolicy to return a
NonResizableEditPolicy.
James
|
|
|
Powered by
FUDForum. Page generated in 0.08188 seconds