Package org.freeplane.features.map

Examples of org.freeplane.features.map.MapModel


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

  public void actionPerformed(ActionEvent e) {
    final MapModel map = Controller.getCurrentController().getMap();
    final MNoteController noteController = (MNoteController) NoteController.getController();
    noteController.setShowNotesInMap(map, ! NoteController.getController().showNotesInMap(map));
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    selection.keepNodePosition(selection.getSelected(), 0.0f, 0.0f);
    setSelected();
View Full Code Here


    setSelected();
  }

  @Override
  public void setSelected() {
    final MapModel map = Controller.getCurrentController().getMap();
    final boolean notesShown = map != null && NoteController.getController().showNotesInMap(map);
    setSelected(notesShown);
  }
View Full Code Here

        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);
View Full Code Here

        return getStyleBackgroundColor(node.getMap(), LogicalStyleController.getController(modeController).getStyles(node));
      }
    });
    addShapeGetter(IPropertyHandler.STYLE, new IPropertyHandler<String, NodeModel>() {
      public String getProperty(final NodeModel node, final String currentValue) {
        final MapModel map = node.getMap();
        final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
        final Collection<IStyle> style = styleController.getStyles(node);
        final String returnedString = getStyleShape(map, style);
        return returnedString;
      }
View Full Code Here

    final NodeStyleModel style = (NodeStyleModel) node.getExtension(NodeStyleModel.class);
    return style == null ? null : style.getNodeFormat();
  }

  public int getMaxWidth(NodeModel node) {
    final MapModel map = node.getMap();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> style = styleController.getStyles(node);
    final int maxTextWidth = getStyleMaxNodeWidth(map, style);
    return maxTextWidth;
    }
View Full Code Here

    final int maxTextWidth = getStyleMaxNodeWidth(map, style);
    return maxTextWidth;
    }

  public int getMinWidth(NodeModel node) {
    final MapModel map = node.getMap();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> style = styleController.getStyles(node);
    final int minWidth = getStyleMinWidth(map, style);
    return minWidth;
    }
View Full Code Here

      }
    }

  private void updateContentStyle() {
        final NodeStyleController style = Controller.getCurrentModeController().getExtension(NodeStyleController.class);
        MapModel map = getModel();
        noteFont = UITools.scale(style.getDefaultFont(map, MapStyleModel.NOTE_STYLE));
        final MapStyleModel model = MapStyleModel.getExtension(map);
        final NodeModel detailStyleNode = model.getStyleNodeSafe(MapStyleModel.DETAILS_STYLE);
        detailFont = UITools.scale(style.getFont(detailStyleNode));
        detailBackground = style.getBackgroundColor(detailStyleNode);
View Full Code Here

  }
 
  protected URI createURI(final NodeModel node) {
    final Controller controller = Controller.getCurrentController();
    final ViewController viewController = controller.getViewController();
    final MapModel map = node.getMap();
    final File file = map.getFile();
    final boolean useRelativeUri = ResourceController.getResourceController().getProperty("links").equals(
        "relative");
    if (file == null && useRelativeUri) {
      JOptionPane.showMessageDialog(viewController.getContentPane(), TextUtils
          .getText("not_saved_for_image_error"), "Freeplane", JOptionPane.WARNING_MESSAGE);
      return null;
    }
    final UrlManager urlManager = controller.getModeController().getExtension(UrlManager.class);
    final JFileChooser chooser = urlManager.getFileChooser(null, false);
    chooser.setAcceptAllFileFilterUsed(false);
    if (factories.size() > 1) {
      final FileFilter combiFileFilter = getCombiFileFilter();
      chooser.addChoosableFileFilter(combiFileFilter);
      for (final IViewerFactory factory : factories) {
        chooser.addChoosableFileFilter(new FactoryFileFilter(factory));
      }
      chooser.setFileFilter(combiFileFilter);
    }
    else {
      chooser.setFileFilter(new FactoryFileFilter(factories.iterator().next()));
    }
    chooser.setAccessory(new ImagePreview(chooser));
    final int returnVal = chooser.showOpenDialog(Controller.getCurrentController().getViewController()
        .getContentPane());
    if (returnVal != JFileChooser.APPROVE_OPTION) {
      return null;
    }
    final File input = chooser.getSelectedFile();
    if (input == null) {
      return null;
    }
    URI uri = uriOf(input);
    if (uri == null) {
      return null;
    }
    if (useRelativeUri && uri.getScheme().equals("file")) {
      uri = LinkController.toLinkTypeDependantURI(map.getFile(), input);
    }
    return uri;
  }
View Full Code Here

      return;
    final IScriptStarter starter = (IScriptStarter) modeController.getExtension(IScriptStarter.class);
    if(starter == null)
      return;
    final NodeModel node = reminderExtension.getNode();
    final MapModel map = node.getMap();
    final Controller controller = modeController.getController();
    if(! controller.getMapViewManager().getMaps(modeController.getModeName()).containsValue(map))
      return;
    starter.executeScript(node, script);
    }
View Full Code Here

        }
      }
      if (node == null) {
        node = Controller.getCurrentModeController().getMapController().getSelectedNode();
      }
      final MapModel map = node.getMap();
      URI absoluteUri = activeView.getAbsoluteUri(map);
      if(absoluteUri == null)
        return false;
      final String sActUri = absoluteUri.toString();
      if (!sActUri.matches(".*_[0-9]{2}\\.[a-zA-Z0-9]*")) {
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.