Class FrameAWTStub


  • public class FrameAWTStub
    extends java.lang.Object
    Code for getting a java.awt.Frame to work with the com.nerius.game framework. Implementation details are taken care of and are hidden so that application developers can focus on the low level game/animation code. Minimal logic related to frames/windows is exposed. The ability to resize a frame isn't supported.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Disposes of this frame and the intricate logic used within.
      BoardAWTStub getAWTStub()
      Returns the item that is necessary to construct a com.nerius.game.AbstractCanvas.
      void hide()
      Hides this frame.
      void setLocation​(int x, int y)
      Sets the location of the upper left corner of this frame; please note the presence of title bar, insets, etc.
      void setUpdatable​(VisiblyUpdatable updatable, Destroyable destroyable)
      This method should be called only once; it should be regarded as part of the construction of this frame, to be called before this frame is made visible.
      void show()
      Makes this frame visible.
      java.awt.Dimension size()
      Includes size of insets: left, right, top, and bottom.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FrameAWTStub

        public FrameAWTStub()
        This constructor is for applications without audio clips.
      • FrameAWTStub

        public FrameAWTStub​(AudioClipSource audioSource)
        This constructor is for applications that use audio clips.
      • FrameAWTStub

        public FrameAWTStub​(AudioClipSource audioSource,
                            int maxFramesPerSecond)
        Parameters:
        maxFramesPerSecond - maximum frames per second; a value of zero or a negative value is interpreted to mean no FPS limit.
        See Also:
        FrameAWTStub(AudioClipSource)
      • FrameAWTStub

        public FrameAWTStub​(boolean strictThreadControl,
                            AudioClipSource audioSource,
                            int maxFramesPerSecond)
        Parameters:
        strictThreadControl - if true then a few extra checks will be made to assert thread correctness.
        See Also:
        FrameAWTStub(AudioClipSource,int)
    • Method Detail

      • getAWTStub

        public BoardAWTStub getAWTStub()
        Returns the item that is necessary to construct a com.nerius.game.AbstractCanvas.
        See Also:
        AbstractCanvas
      • setUpdatable

        public void setUpdatable​(VisiblyUpdatable updatable,
                                 Destroyable destroyable)
        This method should be called only once; it should be regarded as part of the construction of this frame, to be called before this frame is made visible.
        Parameters:
        updatable - specifies what to update() visually down the road.
        destroyable - destroy() will be called on it when this frame receives a java.awt.Event.WINDOW_DESTROY event; it is suggested that dispose() be called on this frame when the method destroy() is invoked.
      • dispose

        public void dispose()
        Disposes of this frame and the intricate logic used within.
      • setLocation

        public void setLocation​(int x,
                                int y)
        Sets the location of the upper left corner of this frame; please note the presence of title bar, insets, etc. which will all be rendered to the right of and below specified location.
      • show

        public void show()
        Makes this frame visible.
      • size

        public java.awt.Dimension size()
        Includes size of insets: left, right, top, and bottom. The frame may need to be shown and/or painted for this to report the correct dimension, so please use with caution.
      • hide

        public void hide()
        Hides this frame.