org.jvnet.lafwidget.animation
Class FadeState

java.lang.Object
  extended by org.jvnet.lafwidget.animation.FadeState

public class FadeState
extends java.lang.Object

Information on the state of the faded component.

Author:
Kirill Grouchnikov

Field Summary
protected static long counter
          Is used to create unique value for the id field.
 FadeKind fadeKind
          Fade animation kind.
 FadeStep fadeStep
          Fade animation step.
protected  long id
          Unique ID.
 
Constructor Summary
FadeState(FadeKind fadeKind, float fadePosition, boolean isFadingIn, boolean toRepaintParent)
          Simple constructor.
 
Method Summary
 FadeTrackerCallback getCallback()
          Returns the application callback.
 FadeState getCopy()
          Returns a copy.
 float getFadePosition()
          Returns the current fade position.
protected static long getId()
          Returns a unique ID.
 int getLoopCount()
           
 boolean isFadingIn()
          Returns the fade-in / fade-out indication.
 boolean isLooping()
          Returns the looping indication.
 boolean isLoopingReverse()
          Returns indication whether the looping fade starts fading out after reaching the maximum value.
 boolean isToRepaintParent()
          Returns indication whether the component parent should be repainted on each fade cycle.
 boolean isToStopAtCycleBreak()
          Returns indication whether the looping fade should stop at reaching the end of the fade-out cycle.
 void setCallback(FadeTrackerCallback callback)
          Sets the callback.
 void setFadePosition(float fadePosition)
          Sets the current fade position.
 void setFadingIn(boolean isFadingIn)
          Sets fade-in / fade-out indication.
 void setLoopCount(int loopCount)
           
 void setLooping(boolean isLooping)
          Sets the looping indication.
 void setLoopingReverse(boolean isLoopingReverse)
          Sets indication whether the looping fade starts fading out after reaching the maximum value.
 void setToRepaintParent(boolean toRepaintParent)
          Sets indication whether the component parent should be repainted on each fade cycle.
 void setToStopAtCycleBreak(boolean toStopAtCycleBreak)
          Sets indication whether the looping fade should stop at reaching the end of the fade-out cycle.
 void toStopAtCycleBreak()
          Sets indication that looping fade should stop at the end of the fade-out cycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counter

protected static long counter
Is used to create unique value for the id field.


id

protected long id
Unique ID.


fadeStep

public FadeStep fadeStep
Fade animation step.


fadeKind

public FadeKind fadeKind
Fade animation kind.

Constructor Detail

FadeState

public FadeState(FadeKind fadeKind,
                 float fadePosition,
                 boolean isFadingIn,
                 boolean toRepaintParent)
Simple constructor.

Parameters:
fadeKind - Fade animation kind.
fadePosition - Fade cycle.
isFadingIn - Indication whether it's a fade-in or fade-out.
toRepaintParent - Indication whether the component parent should be repainted on each fade cycle.
Method Detail

getCopy

public FadeState getCopy()
Returns a copy.

Returns:
Fade state copy.

toStopAtCycleBreak

public void toStopAtCycleBreak()
Sets indication that looping fade should stop at the end of the fade-out cycle.


getId

protected static long getId()
Returns a unique ID.

Returns:
Unique ID.

setCallback

public void setCallback(FadeTrackerCallback callback)
Sets the callback.

Parameters:
callback - Callback.

getCallback

public FadeTrackerCallback getCallback()
Returns the application callback. The result may be null.

Returns:
Possible null application callback.

setFadePosition

public void setFadePosition(float fadePosition)
Sets the current fade position. Valid range is 0.0-10.0.

Parameters:
fadePosition - New fade position.

getFadePosition

public float getFadePosition()
Returns the current fade position.

Returns:
The current fade position.

setFadingIn

public void setFadingIn(boolean isFadingIn)
Sets fade-in / fade-out indication.

Parameters:
isFadingIn - true if the current animation is fade-in, false if the current animation is fade-out.

isFadingIn

public boolean isFadingIn()
Returns the fade-in / fade-out indication.

Returns:
true if the current animation is fade-in, false if the current animation is fade-out.

setLooping

public void setLooping(boolean isLooping)
Sets the looping indication.

Parameters:
isLooping - New value for the looping indication.

isLooping

public boolean isLooping()
Returns the looping indication.

Returns:
true if the animation is looping, false otherwise.

setLoopingReverse

public void setLoopingReverse(boolean isLoopingReverse)
Sets indication whether the looping fade starts fading out after reaching the maximum value.

Parameters:
isLoopingReverse - true if the looping animation should start fading out after reaching the maximum value, false otherwise.

isLoopingReverse

public boolean isLoopingReverse()
Returns indication whether the looping fade starts fading out after reaching the maximum value.

Returns:
true if the looping animation should start fading out after reaching the maximum value, false otherwise.

setToStopAtCycleBreak

public void setToStopAtCycleBreak(boolean toStopAtCycleBreak)
Sets indication whether the looping fade should stop at reaching the end of the fade-out cycle.

Parameters:
toStopAtCycleBreak - true if the looping indication should stop at the next fade-out cycle end, false otherwise.

isToStopAtCycleBreak

public boolean isToStopAtCycleBreak()
Returns indication whether the looping fade should stop at reaching the end of the fade-out cycle.

Returns:
true if the looping indication should stop at the next fade-out cycle end, false otherwise.

setToRepaintParent

public void setToRepaintParent(boolean toRepaintParent)
Sets indication whether the component parent should be repainted on each fade cycle.

Parameters:
toRepaintParent - true if the component parent should be repainted on each fade cycle, false otherwise.

isToRepaintParent

public boolean isToRepaintParent()
Returns indication whether the component parent should be repainted on each fade cycle.

Returns:
true if the component parent should be repainted on each fade cycle, false otherwise.

getLoopCount

public int getLoopCount()

setLoopCount

public void setLoopCount(int loopCount)