public class NativeWindowSurface extends WindowSurface
The WindowSurface also is responsible for generating UI events like keyboard and pen/mouse events as well as paint and resize events.
WindowSurface.RawEventFilter| Modifier and Type | Field and Description |
|---|---|
EveCanvas |
_canvas |
java.awt.Frame |
_frame |
EveWindow |
_window |
protected Countdown |
cd |
static int |
ROTATION_180 |
static int |
ROTATION_270 |
static int |
ROTATION_90 |
static int |
ROTATION_NONE |
Vector |
waitingEvents |
amCreated, applicationWindow, defaultIcon, defaultWindowTitle, invisibleMousePointer, mainSurface, nativeDialogCount, noCloseButtons, overlayer, screenIdIMAGE_SURFACE, PRINTERJOB_SURFACE, WINDOW_SURFACEFLAG_ACCEPTS_DROPPED_FILES, FLAG_ALWAYS_ENABLED, FLAG_ALWAYS_ON_TOP, FLAG_CAN_MAXIMIZE, FLAG_CAN_MINIMIZE, FLAG_CAN_RESIZE, FLAG_DONT_CLEAR_BACKGROUND, FLAG_FOR_SIZE_NO_CLOSE_BUTTON, FLAG_FOR_SIZE_NO_TITLE, FLAG_FULL_SCREEN, FLAG_HAS_CLOSE_BUTTON, FLAG_HAS_TASKBAR_ENTRY, FLAG_HAS_TITLE, FLAG_IS_DEFAULT_SIZE, FLAG_IS_DEFAULT_SURFACE, FLAG_IS_ICONIZED, FLAG_IS_MODAL, FLAG_IS_NOT_DEFAULT_SURFACE, FLAG_IS_VISIBLE, FLAG_MAXIMIZE, FLAG_MAXIMIZE_ON_PDA, FLAG_MINIMIZE, FLAG_SHOW_SIP_BUTTON, FLAG_VISIBLE_ON_TO_FRONT, GUI_FLAG_DONT_REPAINT_ON_RESIZE, GUI_FLAG_HAS_TASKBAR, GUI_FLAG_REPAINT_FULL_CONTROL, GUI_FLAG_REVERSE_OK_CANCEL, SPECIAL_MOUSE_MOVE, SPECIAL_MOUSE_RELEASE_CAPTURE, SPECIAL_MOUSE_RESIZE, STATE_ACCEPT_DROPPED_FILES, STATE_FULL_SCREEN, STATE_MAXIMIZED, STATE_MINIMIZED, STATE_NORMAL, STATE_REJECT_DROPPED_FILES, STATE_RESTORE, STATE_TO_FRONT, STATE_UNKNOWNSIP_CURRENT, SIP_FREEZE, SIP_IS_ON, SIP_LEAVE_BUTTON, SIP_LOCK, SIP_ON, SIP_OVERRIDE_USE_SIP, SIP_REMOVE_BUTTON, SIP_UNFREEZE| Constructor and Description |
|---|
NativeWindowSurface() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCapture()
This returns true if it is possible to read pixel data from the surface
into an Image.
|
static boolean |
canCopyFrom()
Returns if it is possible to copy pixel data from a window.
|
boolean |
canMove()
This returns true if it is possible to move pixel within the surface.
|
int |
captureAppKeys(int options) |
boolean |
captureImage(Image dest,
int x,
int y,
int width,
int height)
Capture pixel data from the surface to an Image.
|
void |
clearCursorRegions()
Remove all set cursor regions.
|
protected boolean |
doCaptureMouse(boolean doGrab) |
void |
doClose() |
protected void |
doCreate(WindowCreationData wco) |
ITaskbarEntry |
doCreateTaskbarEntry() |
boolean |
doGetBounds(Rect dest) |
boolean |
doGetClientRect(Rect dest) |
protected boolean |
doGetDPI(double[] xyDpi) |
boolean |
doGetScreenRect(int screenId,
Rect dest,
boolean desktopOnly) |
boolean |
doSetBounds(int x,
int y,
int width,
int height) |
boolean |
doSetClientRect(int x,
int y,
int width,
int height) |
void |
drawImage(Image src,
int clipX,
int clipY,
int clipWidth,
int clipHeight,
int destX,
int destY,
int width,
int height)
This should always work for any surface and is the minimum functionality
expected.
|
void |
freeNativeGraphics(Object g) |
int |
getAsyncKeyState(int keyCode)
Return the current press state of a particular key or mouse button at this instant
in time.
|
boolean |
getBounds(Rect dest)
Get the bounds of the full window in the screen.
|
boolean |
getClientRect(Rect dest)
Get the rect of the client area within the full window.
|
Image |
getCompatibleImage(int width,
int height)
Get an Image that is optimized for display on the surface.
|
Object |
getDroppedData(int dataID) |
int |
getFlagsForSize(int requestedWidth,
int requestedHeight,
int requestedSetFlags,
int requestedClearFlags)
This is used during Window creation.
|
Font |
getFont() |
Graphics |
getGraphics()
This returns a new Graphics for use on the surface IF it is supported.
|
Object |
getInfo(int infoCode,
Object parameters,
Object dest,
int options) |
java.awt.Frame |
getJavaFrame() |
Object |
getJavaSurface() |
eve.fx.gui.NativeWindowSurface.javaWindow |
getJavaWindow() |
Object |
getNativeGraphics() |
boolean |
getParentSize(Dimension dest)
If the Window is a child window, this returns the size of the
parent Window.
|
protected boolean |
getRawEvent(long howLongToWait,
RawEvent destination) |
boolean |
getScreenRect(int screenId,
Rect dest,
boolean desktopOnly)
Get the size of a particular screen.
|
int |
getState() |
String |
getTitle()
Get the title text of the window.
|
boolean |
hasPendingEvents() |
boolean |
isVisible() |
boolean |
moveImage(int srcX,
int srcY,
int srcWidth,
int srcHeight,
int destX,
int destY)
Move pixel data within the surface.
|
void |
postRawEvent(RawEvent event)
This posts a copy of the data in the RawEvent.
|
void |
removeCursorRegion(int regionID)
Remove the specified cursor region.
|
void |
requestRepaint(int x,
int y,
int width,
int height,
boolean dontMerge) |
boolean |
setBounds(int x,
int y,
int width,
int height) |
boolean |
setClientRect(int x,
int y,
int width,
int height) |
int |
setFlags(int flagsToSet,
int flagsToClear)
Set or get the Flags for a Window.
|
boolean |
setFont(Font font) |
int |
setGuiFlags(int flagsToset,
int flagsToClear)
Set or get the GUI Flags for the device.
|
boolean |
setIcon(DeviceIcon icon)
Get the mouse pointer state at this point in time.
|
boolean |
setInfo(int infoCode,
Object parameters,
int options) |
void |
setState(int newState) |
boolean |
setTaskbarIcon(DeviceIcon icon) |
void |
setTitle(String title)
Set the title text of the window.
|
void |
setVisible(boolean visible) |
boolean |
specialOperation(int which,
Object data) |
static boolean |
supportsMultiple()
Returns if the underlying system supports multiple windows for an application.
|
protected void |
takeKeyFocus() |
acceptDroppedFiles, addRawEventFilter, captureMouse, checkModalActive, clearScreenSizeInInches, clearScreenSizeInInches, close, create, createCursor, createCursor, createDefault, createDefaultWindow, createTaskbarEntry, doStartNativeInput, enterNativeDialog, eveMain, exitNativeDialog, expectRepaintIn, getCompatibleImagePoints, getDPI, getFlags, getFontMetrics, getGuiFlags, getMainSurface, getModal, getModalWindow, getNativeDialogCount, getNativeDrawable, getNew, getRawEvent, getReusedSurfaceEvent, getScreenDPI, getScreenDPI, getScreenIds, getScreenRect, getScreenRect, getScreenSizeInInches, getScreenSizeInInches, getSIP, getSIP, getSurfaceType, getWindowsLock, inNativeDialog, inNativeTextInput, isClosed, main, modalWindowHasPendingEvents, nativeGetSetSIP, postEvent, removeRawEventFilter, setCursor, setCursorRegion, setModal, setOverlays, setScreenSizeInInches, setScreenSizeInInches, setSIP, setSIP, setSIP, shutdown, startNativeInputpublic EveWindow _window
public java.awt.Frame _frame
public EveCanvas _canvas
public static final int ROTATION_NONE
public static final int ROTATION_90
public static final int ROTATION_180
public static final int ROTATION_270
public Vector waitingEvents
protected Countdown cd
public Object getNativeGraphics()
public void freeNativeGraphics(Object g)
public Graphics getGraphics()
ISurfacepublic void clearCursorRegions()
WindowSurfaceclearCursorRegions in class WindowSurfacepublic void removeCursorRegion(int regionID)
WindowSurfaceremoveCursorRegion in class WindowSurfaceregionID - the ID of the cursor region as returned by setCursorRegion.public Object getJavaSurface()
public eve.fx.gui.NativeWindowSurface.javaWindow getJavaWindow()
public java.awt.Frame getJavaFrame()
public static boolean supportsMultiple()
public static boolean canCopyFrom()
public void setState(int newState)
setState in class WindowSurfacepublic void requestRepaint(int x,
int y,
int width,
int height,
boolean dontMerge)
requestRepaint in class WindowSurfacepublic int getState()
getState in class WindowSurfacepublic void doClose()
doClose in class WindowSurfacepublic void setVisible(boolean visible)
setVisible in class WindowSurfacepublic boolean isVisible()
isVisible in class WindowSurfacepublic final boolean getScreenRect(int screenId,
Rect dest,
boolean desktopOnly)
getScreenRect in class WindowSurfacescreenId - the id of the screen. 0 is the default screen.dest - a non-null destination Rect.desktopOnly - true to get the Rect representing the desktop area of the screen.public final boolean getBounds(Rect dest)
WindowSurfacegetBounds in class WindowSurfacedest - a non-null destination Rect.public final boolean setBounds(int x,
int y,
int width,
int height)
setBounds in class WindowSurfacepublic final boolean getClientRect(Rect dest)
WindowSurfacegetClientRect in class WindowSurfacedest - a non-null destination Rect.public final boolean setClientRect(int x,
int y,
int width,
int height)
setClientRect in class WindowSurfacepublic boolean doGetBounds(Rect dest)
public boolean doSetBounds(int x,
int y,
int width,
int height)
protected void doCreate(WindowCreationData wco)
doCreate in class WindowSurfacepublic int getAsyncKeyState(int keyCode)
WindowSurfacegetAsyncKeyState in class WindowSurfaceIKeyspublic Object getInfo(int infoCode, Object parameters, Object dest, int options)
getInfo in class WindowSurfacepublic boolean setInfo(int infoCode,
Object parameters,
int options)
setInfo in class WindowSurfacepublic boolean doGetClientRect(Rect dest)
public boolean doSetClientRect(int x,
int y,
int width,
int height)
public boolean getParentSize(Dimension dest)
WindowSurfacegetParentSize in class WindowSurfacedest - a non-null destination Dimension object.public int setFlags(int flagsToSet,
int flagsToClear)
WindowSurfacesetFlags in class WindowSurfaceflagsToSet - Flags to set.flagsToClear - Flags to clear.public int getFlagsForSize(int requestedWidth,
int requestedHeight,
int requestedSetFlags,
int requestedClearFlags)
WindowSurfacegetFlagsForSize in class WindowSurfacerequestedWidth - the desired width of the Window.requestedHeight - the desired height of the Window.requestedSetFlags - the Flags to be set.requestedClearFlags - the Flags to be cleared.public boolean setIcon(DeviceIcon icon)
WindowSurfacesetIcon in class WindowSurfacepublic boolean setTaskbarIcon(DeviceIcon icon)
setTaskbarIcon in class WindowSurfacepublic Object getDroppedData(int dataID)
getDroppedData in class WindowSurfacepublic Font getFont()
getFont in class WindowSurfacepublic boolean setFont(Font font)
setFont in class WindowSurfacepublic int setGuiFlags(int flagsToset,
int flagsToClear)
WindowSurfacesetGuiFlags in class WindowSurfaceflagsToClear - flags to clear.public String getTitle()
WindowSurfacegetTitle in class WindowSurfacepublic void setTitle(String title)
WindowSurfacesetTitle in class WindowSurfacetitle - the new title for the window.public boolean doGetScreenRect(int screenId,
Rect dest,
boolean desktopOnly)
public int captureAppKeys(int options)
captureAppKeys in class WindowSurfaceprotected void takeKeyFocus()
takeKeyFocus in class WindowSurfaceprotected boolean getRawEvent(long howLongToWait,
RawEvent destination)
throws InterruptedException
getRawEvent in class WindowSurfaceInterruptedExceptionprotected boolean doCaptureMouse(boolean doGrab)
doCaptureMouse in class WindowSurfacepublic void postRawEvent(RawEvent event)
WindowSurfacepostRawEvent in class WindowSurfaceevent - the event to post.public boolean hasPendingEvents()
hasPendingEvents in class WindowSurfacepublic ITaskbarEntry doCreateTaskbarEntry()
doCreateTaskbarEntry in class WindowSurfacepublic void drawImage(Image src, int clipX, int clipY, int clipWidth, int clipHeight, int destX, int destY, int width, int height)
ISurfaceNote that the image is not scaled. If width and height are smaller than the actual image dimensions, then the image is clipped.
src - The source image.clipX - The x co-ordinate of the clipping rectangle within the surface.clipY - The y co-ordinate of the clipping rectangle within the surface.clipWidth - The width of the clipping rectangle within the surface.clipHeight - The height of the clipping rectangle within the surface.destX - The destination x co-ordinate for the image.destY - The destination y co-ordinate for the image.width - The number of pixels horizontally to draw from the image.height - The number of pixels vertically to draw from the image.public boolean captureImage(Image dest, int x, int y, int width, int height)
ISurfacepublic boolean moveImage(int srcX,
int srcY,
int srcWidth,
int srcHeight,
int destX,
int destY)
ISurfacepublic boolean canCapture()
ISurfacepublic boolean canMove()
ISurfacepublic boolean specialOperation(int which,
Object data)
specialOperation in class WindowSurfacepublic Image getCompatibleImage(int width, int height) throws IllegalArgumentException
ISurfacewidth - the width of the image. This must be greater than or equal to 1.height - the height of the image. This must be greater than or equal to 1.IllegalArgumentException - if the width or height is less than 1.protected boolean doGetDPI(double[] xyDpi)
doGetDPI in class WindowSurface