Package org.freeplane.features.map.MapReader

Examples of org.freeplane.features.map.MapReader.NodeTreeCreator


    private void paste(final String text, final NodeModel target, final boolean asSibling, final boolean isLeft) {
      final String[] textLines = text.split(ClipboardController.NODESEPARATOR);
      final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
      final MapReader mapReader = mapController.getMapReader();
      final NodeTreeCreator nodeTreeCreator = mapReader.nodeTreeCreator(target.getMap());
      nodeTreeCreator.setHint(Hint.MODE, Mode.CLIPBOARD);
      for (int i = 0; i < textLines.length; ++i) {
        try {
          final NodeModel newModel = nodeTreeCreator.create(new StringReader(textLines[i]));
          newModel.removeExtension(FreeNode.class);
          final boolean wasLeft = newModel.isLeft();
          mapController.insertNode(newModel, target, asSibling, isLeft, wasLeft != isLeft);
        }
        catch (final XMLException e) {
          LogUtils.severe("error on paste", e);
        }
      }
      nodeTreeCreator.finish(target);
    }
View Full Code Here

TOP

Related Classes of org.freeplane.features.map.MapReader.NodeTreeCreator

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.