Created
October 13, 2017 15:40
-
-
Save grkvlt/434e7a53b5e57e03be6a1c4b8cd38a6f to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pauseViewer(() -> { | |
PrinterJob job = PrinterJob.getPrinterJob(); | |
job.setJobName(Optional.fromNullable(ifs.getName()).or(IFS.UNTITLED)); | |
PageFormat pf = job.defaultPage(); | |
if (getWidth() > getHeight()) { | |
pf.setOrientation(PageFormat.LANDSCAPE); | |
} else { | |
pf.setOrientation(PageFormat.PORTRAIT); | |
} | |
switch (current) { | |
case VIEWER: | |
job.setPrintable(viewer, pf); | |
break; | |
case DETAILS: | |
job.setPrintable(details, pf); | |
break; | |
} | |
boolean ok = job.printDialog(); | |
if (ok) { | |
try { | |
job.print(); | |
} catch (PrinterException pe) { | |
throw new RuntimeException(pe); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment