Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Hide individual resize handles?
Hide individual resize handles? [message #640389] Sun, 21 November 2010 15:10 Go to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Hello,

I've seen that the method canResizeShape of the resize feature is called with
width, height, x and y set to -1 to determine whether to show the resize
handles. If the method returns false, the GFNonResizableEditPolicy is used and
thus all resizing handles are disabled. I've got some shapes that can be
resized horizontally, but require a fixed height. Is there a way to disable
only the top and bottom resize handles? I know that I can prevent the actual
resizing later on, but the current situation isn't optimal from the user's
point of view: the visual appearance of the element pretends to be resizable
in any direction, and you have to actually try and grab it just to be shown
that it can't be resized...

Thanks
Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
I used to drive a Heisenbergmobil, but everytime I looked at the speedometer,
I got lost.
Re: Hide individual resize handles? [message #640509 is a reply to message #640389] Mon, 22 November 2010 11:43 Go to previous messageGo to next message
Matthias Gorning is currently offline Matthias GorningFriend
Messages: 81
Registered: April 2010
Location: Germany
Member
Hi Volker,

unfortunately this is currently not possible.

Please open a bugzilla if you want that we extend the framework for this resize behaviour.

BR,
Matthias
Re: Hide individual resize handles? [message #641503 is a reply to message #640509] Thu, 25 November 2010 17:31 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 261
Registered: July 2009
Senior Member
Hi Matthias,

in another thread opened by me Tim Kaiser replied "I think it makes
sense to not show the resize handles if resize is not enabled."

I wouldn't show selection handles either in this case.
But the orange rectangle (without handles) could be shown.
Changing the primary/secondary selection colors is not really satisfactory.

I think it would make sense to change in

org.eclipse.graphiti.ui.internal.util.draw2d.GFHandleHelper. createShapeHandles(GraphicalEditPart,
IConfigurationProvider, int, boolean)

the line

list.add(new GFSurroundingHandle(owner, cp, supportedResizeDirections,
movable));

to

list.add(new GFSurroundingHandle(owner, cp, PositionConstants.NSEW,
movable));

To have the surrounding handle in any case.

Does that make sense to you?


Another suggestion is for the case that e.g. only horizontal resize is
allowed. Then I would only draw the eastern and western handles since
the corner handles usually allow to resize in both directions (I noticed
though that the cursor is changing in accordance to the resize
configuration).

And finally: it would be nice if not only color and style of the
surrounding handle could be change but also the line width.

Henrik


Am 22.11.2010 12:43, schrieb Matthias Gorning:
> I think it makes sense to not show the resize handles if resize is not
>> enabled.
Re: Hide individual resize handles? [message #643975 is a reply to message #640509] Wed, 08 December 2010 21:05 Go to previous messageGo to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Matthias Gorning <matthias.gorning@sap.com> writes:
> unfortunately this is currently not possible.

After some more digging, I was pleased to find out this is not true - at least
in the current CVS version. The ResizeShapeFeature just has to override
getResizeConfiguration(). If the returned object signals that it's not
possible to resize the object either horizontally or vertically, the resize
handles are not shown. This is sufficient for my application, with one small
exception: The method getResizeConfiguration() does not know about the object
to be resized, so it can't determine the resizing properties
dynamically. Would it be possible to pass the ResizeShapeContext as a
parameter?

BTW, there's a typo in IResizeConfiguration - isHoriz_a_ntalResizeAllowed. Do
you want a separate bugzilla entry for this?

Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
"Ich fürchte, die Tiere betrachten den Menschen als ein Wesen ihresgleichen,
das in höchst gefährlicher Weise den gesunden Tierverstand verloren hat."
(Nietzsche)
Re: Hide individual resize handles? [message #644029 is a reply to message #643975] Thu, 09 December 2010 07:37 Go to previous messageGo to next message
Matthias Gorning is currently offline Matthias GorningFriend
Messages: 81
Registered: April 2010
Location: Germany
Member
Hi Volker,

yes, we can pass the ResizeShapeContext as a
parameter to the method getResizeConfiguration(). Please, open a bugzilla.

I couldn't find the typo in IResizeConfiguration. Where exactly is it?

BR,
Matthias
Re: Hide individual resize handles? [message #644449 is a reply to message #644029] Sat, 11 December 2010 14:38 Go to previous messageGo to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Matthias Gorning <matthias.gorning@sap.com> writes:
> yes, we can pass the ResizeShapeContext as a
> parameter to the method getResizeConfiguration(). Please, open a bugzilla.

Done, 332360.

> I couldn't find the typo in IResizeConfiguration. Where exactly is it?

Horizantal instead of Horizontal. It's also in the patch.

Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
"Aktienkurse sind wie Erdgeschoßwohnungen. Ständig gibt es Einbrüche." (Ingolf
Lück, Wochenshow)
Re: Hide individual resize handles? [message #644462 is a reply to message #644449] Sat, 11 December 2010 16:57 Go to previous messageGo to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Volker Wegert <mail@volker-wegert.de> writes:
> Matthias Gorning <matthias.gorning@sap.com> writes:
>> yes, we can pass the ResizeShapeContext as a
>> parameter to the method getResizeConfiguration(). Please, open a bugzilla.
>
> Done, 332360.

....ouch. There's a subsequent problem: I've got some figures that can't be
resized at all. If I switch off both horizontal and vertical resizing, the
editor no longer hightlights the element when it is selected. Applying the
change proposed by Henrik Rentz-Reichert in this thread (change
GFHandleHelper.createShapeHandles: replace new GFSurroundingHandle(owner, cp,
supportedResizeDirections with new GFSurroundingHandle(owner, cp,
PositionConstants.NSEW) fixes this. I'll add this to the bug.

Volker


--
* Volker Wegert * http://www.volker-wegert.de/contact *
"Ein Gerücht geht so schnell um die Welt, da hat sich die Wahrheit noch nicht
einmal die Schnürsenkel gebunden." (Hans Joachim Rauschenbach)
Re: Hide individual resize handles? [message #644558 is a reply to message #644462] Mon, 13 December 2010 09:40 Go to previous message
Matthias Gorning is currently offline Matthias GorningFriend
Messages: 81
Registered: April 2010
Location: Germany
Member
Changes commited as proposed.

BR,
Matthias
Previous Topic:design question - bundle feature classes as local classes?
Next Topic:Linking Domain Models to Diagram
Goto Forum:
  


Current Time: Fri Apr 19 21:30:45 GMT 2024

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

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

Back to the top