Class JavaApplication

  • All Implemented Interfaces:
    java.awt.event.KeyListener, java.io.Serializable, java.util.EventListener
    Direct Known Subclasses:
    JavaApplication2D, JavaApplication3D

    public abstract class JavaApplication
    extends Application
    implements java.awt.event.KeyListener, java.io.Serializable
    See Also:
    Serialized Form
    • Field Detail

      • m_acWindowTitle

        protected java.lang.String m_acWindowTitle
        constructor inputs
      • m_iXPosition

        protected int m_iXPosition
      • m_iYPosition

        protected int m_iYPosition
      • m_iWidth

        protected int m_iWidth
      • m_iHeight

        protected int m_iHeight
      • m_kBackgroundColor

        protected ColorRGBA m_kBackgroundColor
      • m_eFormat

        protected FrameBuffer.FormatType m_eFormat
        The frame buffer parameters for the renderer creation. You may set these to values different than the defaults during your application constructor call. Default buffer parameters. These may be overridden by the derived class constructor. Current hardware seems to pack a 24-bit depth buffer and 8-bit stencil buffer into a 32-bit buffer, so I suggest not overriding these. Perhaps the only one you should is the multisampling value.
      • m_pkRenderer

        protected Renderer m_pkRenderer
        The renderer (used for 2D and 3D applications).
    • Constructor Detail

      • JavaApplication

        public JavaApplication​(java.lang.String acWindowTitle,
                               int iXPosition,
                               int iYPosition,
                               int iWidth,
                               int iHeight,
                               ColorRGBA rkBackgroundColor)
        Creates a new JavaApplication3.
        Parameters:
        acWindowTitle - the window title
        iXPosition - window screen x-position
        iYPosition - window screen y-position
        iWidth - window width
        iHeight - window height
        rkBackgroundColor - background color
    • Method Detail

      • dispose

        public void dispose()
        Delete memory.
      • GetAspectRatio

        public float GetAspectRatio()
        Returns the window aspect ratio.
        Returns:
        window aspect ratio.
      • GetHeight

        public int GetHeight()
        Returns the window height.
        Returns:
        the window height.
      • GetRenderer

        public Renderer GetRenderer()
        Returns the Renderer object.
        Returns:
        the Renderer object.
      • GetWidth

        public int GetWidth()
        Returns the window width.
        Returns:
        the window width.
      • GetWindowTitle

        public java.lang.String GetWindowTitle()
        Returns the window title.
        Returns:
        the window title.
      • GetXPosition

        public int GetXPosition()
        Returns the window x-position.
        Returns:
        the window x-position.
      • GetYPosition

        public int GetYPosition()
        Returns the window y-position.
        Returns:
        the window y-position.
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        KeyEvents:
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent arg0)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent arg0)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • OnDisplay

        public void OnDisplay()
        OnDisplay call back, called when the application window is displayed
      • OnIdle

        public void OnIdle()
        OnIdle call back, called when the application is idle
      • OnInitialize

        public boolean OnInitialize()
        OnInitialize call back, called when the application is created.
        Returns:
        true
      • OnMove

        public void OnMove​(int iX,
                           int iY)
        OnMove call back, called when the application window is moved.
        Parameters:
        iX - new x-position
        iY - new y-position
      • OnPrecreate

        public boolean OnPrecreate()
        OnPrecreate call back, called before the application is created.
        Returns:
        true
      • OnResize

        public void OnResize​(int iWidth,
                             int iHeight)
        OnResize call back, called when the application window is resized
        Parameters:
        iWidth - the new window width
        iHeight - the new window height
      • OnTerminate

        public void OnTerminate()
        OnTerminate call back, called when the application is terminated.
      • SetRenderer

        public void SetRenderer​(Renderer pkRenderer)
        Set the Renderer object.
        Parameters:
        pkRenderer - the new renderer object.