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<IMG,S,CBV>
public abstract class AbstractFxSpriteFactory<S,B extends AbstractFxSpriteFactory<S,B>> extends java.lang.Object implements FxSpriteFactory<S>
A factory for creating JavaFx "sprites".
-
-
Constructor Summary
Constructors Constructor Description AbstractFxSpriteFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getOpacity()
Gets the opacity.double
getScaleFactor()
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.B
withOpacity(double aOpacity)
With opacity.B
withScaleFactor(double aScaleFactor)
With scale factor.
-
-
-
Method Detail
-
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
public B withScaleFactor(double aScaleFactor)
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
public B withOpacity(double aOpacity)
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
-
-