|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.javafx.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 Exception |
lockedStack
|
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 |
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 |
disposeSurfaceHandle()
Special method to dispose a surface handle, in case of a device change _and_ where there is a different semantics of window handle and surface handle. |
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. |
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()
Lock the surface of this native window |
void |
removeKeyListener(KeyListener l)
|
void |
removeMouseListener(MouseListener l)
|
void |
removePaintListener(PaintListener l)
|
void |
removeWindowListener(WindowListener l)
|
void |
requestFocus()
|
protected void |
sendKeyEvent(int eventType,
int modifiers,
int keyCode,
char keyChar)
|
protected void |
sendMouseEvent(int eventType,
int modifiers,
int x,
int y,
int button,
int rotation)
|
protected void |
sendPaintEvent(int eventType,
int x,
int y,
int w,
int h)
|
protected void |
sendWindowEvent(int eventType)
|
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 . |
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 |
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()
Method invoked after the render toolkit (e.g. |
String |
toString()
|
void |
unlockSurface()
Unlock the surface of this native window Shall not modify the window handle, see NativeWindow.getWindowHandle() ,
or the surface handle, see NativeWindow.lockSurface() |
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 Exception lockedStack
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)
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() throws NativeWindowException
NativeWindow
The window handle, see NativeWindow.getWindowHandle()
,
and the surface handle, see NativeWindow.lockSurface()
,
shall be set and be valid after a successfull call,
ie a return value other than NativeWindow.LOCK_SURFACE_NOT_READY
.
The semantics of the underlying native locked resource
may be related to the ToolkitLock
one. Hence it is
important that implementation of both harmonize well.
The implementation may want to aquire the ToolkitLock
first to become it's owner before proceeding with it's
actual surface lock.
lockSurface
in interface NativeWindow
NativeWindow.LOCK_SUCCESS
, NativeWindow.LOCK_SURFACE_CHANGED
or NativeWindow.LOCK_SURFACE_NOT_READY
.
NativeWindowException
- if surface is already lockedToolkitLock
public void unlockSurface()
NativeWindow
NativeWindow.getWindowHandle()
,
or the surface handle, see NativeWindow.lockSurface()
unlockSurface
in interface NativeWindow
NativeWindow.lockSurface()
,
ToolkitLock
public boolean isSurfaceLocked()
NativeWindow
isSurfaceLocked
in interface NativeWindow
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 invalidate()
NativeWindow
invalidate
in interface NativeWindow
NativeWindow.destroy()
public boolean surfaceSwap()
NativeWindow
surfaceSwap
in interface NativeWindow
public void surfaceUpdated()
NativeWindow
surfaceUpdated
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 void disposeSurfaceHandle()
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 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)
public void addKeyListener(KeyListener l)
public void removeKeyListener(KeyListener l)
public KeyListener[] getKeyListeners()
protected void sendKeyEvent(int eventType, int modifiers, int keyCode, char keyChar)
public void addWindowListener(WindowListener l)
public void removeWindowListener(WindowListener l)
public WindowListener[] getWindowListeners()
protected void sendWindowEvent(int eventType)
public void addPaintListener(PaintListener l)
public void removePaintListener(PaintListener l)
protected void sendPaintEvent(int eventType, int x, int y, int w, int h)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |