make a node non-resizable + non-movable ? [message #148048] |
Tue, 28 August 2007 08:18  |
Eclipse User |
|
|
|
Originally posted by: NOSPAM.xyz.com
I am working on an application in which a lot of useful data
is represented by the exact sizes and relative locations of the nodes.
In some cases the size + location of a node of given type must
be frozen to indicate that this node is in certain state.
How can one do that?
On that node I installed
NonResizableEditPolicyEx
and I also return null from
getDragTacker()
This helped somewhat - now that node does not get selected when
I click on it with the SelectionTool.
However, if I drag a marquee around it it is still gets selected and can
be moved + resized by using the handles.
Any tips?
Theo
|
|
|
|
Re: make a node non-resizable + non-movable ? [message #148110 is a reply to message #148051] |
Tue, 28 August 2007 13:17   |
Eclipse User |
|
|
|
Originally posted by: NOSPAM.xyz.com
Thanks for the quick reply Boris.
I just achieved something similar by overriding
public EditPolicy getPrimaryDragEditPolicy()
to return new UnmovableShapeEditPolicy();
In my case this seems a good way to go because I would like
to deny changing the colors, etc, via the prop. sheet.
Instead, the combination of fore- + background colors should indicate
the special state of this node. Sorry for missing this in my original post.
I would even like to remove the handles because they suggest
editing capabilities. Somehow they survive yet. So now
I am scrambling to find who shows the outline frame with the
handles around a selected node.
Cheers,
Theo
"Boris Blajer" <boris.blajer@borland.com> wrote in message
news:fb14hl$4q0$1@build.eclipse.org...
> Hi Theo,
>
> You may return an unexecutable command instead of SetBoundsCommand from
> the <>LayoutEditPolicy of its parent. Thus it will be possible to select
> the node (e.g., to change its properties via the property sheet), but any
> attempt to move it will fail.
>
> Best regards,
> Boris
>
>
> Theo wrote:
>> I am working on an application in which a lot of useful data
>> is represented by the exact sizes and relative locations of the nodes.
>> In some cases the size + location of a node of given type must
>> be frozen to indicate that this node is in certain state.
>> How can one do that?
>>
>> On that node I installed
>> NonResizableEditPolicyEx
>> and I also return null from
>> getDragTacker()
>>
>> This helped somewhat - now that node does not get selected when
>> I click on it with the SelectionTool.
>> However, if I drag a marquee around it it is still gets selected and can
>> be moved + resized by using the handles.
>> Any tips?
>> Theo
|
|
|
Re: make a node non-resizable + non-movable ? [message #148112 is a reply to message #148110] |
Tue, 28 August 2007 13:46   |
Eclipse User |
|
|
|
Hi Theo,
Returning false from EditPart#isSelectable() method may help you get rid
of the handles.
Best regards,
Boris
Theo wrote:
> Thanks for the quick reply Boris.
> I just achieved something similar by overriding
> public EditPolicy getPrimaryDragEditPolicy()
> to return new UnmovableShapeEditPolicy();
> In my case this seems a good way to go because I would like
> to deny changing the colors, etc, via the prop. sheet.
> Instead, the combination of fore- + background colors should indicate
> the special state of this node. Sorry for missing this in my original post.
>
> I would even like to remove the handles because they suggest
> editing capabilities. Somehow they survive yet. So now
> I am scrambling to find who shows the outline frame with the
> handles around a selected node.
> Cheers,
> Theo
>
>
> "Boris Blajer" <boris.blajer@borland.com> wrote in message
> news:fb14hl$4q0$1@build.eclipse.org...
>> Hi Theo,
>>
>> You may return an unexecutable command instead of SetBoundsCommand from
>> the <>LayoutEditPolicy of its parent. Thus it will be possible to select
>> the node (e.g., to change its properties via the property sheet), but any
>> attempt to move it will fail.
>>
>> Best regards,
>> Boris
>>
>>
>> Theo wrote:
>>> I am working on an application in which a lot of useful data
>>> is represented by the exact sizes and relative locations of the nodes.
>>> In some cases the size + location of a node of given type must
>>> be frozen to indicate that this node is in certain state.
>>> How can one do that?
>>>
>>> On that node I installed
>>> NonResizableEditPolicyEx
>>> and I also return null from
>>> getDragTacker()
>>>
>>> This helped somewhat - now that node does not get selected when
>>> I click on it with the SelectionTool.
>>> However, if I drag a marquee around it it is still gets selected and can
>>> be moved + resized by using the handles.
>>> Any tips?
>>> Theo
>
>
|
|
|
Re: make a node non-resizable + non-movable ? [message #148114 is a reply to message #148112] |
Tue, 28 August 2007 13:55  |
Eclipse User |
|
|
|
Originally posted by: NOSPAM.xyz.com
Yes it does... Today is my lucky day....
MAny thanks
Theo
"Boris Blajer" <boris.blajer@borland.com> wrote in message
news:fb1n1f$sq3$1@build.eclipse.org...
> Hi Theo,
>
> Returning false from EditPart#isSelectable() method may help you get rid
> of the handles.
>
> Best regards,
> Boris
>
>
> Theo wrote:
>> Thanks for the quick reply Boris.
>> I just achieved something similar by overriding
>> public EditPolicy getPrimaryDragEditPolicy()
>> to return new UnmovableShapeEditPolicy();
>> In my case this seems a good way to go because I would like
>> to deny changing the colors, etc, via the prop. sheet.
>> Instead, the combination of fore- + background colors should indicate
>> the special state of this node. Sorry for missing this in my original
>> post.
>>
>> I would even like to remove the handles because they suggest
>> editing capabilities. Somehow they survive yet. So now
>> I am scrambling to find who shows the outline frame with the
>> handles around a selected node.
>> Cheers,
>> Theo
>>
>>
>> "Boris Blajer" <boris.blajer@borland.com> wrote in message
>> news:fb14hl$4q0$1@build.eclipse.org...
>>> Hi Theo,
>>>
>>> You may return an unexecutable command instead of SetBoundsCommand from
>>> the <>LayoutEditPolicy of its parent. Thus it will be possible to select
>>> the node (e.g., to change its properties via the property sheet), but
>>> any attempt to move it will fail.
>>>
>>> Best regards,
>>> Boris
>>>
>>>
>>> Theo wrote:
>>>> I am working on an application in which a lot of useful data
>>>> is represented by the exact sizes and relative locations of the nodes.
>>>> In some cases the size + location of a node of given type must
>>>> be frozen to indicate that this node is in certain state.
>>>> How can one do that?
>>>>
>>>> On that node I installed
>>>> NonResizableEditPolicyEx
>>>> and I also return null from
>>>> getDragTacker()
>>>>
>>>> This helped somewhat - now that node does not get selected when
>>>> I click on it with the SelectionTool.
>>>> However, if I drag a marquee around it it is still gets selected and
>>>> can
>>>> be moved + resized by using the handles.
>>>> Any tips?
>>>> Theo
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03759 seconds