Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Remove resize handlers
Remove resize handlers [message #1313480] Thu, 24 April 2014 22:43 Go to next message
Filipe Ramos is currently offline Filipe Ramos
Messages: 18
Registered: December 2013
Junior Member
Hi,

I have a diagram with objects that I don't want to resize. I created a resize feature that always returns false. However, when I select an object on the editor, the resize handlers are still there, and is even possible to move them (without resizing the object...). Can I hide those handlers?

Thanks!
Re: Remove resize handlers [message #1313506 is a reply to message #1313480] Thu, 24 April 2014 23:05 Go to previous messageGo to next message
Marek Jagielski is currently offline Marek Jagielski
Messages: 63
Registered: April 2012
Member
I don't know exactly how you do this but I created Resize Feature as follow and it is working as expected:

public class ResizeShapeForbiddenFeature extends DefaultResizeShapeFeature {

	public ResizeShapeForbiddenFeature(IFeatureProvider fp) {
		super(fp);
	}

	@Override
	public boolean canResizeShape(IResizeShapeContext context) {
		return false;
	}
}


Marek
Re: Remove resize handlers [message #1314074 is a reply to message #1313480] Fri, 25 April 2014 06:37 Go to previous messageGo to next message
Soeren M is currently offline Soeren M
Messages: 77
Registered: September 2011
Member
Filipe Ramos wrote on Thu, 24 April 2014 18:43
Hi,

I have a diagram with objects that I don't want to resize. I created a resize feature that always returns false. However, when I select an object on the editor, the resize handlers are still there, and is even possible to move them (without resizing the object...). Can I hide those handlers?

Thanks!


If you want them to be unable to get moved, you have to extend the
AbstractMoveShapeFeature
for example.
Re: Remove resize handlers [message #1324012 is a reply to message #1314074] Wed, 30 April 2014 15:09 Go to previous message
Filipe Ramos is currently offline Filipe Ramos
Messages: 18
Registered: December 2013
Junior Member
Thanks Marek Jagielski. Your class is similar to mine, so the problem wasn't there, but your answer sent me on the right direction.

Actually, I had an error in the FeatureProvider, I forgot to change the line that checked the type of object (it was still checking if the object was of type EClass, like in the tutorial...)

@ Soeren M: i wanted to disable the capacity to move the handlers, not the object, but thanks anyway Wink

[Updated on: Wed, 30 April 2014 15:09]

Report message to a moderator

Previous Topic:Run a long feature with a ProgressBar
Next Topic:Displaying Images
Goto Forum:
  


Current Time: Wed Oct 22 23:07:18 GMT 2014

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

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