|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.Struct
org.gnu.glib.GObject
org.gnu.gtk.GtkObject
org.gnu.gtk.Widget
org.gnu.gtk.Container
org.gnu.gtk.Bin
org.gnu.gtk.Window
public class Window
A Window is a window that can be displayed on the screen. It also is a container that can hold a single child widget. It is common to have the window in Window supply the margin around the window of the contained widget.
Constructor Summary | |
---|---|
Window()
Constructs a top-level Window. |
|
Window(org.gnu.glib.Handle handle)
Create a new Window with a handle to a native resource returned from a call to the native libraries. |
|
Window(WindowType windowType)
Construct a new Window object. |
Method Summary | |
---|---|
void |
addAccelGroup(AccelGroup accelGroup)
Associate accesGroup with the window. |
void |
deiconify()
Asks to deiconify the specified Window. |
void |
destroy()
Destroys a window and releases its native resources. |
void |
fullscreen()
|
boolean |
getAcceptFocus()
|
static Pixbuf[] |
getDefaultIconList()
Gets the icons set by setDefaultIconList . |
boolean |
getFocusOnMap()
Gets the value set by setFocusOnMap(boolean) . |
Widget |
getFocusWidget()
Retrieves the current focused Widget within the window. |
Gravity |
getGravity()
Gets the value set by setGravity() . |
Pixbuf |
getIcon()
Returns the icon representing the Window. |
Pixbuf[] |
getIconList()
Retrieves the list of icons set by setIconList(). |
java.lang.String |
getIconName()
Returns the name of the themed icon for the window. |
Point |
getPosition()
Retuns the current position of the window. |
Screen |
getScreen()
Returns the GdkScreen associated with this window. |
Requisition |
getSize()
Returns the current size of a Window. |
boolean |
getSkipPagerHint()
Returns whether the window should appear in the pager. |
boolean |
getSkipTaskbarHint()
Returns whether this window should appear in the task bar. |
java.lang.String |
getTitle()
Returns the title for the Window object |
Window |
getTransientParent()
Fetches the transient parent of this window. |
static Type |
getType()
Retrieve the runtime type used by the GLib library. |
static Window |
getWindow(org.gnu.glib.Handle handle)
Create a new Window with a handle to a native resource returned from a call to the native libraries. |
boolean |
hasToplevelFocus()
Returns whether the input focus is within this Window. |
void |
iconify()
Asks to iconify the Window. |
boolean |
isActive()
Returns whether the window is part of the current active toplevel. |
boolean |
isDestroyed()
Returns true if destroy has previously been called on this object. |
static Window[] |
listToplevelWindows()
Returns a list of all existing toplevel windows. |
void |
maximize()
Asks to maximize the Window so it becomes full-screen. |
void |
move(int x,
int y)
Ask the window manager to move the Window to a given location. |
void |
present()
Presents a window to the user. |
void |
removeAccelGroup(AccelGroup accelGroup)
Reverses the effect of addAccelGroup . |
void |
resize(int width,
int height)
Resizes the Window as if the user had done so, obeying the geometry constraints. |
void |
setAcceptFocus(boolean acceptFocus)
Windows may set a hint asking the desktop environment not to receive the input focus. |
static void |
setAutoStartupNotification(boolean setting)
|
void |
setDecorated(boolean setting)
By default Windows are decorated by a titlebar, resize controls, etc. |
static void |
setDefaultIcon(Pixbuf icon)
|
static boolean |
setDefaultIconFromFile(java.lang.String filename)
Sets an icon to be used as fallback for windows that haven't had setIconList() called on them from a file on disk. |
static void |
setDefaultIconList(Pixbuf[] icons)
Sets up the icon representing a Window. |
void |
setDefaultIconName(java.lang.String name)
Sets an icon to be used as fallback for windows that haven't had setIconList called on them from a named themed icon. |
void |
setDefaultSize(int width,
int height)
Sets the default size for a Window. |
void |
setDefaultWidget(Widget defaultWidget)
The default widget is the widget that is activated when the user presses the Enter key. |
void |
setFocusOnMap(boolean setting)
Windows may set a hint asking the desktop environment not to receive the input focus when the window is mapped. |
void |
setFocusWidget(Widget focus)
If focus is not the current focus widget and is focusable,
set it as the focus widget for the window. |
void |
setGeometryHints(Widget geometryWidget,
Geometry geometry,
WindowHints geomMask)
This method sets up hints about how a Window can be resized by the user. |
void |
setGravity(Gravity gravity)
Window gravity defines the meaning of coordinates passed to move() . |
void |
setIcon(Pixbuf icon)
Sets up the icon representing a Window. |
boolean |
setIconFromFile(java.lang.String filename)
Sets the icon for this window. |
void |
setIconList(Pixbuf[] icons)
Sets up the icon representing a GtkWindow. |
void |
setIconName(java.lang.String name)
Sets the icon for the window from a named themed icon. |
void |
setKeepAbove(boolean setting)
|
void |
setKeepBelow(boolean setting)
|
void |
setModal(boolean modal)
Sets a window modal or non-modal. |
void |
setPosition(WindowPosition position)
Sets a position constraint for this window. |
void |
setResizable(boolean resizable)
Sets whether the user can resize the window. |
void |
setScreen(Screen screen)
Sets the Screen where the window is displayed; if the window is already mapped, it will be unmapped, and then remapped on the new screen. |
void |
setSkipPagerHint(boolean skipHint)
Set to true to keep the window from appearing in the pager. |
void |
setSkipTaskbarHint(boolean skipHint)
Set to true to keep this window from appearing in the task bar. |
void |
setTitle(java.lang.String title)
Set the title for this Window object |
void |
setTransientParent(Window parent)
Dialog windows should be set transient for the main application window they were spawned from. |
void |
stick()
Asks to stick the window. |
void |
unfullscreen()
|
void |
unmaximize()
Asks to unmaximize the Window so it becomes it normal size. |
void |
unstick()
Asks to unstick the window. |
Methods inherited from class org.gnu.gtk.Bin |
---|
getChild |
Methods inherited from class org.gnu.gtk.Container |
---|
add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getEventListenerClass, getEventType, getIntChildProperty, getResizeMode, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode |
Methods inherited from class org.gnu.gtk.GtkObject |
---|
sink |
Methods inherited from class org.gnu.glib.Struct |
---|
equals, getHandle, getNullHandle, hashCode |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Window()
new Window(WindowType.TOPLEVEL)
public Window(WindowType windowType)
windowType
- The type of window to createpublic Window(org.gnu.glib.Handle handle)
handle
- The handle that represents a pointer to a native resource.Method Detail |
---|
public static Window getWindow(org.gnu.glib.Handle handle)
handle
- The handle that represents a pointer to a native resource.public void setTitle(java.lang.String title)
title
- A string containing the title for this Windowpublic java.lang.String getTitle()
public void setResizable(boolean resizable)
resizable
- Determines if the window can be resized.public void addAccelGroup(AccelGroup accelGroup)
accesGroup
with the window.
accelGroup
- The AccelGroup to associate with this window.public void removeAccelGroup(AccelGroup accelGroup)
addAccelGroup
.
accelGroup
- The AccelGroup to disassociate with this window.public void setModal(boolean modal)
modal
- Indicates whether the window should be modal or not.public void setDefaultSize(int width, int height)
width
- The width to set for the default size.height
- the height to set for the default size.public void setGeometryHints(Widget geometryWidget, Geometry geometry, WindowHints geomMask)
geometryWidget
- The Widget the geometry hints will be applied to.geometry
- The geometry information.geomMask
- Mask indicating which fields should be paid attention to.public void setGravity(Gravity gravity)
move()
.
gravity
- The window gravity.public Gravity getGravity()
setGravity()
.
public void setPosition(WindowPosition position)
WindowPosition.CENTER_ALWAYS
, this will also cause the window
to be repositioned to satisfy the new constraint.
position
- A position constraint.public Widget getFocusWidget()
public void setFocusWidget(Widget focus)
focus
is not the current focus widget and is focusable,
set it as the focus widget for the window.
focus
- The widget to receive focus for the Window.public void setDefaultWidget(Widget defaultWidget)
defaultWidget
- The widget that should become the default widget.public void present()
show
as well.
public void iconify()
public void deiconify()
public void stick()
public void unstick()
public void maximize()
public void unmaximize()
public void setDecorated(boolean setting)
setting
- Determines if the Window should be decorated.public Requisition getSize()
public Point getPosition()
public void move(int x, int y)
x
- The x coordinate for the move.y
- The y coordinate for the move.public void resize(int width, int height)
width
- The width for the resized Window.height
- The height for the resized Window.public void setIcon(Pixbuf icon)
icon
- The Icon to use for this Window.public Pixbuf getIcon()
public void setIconList(Pixbuf[] icons)
public Pixbuf[] getIconList()
public void setSkipTaskbarHint(boolean skipHint)
skipHint
- public boolean getSkipTaskbarHint()
public void setSkipPagerHint(boolean skipHint)
skipHint
- public boolean getSkipPagerHint()
public void setAcceptFocus(boolean acceptFocus)
acceptFocus
- true to set this hint.public boolean getAcceptFocus()
public void setScreen(Screen screen)
screen
- the new screen.public Screen getScreen()
getScreen
in class Widget
public boolean isActive()
Plug
embedded in the active toplevel. You might use this method
if you wanted to draw a widget differently in an active window from a
widget in an inactive window.
public boolean hasToplevelFocus()
isActive()
, but for
embedded windows, like Plug
, the results will differ.
public boolean setIconFromFile(java.lang.String filename)
filename
- the full path to the icon
true
if the icon was successfully set,
false
otherwise.public static boolean setDefaultIconFromFile(java.lang.String filename)
filename
- the path to the icon
true
if it was successfully set,
false
otherwise.setIconName(String)
public static void setDefaultIcon(Pixbuf icon)
public static void setAutoStartupNotification(boolean setting)
public void fullscreen()
public void unfullscreen()
public void setKeepAbove(boolean setting)
public void setKeepBelow(boolean setting)
public static void setDefaultIconList(Pixbuf[] icons)
icons
- the list of icons to use.public static Pixbuf[] getDefaultIconList()
setDefaultIconList
.
public static Window[] listToplevelWindows()
public void setFocusOnMap(boolean setting)
setting
- TRUE to let this window receive input focus on map.public boolean getFocusOnMap()
setFocusOnMap(boolean)
.
public void setIconName(java.lang.String name)
IconTheme
for more details.
Note that this has nothing to do with the WM_ICON_NAME property which is mentioned in the ICCCM.
name
- The name of the themed icon.public java.lang.String getIconName()
public void setDefaultIconName(java.lang.String name)
setIconList
called on them from a named themed icon.
setIconName(String)
public Window getTransientParent()
setTransientParent(Window)
public void setTransientParent(Window parent)
parent
- Transient parent window.public static Type getType()
public void destroy()
destroy
in class GtkObject
ObjectDestroyedException
public boolean isDestroyed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |