com.jniwrapper.jawt
Class JAWT

java.lang.Object
  extended by com.jniwrapper.jawt.JAWT

public class JAWT
extends java.lang.Object

Main JAWT interface class. Provides access to JAWT features of the underlying platform. For additional information, please refer to the original JAWT documentation.

Since:
1.2

Field Summary
static int JAWT_LOCK_BOUNDS_CHANGED
           
static int JAWT_LOCK_CLIP_CHANGED
           
static int JAWT_LOCK_ERROR
           
static int JAWT_LOCK_SURFACE_CHANGED
           
static boolean JDK_1_4
          Convenience constant to quickly determine which JAWT features to expect.
 
Method Summary
static void freeDrawingSurface(JAWT_DrawingSurface ds)
          Releases the drawing surface.
static java.awt.Component getComponentFromHandle(Pointer.Void handle)
          Gets an AWT component by a given native handle.
static JAWT_DrawingSurface getDrawingSurface(java.awt.Component component)
          Obtains drawing surface for a given component.
static void lockAWT()
          Locks the AWT for synchronization purposes.
static void unlockAWT()
          Unlocks the AWT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JDK_1_4

public static final boolean JDK_1_4
Convenience constant to quickly determine which JAWT features to expect. For example, AWT locking is supported only since version 1.4.


JAWT_LOCK_ERROR

public static final int JAWT_LOCK_ERROR
See Also:
Constant Field Values

JAWT_LOCK_CLIP_CHANGED

public static final int JAWT_LOCK_CLIP_CHANGED
See Also:
Constant Field Values

JAWT_LOCK_BOUNDS_CHANGED

public static final int JAWT_LOCK_BOUNDS_CHANGED
See Also:
Constant Field Values

JAWT_LOCK_SURFACE_CHANGED

public static final int JAWT_LOCK_SURFACE_CHANGED
See Also:
Constant Field Values
Method Detail

getDrawingSurface

public static JAWT_DrawingSurface getDrawingSurface(java.awt.Component component)
Obtains drawing surface for a given component. The surface should be freed by calling freeDrawingSurface().

Parameters:
component - the target component (should be a window or a canvas for native rendering).
Returns:
the drawing surface structure for the specified component.

freeDrawingSurface

public static void freeDrawingSurface(JAWT_DrawingSurface ds)
Releases the drawing surface.

Parameters:
ds - a drawing surface structure.

lockAWT

public static void lockAWT()
Locks the AWT for synchronization purposes.


unlockAWT

public static void unlockAWT()
Unlocks the AWT.


getComponentFromHandle

public static java.awt.Component getComponentFromHandle(Pointer.Void handle)
Gets an AWT component by a given native handle.

Parameters:
handle - a handle.
Returns:
a component that corresponds to the given handle or null if no such component exists.
Throws:
java.lang.UnsupportedOperationException - if the current JDK version is less than 1.4.