HandleBounds and selection of children [message #225529] |
Tue, 31 October 2006 12:31 |
Eclipse User |
|
|
|
Originally posted by: ingo.koch[nospam].sap.com
Hi,
i have implemented a container editpart whose figure implements
HandleBounds.
The container editpart has several children (also editparts) which are
located
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,
Ingo
|
|
|
|
Re: HandleBounds and selection of children [message #225772 is a reply to message #225542] |
Thu, 02 November 2006 09:59 |
Eclipse User |
|
|
|
Originally posted by: ingo.koch[nospam].sap.com
Ok, thank you but the problem was something else...
I used a transparent border which consumed the clicks....
Thanks,
Ingo
"Nhu Le" <nle.misc@gmail.com> wrote in message
news:ei7id2$mov$1@utils.eclipse.org...
> Hi,
>
> 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;
> break;
> }
> }
> }
> return retVal;
> }
>
> Hope it helps.
> Nhu Le
>
>
> Ingo Koch wrote:
>> Hi,
>>
>> i have implemented a container editpart whose figure implements
>> HandleBounds.
>> The container editpart has several children (also editparts) which are
>> located
>> 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,
>> Ingo
>>
|
|
|
Re: HandleBounds and selection of children [message #225805 is a reply to message #225772] |
Thu, 02 November 2006 14:20 |
Nhu Le Messages: 47 Registered: July 2009 |
Member |
|
|
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()).
Nhu Le
Ingo Koch wrote:
> Ok, thank you but the problem was something else...
> I used a transparent border which consumed the clicks....
>
> Thanks,
> Ingo
>
>
> "Nhu Le" <nle.misc@gmail.com> wrote in message
> news:ei7id2$mov$1@utils.eclipse.org...
>> Hi,
>>
>> 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;
>> break;
>> }
>> }
>> }
>> return retVal;
>> }
>>
>> Hope it helps.
>> Nhu Le
>>
>>
>> Ingo Koch wrote:
>>> Hi,
>>>
>>> i have implemented a container editpart whose figure implements
>>> HandleBounds.
>>> The container editpart has several children (also editparts) which are
>>> located
>>> 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,
>>> Ingo
>>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03491 seconds