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<Node,S,FxCheckerboardViewer<?,S>>,org.refcodes.factory.ContextLookupFactory<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
Constructors Constructor Description AbstractFxSpriteFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetOpacity()Gets the opacity.doublegetScaleFactor()Gets the scale factor.protected static doublegetScaleX(Node aSprite, FxCheckerboardViewer<?,?> aCheckerboard)Gets the scale X.protected static doublegetScaleY(Node aSprite, FxCheckerboardViewer<?,?> aCheckerboard)Gets the scale Y.voidsetOpacity(double aOpacity)Sets the opacity.voidsetScaleFactor(double aScaleFactor)Sets the scale factor.protected <N extends Node>
NtoInitNode(double aScale, N aSprite, FxCheckerboardViewer<?,?> aCheckerboard)Inits the sprite.protected <N extends Node>
NtoInitNode(N aSprite, FxCheckerboardViewer<?,?> aCheckerboard)Inits the sprite.BwithOpacity(double aOpacity)With opacity.BwithScaleFactor(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.checkerboard.alt.javafx.FxSpriteFactory
createInstance
-
-
-
-
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(Node aSprite, FxCheckerboardViewer<?,?> aCheckerboard)
Gets the scale X.- Parameters:
aSprite- the spriteaCheckerboard- the checkerboard- Returns:
- the scale X
-
getScaleY
protected static double getScaleY(Node aSprite, FxCheckerboardViewer<?,?> aCheckerboard)
Gets the scale Y.- Parameters:
aSprite- the spriteaCheckerboard- the checkerboard- Returns:
- the scale Y
-
toInitNode
protected <N extends 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 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
-
-