schema example - hack to add initial location for TablePart? [message #191810] |
Thu, 11 August 2005 17:21 |
Eclipse User |
|
|
|
Originally posted by: pbeagan.yahoo_dontspamme_.com
In the Schema example, the current behavior is to always put a newly created
table in the upper left corner of the diagram, regardless of where the
mouse clicks (in manual layout mode). I want to have the initial Location
of a TablePart set where the mouse clicks just like in the shapes or logic
example.
I can get the location from the request in SchemaContainerEditPolicy using :
Point location = request.getLocation();
Then in TableAddCommand.execute() , doing a table.getBounds() returns null
regardless if called before or after schema.addTable(table). So after the
table is added to the schema, I create a new Rectangle() and do a
setLocation() with the location from the request and a setSize(-1,-1).
This seems like a hack to me. Is there a better way to do this?
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.02273 seconds