|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.newt.Window
public abstract class Window
Field Summary | |
---|---|
static int |
ClickTimeout
|
protected AbstractGraphicsConfiguration |
config
|
static boolean |
DEBUG_IMPLEMENTATION
|
static boolean |
DEBUG_KEY_EVENT
|
static boolean |
DEBUG_MOUSE_EVENT
|
static boolean |
DEBUG_WINDOW_EVENT
|
protected int |
eventMask
|
protected boolean |
fullscreen
|
protected int |
height
|
protected Screen |
screen
|
protected String |
title
|
protected boolean |
undecorated
|
protected boolean |
visible
|
protected int |
width
|
protected long |
windowHandle
|
protected int |
x
|
protected int |
y
|
Fields inherited from interface javax.media.nativewindow.NativeWindow |
---|
LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY |
Constructor Summary | |
---|---|
Window()
|
Method Summary | |
---|---|
void |
addKeyListener(KeyListener l)
|
void |
addMouseListener(MouseListener l)
|
void |
addPaintListener(PaintListener l)
|
void |
addSurfaceUpdatedListener(SurfaceUpdatedListener l)
|
void |
addWindowListener(WindowListener l)
|
protected void |
clearEventMask()
|
protected abstract void |
closeNative()
|
protected static Window |
create(String type,
long parentWindowHandle,
Screen screen,
Capabilities caps,
boolean undecorated)
|
protected static Window |
create(String type,
Object[] cstrArguments,
Screen screen,
Capabilities caps,
boolean undecorated)
|
protected abstract void |
createNative(long parentWindowHandle,
Capabilities caps)
Create native windowHandle, ie creates a new native invisible window. |
void |
destroy()
destroys the window and releases windowing related resources. |
void |
destroy(boolean deep)
|
long |
getDisplayHandle()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
AbstractGraphicsConfiguration |
getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window. |
int |
getHeight()
Returns the height of the client area of this window |
Insets |
getInsets()
Returns the insets for this native window (the difference between the size of the toplevel window with the decorations and the client area). |
KeyListener[] |
getKeyListeners()
|
Exception |
getLockedStack()
Return the lock-exception, or null if not locked. |
MouseListener[] |
getMouseListeners()
|
Screen |
getScreen()
|
int |
getScreenIndex()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
long |
getSurfaceHandle()
Returns the handle to the surface for this NativeWindow. |
Thread |
getSurfaceLockOwner()
|
SurfaceUpdatedListener[] |
getSurfaceUpdatedListener()
|
String |
getTitle()
|
int |
getWidth()
Returns the width of the client area of this window |
long |
getWindowHandle()
Returns the window handle for this NativeWindow. |
WindowListener[] |
getWindowListeners()
|
Object |
getWrappedWindow()
If this Window actually wraps one from another toolkit such as the AWT, this will return a non-null value. |
int |
getX()
|
int |
getY()
|
boolean |
hasDeviceChanged()
If the implementation is capable of detecting a device change return true and clear the status/reason of the change. |
void |
invalidate()
render all native window information invalid, as if the native window was destroyed |
boolean |
isFullscreen()
|
boolean |
isSurfaceLocked()
Return if surface is locked |
boolean |
isUndecorated()
|
boolean |
isVisible()
|
int |
lockSurface()
Recursive and blocking lockSurface() implementation |
void |
removeAllSurfaceUpdatedListener()
|
void |
removeKeyListener(KeyListener l)
|
void |
removeMouseListener(MouseListener l)
|
void |
removePaintListener(PaintListener l)
|
void |
removeSurfaceUpdatedListener(SurfaceUpdatedListener l)
|
void |
removeWindowListener(WindowListener l)
|
void |
requestFocus()
|
void |
sendEvent(NEWTEvent e)
|
protected void |
sendKeyEvent(int eventType,
int modifiers,
int keyCode,
char keyChar)
|
protected void |
sendKeyEvent(KeyEvent e)
|
protected void |
sendMouseEvent(int eventType,
int modifiers,
int x,
int y,
int button,
int rotation)
Be aware that this method synthesizes the events: MouseClicked and MouseDragged |
protected void |
sendMouseEvent(MouseEvent e)
|
protected void |
sendPaintEvent(int eventType,
int x,
int y,
int w,
int h)
|
protected void |
sendPaintEvent(PaintEvent e)
|
protected void |
sendWindowEvent(int eventType)
|
protected void |
sendWindowEvent(WindowEvent e)
|
void |
setAutoDrawableClient(boolean b)
If set to true, certain action will be performed by the owning AutoDrawable, ie the destroy() call within windowDestroyNotify() |
abstract boolean |
setFullscreen(boolean fullscreen)
|
abstract void |
setPosition(int x,
int y)
Sets the location of the top left corner of the window, including decorations (so the client area will be placed at x+insets.left,y+insets.top .This call is ignored if in fullscreen mode. |
abstract void |
setSize(int width,
int height)
Sets the size of the client area of the window, excluding decorations Total size of the window will be width+insets.left+insets.right, height+insets.top+insets.bottom This call is ignored if in fullscreen mode. |
void |
setTitle(String title)
|
void |
setUndecorated(boolean value)
|
abstract void |
setVisible(boolean visible)
|
boolean |
surfaceSwap()
Provide a mechanism to utilize custom (pre-) swap surface code. |
void |
surfaceUpdated(Object updater,
NativeWindow window,
long when)
Notification of a surface update event. |
static String |
toHexString(int hex)
|
static String |
toHexString(long hex)
|
String |
toString()
|
void |
unlockSurface()
Recursive and unblocking unlockSurface() implementation |
protected void |
windowDestroyed()
|
protected void |
windowDestroyNotify()
|
protected static Window |
wrapHandle(String type,
Screen screen,
AbstractGraphicsConfiguration config,
long windowHandle,
boolean fullscreen,
boolean visible,
int x,
int y,
int width,
int height)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean DEBUG_MOUSE_EVENT
public static final boolean DEBUG_KEY_EVENT
public static final boolean DEBUG_WINDOW_EVENT
public static final boolean DEBUG_IMPLEMENTATION
protected Screen screen
protected AbstractGraphicsConfiguration config
protected long windowHandle
protected boolean fullscreen
protected boolean visible
protected int width
protected int height
protected int x
protected int y
protected int eventMask
protected String title
protected boolean undecorated
public static final int ClickTimeout
Constructor Detail |
---|
public Window()
Method Detail |
---|
protected static Window create(String type, long parentWindowHandle, Screen screen, Capabilities caps, boolean undecorated)
protected static Window create(String type, Object[] cstrArguments, Screen screen, Capabilities caps, boolean undecorated)
protected static Window wrapHandle(String type, Screen screen, AbstractGraphicsConfiguration config, long windowHandle, boolean fullscreen, boolean visible, int x, int y, int width, int height)
public static String toHexString(int hex)
public static String toHexString(long hex)
protected abstract void createNative(long parentWindowHandle, Capabilities caps)
protected abstract void closeNative()
public Screen getScreen()
public String toString()
toString
in class Object
public String getTitle()
public void setTitle(String title)
public void setUndecorated(boolean value)
public boolean isUndecorated()
public void requestFocus()
public int lockSurface()
lockSurface
in interface NativeWindow
NativeWindow.LOCK_SUCCESS
, NativeWindow.LOCK_SURFACE_CHANGED
or NativeWindow.LOCK_SURFACE_NOT_READY
.ToolkitLock
public void unlockSurface() throws NativeWindowException
unlockSurface
in interface NativeWindow
NativeWindowException
- if surface is not lockedNativeWindow.lockSurface()
,
ToolkitLock
public boolean isSurfaceLocked()
NativeWindow
isSurfaceLocked
in interface NativeWindow
public Thread getSurfaceLockOwner()
public Exception getLockedStack()
NativeWindow
NativeWindow.lockSurface()
and hence holds the locker's call stack.
getLockedStack
in interface NativeWindow
public void destroy()
NativeWindow
destroy
in interface NativeWindow
public void destroy(boolean deep)
deep
- If true, the linked Screen and Display will be destroyed as well.public void invalidate()
NativeWindow
invalidate
in interface NativeWindow
NativeWindow.destroy()
public boolean surfaceSwap()
NativeWindow
surfaceSwap
in interface NativeWindow
protected void clearEventMask()
public long getDisplayHandle()
NativeWindow
getDisplayHandle
in interface NativeWindow
public int getScreenIndex()
NativeWindow
getScreenIndex
in interface NativeWindow
public long getWindowHandle()
NativeWindow
The window handle should be set/update by NativeWindow.lockSurface()
,
where NativeWindow.unlockSurface()
is not allowed to modify it.
After NativeWindow.unlockSurface()
it is no more guaranteed
that the window handle is still valid.
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 long getSurfaceHandle()
NativeWindow
The surface handle should be set/update by NativeWindow.lockSurface()
,
where NativeWindow.unlockSurface()
is not allowed to modify it.
After NativeWindow.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 NativeWindow
public AbstractGraphicsConfiguration getGraphicsConfiguration()
NativeWindow
getGraphicsConfiguration
in interface NativeWindow
GraphicsConfigurationFactory.chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
public int getWidth()
getWidth
in interface NativeWindow
public int getHeight()
getHeight
in interface NativeWindow
public Insets getInsets()
public Object getWrappedWindow()
public int getX()
public int getY()
public boolean isVisible()
public boolean isFullscreen()
public boolean hasDeviceChanged()
public void setAutoDrawableClient(boolean b)
protected void windowDestroyNotify()
protected void windowDestroyed()
public abstract void setVisible(boolean visible)
public abstract void setSize(int width, int height)
width+insets.left+insets.right, height+insets.top+insets.bottom
width
- of the client area of the windowheight
- of the client area of the windowpublic abstract void setPosition(int x, int y)
x+insets.left,y+insets.top
.
x
- coord of the top left cornery
- coord of the top left cornerpublic abstract boolean setFullscreen(boolean fullscreen)
public void addSurfaceUpdatedListener(SurfaceUpdatedListener l)
public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l)
public void removeAllSurfaceUpdatedListener()
public SurfaceUpdatedListener[] getSurfaceUpdatedListener()
public void surfaceUpdated(Object updater, NativeWindow window, long when)
SurfaceUpdatedListener
surfaceUpdated
in interface SurfaceUpdatedListener
updater
- is the caller object who updated the surface,
e.g. a JOGL GLDrawable.window
- the NativeWindow, which surface is updatedwhen
- the time in ms, when the surface was updatedpublic void sendEvent(NEWTEvent e)
public void addMouseListener(MouseListener l)
public void removeMouseListener(MouseListener l)
public MouseListener[] getMouseListeners()
protected void sendMouseEvent(int eventType, int modifiers, int x, int y, int button, int rotation)
protected void sendMouseEvent(MouseEvent e)
public void addKeyListener(KeyListener l)
public void removeKeyListener(KeyListener l)
public KeyListener[] getKeyListeners()
protected void sendKeyEvent(int eventType, int modifiers, int keyCode, char keyChar)
protected void sendKeyEvent(KeyEvent e)
public void addWindowListener(WindowListener l)
public void removeWindowListener(WindowListener l)
public WindowListener[] getWindowListeners()
protected void sendWindowEvent(int eventType)
protected void sendWindowEvent(WindowEvent e)
public void addPaintListener(PaintListener l)
public void removePaintListener(PaintListener l)
protected void sendPaintEvent(int eventType, int x, int y, int w, int h)
protected void sendPaintEvent(PaintEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |