again: how to make an editPart non-resizable ? [message #53347] |
Fri, 22 September 2006 04:16  |
Eclipse User |
|
|
|
Originally posted by: tivadar.szemethy.netvisor.hu
Hello,
I am trying to disable resizing of my editParts.
I followed the advices in the GMF Developer's Guide - Diagram Services
Layer - How-to Guide to override getPrimaryDragEditPolicy().
However, the object can still be resized through the properties view.
How can I prevent that ?
thanks,
Tivadar
|
|
|
|
Re: again: how to make an editPart non-resizable ? [message #54724 is a reply to message #54357] |
Mon, 25 September 2006 05:11  |
Eclipse User |
|
|
|
Originally posted by: tivadar.szemethy.netvisor.hu
Vlad Ciubotariu wrote:
> Override the method below in ShapeEditPart to ignore notifications about
> the size of the view.
This will make the model and the view inconsistent. The data (e.g. X
coord in the model -- more precisely in the _diagram file -- ) will
change, but not updated on the screen. If the user saves the model and
loads in the next edit session, he/she will see the updated parameter,
exactly the situation I want to prevent.
Tiv
>
> vlad
>
> protected void handleNotificationEvent(Notification notification) {
> Object feature = notification.getFeature();
> if (NotationPackage.eINSTANCE.getSize_Width().equals(feature)
> || NotationPackage.eINSTANCE.getSize_Height().equals(feature)
> || NotationPackage.eINSTANCE.getLocation_X().equals(feature)
> || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
> refreshBounds();
> }
> else if (NotationPackage.eINSTANCE.getFillStyle_FillColor().equals(f eature)) {
> Integer c = (Integer) notification.getNewValue();
> setBackgroundColor(DiagramColorRegistry.getInstance().getCol or(c));
> }
> else if (NotationPackage.eINSTANCE.getLineStyle_LineColor().equals(f eature)) {
> Integer c = (Integer) notification.getNewValue();
> setForegroundColor(DiagramColorRegistry.getInstance().getCol or(c));
> }
> else if (NotationPackage.eINSTANCE.getFontStyle().isInstance(notific ation.getNotifier()))
> refreshFont();
> else if (notification.getFeature() == NotationPackage.eINSTANCE.getView_Element()
> && ((EObject)notification.getNotifier())== getNotationView())
> handleMajorSemanticChange();
> else if (notification.getEventType() == EventType.UNRESOLVE
> && notification.getNotifier() == ((View)getModel()).getElement())
> handleMajorSemanticChange();
>
> else
> super.handleNotificationEvent(notification);
> }
>
>
> On Fri, 22 Sep 2006 10:16:12 +0200, Tivadar Szemethy wrote:
>
>> Hello,
>>
>> I am trying to disable resizing of my editParts.
>> I followed the advices in the GMF Developer's Guide - Diagram Services
>> Layer - How-to Guide to override getPrimaryDragEditPolicy().
>>
>> However, the object can still be resized through the properties view.
>> How can I prevent that ?
>>
>> thanks,
>> Tivadar
>
|
|
|
Powered by
FUDForum. Page generated in 0.03506 seconds