Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to keep the relation of the sides of a figure?
How to keep the relation of the sides of a figure? [message #212487] Sat, 29 November 2008 09:57 Go to next message
Eclipse UserFriend
Originally posted by: cayla_sha.gmx.net

Hello!

How can I preserve the relation of the sides? When the user drags at the
sides of the figure to make it bigger or smaller he can distort the shape.
I have, for example, a shape, that has height=45 and width=30 as
default. Now I want, that the ratio/relation/proportion of the sides is
always 45:30.

Where can I put the code to monitor the change?

A notification is not thrown until the user releases the mouse after
dragging. At this point I get the new width and height within the
notification and then I just can ask, if the new w and h has the right
ratio. And if not, I can take the old w and h. But the user will never
be abel to adjust the exact right ratio with the mouse. So in reality
the user wouldn`t be abel to resize the figure anymore, aside from
people with a proper amount of luck ;)

I know, that there is a Resize Constraint in the gmfgraph, but this
Constraint just prevents from dragging into one (or more) specific
direction. I want to allow dragging into any direction, but just within
my ratio.

Thanks in advance!
Best wishes!
Julia
Re: How to keep the relation of the sides of a figure? [message #212537 is a reply to message #212487] Mon, 01 December 2008 10:00 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Cayla,

I think you have to create custom LayoutEditPolicy (or try to tune existing)
and install it onto the container off these diagram nodes. This EditPolicy
should process resize requests in accordance with your rules.

-----------------
Alex Shatalin
Previous Topic:How to get the underlying XML from a palette tool
Next Topic:Target Decoration of Polyline Connection
Goto Forum:
  


Current Time: Fri Apr 26 15:03:56 GMT 2024

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

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

Back to the top