Search in sources :

Example 1 with XsltPipeReaderFactory

use of org.freeplane.core.util.XsltPipeReaderFactory in project freeplane by freeplane.

the class XmlImporter method newMap.

private void newMap(final InputStream in, final File outputFile) throws IOException, XMLException, MalformedURLException {
    final Reader reader = new XsltPipeReaderFactory(xsltResource).getReader(in);
    final ModeController modeController = Controller.getCurrentModeController();
    final MapController mapController = modeController.getMapController();
    final MapModel map = new MMapModel();
    modeController.getMapController().getMapReader().createNodeTreeFromXml(map, reader, Mode.FILE);
    final URL mapUrl = Compat.fileToUrl(outputFile);
    map.setURL(mapUrl);
    map.setSaved(false);
    mapController.fireMapCreated(map);
    mapController.newMapView(map);
}
Also used : MMapModel(org.freeplane.features.map.mindmapmode.MMapModel) Reader(java.io.Reader) ModeController(org.freeplane.features.mode.ModeController) MMapModel(org.freeplane.features.map.mindmapmode.MMapModel) MapModel(org.freeplane.features.map.MapModel) XsltPipeReaderFactory(org.freeplane.core.util.XsltPipeReaderFactory) URL(java.net.URL) MapController(org.freeplane.features.map.MapController)

Aggregations

Reader (java.io.Reader)1 URL (java.net.URL)1 XsltPipeReaderFactory (org.freeplane.core.util.XsltPipeReaderFactory)1 MapController (org.freeplane.features.map.MapController)1 MapModel (org.freeplane.features.map.MapModel)1 MMapModel (org.freeplane.features.map.mindmapmode.MMapModel)1 ModeController (org.freeplane.features.mode.ModeController)1