Class AbstractFxSpriteFactory<S,NF extends AbstractFxSpriteFactory<S,NF>>

  • Type Parameters:
    S - the generic type
    NF - the generic type
    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,NF extends AbstractFxSpriteFactory<S,NF>>
    extends java.lang.Object
    implements FxSpriteFactory<S>
    A factory for creating AbstractFxSprite objects.
    • Constructor Detail

      • AbstractFxSpriteFactory

        public AbstractFxSpriteFactory()
    • 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 NF 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 NF 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 sprite
        aCheckerboard - the checkerboard
        Returns:
        the scale X
      • getScaleY

        protected static double getScaleY​(javafx.scene.Node aSprite,
                                          FxCheckerboardViewer<?,?> aCheckerboard)
        Gets the scale Y.
        Parameters:
        aSprite - the sprite
        aCheckerboard - the checkerboard
        Returns:
        the scale Y
      • initSprite

        protected javafx.scene.Node initSprite​(javafx.scene.Node aSprite,
                                               FxCheckerboardViewer<?,?> aCheckerboard)
        Inits the sprite.
        Parameters:
        aSprite - the sprite
        aCheckerboard - the checkerboard
        Returns:
        the node