use of com.igormaznitsa.mindmap.print.MMDPrint in project netbeans-mmd-plugin by raydac.
the class MMDGraphEditor method getPages.
@Override
public PrintPage[][] getPages(final int paperWidthInPixels, final int paperHeightInPixels, final double pageZoomFactor) {
final MMDPrintOptions printOptions = new MMDPrintOptions();
if (pageZoomFactor < 0.1d) {
printOptions.setScaleType(MMDPrintOptions.ScaleType.FIT_TO_SINGLE_PAGE);
} else if (pageZoomFactor > 20.0d) {
printOptions.setScaleType(MMDPrintOptions.ScaleType.ZOOM);
printOptions.setScale(1.0d);
} else {
printOptions.setScaleType(MMDPrintOptions.ScaleType.ZOOM);
printOptions.setScale(pageZoomFactor);
}
final com.igormaznitsa.mindmap.print.PrintPage[][] pages = new MMDPrint(this.mindMapPanel, paperWidthInPixels, paperHeightInPixels, printOptions).getPages();
final PrintPage[][] result = new PrintPage[pages.length][];
for (int i = 0; i < pages.length; i++) {
result[i] = new PrintPage[pages[i].length];
for (int p = 0; p < pages[i].length; p++) {
result[i][p] = new PrintPageAdapter(pages[i][p]);
}
}
return result;
}
Aggregations