Exemplo n.º 1
0
  /**
   * Sets the new state of the map sharing controller and updates the Freemind window title to
   * indicate the state.
   *
   * @param newState
   */
  private void setState(int newState) {
    state = newState;

    // TODO: Hack alert. Window title setting belongs into a view...
    // Set the window title:
    switch (newState) {
      case STATE_CONNECTED:
        // TODO: Update resource files.
        controller.getFrame().setTitle(frameTitle + " - " + "Connected");
        //
        //	controller.getFrame().getFreeMindMenuBar().getMenu(0).getItem(7).setText("Disconnect");
        break;
      case STATE_NOT_CONNECTED:
        controller.getFrame().setTitle(frameTitle);
        // TODO: Update resource files.
        // Change the "File->Share" menu item to be "File->Share"
        //				if(controller.getFrame().getFreeMindMenuBar() != null)
        //					controller.getFrame().getFreeMindMenuBar().getMenu(0).getItem(7).setText("Share");

        break;
      case STATE_SENT_SHARE_REQUEST_PENDING:
        break;
      case STATE_RECEIVED_SHARE_REQUEST_PENDING:
        break;
      case STATE_SHARING_MAP:
        // TODO: Update resource files.
        controller.getFrame().setTitle(frameTitle + " - " + "Sharing Map");
        // Change the "File->Share" menu item to be "File->Stop Sharing"
        //				if(controller.getFrame().getFreeMindMenuBar() != null)
        //					controller.getFrame().getFreeMindMenuBar().getMenu(0).getItem(7).setText("Stop
        // Sharing");
        break;
      default:
    } // endswitch
  }
Exemplo n.º 2
0
 private void toggleCryptState(MindMapNode node) {
   final MindMapController mindMapController = getMindMapController();
   if (node instanceof EncryptedMindMapNode) {
     EncryptedMindMapNode encNode = (EncryptedMindMapNode) node;
     if (encNode.isAccessible()) {
       // to remove all children views:
       encNode.encrypt();
       encNode.setShuttingDown(true);
     } else {
       doPasswordCheckAndDecryptNode(encNode);
     }
     mindMapController.nodeStructureChanged(encNode);
     final MapView mapView = mindMapController.getView();
     mapView.selectAsTheOnlyOneSelected(mapView.getNodeView(encNode));
     encNode.setShuttingDown(false);
   } else {
     // box:
     JOptionPane.showMessageDialog(
         mindMapController.getFrame().getContentPane(),
         mindMapController.getText(
             "accessories/plugins/EncryptNode.properties_insert_encrypted_node_first"),
         "Freemind",
         JOptionPane.INFORMATION_MESSAGE);
   }
 }
  /**
   * null if you cannot provide a title that is present in the resources. Use the setName method to
   * set your not translateble title after that. give a resource name for the icon.
   */
  protected NodeGeneralAction(
      MindMapController modeController, final String textID, String iconPath) {
    super(
        null,
        iconPath != null ? new ImageIcon(modeController.getResource(iconPath)) : null,
        modeController);
    this.modeController = modeController;
    if (textID != null) {
      setName(modeController.getText(textID));
    }

    this.singleNodeOperation = null;
    this.actor = null;
    if (logger == null) {
      logger = modeController.getFrame().getLogger(this.getClass().getName());
    }
  }
Exemplo n.º 4
0
 public FontFamilyAction(MindMapController modeController) {
   super(modeController, "font_family", null, (NodeActorXml) null);
   addActor(this);
   // default value:
   actionFont = modeController.getFrame().getProperty("defaultfont");
 }