12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- /*
- * 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 gui.Hauptfenster;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.text.ParseException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import javax.sip.InvalidArgumentException;
- import javax.sip.SipException;
- import model.VoIP;
-
- /**
- *
- * @author Normal
- */
- public class CommandController implements ActionListener
- {
- private VoIP model;
- private Hauptfenster view;
- public CommandController(VoIP model, Hauptfenster view)
- {
- this.model = model;
- this.view = view;
-
- }
- public void registerEvents()
- {
- view.getBtn1().addActionListener(this);
- }
-
- @Override
- public void actionPerformed(ActionEvent e)
- {
- try
- {
- model.sendRegister("123123", 1);
- }
- catch (ParseException ex)
- {
- Logger.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
- }
- catch (InvalidArgumentException ex)
- {
- Logger.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
- }
- catch (SipException ex)
- {
- Logger.getLogger(CommandController.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
|