Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Moving figures in layout(How to freely move figures inside the compartment layout.)
Moving figures in layout [message #834185] Sun, 01 April 2012 14:50 Go to next message
Ondra Netocny is currently offline Ondra NetocnyFriend
Messages: 12
Registered: July 2011
Junior Member
Hello everybody!
I would like to implement compartment, which will allow to move (like with no layout use) its child figures freely in major direction (eg. verticaly), but in minor direction (eg. horizontaly) shoul be aligned a have a fixed position. It should completely same as FlowLayout or ConstrainedToolbarLayout, but there will be ability to move (drag and drop) child figures. I am thinking about overiding some of layouts, but i do not know how to. Is it the right way, or is there any other option to achieve this? I would be grateful for any kind of advice.


Thanks in advance, Ondra
  • Attachment: kresba.png
    (Size: 5.88KB, Downloaded 236 times)
Re: Moving figures in layout [message #834364 is a reply to message #834185] Sun, 01 April 2012 21:26 Go to previous message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member

I think the simplest way is to start from the code from org.eclipse.draw2d.XYLayout, use Rectangle's as a constraints as it is normally done, with the only change that in the layout() method before the calling the child.setBounds(rect) additionally snap the 'rect' to be centered at the known vertical line.

When done with the draw2d part, you will probably need to fix the XYLayoutEditPloicy at the GEF layer to show the feedback using the same trick as above.

Michael "Borlander" Golubev
at Montages Think Tank, Prague, Czech Republic
Montages AG, Z├╝rich, Switzerland

[Updated on: Sun, 01 April 2012 21:27]

Report message to a moderator

Previous Topic:Rectangle background image
Next Topic:copying / Cloning a Diagram object
Goto Forum:

Current Time: Thu Oct 22 01:55:22 GMT 2020

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

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

Back to the top