|HandleBounds and selection of children [message #225529]
||Tue, 31 October 2006 12:31
Originally posted by: ingo.koch[nospam].sap.com|
i have implemented a container editpart whose figure implements
The container editpart has several children (also editparts) which are
in the small area between the containers real bounds and the containers
Now I have the problem that I cannot select these child editparts.
Is there any possibility to workaround this issue?
Modify SelectionTool or drag tracker?
|Re: HandleBounds and selection of children [message #225805 is a reply to message #225772]
||Thu, 02 November 2006 14:20
| Nhu Le
Registered: July 2009
Since the border is transparent, should it consume the mouse event?. If |
it consumes the mouse click then you should be able to select the child
editparts without any problem.
In the implementation I did before, the parent is selected only when you
select within the handlebounds. When you click on a child, only that
child get selected. However, in order for the child the receive the
mouse event in the first place, the parent must indicate the the mouse
click is inside it's boundary (hence the overriden containsPoint()).
Ingo Koch wrote:
> Ok, thank you but the problem was something else...
> I used a transparent border which consumed the clicks....
> "Nhu Le" <firstname.lastname@example.org> wrote in message
>> I think the easiest way is to override containsPoint() method like so:
>> public boolean containsPoint(int x, int y)
>> boolean retVal = false;
>> //See if it is in the main body
>> retVal = getHandleBounds().contains(x, y);
>> //Must include all the children
>> if (!retVal)
>> List children = getChildren();
>> Iterator childItr = children.iterator();
>> while (childItr.hasNext())
>> IFigure child = (IFigure) childItr.next();
>> if (child.containsPoint(x, y))
>> retVal = true;
>> return retVal;
>> Hope it helps.
>> Nhu Le
>> Ingo Koch wrote:
>>> i have implemented a container editpart whose figure implements
>>> The container editpart has several children (also editparts) which are
>>> in the small area between the containers real bounds and the containers
>>> handle bounds.
>>> Now I have the problem that I cannot select these child editparts.
>>> Is there any possibility to workaround this issue?
>>> Modify SelectionTool or drag tracker?
>>> Kind regards,
Powered by FUDForum
. Page generated in 0.08192 seconds