|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Interface describing print lifecycle to support AWT printing, e.g. More...
Classes | |
| class | Context |
Convenient AWTPrintLifecycle context simplifying calling setupPrint(..) and AWTPrintLifecycle#releasePrint() on all AWTPrintLifecycle elements of a Container. More... | |
Public Member Functions | |
| void | setupPrint (double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) |
Shall be called before PrinterJob#print(). More... | |
| void | releasePrint () |
Shall be called after PrinterJob#print(). More... | |
Static Public Attributes | |
| static final int | DEFAULT_PRINT_TILE_SIZE = 1024 |
Interface describing print lifecycle to support AWT printing, e.g.
on AWT GLAutoDrawables.
Implementing GLAutoDrawable classes based on AWT supporting Component#print(Graphics) shall implement this interface.
Users attempting to print an AWT Container containing AWTPrintLifecycle elements shall consider decorating the Container#printAll(Graphics) call with
setupPrint(..) and releasePrint() on all AWTPrintLifecycle elements in the Container.
To minimize this burden, a user can use Context.setupPrint(..):
Container cont; double scaleGLMatXY = 72.0/glDPI; int numSamples = 0; // leave multisampling as-is PrinterJob job; ... final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(cont, scaleGLMatXY, scaleGLMatXY, numSamples); try { AWTEDTExecutor.singleton.invoke(true, new Runnable() { public void run() { try { job.print(); } catch (PrinterException ex) { ex.printStackTrace(); } } }); } finally { ctx.releasePrint(); }
Definition at line 76 of file AWTPrintLifecycle.java.
| void com.jogamp.nativewindow.awt.AWTPrintLifecycle.releasePrint | ( | ) |
Shall be called after PrinterJob#print().
See Usage.
Implemented in com.jogamp.opengl.awt.GLCanvas, com.jogamp.opengl.awt.GLJPanel, and com.jogamp.newt.awt.NewtCanvasAWT.
| void com.jogamp.nativewindow.awt.AWTPrintLifecycle.setupPrint | ( | double | scaleMatX, |
| double | scaleMatY, | ||
| int | numSamples, | ||
| int | tileWidth, | ||
| int | tileHeight | ||
| ) |
Shall be called before PrinterJob#print().
See Usage.
| scaleMatX | Graphics2D scaling factor, i.e. rendering 1/scaleMatX * width pixels |
| scaleMatY | Graphics2D scaling factor, i.e. rendering 1/scaleMatY * height pixels |
| numSamples | multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples |
| tileWidth | custom tile width for tile renderer, pass -1 for default. |
| tileHeight | custom tile height for tile renderer, pass -1 for default. FIXME: Add border size ! |
Implemented in com.jogamp.opengl.awt.GLCanvas, com.jogamp.opengl.awt.GLJPanel, and com.jogamp.newt.awt.NewtCanvasAWT.
|
static |
Definition at line 78 of file AWTPrintLifecycle.java.