Home » Eclipse Projects » GEF » ignore all commands and disable 'not permitted' icon?
ignore all commands and disable 'not permitted' icon? [message #223583] |
Fri, 29 September 2006 15:42 |
Mark Robinson Messages: 37 Registered: July 2009 |
Member |
|
|
I'll try and explain this clearly:
I have a container figure heirarchy as follows:
Diagram Edit Part; which contains:
Container Edit Part A (with toolbarlayout); which contains:
Container Edit Part B (with xylayout); which contains:
Children Edit Parts C.
Container B has a layout policy that constrains Children C to be dragged
only along the outer edges of container B. When a child C is being dragged
I've changed the feedback figure to hug the edges of the parent container
B, regardless of where the mouse is.
What I would now like to do is: whilst dragging C, stop all the other
Container EditParts from receiving requests (or ignore the requests).
Basically, once the child has started to be dragged, it should be placed
somewhere along the edge of its container, even if the mouse leaves this
edit part. This works fine if the mouse is within the parent container;
however, if the mouse leaves the parent container, then the containers
parent (A) gets a move request, the cursor changes to the 'not allowed'
icon and (A) now has the command (my feedback figure is still updated
correctly and will respond to mouse changes correctly - hugging the edge
of the original parent container (B)).
So, after starting the drag, when the mouse is on another editpart I don't
want the cursor to change to 'not allowed' and I want the original drag
command to drop on the original container (B) when the mouse is released.
Is this possible, and if so, how would I achieve this?
Regards,
Mark Robinson
|
|
|
Re: ignore all commands and disable 'not permitted' icon? [message #223591 is a reply to message #223583] |
Mon, 02 October 2006 10:52 |
Mark Robinson Messages: 37 Registered: July 2009 |
Member |
|
|
I've figured this out.
I've gotten the container A to 'ignore' the move request by overriding
getTargetEditPart its ToolbarLayoutEditPolicy. I check the requests list
of editparts, and if the first editPart in the list is an instance of C, I
return the C.getParent() editPart. Bingo, works like a dream.
I've just got to deal with the Diagram EditPart now. Hopefully it should
be along similar lines (touch wood).
Regards,
Mark Robinson
Mark Robinson wrote:
> I'll try and explain this clearly:
> I have a container figure heirarchy as follows:
> Diagram Edit Part; which contains:
> Container Edit Part A (with toolbarlayout); which contains:
> Container Edit Part B (with xylayout); which contains:
> Children Edit Parts C.
> Container B has a layout policy that constrains Children C to be dragged
> only along the outer edges of container B. When a child C is being dragged
> I've changed the feedback figure to hug the edges of the parent container
> B, regardless of where the mouse is.
> What I would now like to do is: whilst dragging C, stop all the other
> Container EditParts from receiving requests (or ignore the requests).
> Basically, once the child has started to be dragged, it should be placed
> somewhere along the edge of its container, even if the mouse leaves this
> edit part. This works fine if the mouse is within the parent container;
> however, if the mouse leaves the parent container, then the containers
> parent (A) gets a move request, the cursor changes to the 'not allowed'
> icon and (A) now has the command (my feedback figure is still updated
> correctly and will respond to mouse changes correctly - hugging the edge
> of the original parent container (B)).
> So, after starting the drag, when the mouse is on another editpart I don't
> want the cursor to change to 'not allowed' and I want the original drag
> command to drop on the original container (B) when the mouse is released.
> Is this possible, and if so, how would I achieve this?
> Regards,
> Mark Robinson
|
|
|
Re: ignore all commands and disable 'not permitted' icon? [message #223628 is a reply to message #223591] |
Mon, 02 October 2006 22:12 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
EditPart A should be getting the ADD request, and not the MOVE one. If that
is the case, a better way to do what you want is to override the
getDragTracker() method for EditPart C and provide a custom
DragEditPartsTracker that always returns true for isMove().
"Mark Robinson" <mr@prismtech.com> wrote in message
news:b97ec512c51c68c24cea0250fc45c6c3$1@www.eclipse.org...
> I've figured this out.
>
> I've gotten the container A to 'ignore' the move request by overriding
> getTargetEditPart its ToolbarLayoutEditPolicy. I check the requests list
> of editparts, and if the first editPart in the list is an instance of C, I
> return the C.getParent() editPart. Bingo, works like a dream.
>
> I've just got to deal with the Diagram EditPart now. Hopefully it should
> be along similar lines (touch wood).
>
> Regards,
> Mark Robinson
>
>
> Mark Robinson wrote:
>
>> I'll try and explain this clearly:
>
>> I have a container figure heirarchy as follows:
>> Diagram Edit Part; which contains:
>> Container Edit Part A (with toolbarlayout); which contains:
>> Container Edit Part B (with xylayout); which contains:
>> Children Edit Parts C.
>
>> Container B has a layout policy that constrains Children C to be dragged
>> only along the outer edges of container B. When a child C is being
>> dragged I've changed the feedback figure to hug the edges of the parent
>> container B, regardless of where the mouse is.
>
>> What I would now like to do is: whilst dragging C, stop all the other
>> Container EditParts from receiving requests (or ignore the requests).
>
>> Basically, once the child has started to be dragged, it should be placed
>> somewhere along the edge of its container, even if the mouse leaves this
>> edit part. This works fine if the mouse is within the parent container;
>> however, if the mouse leaves the parent container, then the containers
>> parent (A) gets a move request, the cursor changes to the 'not allowed'
>> icon and (A) now has the command (my feedback figure is still updated
>> correctly and will respond to mouse changes correctly - hugging the edge
>> of the original parent container (B)).
>
>> So, after starting the drag, when the mouse is on another editpart I
>> don't want the cursor to change to 'not allowed' and I want the original
>> drag command to drop on the original container (B) when the mouse is
>> released.
>
>
>
>> Is this possible, and if so, how would I achieve this?
>
>> Regards,
>> Mark Robinson
>
|
|
|
Goto Forum:
Current Time: Wed Jan 15 11:44:41 GMT 2025
Powered by FUDForum. Page generated in 0.03286 seconds
|