How to gain gridlayout like functionality [message #92965] |
Mon, 08 September 2003 14:29 |
Eclipse User |
|
|
|
Originally posted by: anders.soderman.home.se
Hi
I am trying to make it possible to add children to a parent container in a
gridlayout type of style.
The parent container should have rows and columns which makes a coordinate
system so if for example
we have rows=2 columns = 2 the figure should look like this
---------------------
| 0,0 | 0,1 |
|---------------------
| 1,0 | 1,1 |
---------------------
When you drag a palette item and drop it on e.g 1,0 that square should size
if needed and
the model should be able to know where it was dropped.
This is almost like a flowlayout with one more dimension.
What is the preferred way of designing this behaviour. I would prefer a
solution that affects the model the least
since this is a presentaion thing. I have tried going the editpart way but
it seems to me that it shouldn't have to be this complicated.
Thanks Anders
|
|
|
Re: How to gain gridlayout like functionality [message #93334 is a reply to message #92965] |
Wed, 10 September 2003 14:25 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
To do this, you need to write your own draw2d layoutmanager, and GEF
constrainedLayoutEditPolicy which interpret's drop locations and generates
the right commands for placing the objects in the corresponding row/column.
You also need to store the row/column data in your model somewhere.
"Anders S
|
|
|
Powered by
FUDForum. Page generated in 0.03328 seconds