@BeforeClass
 public static void init() {
   MainController.getInstance();
   controller = StudentController.getInstance();
   major = (MajorDao) DaoFactory.getMajorDao();
   major.create(new Major());
 }
Ejemplo n.º 2
0
  /**
   * Adds new conversations to the list when the list is refreshed
   *
   * @throws XMPPException
   */
  private void addNewConversationsToList() throws XMPPException {
    UserDataWrapper userWrapper = null;

    for (Conversation c : this.chatCollection.getVisibleConversations()) {
      userWrapper = null;
      for (UserDataWrapper u : this.users) {
        if (u.getConversation().getUser() != null) {
          u.getConversation().getUser().getTypingState();
        }

        if (u.getConversation() == c) {
          userWrapper = u;
          break;
        }
      }
      if (userWrapper == null) {
        userWrapper = new UserDataWrapper(c, this.model);
        this.users.add(userWrapper);
      }

      if (!listPane.sidePanelUserExists(userWrapper)) {
        ImageIcon leafIcon = controller.getAvatarPicture(c.getUser());
        listPane.addElement(userWrapper.toString(), leafIcon, userWrapper, new SelectListener());
      }
    }

    // refreshes the list on the screen with the new data
    listPane.updateUI();
  }
Ejemplo n.º 3
0
 /** Implementação do método acaoEscolhida */
 @Override
 public void acaoEscolhida(String acao) {
   if (acao.equals("login")) {
     if (login(views.get("loginView").getModelo())) {
       MainController.getInstance().acaoEscolhida("mainView");
     } else {
       System.out.println("Usuário Inválido");
       renderizaView("loginView");
     }
   } else {
     renderizaView("loginView");
   }
 }