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, screenId
IMAGE_SURFACE, PRINTERJOB_SURFACE, WINDOW_SURFACE
FLAG_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_UNKNOWN
SIP_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, startNativeInput
public 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()
ISurface
public void clearCursorRegions()
WindowSurface
clearCursorRegions
in class WindowSurface
public void removeCursorRegion(int regionID)
WindowSurface
removeCursorRegion
in class WindowSurface
regionID
- 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 WindowSurface
public void requestRepaint(int x, int y, int width, int height, boolean dontMerge)
requestRepaint
in class WindowSurface
public int getState()
getState
in class WindowSurface
public void doClose()
doClose
in class WindowSurface
public void setVisible(boolean visible)
setVisible
in class WindowSurface
public boolean isVisible()
isVisible
in class WindowSurface
public final boolean getScreenRect(int screenId, Rect dest, boolean desktopOnly)
getScreenRect
in class WindowSurface
screenId
- 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)
WindowSurface
getBounds
in class WindowSurface
dest
- a non-null destination Rect.public final boolean setBounds(int x, int y, int width, int height)
setBounds
in class WindowSurface
public final boolean getClientRect(Rect dest)
WindowSurface
getClientRect
in class WindowSurface
dest
- a non-null destination Rect.public final boolean setClientRect(int x, int y, int width, int height)
setClientRect
in class WindowSurface
public boolean doGetBounds(Rect dest)
public boolean doSetBounds(int x, int y, int width, int height)
protected void doCreate(WindowCreationData wco)
doCreate
in class WindowSurface
public int getAsyncKeyState(int keyCode)
WindowSurface
getAsyncKeyState
in class WindowSurface
IKeys
public Object getInfo(int infoCode, Object parameters, Object dest, int options)
getInfo
in class WindowSurface
public boolean setInfo(int infoCode, Object parameters, int options)
setInfo
in class WindowSurface
public boolean doGetClientRect(Rect dest)
public boolean doSetClientRect(int x, int y, int width, int height)
public boolean getParentSize(Dimension dest)
WindowSurface
getParentSize
in class WindowSurface
dest
- a non-null destination Dimension object.public int setFlags(int flagsToSet, int flagsToClear)
WindowSurface
setFlags
in class WindowSurface
flagsToSet
- Flags to set.flagsToClear
- Flags to clear.public int getFlagsForSize(int requestedWidth, int requestedHeight, int requestedSetFlags, int requestedClearFlags)
WindowSurface
getFlagsForSize
in class WindowSurface
requestedWidth
- 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)
WindowSurface
setIcon
in class WindowSurface
public boolean setTaskbarIcon(DeviceIcon icon)
setTaskbarIcon
in class WindowSurface
public Object getDroppedData(int dataID)
getDroppedData
in class WindowSurface
public Font getFont()
getFont
in class WindowSurface
public boolean setFont(Font font)
setFont
in class WindowSurface
public int setGuiFlags(int flagsToset, int flagsToClear)
WindowSurface
setGuiFlags
in class WindowSurface
flagsToClear
- flags to clear.public String getTitle()
WindowSurface
getTitle
in class WindowSurface
public void setTitle(String title)
WindowSurface
setTitle
in class WindowSurface
title
- the new title for the window.public boolean doGetScreenRect(int screenId, Rect dest, boolean desktopOnly)
public int captureAppKeys(int options)
captureAppKeys
in class WindowSurface
protected void takeKeyFocus()
takeKeyFocus
in class WindowSurface
protected boolean getRawEvent(long howLongToWait, RawEvent destination) throws InterruptedException
getRawEvent
in class WindowSurface
InterruptedException
protected boolean doCaptureMouse(boolean doGrab)
doCaptureMouse
in class WindowSurface
public void postRawEvent(RawEvent event)
WindowSurface
postRawEvent
in class WindowSurface
event
- the event to post.public boolean hasPendingEvents()
hasPendingEvents
in class WindowSurface
public ITaskbarEntry doCreateTaskbarEntry()
doCreateTaskbarEntry
in class WindowSurface
public void drawImage(Image src, int clipX, int clipY, int clipWidth, int clipHeight, int destX, int destY, int width, int height)
ISurface
Note 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)
ISurface
public boolean moveImage(int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY)
ISurface
public boolean canCapture()
ISurface
public boolean canMove()
ISurface
public boolean specialOperation(int which, Object data)
specialOperation
in class WindowSurface
public Image getCompatibleImage(int width, int height) throws IllegalArgumentException
ISurface
width
- 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