Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » make a node non-resizable + non-movable ?
make a node non-resizable + non-movable ? [message #148048] Tue, 28 August 2007 12:18 Go to next message
Eclipse UserFriend
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 #148051 is a reply to message #148048] Tue, 28 August 2007 12:30 Go to previous messageGo to next message
Boris Blajer is currently offline Boris BlajerFriend
Messages: 217
Registered: July 2009
Senior Member
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 #148110 is a reply to message #148051] Tue, 28 August 2007 17:17 Go to previous messageGo to next message
Eclipse UserFriend
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 17:46 Go to previous messageGo to next message
Boris Blajer is currently offline Boris BlajerFriend
Messages: 217
Registered: July 2009
Senior Member
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 17:55 Go to previous message
Eclipse UserFriend
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
>>
Previous Topic:create a child element when an attribute of the parent is set ...
Next Topic:Multiple editors in one feature
Goto Forum:
  


Current Time: Fri Jul 19 17:19:02 GMT 2024

Powered by FUDForum. Page generated in 0.04425 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top