@Override public void mousePressed(MouseEvent e){
  if (e.getClickCount() == 1 && SwingUtilities.isLeftMouseButton(e)) {
    String url=getUrl(e);
    if (url != null && !isUrlDeleted(e)) {
      if (linkListener != null) {
        linkListener.linkClicked(url);
      }
      return;
    }
    User user=getUser(e);
    if (user != null) {
      for (      UserListener listener : userListener) {
        listener.userClicked(user,e);
      }
      return;
    }
    EmoticonImage emote=getEmoticon(e);
    if (emote != null) {
      for (      UserListener listener : userListener) {
        listener.emoteClicked(emote.getEmoticon(),e);
      }
      return;
    }
    Usericon usericon=getUsericon(e);
    if (usericon != null) {
      for (      UserListener listener : userListener) {
        listener.usericonClicked(usericon,e);
      }
    }
  }
 else   if (e.isPopupTrigger()) {
    openContextMenu(e);
  }
}

@ Override public void mousePressed ( MouseEvent e ) { if ( e . getClickCount ( ) == 1 && SwingUtilities . isLeftMouseButton ( e ) ) { String url = getUrl ( e ) ; if ( url != null && ! isUrlDeleted ( e ) ) { if ( linkListener != null ) { linkListener . linkClicked ( url ) ; } return ; } User user = getUser ( e ) ; if ( user != null ) { for ( UserListener listener : userListener ) { listener . userClicked ( user , e ) ; } return ; } EmoticonImage emote = getEmoticon ( e ) ; if ( emote != null ) { for ( UserListener listener : userListener ) { listener . emoteClicked ( emote . getEmoticon ( ) , e ) ; } return ; } Usericon usericon = getUsericon ( e ) ; if ( usericon != null ) { for ( UserListener listener : userListener ) { listener . usericonClicked ( usericon , e ) ; } } } else if ( e . isPopupTrigger ( ) ) { openContextMenu ( e ) ; } }
handles mouse presses . this is favourable to mouseclicked because it might work better in a fast moving chat and you won ' t select text instead of opening userinfo etc .
