FileDocCategorySizeDatePackage
NativeWindow.javaAPI DocAndroid 1.5 API6091Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.wtk

NativeWindow

public interface NativeWindow
Provides cross-platform way to manipulate native window. Results of methods are reported through native messages.

Fields Summary
static final int
BOUNDS_NOMOVE
Means only size should be changed
static final int
BOUNDS_NOSIZE
Means only position should be changed
Constructors Summary
Methods Summary
public voiddispose()
Destroys the asscoiated window. Attempts to use it thereafter can result in unpredictable bechavior.

public java.awt.RectanglegetBounds()
Returns last notified window bounds. This means the last bounds reported by system event.

If child, position is relative to parent window.

return
last notified window bounds

public longgetId()
Returns system id of the associated window

return
HWND on Windows, xwindow on X

public java.awt.InsetsgetInsets()
Returns last notified insets. This means the last insets reported by system event. Insets are margins around client area ocupied by system provided decor, ususally border and titlebar.

return
last notified insets

public org.apache.harmony.awt.gl.MultiRectAreagetObscuredRegion(java.awt.Rectangle part)

public java.awt.PointgetScreenPos()
Get absolute position on the screen

public voidgrabMouse()
Activate the mouse event capturing

public booleanisFocusable()

return
current focusable window state

public voidplaceAfter(org.apache.harmony.awt.wtk.NativeWindow w)
Changes window Z-order to place this window under, If w is null places places this window on the top. Z-order is per parent. Toplevels a children of desktop in terms of Z-order.

param
w - window to place under.

public voidsetAlwaysOnTop(boolean value)
Makes window top-most if value is true, non-topmost(normal) otherwise.

public voidsetBounds(int x, int y, int w, int h, int boundsMask)
Tries to set desired window bounds. It's not gurantied the property will have the desired value. The value change should be reported by system event (as for other properties).

If child, position is relative to parent window.

param
x - desired x
param
y - desired y
param
w - desired width
param
h - desired height
param
boundsMask - bitwise OR of BOUNDS_* constants. Governs the new bounds interpretation.

public voidsetEnabled(boolean value)
Enables/disables processing of input (key, mouse) event by window. If disabled input events are ignored.

param
value - if enabled

public booleansetFocus(boolean focus)
Tries to set application input focus to the window or clear current focus from focused window.

For toplevel windows it's not gurantied focus will land in desired window even if function returns true. Focus traversal should be tracked by processing system events.

param
focus - if true sets focus, else clears focus
return
if success

public voidsetFocusable(boolean value)
Sets the "focusable" window state.

param
value - if true makes window focusable

public voidsetIMStyle()
Make window an "input method window" by setting special window style, e. g. small title bar, no close, minimize/maximize buttons. For internal use by input method framework.

public voidsetIconImage(java.awt.Image image)
Set the image to be displayed in the minimized icon for top-level [decorated] window.

param
image the icon image to be displayed

public voidsetMaximizedBounds(java.awt.Rectangle bounds)
Set desired [top-level] window bounds when being in maximized state. Fields set to Integer.MAX_VALUE are ignored[system-supplied values are used instead]

public voidsetPacked(boolean packed)
Set a window "packed" flag: the flag indicates that if insets change client area shouldn't be resized, but frame must be resized instead

public voidsetResizable(boolean value)
Makes the window resizable/not resizable by user

param
value - if resizable

public voidsetState(int state)
Set extended state for top-level window.

param
state - new state, bitmask of ICONIFIED, MAXIMIZED_BOTH, etc.

public voidsetTitle(java.lang.String title)
Sets the window caption

param
title - caption text

public voidsetVisible(boolean v)
Shows/hides window

param
v - new visibility

public voidtoBack()
Places window on bottom of Z-order

public voidtoFront()
Places window on top of Z-order

public voidungrabMouse()
Deactivate mouse event capturing