Package org.freeplane.features.map

Examples of org.freeplane.features.map.MapModel


  private void registerAttributeHandlers(ReadManager reader) {
    reader.addAttributeHandler(MAP_EXTENSION_XML_TAG, PROJECT_ID_XML_TAG, new IAttributeHandler() {
     
      public void setAttribute(Object map, String value) {
        final MapModel mapModel = (MapModel) map;
       
        WorkspaceMapModelExtension wmme = WorkspaceController.getMapModelExtension(mapModel);
        if(wmme.getProject() == null) {
          AWorkspaceProject prj = WorkspaceController.getCurrentModel().getProject(value);
          if(prj == null) {
            //WORKSPACE - todo: propagate exception
            LogUtils.warn("project with id="+value+" was not found");
            return;
          }
          wmme.setProject(prj);
        }
      }     
    });
   
    reader.addAttributeHandler(MAP_EXTENSION_XML_TAG, PROJECT_HOME_XML_TAG, new IAttributeHandler() {
     
      public void setAttribute(Object map, String value) {
        final MapModel mapModel = (MapModel) map;
       
        WorkspaceMapModelExtension wmme = WorkspaceController.getMapModelExtension(mapModel);
        if(wmme.getProject() == null) {
          //WORKSPACE - todo: find project for uri?
//          AWorkspaceProject prj = WorkspaceController.getCurrentModel().getProject(value);
View Full Code Here


  }

  public void actionPerformed(final ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final MapStyle mapStyle = controller.getModeController().getExtension(MapStyle.class);
    final MapModel model = controller.getMap();
    mapStyle.setProperty(model, MapStyle.RESOURCES_BACKGROUND_IMAGE, null);
  }
View Full Code Here

    getDelegate().setLeft(isLeft);
  }

  // NodeRO: R
  public Proxy.Map getMap() {
    final MapModel map = getDelegate().getMap();
    return map != null ? new MapProxy(map, getScriptContext()) : null;
  }
View Full Code Here

    info.rootID = Controller.getCurrentController().getSelection().getSelected().createID();
    findNext();
    }

  void findNext() {
    final MapModel map = Controller.getCurrentController().getMap();
    final FindNodeList info = FindNodeList.get(map);
    if (info == null || info.condition == null) {
      displayNoPreviousFindMessage();
      return;
    }
    final FilterController filterController = FilterController.getCurrentFilterController();
    final NodeModel start = Controller.getCurrentController().getSelection().getSelected();
    final NodeModel root = map.getNodeForID(info.rootID);
    if (root == null) {
      info.condition = null;
      displayNoPreviousFindMessage();
      return;
    }
View Full Code Here

  /**
   * Display a node in the display (used by find and the goto action by arrow
   * link actions).
   */
  private void displayNode(final FindNodeList info, final NodeModel node) {
    final MapModel map = node.getMap();
    final LinkedList<String> nodesUnfoldedByDisplay = new LinkedList<String>();
    NodeModel nodeOnPath = null;
    for (nodeOnPath = node; nodeOnPath != null && !info.nodesUnfoldedByDisplay.contains(nodeOnPath.createID()); nodeOnPath = nodeOnPath
        .getParentNode()) {
      if (Controller.getCurrentModeController().getMapController().isFolded(nodeOnPath)) {
        nodesUnfoldedByDisplay.add(nodeOnPath.createID());
      }
    }
    final ListIterator<String> oldPathIterator = info.nodesUnfoldedByDisplay
        .listIterator(info.nodesUnfoldedByDisplay.size());
    while (oldPathIterator.hasPrevious()) {
      final String oldPathNodeID = oldPathIterator.previous();
      final NodeModel oldPathNode = map.getNodeForID(oldPathNodeID);
      if (oldPathNode != null && oldPathNode.equals(nodeOnPath)) {
        break;
      }
      oldPathIterator.remove();
      if (oldPathNode != null) {
View Full Code Here

          return null;
        final StringBuilder rule = new StringBuilder();
        // set default font for notes:
        final NodeStyleController style = (NodeStyleController) Controller.getCurrentModeController().getExtension(
            NodeStyleController.class);
        MapModel map = modeController.getController().getMap();
        if(map != null){
            final Font defaultFont;
            defaultFont = style.getDefaultFont(map, MapStyleModel.NOTE_STYLE);
            rule.append("font-family: " + defaultFont.getFamily() + ";");
            rule.append("font-size: " + defaultFont.getSize() + "pt;");
View Full Code Here

    if (newView == null) {
      updateMenus();
      return;
    }
    final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager();
    final MapModel map = mapViewManager.getModel(newView);
    final String restoreString = getRestoreable(map);
    updateList(map, restoreString);
  }
View Full Code Here

    Controller.getCurrentController().selectMode(mode);
    File file = createFileFromRestorable(tokens);
    if(!changedToMapView)
      Controller.getCurrentModeController().getMapController().newMap(Compat.fileToUrl(file));
    else{
      final MapModel map = Controller.getCurrentController().getMap();
      Controller.getCurrentModeController().getMapController().newMapView(map);
    }
  }
View Full Code Here

  public EditStylesAction() {
    super("EditStylesAction");
  }
 
  public void actionPerformed(final ActionEvent e) {
    final MapModel map = Controller.getCurrentController().getMap();
    final MapStyleModel mapStyleModel = MapStyleModel.getExtension(map);
    final MapModel styleMap = mapStyleModel.getStyleMap();
    if(styleMap == null){
      UITools.errorMessage(TextUtils.getText("no_styles_found_in_map"));
      return;
    }
    final IUndoHandler undoHandler = (IUndoHandler) map.getExtension(IUndoHandler.class);
View Full Code Here

    dialog.setLocationRelativeTo(Controller.getCurrentController().getViewController().getJFrame());
    dialog.setVisible(true);
  }

  void commit() {
      final MapModel currentMap = Controller.getCurrentController().getMap();
      LogicalStyleController.getController().refreshMap(currentMap);
      final ModeController currentModeController = Controller.getCurrentModeController();
    currentModeController.commit();
    }
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.