Exemplo n.º 1
0
  public static void main(String[] args) {

    MyView view = new MyView();
    MyModel model = new MyModel();

    Presenter presenter = new Presenter(model, view);
    model.addObserver(presenter);
    view.addObserver(presenter);
    view.start();
  }
Exemplo n.º 2
0
  public static void main(String[] args) {

    MyModel m = new MyModel();
    MyView v = new MyView();
    MazeClientHandler ch = new MazeClientHandler();
    ServerWindow sw = new ServerWindow(235, 80, "Maze Server");
    Presenter p = new Presenter(m, v, ch, sw);
    m.addObserver(p);
    v.addObserver(p);
    ch.addObserver(p);
    sw.addObserver(p);
    sw.run();
  }
Exemplo n.º 3
0
  public static void main(String[] args) {

    MyModel model = new MyModel();
    MyView view =
        new MyView(
            new BufferedReader(new InputStreamReader(System.in)), new PrintWriter(System.out));

    MyController controller = new MyController(model, view);
    model.setController(controller);
    view.setController(controller);

    view.start();
  }