Hi all,
Old programmer, getting there with Java, new to GUI.
I want to put together a GUI that handles interrelated models. The model is a Person object in a family tree. The view will initially just be a box with the person's details shown in it, linked with lines to parents, siblings and children. The controller will obviously bind these two together.
I want to allow the user to move from person to person, up to parents, left/right to siblings and down to children, probably with cursor keys.
My problem is this. The view can recognise the user operation, say 'select father'. It must then ask the model (a Person object) to identify which person is its father. But how can that mechanism then indicate which controller or view should be signalled to take focus?
Clearly I could create a Map that lets me find the controller responsible for the parent of the person but this feels like breaking the whole advantage of the MVC pattern. Is there a 'good' way of dealing with this?
Paul
Controller represents the object which gets the values from user interface, calls appropriate classes and forwards a response back to the view.
Model represents the Object which holds the information in the front-end view and passes it over to the controller when controller is invoked
>>>But how can that mechanism then indicate which controller or view should be signalled to take focus?
You would have a single "controller" which would control the entire application.
You would have multiple "views", for parents , children, siblings, ect and you would have their corrosponding objects as Models.
I am not sure if you have followed the MVC architecture correctly.
Some refrences which might help:
http://www.enode.com/x/markup/tutorial/mvc.html
http://cristobal.baray.com/indiana/projects/mvc.html