Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » schema example - hack to add initial location for TablePart?
schema example - hack to add initial location for TablePart? [message #191810] Thu, 11 August 2005 17:21
Eclipse UserFriend
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.
Previous Topic:Changing palettes and maintaining there state
Next Topic:Replacing a Figure on the Fly
Goto Forum:
  


Current Time: Fri Apr 26 02:15:13 GMT 2024

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

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

Back to the top