|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.gui2.ModelController
The ModelController manages a list of views of one model object.
If the model changes, a simple call of makeDirty()
notifies
all registered views of that change and forces them to update.
Constructor Summary | |
ModelController(java.lang.Object source)
Constructs a new ModelController connected with the specified source object. |
Method Summary | |
void |
addView(DrawAtom drw)
Adds a view to the ModelController. |
boolean |
containsView(DrawAtom drw)
Checks if the given DrawAtom is registered as view
on this ModelController. |
void |
makeDirty()
Notifies all registered views of a change at the model. |
void |
removeView(DrawAtom drw)
Removes a view from the ModelController. |
void |
setSource(java.lang.Object source)
Sets the source object (the model) of the controller. |
java.lang.Object |
source()
Returns the source object (the model) of the controller. |
boolean |
sourceChanged()
Returns true , if the source object has changed.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ModelController(java.lang.Object source)
source
- source (model) object of the controller.Method Detail |
public java.lang.Object source()
public void setSource(java.lang.Object source)
makeDirty()
.source
- the new source objectpublic boolean sourceChanged()
true
, if the source object has changed.
The method will only return true
, while the
views are set dirty as result of a source change.true
, if the source object has changed.public void addView(DrawAtom drw)
drw
- DrawAtom
to add as view.public void removeView(DrawAtom drw)
drw
- DrawAtom
to remove.public boolean containsView(DrawAtom drw)
DrawAtom
is registered as view
on this ModelController.drw
- DrawAtom
to checktrue
, if drw
is registered as
view, false
otherwise.public void makeDirty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |