use of org.freeplane.features.export.mindmapmode.ExportToImage in project freeplane by freeplane.
the class PresentationPngExporter method exportSlide.
private void exportSlide(File presentationDirectory, Slide slide) {
final NodeModel placedNode = slide.getCurrentPlacedNode();
if (placedNode != null)
slide.apply(presentationZoomFactor);
else
slide.apply(1f);
mapViewComponent.validate();
mapViewComponent.setSize(mapViewComponent.getPreferredSize());
File exportFile = new File(presentationDirectory, FileUtils.validFileNameOf(slide.getName()) + ".png");
final ExportToImage exporter = ExportToImage.toPNG();
final Controller controller = Controller.getCurrentController();
final MapModel map = controller.getMap();
if (placedNode != null) {
final Dimension slideSize;
if (ResourceController.getResourceController().getBooleanProperty(SWITCH_TO_FULL_SCREEN_PROPERTY))
slideSize = mapViewComponent.getGraphicsConfiguration().getBounds().getSize();
else
slideSize = SwingUtilities.getWindowAncestor(mapViewComponent).getSize();
exporter.export(map, slideSize, placedNode, slide.getPlacedNodePosition(), exportFile);
} else
exporter.export(map, exportFile);
}
Aggregations