Class FadeTransition
- java.lang.Object
-
- org.eclipse.nebula.effects.stw.Transition
-
- org.eclipse.nebula.effects.stw.transitions.FadeTransition
-
public class FadeTransition extends Transition
Applies a fade effect. The from control fades out and the the to control fades in smoothly.
-
-
Field Summary
Fields Modifier and Type Field Description private double
_aFrom
private double
_alphaFrom
private double
_alphaFrom0
private double
_alphaTo
private double
_alphaTo0
private double
_aTo
private int
_aw
private long
_fadeInMidT
private double
_fadeInStart
private long
_fadeInStartT
private double
_fadeInStop
private long
_fadeInStopT
private long
_fadeOutMidT
private double
_fadeOutStart
private long
_fadeOutStartT
private double
_fadeOutStop
private long
_fadeOutStopT
private boolean
_flag1
private boolean
_flag2
private int
_halfAW
private long
_halfTFrom
private long
_halfTTo
private long
_t1
private long
_TFrom
private long
_TTo
private double
_vFrom0
private double
_vTo0
-
Fields inherited from class org.eclipse.nebula.effects.stw.Transition
_fps, _T, _transitionManager, DEFAULT_FPS, DEFAULT_T, DIR_DOWN, DIR_LEFT, DIR_RIGHT, DIR_UP, IS_LINUX_OS, IS_MAC_OS
-
-
Constructor Summary
Constructors Constructor Description FadeTransition(TransitionManager transitionManager)
This constructor creates a FadeTransition with number of frames per second ofTransition.DEFAULT_FPS
and total transition time ofTransition.DEFAULT_T
milliseconds.FadeTransition(TransitionManager transitionManager, long fps, long T)
This constructor creates a FadeTransition with fps number of frames per second and T total transition time in milliseconds.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
endTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)
protected void
initTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)
void
setFadeInStart(double percentage)
Specifies when the fade-in effect is started as a percentage of the transition total time.void
setFadeInStop(double percentage)
Specifies when the fade-in effect is ended as a percentage of the transition total time.void
setFadeOutStart(double percentage)
Specifies when the fade-out effect is started as a percentage of the transition total time.void
setFadeOutStop(double percentage)
Specifies when the fade-out effect is ended as a percentage of the transition total time.protected void
stepTransition(long t, org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)
-
Methods inherited from class org.eclipse.nebula.effects.stw.Transition
doEvents, getFPS, getTotalTransitionTime, setFPS, setTotalTransitionTime, start
-
-
-
-
Field Detail
-
_aw
private int _aw
-
_halfAW
private int _halfAW
-
_aFrom
private double _aFrom
-
_aTo
private double _aTo
-
_alphaFrom
private double _alphaFrom
-
_alphaTo
private double _alphaTo
-
_alphaFrom0
private double _alphaFrom0
-
_alphaTo0
private double _alphaTo0
-
_vFrom0
private double _vFrom0
-
_vTo0
private double _vTo0
-
_flag1
private boolean _flag1
-
_flag2
private boolean _flag2
-
_t1
private long _t1
-
_TFrom
private long _TFrom
-
_TTo
private long _TTo
-
_halfTFrom
private long _halfTFrom
-
_halfTTo
private long _halfTTo
-
_fadeOutStartT
private long _fadeOutStartT
-
_fadeOutMidT
private long _fadeOutMidT
-
_fadeOutStopT
private long _fadeOutStopT
-
_fadeInStartT
private long _fadeInStartT
-
_fadeInMidT
private long _fadeInMidT
-
_fadeInStopT
private long _fadeInStopT
-
_fadeOutStart
private double _fadeOutStart
-
_fadeOutStop
private double _fadeOutStop
-
_fadeInStart
private double _fadeInStart
-
_fadeInStop
private double _fadeInStop
-
-
Constructor Detail
-
FadeTransition
public FadeTransition(TransitionManager transitionManager)
This constructor creates a FadeTransition with number of frames per second ofTransition.DEFAULT_FPS
and total transition time ofTransition.DEFAULT_T
milliseconds. It is similar to new FadeTransition(transitionManager,Transition.DEFAULT_FPS
,Transition.DEFAULT_T
)- Parameters:
transitionManager
- the transition manager to be used to manage transitions
-
FadeTransition
public FadeTransition(TransitionManager transitionManager, long fps, long T)
This constructor creates a FadeTransition with fps number of frames per second and T total transition time in milliseconds.- Parameters:
transitionManager
- the transition manager to be used to manage transitionsfps
- number of frames per secondT
- the total time the transition effect will take in milliseconds
-
-
Method Detail
-
initTransition
protected void initTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)
- Specified by:
initTransition
in classTransition
-
stepTransition
protected void stepTransition(long t, org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)
- Specified by:
stepTransition
in classTransition
-
endTransition
protected void endTransition(org.eclipse.swt.graphics.Image from, org.eclipse.swt.graphics.Image to, org.eclipse.swt.graphics.GC gc, double direction)
- Specified by:
endTransition
in classTransition
-
setFadeOutStart
public void setFadeOutStart(double percentage)
Specifies when the fade-out effect is started as a percentage of the transition total time. For example, 0% means that the fade-out effect will start at the beginning of the transition.
percentage should have a value in the interval from 0 to 100 inclusive otherwise the passed value would be ignored leaving the previous value unchanged.- Parameters:
percentage
- is a percentage of the transition total time.
-
setFadeOutStop
public void setFadeOutStop(double percentage)
Specifies when the fade-out effect is ended as a percentage of the transition total time. For example, 50% means that the fade-out effect will stop at the mid of the transition.
percentage should have a value in the interval from 0 to 100 inclusive otherwise the passed value would be ignored leaving the previous value unchanged.- Parameters:
percentage
- is a percentage of the transition total time.
-
setFadeInStart
public void setFadeInStart(double percentage)
Specifies when the fade-in effect is started as a percentage of the transition total time. For example, 50% means that the fade-in effect will start at the mid of the transition.
percentage should have a value in the interval from 0 to 100 inclusive otherwise the passed value would be ignored leaving the previous value unchanged.- Parameters:
percentage
- is a percentage of the transition total time.
-
setFadeInStop
public void setFadeInStop(double percentage)
Specifies when the fade-in effect is ended as a percentage of the transition total time. For example, 100% means that the fade-in effect will stop at the end of the transition.
percentage should have a value in the interval from 0 to 100 inclusive otherwise the passed value would be ignored leaving the previous value unchanged.- Parameters:
percentage
- is a percentage of the transition total time.
-
-