org.minueto.window
Interface MinuetoWindow

All Superinterfaces:
MinuetoDrawingSurface
All Known Implementing Classes:
MinuetoFrame, MinuetoFullscreen, MinuetoPanel

public interface MinuetoWindow
extends MinuetoDrawingSurface

Interface describing the minimum functionality provided by all implementation of Minueto.

Since:
1.1
See Also:
MinuetoBaseWindow

Method Summary
 void close()
          Close the window and free any ressource still in use by the window.
 double getFrameRate()
          Returns the number of frame renders per second.
 int getPositionX()
          Returns the top-left X screen location of the MinuetoWindow drawing surface
 int getPositionY()
          Returns the top-left Y screen location of the MinuetoWindow drawing surface
 boolean isClosed()
          Returns if the MinuetoWindow is was closed.
 boolean isVisible()
          Returns if the MinuetoWindow is visible or not.
 void registerFocusHandler(MinuetoFocusHandler handler, MinuetoEventQueue queue)
          Assign a focus handler to the MinuetoWindow to process focus events.
 void registerKeyboardHandler(MinuetoKeyboardHandler handler, MinuetoEventQueue queue)
          Assign a keyboard handler to the MinuetoWindow to process keyboard input.
 void registerMouseHandler(MinuetoMouseHandler handler, MinuetoEventQueue queue)
          Assign a mouse handler to the MinuetoWindow to process mouse input.
 void registerMouseWheelHandler(MinuetoMouseWheelHandler handler, MinuetoEventQueue queue)
          Assign a mousewheel handler to the MinuetoWindow to process mouse wheel input.
 void registerWindowHandler(MinuetoWindowHandler handler, MinuetoEventQueue queue)
          Assign a window handler to the MinuetoWindow to process window input.
 void render()
          Draws the content of the backbuffer onto the window.
 void setCursorVisible(boolean value)
          Shows or hides the mouse cursor.
 void setMaxFrameRate(double value)
          Caps the number of frames which can be rendered (display) per second.
 void setTitle(java.lang.String title)
          Change the title of the window.
 void setVisible(boolean value)
          Shows or hides the MinuetoWindow.
 void unregisterFocusHandler(MinuetoFocusHandler handler, MinuetoEventQueue queue)
          Removes a focus handler from the MinuetoWindow.
 void unregisterKeyboardHandler(MinuetoKeyboardHandler handler, MinuetoEventQueue queue)
          Removes a keyboard handler from the MinuetoWindow.
 void unregisterMouseHandler(MinuetoMouseHandler handler, MinuetoEventQueue queue)
          Removes a mouse handler from the MinuetoWindow.
 void unregisterMouseWheelHandler(MinuetoMouseWheelHandler handler, MinuetoEventQueue queue)
          Removes a mouse wheel handler from the MinuetoWindow.
 void unregisterWindowHandler(MinuetoWindowHandler handler, MinuetoEventQueue queue)
          Removes a window handler from the MinuetoWindow.
 
Methods inherited from interface org.minueto.image.MinuetoDrawingSurface
clear, clear, draw, drawLine, getHeight, getWidth, save, setPixel
 

Method Detail

render

void render()
Draws the content of the backbuffer onto the window. The content of the backbuffer is lost after this call.

Throws:
MinuetoWindowInvalidStateException - if this window is hidden (invisible) or has been closed.

getPositionX

int getPositionX()
Returns the top-left X screen location of the MinuetoWindow drawing surface

Returns:
int denoting the x position of the drawing surface
Since:
1.1

getPositionY

int getPositionY()
Returns the top-left Y screen location of the MinuetoWindow drawing surface

Returns:
int denoting the y position of the drawing surface
Since:
1.1

getFrameRate

double getFrameRate()
Returns the number of frame renders per second. This is value is updated every 50 frames.

Returns:
int denoting the number of frames drawn per second.
Since:
0.6

setMaxFrameRate

void setMaxFrameRate(double value)
Caps the number of frames which can be rendered (display) per second. The efficienty of the cap depends on the accuracy of the system timer. Calling this method with a value of 0 will disable the cap.

Parameters:
value - double denoting the desired number of frames to be displayed per second.
Since:
0.6

registerKeyboardHandler

void registerKeyboardHandler(MinuetoKeyboardHandler handler,
                             MinuetoEventQueue queue)
Assign a keyboard handler to the MinuetoWindow to process keyboard input. An unlimited number of keyboard handlers can be registered with a window, but too many handlers may slow the application (because of the large number of events produced).

Parameters:
handler - MinuetoKeyboardHandler to register with the MinuetoEventQueue.
queue - MinuetoEventQueue that will store events..
Since:
0.8

registerMouseHandler

void registerMouseHandler(MinuetoMouseHandler handler,
                          MinuetoEventQueue queue)
Assign a mouse handler to the MinuetoWindow to process mouse input. An unlimited number of mouse handlers can be registered with a window, but too many handlers may slow the application (because of the large number of events produced).

