Package com.nerius.game.util
Class FrameAWTStub
- java.lang.Object
-
- com.nerius.game.util.FrameAWTStub
-
public class FrameAWTStub extends java.lang.Object
Code for getting ajava.awt.Frame
to work with thecom.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.
-
-
Constructor Summary
Constructors Constructor Description FrameAWTStub()
This constructor is for applications without audio clips.FrameAWTStub(boolean strictThreadControl, AudioClipSource audioSource, int maxFramesPerSecond)
FrameAWTStub(AudioClipSource audioSource)
This constructor is for applications that use audio clips.FrameAWTStub(AudioClipSource audioSource, int maxFramesPerSecond)
-
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 acom.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.
-
-
-
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
- iftrue
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 acom.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 toupdate()
visually down the road.destroyable
-destroy()
will be called on it when this frame receives ajava.awt.Event.WINDOW_DESTROY
event; it is suggested thatdispose()
be called on this frame when the methoddestroy()
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.
-
-