예제 #1
0
 /**
  * Called by the JabberListener to indicate that a user has accepted or declined an invitation to
  * share a map.
  *
  * @param isAccepted
  */
 public void setMapShareRequestAccepted(String userName, boolean isAccepted) {
   if (state == STATE_SENT_SHARE_REQUEST_PENDING) {
     if (isAccepted) {
       setState(STATE_SHARING_MAP);
       sender.setShareMapUser(userName);
       sender.isMapShared(true);
       // TODO: Send current mind map to share user.
       /*
        * MindMapXMLElement mapElement = new
        * MindMapXMLElement(controller.getFrame()); try { StringWriter
        * sw = new StringWriter();
        *
        * sw.write(" <map version=\"" +
        * controller.getFrame().getFreemindVersion()+"\">\n");
        * MindMapMapModel mindMapNodeModel = (MindMapMapModel)
        * controller.getView().getModel();
        * mindMapNodeModel.saveInternal(sw, true); // save(sw,
        * (MindMapMapModel) controller.getView().getModel().getRoot());
        * sw.write(" </map>\n");
        *
        * sender.sendMap(sw.getBuffer().toString()); } catch(Exception
        * e) { freemind.main.Resources.getInstance().logException(e); }
        */
       jabberConnectionWizardView.showSharingAcceptedMessage(userName);
     } else {
       setState(STATE_CONNECTED);
       sender.isMapShared(false);
       jabberConnectionWizardView.showSharingDeclinedMessage(userName);
     }
   } // endif
 }
예제 #2
0
 private void addListeners() {
   jabberConnectionWizardView.addCloseButtonMouseListener(new CloseButtonClickListener());
   jabberConnectionWizardView.addNextButtonMouseListener(new NextButtonClickListener());
   jabberConnectionWizardView.addBackButtonMouseListener(new BackButtonClickListener());
   jabberConnectionWizardView.addAcceptButtonMouseListener(new AcceptButtonClickListener());
   jabberConnectionWizardView.addDeclineButtonMouseListener(new DeclineButtonClickListener());
 }
예제 #3
0
 public void setMapSharingRequested(String username, String mapContent, String mapFileName) {
   setState(STATE_RECEIVED_SHARE_REQUEST_PENDING);
   mapSharingRequestingUser = username;
   this.mapContent = mapContent;
   this.mapFileName = mapFileName;
   jabberConnectionWizardView.showMapShareAcceptDeclineMessage(mapSharingRequestingUser);
 }
예제 #4
0
 public void showMapSharingDialogue() {
   if (state == STATE_SHARING_MAP || state == STATE_CONNECTED) {
     // TODO: Ask "Are you sure you want to stop sharing?"
     sender.sendMapSharingStopRequest();
     stopSharing();
   } else {
     jabberConnectionWizardView.showConnectToServerDialog();
   }
 }
예제 #5
0
 /**
  * Called by the JabberListener when the other user no longer shares his/her map.
  *
  * @param username
  */
 public void setSharingStopped(String username) {
   stopSharing();
   jabberConnectionWizardView.showSharingStoppedMessage(username);
 }