123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
- package controller;
-
- import java.util.Observable;
- import java.util.Observer;
- import model.Transmitter;
- import view.ChatView;
-
- /**
- *
- * @author Apollo
- */
- public class ReceiveAdapter implements Observer
- {
- ChatView view;
- Transmitter model;
-
- public ReceiveAdapter(ChatView view,Transmitter model)
- {
- this.view = view;
- this.model = model;
- }
-
- public void registerEvents()
- {
- model.addObserver(this);
- }
-
- @Override
- public void update(Observable arg0, Object arg1)
- {
- String message = model.getNachricht();
- view.getChatanzeige().append(message+"\n");
- }
- }
-
|