|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
com.jogamp.newt.awt.NewtCanvasAWT
public class NewtCanvasAWT
AWT Canvas containing a NEWT Window using native parenting.
setShallUseOffscreenLayer(true)
maybe called to use an offscreen drawable (FBO or PBuffer) allowing
the underlying JAWT mechanism to composite the image, if supported.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Nested classes/interfaces inherited from interface javax.media.nativewindow.WindowClosingProtocol |
|---|
WindowClosingProtocol.WindowClosingMode |
| Nested classes/interfaces inherited from interface com.jogamp.nativewindow.awt.AWTPrintLifecycle |
|---|
AWTPrintLifecycle.Context |
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface com.jogamp.nativewindow.awt.AWTPrintLifecycle |
|---|
DEFAULT_PRINT_TILE_SIZE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
NewtCanvasAWT()
Instantiates a NewtCanvas without a NEWT child. |
|
NewtCanvasAWT(GraphicsConfiguration gc)
Instantiates a NewtCanvas without a NEWT child. |
|
NewtCanvasAWT(GraphicsConfiguration gc,
Window child)
Instantiates a NewtCanvas with a NEWT child. |
|
NewtCanvasAWT(Window child)
Instantiates a NewtCanvas with a NEWT child. |
|
| Method Summary | |
|---|---|
void |
addNotify()
|
void |
destroy()
Destroys this resource: Make the NEWT Child invisible Disconnects the NEWT Child from this Canvas NativeWindow, reparent to NULL Issues destroy() on the NEWT Child
Remove reference to the NEWT Child
|
WindowClosingProtocol.WindowClosingMode |
getDefaultCloseOperation()
|
NativeWindow |
getNativeWindow()
|
Window |
getNEWTChild()
|
boolean |
getShallUseOffscreenLayer()
Returns the property set by OffscreenLayerOption.setShallUseOffscreenLayer(boolean). |
boolean |
getSkipJAWTDestroy()
See setSkipJAWTDestroy(boolean). |
boolean |
isApplet()
Returns true if the AWT component is parented to an Applet,
otherwise false. |
boolean |
isAWTEventPassThrough()
Returns true if Key and Mouse input events will be passed through AWT,
otherwise only the NEWT child will receive them. |
boolean |
isOffscreenLayerSurfaceEnabled()
Returns true if this instance uses an offscreen layer, otherwise false. |
void |
paint(Graphics g)
|
void |
print(Graphics graphics)
|
void |
releasePrint()
Shall be called after PrinterJob.print(). |
void |
removeNotify()
|
void |
reshape(int x,
int y,
int width,
int height)
|
WindowClosingProtocol.WindowClosingMode |
setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode op)
|
Window |
setNEWTChild(Window newChild)
Sets a new NEWT child, provoking reparenting. |
void |
setShallUseOffscreenLayer(boolean v)
Request an offscreen layer, if supported. |
void |
setSkipJAWTDestroy(boolean v)
Mitigates Bug 910 (IcedTea-Web), i.e. |
void |
setupPrint(double scaleMatX,
double scaleMatY,
int numSamples,
int tileWidth,
int tileHeight)
Shall be called before PrinterJob.print(). |
void |
update(Graphics g)
|
| Methods inherited from class java.awt.Canvas |
|---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
| Constructor Detail |
|---|
public NewtCanvasAWT()
public NewtCanvasAWT(GraphicsConfiguration gc)
public NewtCanvasAWT(Window child)
public NewtCanvasAWT(GraphicsConfiguration gc,
Window child)
| Method Detail |
|---|
public void setShallUseOffscreenLayer(boolean v)
OffscreenLayerOption
Shall be called before the first NativeSurface.lockSurface(),
and hence before realization.
setShallUseOffscreenLayer in interface OffscreenLayerOptionOffscreenLayerOption.getShallUseOffscreenLayer(),
OffscreenLayerOption.isOffscreenLayerSurfaceEnabled()public final boolean getShallUseOffscreenLayer()
OffscreenLayerOptionOffscreenLayerOption.setShallUseOffscreenLayer(boolean).
getShallUseOffscreenLayer in interface OffscreenLayerOptionpublic final boolean isOffscreenLayerSurfaceEnabled()
OffscreenLayerOption
This instance is an offscreen layer, if setShallUseOffscreenLayer(true)
has been called before it's realization and first lock and the underlying implementation supports it.
NativeSurface.lockSurface().
isOffscreenLayerSurfaceEnabled in interface OffscreenLayerOptionOffscreenLayerOption.setShallUseOffscreenLayer(boolean)public final boolean isApplet()
Applet,
otherwise false. This information is valid only after addNotify() is issued.
public Window setNEWTChild(Window newChild)
A previously detached newChild will be released to top-level status
and made invisible.
Note: When switching NEWT child's, detaching the previous first via setNEWTChild(null)
produced much cleaner visual results.
public Window getNEWTChild()
public NativeWindow getNativeWindow()
removeNotify() has been called,
or addNotify() hasn't been called yet.public WindowClosingProtocol.WindowClosingMode getDefaultCloseOperation()
getDefaultCloseOperation in interface WindowClosingProtocolWindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE,
WindowClosingProtocol.WindowClosingMode.DO_NOTHING_ON_CLOSEpublic WindowClosingProtocol.WindowClosingMode setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode op)
setDefaultCloseOperation in interface WindowClosingProtocolop - the new close operation value
WindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE,
WindowClosingProtocol.WindowClosingMode.DO_NOTHING_ON_CLOSEpublic final void setSkipJAWTDestroy(boolean v)
skipJAWTDestroy defaults to false.
Due to above IcedTea-Web issue the Applet code needs to avoid JAWT destruction before
Applet.destroy() is reached by setting skipJAWTDestroy to true.
Afterwards the value should be reset to false and destroy() needs to be called,
which finally will perform the pending JAWT destruction.
public final boolean getSkipJAWTDestroy()
setSkipJAWTDestroy(boolean).
public void addNotify()
addNotify in class Canvaspublic void removeNotify()
removeNotify in class Componentpublic final void destroy()
destroy() on the NEWT Child
Window.destroy()public void paint(Graphics g)
paint in class Canvaspublic void update(Graphics g)
update in class Canvas
public void reshape(int x,
int y,
int width,
int height)
reshape in class Component
public void setupPrint(double scaleMatX,
double scaleMatY,
int numSamples,
int tileWidth,
int tileHeight)
AWTPrintLifecyclePrinterJob.print().
See Usage.
setupPrint in interface AWTPrintLifecyclescaleMatX - Graphics2D scaling factor, i.e. rendering 1/scaleMatX * width pixelsscaleMatY - Graphics2D scaling factor, i.e. rendering 1/scaleMatY * height pixelsnumSamples - multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samplestileWidth - custom tile width for tile renderer, pass -1 for default.tileHeight - custom tile height for tile renderer, pass -1 for default.public void releasePrint()
AWTPrintLifecyclePrinterJob.print().
See Usage.
releasePrint in interface AWTPrintLifecyclepublic void print(Graphics graphics)
print in class Componentpublic final boolean isAWTEventPassThrough()
true if Key and Mouse input events will be passed through AWT,
otherwise only the NEWT child will receive them.
Normally only the NEWT child will receive Key and Mouse input events.
In offscreen mode, e.g. OSX/CALayer, the AWT events will be received and translated into NEWT events
and delivered to the NEWT child window.
Note: AWT key events will consumed in pass-through mode.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||