Interface FxSpriteFactory<S>
-
- Type Parameters:
S
- the generic type of the identifier for which the sprite is to be created.
- All Superinterfaces:
org.refcodes.factory.ContextLookupFactory<Node,S,FxCheckerboardViewer<?,S>>
,org.refcodes.checkerboard.SpriteFactory<Node,S,FxCheckerboardViewer<?,S>>
- All Known Implementing Classes:
AbstractFxSpriteFactory
public interface FxSpriteFactory<S> extends org.refcodes.checkerboard.SpriteFactory<Node,S,FxCheckerboardViewer<?,S>>
A factory for creating sprites for theFxCheckerboardViewer
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Node
createInstance(S aIdentifier, FxCheckerboardViewer<?,S> aContext)
Some words when using theFxCheckerboardViewerImpl
implementation of theFxCheckerboardViewer
: In case you return aNode
for the provided identifier being the same instance as a previously createdNode
for the same previously provided identifier, then theNode
is just redrawn by theFxCheckerboardViewerImpl
(preventing fading out / fading in when updating theNode
).
-
-
-
Method Detail
-
createInstance
Node createInstance(S aIdentifier, FxCheckerboardViewer<?,S> aContext)
Some words when using theFxCheckerboardViewerImpl
implementation of theFxCheckerboardViewer
: In case you return aNode
for the provided identifier being the same instance as a previously createdNode
for the same previously provided identifier, then theNode
is just redrawn by theFxCheckerboardViewerImpl
(preventing fading out / fading in when updating theNode
). If another instance is returned, then the previously setNode
is removed (fade out) before the newly createdNode
is added (fade in) by theFxCheckerboardViewerImpl
. You may use aMap
(WeakHashMap
) for relating the identifier to the accordingNode
in order to identify whether to create a newNode
or update an existing one.- Specified by:
createInstance
in interfaceorg.refcodes.factory.ContextLookupFactory<Node,S,FxCheckerboardViewer<?,S>>
-
-