Examples of MMapIO


Examples of org.freeplane.features.mapio.mindmapmode.MMapIO

    if (save) {
      if (!createFolderStructure(f)) {
        return null;
      }
    }
    final MMapIO mapIO = (MMapIO) MModeController.getMModeController().getExtension(MapIO.class);

    MapModel map = mapIO.newMapFromDefaultTemplate();
    if (map == null) {
      return null;
    }

    if (name != null) {
      //WORKSPACE - fixme: the updates do not show in mapview (ask dimitry)
      //String oldName = map.getRootNode().getText();
      map.getRootNode().setText(name);
      Controller.getCurrentController().getMapViewManager().getMapViewComponent().repaint();
    }

    if (save) {
      mapIO.save(map, f);
    }
    else {
      if(f != null) {
        try {
          map.setURL(Compat.fileToUrl(f));
        } catch (MalformedURLException e) {
          LogUtils.warn(WorkspaceNewMapAction.class + ": " + e.getMessage());
        }
      }
      Controller.getCurrentModeController().getMapController().setSaved(map, false);
    }


    //WORKSPACE - todo: remove the following when the "fixme" above has been fixed
    if(f != null) {
      Controller.getCurrentController().close(true);
      try {
        mapIO.newMap(f.toURI().toURL());
      } catch (Exception e) {
        LogUtils.severe(e);
      }
    }
    return map;
View Full Code Here

Examples of org.freeplane.features.mapio.mindmapmode.MMapIO

    return ProxyUtils.findAll(Controller.getCurrentController().getMap().getRootNode(), scriptContext, false);
    }

  public Map newMap() {
    final MapModel oldMap = Controller.getCurrentController().getMap();
    final MMapIO mapIO = (MMapIO) Controller.getCurrentModeController().getExtension(MapIO.class);
    final MapModel newMap = mapIO.newMapFromDefaultTemplate();
    restartTransaction(oldMap, newMap);
    return new MapProxy(newMap, scriptContext);
  }
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.