Model-View-Controller Question [message #150488] |
Fri, 10 September 2004 16:34 |
Eclipse User |
|
|
|
Originally posted by: patrick.sirr.embarcadero.com
Hello - I understand the GEF MVC model. I have a problem though that I
can't fit into that archetecture. I was hoping for some help.
Normal MVC :
User Grabs a figure with the mouse
Figure's EditPart is queried for a command using a request.
The EditPart's installed policies fulfil that request for a command
Command is executed changing the Model
The Model sends a property change (ie location) to the listenters (ie the
EditPart)
The Edit part receives and says 'updateVisuals' to get the figure to update.
Here's my situation. Anyone have any ideas on how to fit this into the MVC
paradigm? :
User hits the SWT.INSERT key on the diagram
The insert key is received and a command is created and executed to create a
new model element
Problem -> Within that command I'd like to position the new figure in the
center of the diagram. My problem is though that I've created the new model
element and I know that it's first listener is the EditPart I need, but
casting that first listener to an EditPart violates MVC. How can I get the
figure created by the step above and position it without violating MVC?
Thanks!
Patrick
|
|
|
Powered by
FUDForum. Page generated in 0.07105 seconds