Class AbstractFxSpriteFactory<S,B extends AbstractFxSpriteFactory<S,B>>
java.lang.Object
org.refcodes.checkerboard.alt.javafx.AbstractFxSpriteFactory<S,B>
- Type Parameters:
S
- the generic type for the player's status.B
- the generic type of the builder to be returned upon invoking builder methods.
- All Implemented Interfaces:
FxSpriteFactory<S>
,org.refcodes.checkerboard.SpriteFactory<javafx.scene.Node,
,S, FxCheckerboardViewer<?, S>> org.refcodes.factory.ContextLookupFactory<javafx.scene.Node,
S, FxCheckerboardViewer<?, S>>
public abstract class AbstractFxSpriteFactory<S,B extends AbstractFxSpriteFactory<S,B>>
extends Object
implements FxSpriteFactory<S>
A factory for creating JavaFx "sprites".
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the opacity.double
Gets the scale factor.protected static double
getScaleX
(javafx.scene.Node aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Gets the scale X.protected static double
getScaleY
(javafx.scene.Node aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Gets the scale Y.void
setOpacity
(double aOpacity) Sets the opacity.void
setScaleFactor
(double aScaleFactor) Sets the scale factor.protected <N extends javafx.scene.Node>
NtoInitNode
(double aScale, N aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Inits the sprite.protected <N extends javafx.scene.Node>
NtoInitNode
(N aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Inits the sprite.withOpacity
(double aOpacity) With opacity.withScaleFactor
(double aScaleFactor) With scale factor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.factory.ContextLookupFactory
create
Methods inherited from interface org.refcodes.checkerboard.alt.javafx.FxSpriteFactory
create
-
Constructor Details
-
AbstractFxSpriteFactory
public AbstractFxSpriteFactory()
-
-
Method Details
-
getScaleFactor
public double getScaleFactor()Gets the scale factor.- Returns:
- the scale factor
-
setScaleFactor
public void setScaleFactor(double aScaleFactor) Sets the scale factor.- Parameters:
aScaleFactor
- the new scale factor
-
withScaleFactor
With scale factor.- Parameters:
aScaleFactor
- the scale factor- Returns:
- the nf
-
getOpacity
public double getOpacity()Gets the opacity.- Returns:
- the opacity
-
setOpacity
public void setOpacity(double aOpacity) Sets the opacity.- Parameters:
aOpacity
- the new opacity
-
withOpacity
With opacity.- Parameters:
aOpacity
- the opacity- Returns:
- the nf
-
getScaleX
protected static double getScaleX(javafx.scene.Node aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Gets the scale X.- Parameters:
aSprite
- the spriteaCheckerboard
- the checkerboard- Returns:
- the scale X
-
getScaleY
protected static double getScaleY(javafx.scene.Node aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Gets the scale Y.- Parameters:
aSprite
- the spriteaCheckerboard
- the checkerboard- Returns:
- the scale Y
-
toInitNode
protected <N extends javafx.scene.Node> N toInitNode(N aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Inits the sprite.- Type Parameters:
N
- The type of the sprite to be used.- Parameters:
aSprite
- the spriteaCheckerboard
- the checkerboard- Returns:
- the node
-
toInitNode
protected <N extends javafx.scene.Node> N toInitNode(double aScale, N aSprite, FxCheckerboardViewer<?, ?> aCheckerboard) Inits the sprite.- Type Parameters:
N
- The type of the sprite to be used.- Parameters:
aSprite
- the spriteaScale
- The scale between 0 and 1.aCheckerboard
- the checkerboard.- Returns:
- the node
-