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)TheComponentinput 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 voidaddInputListener(InputListener inputListener)Registers anInputListener.java.applet.AudioClipgetAudioClip(java.lang.String resourceName)Implements the required audio clip getting ability.InputListenergetInputListenerHook()Thejava.awt.Componenetthat is coupled with thisBoardAWTAdaptermust call theInputListenermethods on the object returned bygetInputListenerHook()directly, in order to pass user key/mouse events on to the registeredInputListenerobjects.voidremoveInputListener(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)TheComponentinput to the constructors must pass user key/mouse events to this module via the object returned bygetInputListenerHook(). This is part of the contract betweenBoardAWTAdapterandjava.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:
getAudioClipin interfaceAudioClipSource
-
addInputListener
public void addInputListener(InputListener inputListener)
Registers anInputListener.- Specified by:
addInputListenerin interfaceBoardAWTStub
-
removeInputListener
public void removeInputListener(InputListener inputListener)
Unregisters anInputListener.- Specified by:
removeInputListenerin interfaceBoardAWTStub
-
getInputListenerHook
public InputListener getInputListenerHook()
Thejava.awt.Componenetthat is coupled with thisBoardAWTAdaptermust call theInputListenermethods on the object returned bygetInputListenerHook()directly, in order to pass user key/mouse events on to the registeredInputListenerobjects. In other words each call to the returnedInputListener's methods will result in respective calls to registeredInputListenerobjects.
-
-