Class Window
java.lang.Object
javaforce.ui.Window
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoiddestroy()Show the window.Canvas[]intintint[]Get window position.intgetScale()intgetWidth()intstatic Window[]voidhide()Hide the window.voidHide the cursor.static booleaninit()voidlayout()voidHide the cursor and lock to this window.static voidPolls for events.static voidpollEvents(int wait) Polls for events.static voidPosts an empty event to wake main thread.static voidstatic voidregisterCanvas(Canvas canvas) voidvoidresize(int w, int h) voidsetContent(Component content) voidSet the OpenGL Context current for this window.voidSet an icon to the window.voidsetKeyListener(KeyEvents keys) voidsetMouseListener(MouseEvents mouse) voidsetPosition(int x, int y) set window position.voidsetScale(int scale) voidsetWindowListener(WindowEvents window) voidshow()Show the window.voidShow the cursor (default).voidswap()Swaps the OpenGL Buffers.
-
Field Details
-
STYLE_VISIBLE
public static final int STYLE_VISIBLE- See Also:
-
STYLE_RESIZABLE
public static final int STYLE_RESIZABLE- See Also:
-
STYLE_TITLEBAR
public static final int STYLE_TITLEBAR- See Also:
-
STYLE_FULLSCREEN
public static final int STYLE_FULLSCREEN- See Also:
-
-
Constructor Details
-
Window
public Window()
-
-
Method Details
-
init
public static boolean init() -
create
-
destroy
public void destroy()Show the window. -
setCurrent
public void setCurrent()Set the OpenGL Context current for this window. -
setIcon
Set an icon to the window. This function is somewhat platform dependant. Only windows is supported currently.- Parameters:
filename- = file (.ico for windows)
-
setKeyListener
-
setMouseListener
-
setWindowListener
-
pollEvents
public static void pollEvents(int wait) Polls for events.- Parameters:
wait- = time to wait for event to occur -1 = wait forever 0 = do not wait x = wait x milliseconds
-
postEvent
public static void postEvent()Posts an empty event to wake main thread. -
pollEvents
public static void pollEvents()Polls for events. Does not wait for an event. Same as pollEvents(0); -
show
public void show()Show the window. -
hide
public void hide()Hide the window. -
swap
public void swap()Swaps the OpenGL Buffers. -
hideCursor
public void hideCursor()Hide the cursor. -
showCursor
public void showCursor()Show the cursor (default). -
lockCursor
public void lockCursor()Hide the cursor and lock to this window. Use showCursor() to unlock. -
getPosition
public int[] getPosition()Get window position.- Returns:
- int[0] = x, int[1] = y
-
setPosition
public void setPosition(int x, int y) set window position. return: int[0] = x, int[1] = y -
getWidth
public int getWidth() -
getWidthScaled
public int getWidthScaled() -
getHeight
public int getHeight() -
getHeightScaled
public int getHeightScaled() -
getWindows
-
getContent
-
setContent
-
getScale
public int getScale() -
setScale
public void setScale(int scale) -
layout
public void layout() -
resize
public void resize(int w, int h) -
registerCanvas
-
render
-
getCanvasList
-
redrawAll
public static void redrawAll()
-