java-gnome version 4.0.7

org.gnome.gdk
Class Window

java.lang.Object
  extended by org.freedesktop.bindings.Proxy
      extended by org.gnome.glib.Object
          extended by org.gnome.gdk.Drawable
              extended by org.gnome.gdk.Window

public class Window
extends Drawable

The underlying native resource driving a rectangular region on a screen. These are notable as being what powers the display of Widgets, being both that upon which drawing is done, and that to which user actions are delivered.

In theory, some, but not all, Widgets have their own native windows to draw upon and from whence events originate. Thus Widgets such as Buttons have their own underlying native resource, whereas Labels and various Containers do not. In practise, this distinction is blurred and newer versions of GTK do all sorts of strange things under the hood for greater efficiency. You don't need to worry about any of this.

These are wrappers around Xlib's Window object. They can be arranged in tree structures, wrapping and overlapping one another, with parents cropping children, etc. You don't need to worry about any of this either.

What this is useful for is as a way to get to the state of top level windows and various low level drawing functions.

Since the C name of this class is GdkWindow, the unavoidable consequence of the java-gnome mapping algorithm is that the name of this class Java is Window. This can be a bit of a pain if you're working in a piece of code where org.gnome.gtk.Window is already imported, but c'est la vie.

Since:
4.0.4
Author:
Andrew Cowie

Method Summary
 int getOriginX()
          Get the horizontal position of this Window in terms of the root Window's co-ordinates.
 int getOriginY()
          Get the vertical position of this Window in terms of the root Window's co-ordinates.
 int getPositionX()
          Get the horizontal position of this Window relative to its parent Window.
 int getPositionY()
          Get the vertical position of this Window relative to its parent Window.
 WindowState getState()
          Return a flags object representing the current state of the Window (maximized, iconified, etc).
 void setCursor(Cursor cursor)
          Set the Cursor that will be shown when the pointer hovers over this Drawable Window.
 
Methods inherited from class org.gnome.gdk.Drawable
getDepth
 
Methods inherited from class org.freedesktop.bindings.Proxy
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getOriginX

public int getOriginX()
Get the horizontal position of this Window in terms of the root Window's co-ordinates. The root window is what you might think of as the desktop background, although in X terms it really is the parent of all windows.

Since:
4.0.6

getOriginY

public int getOriginY()
Get the vertical position of this Window in terms of the root Window's co-ordinates.

Since:
4.0.6

getPositionX

public int getPositionX()
Get the horizontal position of this Window relative to its parent Window. Given that many Widgets draw directly on their parent's org.gnome.gdk Window, you may at times be surprised at what this reports.

Since:
4.0.6

getPositionY

public int getPositionY()
Get the vertical position of this Window relative to its parent Window.

Since:
4.0.6

getState

public WindowState getState()
Return a flags object representing the current state of the Window (maximized, iconified, etc). See WindowState for the individual constants, obviously, but be aware that an unmapped Window will have no WindowState bits set.

Since:
4.0.4

setCursor

public void setCursor(Cursor cursor)
Set the Cursor that will be shown when the pointer hovers over this Drawable Window.

Parameters:
cursor - Passing null will cause this Window to [revert to] using the Cursor default inherited from its parent.
Since:
4.0.6


java-gnome