Examples of MFileManager


Examples of org.freeplane.features.url.mindmapmode.MFileManager

      modeController.getMapController().addNodeSelectionListener(mapChangeAdapter);
      modeController.getMapController().addNodeChangeListener(mapChangeAdapter);
      modeController.getMapController().addMapChangeListener(mapChangeAdapter);
      controller.getMapViewManager().addMapSelectionListener(mapChangeAdapter);
    }
    final MFileManager fileManager = new MFileManager();
    UrlManager.install(fileManager);
    MMapIO.install(modeController);
    controller.getMapViewManager().addMapViewChangeListener(fileManager);
    IconController.install(new MIconController(modeController));
    new ProgressFactory().installActions(modeController);
View Full Code Here

Examples of org.freeplane.features.url.mindmapmode.MFileManager

    NodeStyleController.install(new MNodeStyleController(modeController));
    EdgeController.install(new MEdgeController(modeController));
    CloudController.install(new MCloudController(modeController));
    NoteController.install(new MNoteController(modeController));
    LinkController.install(new MLinkController());
    MFileManager.install(new MFileManager());
    MMapIO.install(modeController);
    final MLogicalStyleController logicalStyleController = new MLogicalStyleController(modeController);
    logicalStyleController.initS();
    LogicalStyleController.install(logicalStyleController);
    AttributeController.install(new MAttributeController(modeController));
View Full Code Here

Examples of org.freeplane.features.url.mindmapmode.MFileManager

        }
    }

  void importOldDefaultStyle() {
    final ModeController modeController = Controller.getCurrentController().getModeController(MModeController.MODENAME);
    MFileManager fm = MFileManager.getController(modeController);
    final String standardTemplateName = fm.getStandardTemplateName();
    final File userDefault;
    final File absolute = new File(standardTemplateName);
    if(absolute.isAbsolute())
      userDefault = absolute;
    else{
      final File userTemplates = fm.defaultUserTemplateDir();
      userDefault= new File(userTemplates, standardTemplateName);
    }
    if(userDefault.exists()){
      return;
    }
    userDefault.getParentFile().mkdirs();
    if(! userDefault.getParentFile().exists()){
      return;
    }
    MapModel defaultStyleMap = new MapModel();
    final File allUserTemplates = fm.defaultStandardTemplateDir();
    final File standardTemplate = new File(allUserTemplates, "standard.mm");
    try {
      fm.loadCatchExceptions(standardTemplate.toURL(), defaultStyleMap);
    }
    catch (Exception e) {
      LogUtils.warn(e);
      try {
        fm.loadCatchExceptions(ResourceController.getResourceController().getResource("/styles/viewer_standard.mm"), defaultStyleMap);
      }
      catch (Exception e2) {
        defaultStyleMap.createNewRoot();
        LogUtils.severe(e);
      }
    }
        final NodeStyleController nodeStyleController = NodeStyleController.getController(modeController);
        updateDefaultStyle(nodeStyleController, defaultStyleMap);
        updateNoteStyle(nodeStyleController, defaultStyleMap);

        try {
          fm.writeToFile(defaultStyleMap, userDefault);
        }
        catch (IOException e) {
        }

View Full Code Here

Examples of org.freeplane.features.url.mindmapmode.MFileManager

  }

  public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final ModeController modeController = controller.getModeController();
    final MFileManager fileManager = MFileManager.getController(modeController);
    final JFileChooser fileChooser = fileManager.getFileChooser(true);
    fileChooser.setMultiSelectionEnabled(false);
    final int returnVal = fileChooser.showOpenDialog(controller.getMapViewManager().getMapViewComponent());
    if (returnVal != JFileChooser.APPROVE_OPTION) {
      return;
    }
View Full Code Here

Examples of org.freeplane.features.url.mindmapmode.MFileManager

    final Controller controller = Controller.getCurrentController();
    modeController = new MModeController(controller);
    controller.addModeController(modeController);
    controller.selectModeForBuild(modeController);
    new MMapController(modeController);
    final MFileManager fileManager = new MFileManager();
    UrlManager.install(fileManager);
    MMapIO.install(modeController);
    controller.getMapViewManager().addMapViewChangeListener(fileManager);
    IconController.install(new MIconController(modeController));
    new ProgressFactory().installActions(modeController);
View Full Code Here

Examples of org.freeplane.features.url.mindmapmode.MFileManager

      super(urlManager, mapController);
      this.fileManager = urlManager;
      this.mapController = mapController;
    }
  public static void install(MModeController modeController){
    MFileManager urlManager = (MFileManager) modeController.getExtension(UrlManager.class);
    MMapController mapController = (MMapController) modeController.getMapController();
    final MMapIO mapIO = new MMapIO(urlManager, mapController);
    modeController.addExtension(MapIO.class, mapIO);
  }
View Full Code Here

Examples of org.freeplane.features.url.mindmapmode.MFileManager

          LogUtils.info("installing add-on from " + urlField.getText());
          controller.getViewController().setWaitingCursor(true);
          final URL url = toURL(urlField.getText());
          setStatusInfo(getText("status.installing"));
          final ModeController modeController = controller.getModeController(MModeController.MODENAME);
          final MFileManager fileManager = (MFileManager) MFileManager.getController(modeController);
          MapModel newMap = new MMapModel();
          if (!fileManager.loadCatchExceptions(url, newMap)) {
              LogUtils.warn("can not load " + url);
              return;
          }
          controller.getModeController().getMapController().fireMapCreated(newMap);
          AddOnProperties addOn = (AddOnProperties) ScriptingEngine.executeScript(newMap.getRootNode(),
View Full Code Here

Examples of org.freeplane.features.url.mindmapmode.MFileManager

      if(file == null){
        alternativeURL =  url;
      }
      else{
        if(file.exists()){
          final MFileManager fileManager = MFileManager.getController(getMModeController());
          File alternativeFile = fileManager.getAlternativeFile(file, AlternativeFileMode.AUTOSAVE);
          if(alternativeFile != null){
            alternativeURL = Compat.fileToUrl(alternativeFile);
          }
          else
            return false;
        }
        else{
          alternativeURL = url;
        }
      }
    }
    catch (MalformedURLException e) {
    }
    catch (URISyntaxException e) {
    }

    if(alternativeURL == null)
      return false;
    Controller.getCurrentController().getViewController().setWaitingCursor(true);
    try{
      final MapModel newModel = new MMapModel();
        final MFileManager fileManager = MFileManager.getController(getMModeController());
        fileManager.loadAndLock(alternativeURL, newModel);
      newModel.setURL(url);
      newModel.setSaved(alternativeURL.equals(url));
      fireMapCreated(newModel);
      newMapView(newModel);
      return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.