Package com.nerius.game.util
Class BoardAWTAdapter
- java.lang.Object
-
- com.nerius.game.util.CanvasAWTAdapter
-
- com.nerius.game.util.BoardAWTAdapter
-
- All Implemented Interfaces:
AudioClipSource
,BoardAWTStub
,CanvasAWTStub
,Destroyable
,HeadlessBoardAWTStub
public class BoardAWTAdapter extends CanvasAWTAdapter implements BoardAWTStub
The most basic implementation ofcom.nerius.game.BoardAWTStub
.
-
-
Field Summary
-
Fields inherited from class com.nerius.game.util.CanvasAWTAdapter
DEFAULT_MAX_FPS
-
-
Constructor Summary
Constructors Constructor Description BoardAWTAdapter(java.awt.Component target, boolean strictThreadControl, AudioClipSource audioSource)
TheComponent
input to the constructors must pass user key/mouse events to this module via the object returned bygetInputListenerHook()
.BoardAWTAdapter(java.awt.Component target, boolean strictThreadControl, AudioClipSource audioSource, int maxFramesPerSecond)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInputListener(InputListener inputListener)
Registers anInputListener
.java.applet.AudioClip
getAudioClip(java.lang.String resourceName)
Implements the required audio clip getting ability.InputListener
getInputListenerHook()
Thejava.awt.Componenet
that is coupled with thisBoardAWTAdapter
must call theInputListener
methods on the object returned bygetInputListenerHook()
directly, in order to pass user key/mouse events on to the registeredInputListener
objects.void
removeInputListener(InputListener inputListener)
Unregisters anInputListener
.-
Methods inherited from class com.nerius.game.util.CanvasAWTAdapter
destroy, produceImage, produceImage, requestUpdate, setUpdatable, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.nerius.game.CanvasAWTStub
produceImage, produceImage, requestUpdate
-
-
-
-
Constructor Detail
-
BoardAWTAdapter
public BoardAWTAdapter(java.awt.Component target, boolean strictThreadControl, AudioClipSource audioSource)
TheComponent
input to the constructors must pass user key/mouse events to this module via the object returned bygetInputListenerHook()
. This is part of the contract betweenBoardAWTAdapter
andjava.awt.Component
.- See Also:
CanvasAWTAdapter(Component,boolean)
-
BoardAWTAdapter
public BoardAWTAdapter(java.awt.Component target, boolean strictThreadControl, 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:
BoardAWTAdapter(Component,boolean,AudioClipSource)
-
-
Method Detail
-
getAudioClip
public java.applet.AudioClip getAudioClip(java.lang.String resourceName)
Implements the required audio clip getting ability.- Specified by:
getAudioClip
in interfaceAudioClipSource
-
addInputListener
public void addInputListener(InputListener inputListener)
Registers anInputListener
.- Specified by:
addInputListener
in interfaceBoardAWTStub
-
removeInputListener
public void removeInputListener(InputListener inputListener)
Unregisters anInputListener
.- Specified by:
removeInputListener
in interfaceBoardAWTStub
-
getInputListenerHook
public InputListener getInputListenerHook()
Thejava.awt.Componenet
that is coupled with thisBoardAWTAdapter
must call theInputListener
methods on the object returned bygetInputListenerHook()
directly, in order to pass user key/mouse events on to the registeredInputListener
objects. In other words each call to the returnedInputListener
's methods will result in respective calls to registeredInputListener
objects.
-
-