[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: How do I resize an element and the element inside it?

It sounds like you might have two of the same policies installed. resize 
feedback is XOR, so if it paints twice, it will erase itself.

ResizableEditPolicy should be created inside the LayoutEditPolicy in 
createChildEditPolicy(...). You shouldn't install it from the editpart.


"Daniel D. Vanzin" <ddv@xxxxxxxxxxxx> wrote in message 
news:dtfnkp$d47$1@xxxxxxxxxxxxxxxxxxxx
> Now resizing/moving works fine, but I can't see the feedback (the gray 
> rectangle)! I'm using a XYLayoutEditPolicy. Should I ovewrite something?
>
> thanks
>
> Daniel D. Vanzin wrote:
>> Wait, It appears to have worked for now. I used SELECTION_ROLE_FEEDBACK. 
>> Later I will try to make everything else to worl
>>
>> Daniel D. Vanzin wrote:
>>> But If I use ResizableEditPolicy as a PRIMARY_DRAG_ROLE, I loose the 
>>> selection handles in my element, together with the ability to 
>>> move/resize.
>>>
>>> installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new
>>>               ResizableEditPolicy());
>>> installEditPolicy(EditPolicy.LAYOUT_ROLE, new
>>>               DiagramLayoutEditPolicy()); /extends XYEditPolicy
>>>
>>> Is there something different I should be doing?
>>>
>>> thanks
>>>
>>> Randy Hudson wrote:
>>>> You need to be using the XYLayoutPolicy on the *parents* of anything 
>>>> that you want to resize. ResizableEditPolicy is not a LAYOUT_ROLE. It 
>>>> is PRIMARY_DRAG_ROLE.
>>>>
>>>> boa sorte.
>>>>
>>>> "Daniel D. Vanzin" <ddv@xxxxxxxxxxxx> wrote in message 
>>>> news:dtd1i7$4q0$1@xxxxxxxxxxxxxxxxxxxx
>>>>> If I define a LAYOUT_ROLE to something like XYLayoutPolicy, then I can 
>>>>> resize the children, but not the parent. IF its a ResizableEditPolicy, 
>>>>> the parent can be resized, but not the childres.
>>>>>
>>>>> Should I implement a new policy? If so, any tips how? I want that 
>>>>> whenever the parent resizes, so does the children. But the opposite is 
>>>>> not always true.
>>>>>
>>>>> thanks
>>>>
>>>