public interface Window
Definition of an interface for describing windows in a platform independent way.
This interface is an abstraction of a typical window. It defines methods for querying and setting window related properties. For each supported GUI library (or platform) there will be an implementation that hides the specifics of window objects of that library. So application code can simply manipulate these objects through the methods provided here.
Modifier and Type | Method and Description |
---|---|
void |
addMouseListener(FormMouseListener l)
Adds a listener for mouse events to this window.
|
void |
addWindowListener(WindowListener l)
Adds a window listener for this window.
|
boolean |
close(boolean force)
Closes this window.
|
int |
getHeight()
Returns the window's height.
|
Window |
getParentWindow()
Returns the (platform independent abstraction of) window's parent window.
|
Object |
getRootContainer()
Returns the window's root container.
|
String |
getTitle()
Returns the window's title.
|
int |
getWidth()
Returns the window's width.
|
WindowClosingStrategy |
getWindowClosingStrategy()
Returns the current
WindowClosingStrategy of this window. |
Object |
getWindowController()
Returns the controller object for this window.
|
int |
getXPos()
Returns the window's x position.
|
int |
getYPos()
Returns the window's y position.
|
boolean |
isVisible()
Returns a flag if this window is visible.
|
void |
open()
Opens the window.
|
void |
removeMouseListener(FormMouseListener l)
Removes the specified mouse listener from this window.
|
void |
removeWindowListener(WindowListener l)
Removes a window listener for this window.
|
void |
setBounds(int x,
int y,
int w,
int h)
Allows to set the window's bounds.
|
void |
setTitle(String s)
Sets the window's title.
|
void |
setVisible(boolean f)
Sets the window's visible flag.
|
void |
setWindowClosingStrategy(WindowClosingStrategy windowClosingStrategy)
Sets the
WindowClosingStrategy for this window. |
boolean isVisible()
void setVisible(boolean f)
f
- the flag's valuevoid open()
boolean close(boolean force)
force
parameter determines whether the
window's WindowClosingStrategy
is to be invoked: if set to
false, the WindowClosingStrategy
is queried, and the
window is only closed if permitted. Otherwise, the window is always
closed. The return value indicates the success of the operation. A value
of false means that the window could not be closed because the
WindowClosingStrategy
prohibited this operation.force
- a flag whether the window is to be closed unconditionallyint getXPos()
int getYPos()
int getWidth()
int getHeight()
void setBounds(int x, int y, int w, int h)
x
- the new x positiony
- the new y positionw
- the new widthh
- the new heightString getTitle()
void setTitle(String s)
s
- the new titleWindow getParentWindow()
void addWindowListener(WindowListener l)
l
- the listener to addvoid removeWindowListener(WindowListener l)
l
- the listener to removeWindowClosingStrategy getWindowClosingStrategy()
WindowClosingStrategy
of this window.WindowClosingStrategy
; this can be nullvoid setWindowClosingStrategy(WindowClosingStrategy windowClosingStrategy)
WindowClosingStrategy
for this window. This
object checks if a window can be closed.windowClosingStrategy
- the new WindowClosingStrategy
Object getWindowController()
Object getRootContainer()
void addMouseListener(FormMouseListener l)
FormMouseListener
interface.l
- the mouse listener to be addedvoid removeMouseListener(FormMouseListener l)
l
- the listener to removeCopyright © 2016 The JGUIraffe Team. All rights reserved.