@SuppressWarnings("unchecked")
    @Override
    public void actionPerformed(ActionEvent e) {
        if (log.isDebugEnabled())
            log.debug("Method call. Arguments: " + e.getActionCommand() + " "
                    + e.getSource());
        try {
            if ("AddGroup".equals(e.getActionCommand()))
                server.addGroup((Group) e.getSource());
            if ("AddStudent".equals(e.getActionCommand()))
                server.addStudent((Student) e.getSource());
            if ("RemoveGroup".equals(e.getActionCommand()))
                server.removeGroup((String) e.getSource());
            if ("RemoveStudent".equals(e.getActionCommand()))
                server.removeStudent((Integer) e.getSource());
            if ("UptadeGroup".equals(e.getActionCommand()))
                server.updateGroup((Group) e.getSource());
            if ("UpdateStudent".equals(e.getActionCommand()))
                server.updateStudent((Student) e.getSource());
            if ("UpdateGroupNumber".equals(e.getActionCommand())) {
                List<Object> params = (List<Object>) e.getSource();
                server.updateGroup((String) params.get(0),
                        (String) params.get(1));
            }
        } catch (ServerException ex) {
            ControllerException e1 = new ControllerException(ex);
            log.error("Exception", e1);
            view.exceptionHandling(e1);
        }

    }