Parameters:
handler - MinuetoMouseHandler to register with the MinuetoWindow.
queue - MinuetoEventQueue that will store events.
Since:
0.8

registerWindowHandler

void registerWindowHandler(MinuetoWindowHandler handler,
                           MinuetoEventQueue queue)
Assign a window handler to the MinuetoWindow to process window input. An unlimited number of window handlers can be registered with a window, but too many handlers may slow the application (because of the large number of events produced).

Parameters:
handler - MinuetoWindowHandler to register with the MinuetoWindow.
queue - MinuetoEventQueue that will store events.
Since:
0.8

registerFocusHandler

void registerFocusHandler(MinuetoFocusHandler handler,
                          MinuetoEventQueue queue)
Assign a focus handler to the MinuetoWindow to process focus events. An unlimited number of window handlers can be registered with a window, but too many handlers may slow the application (because of the large number of events produced).

Parameters:
handler - MinuetoFocusHandler to register with the MinuetoWindow.
queue - MinuetoEventQueue that will store events.
Since:
1.1

registerMouseWheelHandler

void registerMouseWheelHandler(MinuetoMouseWheelHandler handler,
                               MinuetoEventQueue queue)
Assign a mousewheel handler to the MinuetoWindow to process mouse wheel input. An unlimited number of mouse wheel handlers can be registered with a window, but too many handlers may slow the application (because of the large number of events produced).

Parameters:
handler - MinuetoMouseWheelHandler to register with the MinuetoWindow.
queue - MinuetoEventQueue that will store events.
Since:
0.8

unregisterKeyboardHandler

void unregisterKeyboardHandler(MinuetoKeyboardHandler handler,
                               MinuetoEventQueue queue)
Removes a keyboard handler from the MinuetoWindow. Note that both the correct handler and queue must be given to unregister the handler.

Parameters:
handler - MinuetoKeyboardHandler to unregister with the MinuetoWindow.
queue - MinuetoEventQueue that stored the events.
Since:
1.0

unregisterMouseHandler

void unregisterMouseHandler(MinuetoMouseHandler handler,
                            MinuetoEventQueue queue)
Removes a mouse handler from the MinuetoWindow. Note that both the correct handler and queue must be given to unregister the handler.

Parameters:
handler - MinuetoMouseHandler to unregister with the MinuetoWindow.
queue - MinuetoEventQueue that stored the events.
Since:
1.0

unregisterWindowHandler

void unregisterWindowHandler(MinuetoWindowHandler handler,
                             MinuetoEventQueue queue)
Removes a window handler from the MinuetoWindow. Note that both the correct handler and queue must be given to unregister the handler.

Parameters:
handler - MinuetoWindowHandler to unregister with the MinuetoWindow.
queue - MinuetoEventQueue that stored the events.
Since:
1.0

unregisterFocusHandler

void unregisterFocusHandler(MinuetoFocusHandler handler,
                            MinuetoEventQueue queue)
Removes a focus handler from the MinuetoWindow. Note that both the correct handler and queue must be given to unregister the handler.

Parameters:
handler - MinuetoFocusHandler to unregister with the MinuetoWindow.
queue - MinuetoEventQueue that stored the events.
Since:
1.1

unregisterMouseWheelHandler

void unregisterMouseWheelHandler(MinuetoMouseWheelHandler handler,
                                 MinuetoEventQueue queue)
Removes a mouse wheel handler from the MinuetoWindow. Note that both the correct handler and queue must be given to unregister the handler.

Parameters:
handler - MinuetoMouseWheelHandler to unregister with the MinuetoWindow.
queue - MinuetoEventQueue that stored the events.
Since:
1.0

close

void close()
Close the window and free any ressource still in use by the window. Once executed, this window can no longuer be used. Any further invocation of a method from this object will result in a MinuetoWindowInvalidStateException.


setCursorVisible

void setCursorVisible(boolean value)
Shows or hides the mouse cursor.

Parameters:
value - boolean denoting if the window should be visible or not.
Throws:
MinuetoWindowInvalidStateException - if this window is hidden (invisible) or has been closed.
Since:
0.4.6

setTitle

void setTitle(java.lang.String title)
Change the title of the window.

Parameters:
title - String identifying the desired title of the screen.
Throws:
MinuetoWindowInvalidStateException - if this window is hidden (invisible) or has been closed.

setVisible

void setVisible(boolean value)
Shows or hides the MinuetoWindow.

Parameters:
value - boolean denoting if the window should be visible or not.
Throws:
MinuetoWindowInvalidStateException - if this window is hidden (invisible) or has been closed.

isVisible

boolean isVisible()
Returns if the MinuetoWindow is visible or not.

Returns:
boolean if Window is visible or not
Since:
1.2

isClosed

boolean isClosed()
Returns if the MinuetoWindow is was closed.

Returns:
boolean if Window was closed or not
Since:
1.2