Package org.freeplane.features.map

Examples of org.freeplane.features.map.MapModel


    }
    try {
      final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
      mapController.newUntitledMap(Compat.fileToUrl(file));
      final Controller controller = Controller.getCurrentController();
      final MapModel map = controller.getMap();
      final Object rootText = map.getRootNode().getUserObject();
      if(rootText instanceof NamedObject){
        map.getRootNode().setText(rootText.toString());
      }
      controller.getModeController().getMapController().setSaved(map, true);
      return map;
    }
    catch (Exception e) {
View Full Code Here


    final IActor actor = new IActor() {
      private final String oldEquation = equation;

      public void act() {
        model.setEquation(newEquation);
        final MapModel map = Controller.getCurrentModeController().getController().getMap();
        Controller.getCurrentModeController().getMapController().setSaved(map, false);
      }

      public String getDescription() {
        return "setLatexEquationUndoable";
View Full Code Here

    links = new LinkedList<NodeLinkModel>();
  }

  public void addArrowlink(final NodeLinkModel newLink) {
    links.add(newLink);
    final MapModel map = newLink.getSource().getMap();
    addLinkToMap(map, newLink);
  }
View Full Code Here

  public ImportLinkedBranchWithoutRootAction() {
    super("ImportLinkedBranchWithoutRootAction");
  }

  public void actionPerformed(final ActionEvent e) {
    final MapModel map = Controller.getCurrentController().getMap();
    final ModeController modeController = Controller.getCurrentModeController();
    final NodeModel selected = modeController.getMapController().getSelectedNode();
    if (selected == null || NodeLinks.getLink(selected) == null) {
      JOptionPane.showMessageDialog(Controller.getCurrentController().getMapViewManager().getMapViewComponent(), TextUtils
          .getText("import_linked_branch_no_link"));
      return;
    }
    try {
      final URI uri = NodeLinks.getLink(selected);
      final URL url = map.getURL();
      final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(url, uri
          .getPath()).getFile());
      final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
      map.setURL(url);
      for (final NodeModel child : Controller.getCurrentModeController().getMapController().childrenUnfolded(node)) {
        ((MMapController) modeController.getMapController()).insertNode(child, selected);
      }
      ((MLinkController) LinkController.getController()).setLink(selected, (URI) null, LinkController.LINK_ABSOLUTE);
    }
View Full Code Here

      copier.copy(key, from, to);
    }
  }

  public void undoableCopyExtensions(final Object key, final NodeModel from, final NodeModel to) {
    final MapModel map = to.getMap();
    if (map == null) {
      copyExtensions(key, from, to);
      return;
    }
    final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
    if (undoHandler == null) {
      copyExtensions(key, from, to);
      return;
    }
    final NodeModel backup = new NodeModel(null);
View Full Code Here

  public ImportLinkedBranchAction() {
    super("ImportLinkedBranchAction");
  }

  public void actionPerformed(final ActionEvent e) {
    final MapModel map = Controller.getCurrentController().getMap();
    final ModeController modeController = Controller.getCurrentModeController();
    final NodeModel selected = modeController.getMapController().getSelectedNode();
    final IMapViewManager viewController = Controller.getCurrentController().getMapViewManager();
    if (selected == null || NodeLinks.getLink(selected) == null) {
      JOptionPane.showMessageDialog((viewController.getMapViewComponent()), TextUtils
          .getText("import_linked_branch_no_link"));
      return;
    }
    final URI uri = NodeLinks.getLink(selected);
    try {
      final File file = uri.isAbsolute() && !uri.isOpaque() ? new File(uri) : new File(new URL(map.getURL(), uri
          .getPath()).getFile());
      final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, file);
      PersistentNodeHook.removeMapExtensions(node);
      ((MMapController) modeController.getMapController()).insertNode(node, selected);
      ((MLinkController) LinkController.getController()).setLink(selected, (URI) null, LinkController.LINK_ABSOLUTE);
View Full Code Here

  void redo() {
    if (!filters.hasNext()) {
      return;
    }
    Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final Filter next = filters.next();
    next.applyFilter(this, map, true);
  }
View Full Code Here

    next.applyFilter(this, map, true);
  }

  void undo() {
    Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final Filter previous = filters.previous();
    undoImpl(map);
    while (previous != filters.next()) {
      ;
    }
View Full Code Here

  public void actionPerformed(final ActionEvent e) {
    final ModeController modeController = Controller.getCurrentModeController();
    ArrayList<IIconInformation> actions = new ArrayList<IIconInformation>();
   
    final Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final IconRegistry iconRegistry = map.getIconRegistry();
    final ListModel usedIcons = iconRegistry.getIconsAsListModel();
    for(int i = 0; i < usedIcons.getSize(); i++){
      final Object icon = usedIcons.getElementAt(i);
      if(icon instanceof MindIcon){
        actions.add(new IconAction((MindIcon) icon));
View Full Code Here

      chooser.addChoosableFileFilter(fileFilter);
    }
    final int returnVal = chooser.showOpenDialog(Controller.getCurrentController().getViewController().getContentPane());
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      try {
        final MapModel map = parent.getMap();
        final URL url = map.getURL();
        final NodeModel node = ((MFileManager) UrlManager.getController()).loadTree(map, chooser.getSelectedFile());
        map.setURL(url);
        PersistentNodeHook.removeMapExtensions(node);
        ((MMapController) Controller.getCurrentModeController().getMapController()).insertNode(node, parent);
      }
      catch (final Exception ex) {
        UrlManager.getController().handleLoadingException(ex);
View Full Code Here

TOP

Related Classes of org.freeplane.features.map.MapModel

Copyright © 2018 www.massapicom. 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.