OOP2

AbstractController.java

1
package be.uhasselt.oo2.mvc;
2
3
import java.util.Observable;
4
5
/**
6
 *
7
 * @author jvermeulen
8
 */
9
public abstract class AbstractController implements Controller {
10
    private Observable mModel;
11
    private View mView;
12
    
13
    public AbstractController(Observable model) {
14
        // Set the model.
15
        setModel(model);
16
    }
17
    
18
    
19
    @Override
20
    public void setView(View view) {
21
        mView = view;
22
    }
23
24
    @Override
25
    public View getView() {
26
        return mView;
27
    }
28
29
    @Override
30
    public void setModel(Observable model) {
31
        mModel = model;
32
    }
33
34
    @Override
35
    public Observable getModel() {
36
        return mModel;
37
    }
38
    
39
}
40