Skip to content

Instantly share code, notes, and snippets.

@grkvlt
Created October 13, 2017 15:40
Show Gist options
  • Save grkvlt/434e7a53b5e57e03be6a1c4b8cd38a6f to your computer and use it in GitHub Desktop.
Save grkvlt/434e7a53b5e57e03be6a1c4b8cd38a6f to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
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