|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.nativewindow.impl.jawt.JAWTWindow
public abstract class JAWTWindow
Field Summary | |
---|---|
protected Rectangle |
bounds
|
protected Component |
component
|
protected AbstractGraphicsConfiguration |
config
|
protected static boolean |
DEBUG
|
protected long |
drawable
|
Fields inherited from interface javax.media.nativewindow.NativeSurface |
---|
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED |
Constructor Summary | |
---|---|
JAWTWindow(Object comp,
AbstractGraphicsConfiguration config)
|
Method Summary | |
---|---|
void |
destroy()
destroys the window and releases windowing related resources. |
Component |
getAWTComponent()
|
Rectangle |
getBounds()
|
long |
getDisplayHandle()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
AbstractGraphicsConfiguration |
getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window. |
int |
getHeight()
Returns the current height of this surface. |
Point |
getLocationOnScreen(Point storage)
Returns the current absolute location of this window. |
protected abstract Point |
getLocationOnScreenImpl(int x,
int y)
|
NativeWindow |
getParent()
|
int |
getScreenIndex()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
long |
getSurfaceHandle()
Returns the handle to the surface for this NativeSurface. |
Thread |
getSurfaceLockOwner()
Return the locking owner's Thread, or null if not locked. |
int |
getWidth()
Returns the current width of this surface. |
long |
getWindowHandle()
Returns the window handle for this NativeWindow. |
int |
getX()
Returns the current x position of this window, relative to it's parent. |
int |
getY()
Returns the current y position of this window, relative to it's parent. |
protected void |
invalidate()
|
boolean |
isSurfaceLocked()
Return if surface is locked |
boolean |
isSurfaceLockedByOtherThread()
Return if surface is locked by another thread, ie not the current one |
int |
lockSurface()
Lock the surface of this native window |
protected abstract int |
lockSurfaceImpl()
|
void |
setSize(int width,
int height)
|
boolean |
surfaceSwap()
Provide a mechanism to utilize custom (pre-) swap surface code. |
void |
surfaceUpdated(Object updater,
NativeSurface ns,
long when)
Notification of a surface update event. |
void |
surfaceUpdated(Object updater,
NativeWindow window,
long when)
|
String |
toString()
|
void |
unlockSurface()
Unlock the surface of this native window Shall not modify the surface handle, see NativeSurface.lockSurface() |
protected abstract void |
unlockSurfaceImpl()
|
protected void |
updateBounds(JAWT_Rectangle jawtBounds)
|
protected abstract void |
validateNative()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final boolean DEBUG
protected Component component
protected AbstractGraphicsConfiguration config
protected long drawable
protected Rectangle bounds
Constructor Detail |
---|
public JAWTWindow(Object comp, AbstractGraphicsConfiguration config)
Method Detail |
---|
protected abstract void validateNative() throws NativeWindowException
NativeWindowException
protected void invalidate()
protected final void updateBounds(JAWT_Rectangle jawtBounds)
public final Rectangle getBounds()
public final Component getAWTComponent()
public final void surfaceUpdated(Object updater, NativeSurface ns, long when)
SurfaceUpdatedListener
surfaceUpdated
in interface SurfaceUpdatedListener
updater
- is the caller object who updated the surface,
e.g. a JOGL GLDrawable.ns
- the updated NativeSurfacewhen
- the time in ms, when the surface was updatedprotected abstract int lockSurfaceImpl() throws NativeWindowException
NativeWindowException
public final int lockSurface() throws NativeWindowException
NativeSurface
The surface handle, see NativeSurface.lockSurface()
,
shall be valid after a successfull call,
ie return a value other than NativeSurface.LOCK_SURFACE_NOT_READY
.
This call is blocking until the surface has been locked or a timeout is reached. The latter will throw a runtime exception.
This call allows recursion from the same thread.
The implementation may want to aquire the
application level RecursiveLock
first before proceeding with a native surface lock.
The implementation shall also invoke AbstractGraphicsDevice.lock()
for the initial lock (recursive count zero).
lockSurface
in interface NativeSurface
NativeSurface.LOCK_SUCCESS
, NativeSurface.LOCK_SURFACE_CHANGED
or NativeSurface.LOCK_SURFACE_NOT_READY
.
NativeWindowException
RecursiveLock
protected abstract void unlockSurfaceImpl() throws NativeWindowException
NativeWindowException
public final void unlockSurface()
NativeSurface
NativeSurface.lockSurface()
The implementation shall also invoke AbstractGraphicsDevice.unlock()
for the final unlock (recursive count zero).
unlockSurface
in interface NativeSurface
NativeSurface.lockSurface()
,
RecursiveLock
public final boolean isSurfaceLockedByOtherThread()
NativeSurface
isSurfaceLockedByOtherThread
in interface NativeSurface
public final boolean isSurfaceLocked()
NativeSurface
isSurfaceLocked
in interface NativeSurface
public final Thread getSurfaceLockOwner()
NativeSurface
getSurfaceLockOwner
in interface NativeSurface
public final boolean surfaceSwap()
NativeSurface
surfaceSwap
in interface NativeSurface
public final void surfaceUpdated(Object updater, NativeWindow window, long when)
public final long getSurfaceHandle()
NativeSurface
The surface handle should be set/update by NativeSurface.lockSurface()
,
where NativeSurface.unlockSurface()
is not allowed to modify it.
After NativeSurface.unlockSurface()
it is no more guaranteed
that the surface handle is still valid.
The surface handle shall reflect the platform one
for all drawable surface operations, e.g. opengl, swap-buffer.
On X11 this returns an entity of type Window,
since there is no differentiation of surface and window there.
On Microsoft Windows this returns an entity of type HDC.
getSurfaceHandle
in interface NativeSurface
public final AbstractGraphicsConfiguration getGraphicsConfiguration()
NativeSurface
getGraphicsConfiguration
in interface NativeSurface
javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
public final long getDisplayHandle()
NativeSurface
getDisplayHandle
in interface NativeSurface
public final int getScreenIndex()
NativeSurface
getScreenIndex
in interface NativeSurface
public final void setSize(int width, int height)
public final int getWidth()
NativeSurface
getWidth
in interface NativeSurface
public final int getHeight()
NativeSurface
getHeight
in interface NativeSurface
public void destroy()
NativeWindow
destroy
in interface NativeWindow
public final NativeWindow getParent()
getParent
in interface NativeWindow
public long getWindowHandle()
NativeWindow
The window handle shall reflect the platform one for all window related operations, e.g. open, close, resize.
On X11 this returns an entity of type Window.
On Microsoft Windows this returns an entity of type HWND.
getWindowHandle
in interface NativeWindow
public final int getX()
NativeWindow
getX
in interface NativeWindow
public final int getY()
NativeWindow
getY
in interface NativeWindow
public Point getLocationOnScreen(Point storage)
NativeWindow
getLocationOnScreen
in interface NativeWindow
storage
- if not null,
Point.translate(javax.media.nativewindow.util.Point)
the passed Point
by this location on the screen and return it.
protected abstract Point getLocationOnScreenImpl(int x, int y)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |