Package javaforce.ui

Class Window

java.lang.Object
javaforce.ui.Window

public class Window extends Object
  • Field Details

  • Constructor Details

    • Window

      public Window()
  • Method Details

    • init

      public static boolean init()
    • create

      public boolean create(int style, String title, int width, int height, Window shared)
    • destroy

      public void destroy()
      Show the window.
    • setCurrent

      public void setCurrent()
      Set the OpenGL Context current for this window.
    • setIcon

      public void setIcon(String filename, int x, int y)
      Set an icon to the window. This function is somewhat platform dependant. Only windows is supported currently.
      Parameters:
      filename - = file (.ico for windows)
    • setKeyListener

      public void setKeyListener(KeyEvents keys)
    • setMouseListener

      public void setMouseListener(MouseEvents mouse)
    • setWindowListener

      public void setWindowListener(WindowEvents window)
    • 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

      public static Window[] getWindows()
    • getContent

      public Component getContent()
    • setContent

      public void setContent(Component content)
    • getScale

      public int getScale()
    • setScale

      public void setScale(int scale)
    • layout

      public void layout()
    • resize

      public void resize(int w, int h)
    • registerCanvas

      public static void registerCanvas(Canvas canvas)
    • render

      public void render(Scene scene)
    • getCanvasList

      public Canvas[] getCanvasList()
    • redrawAll

      public static void redrawAll()