Package org.eclipse.nebula.animation
Class ScrollingSmoother
java.lang.Object
org.eclipse.nebula.animation.ScrollingSmoother
public class ScrollingSmoother
extends java.lang.Object
Allows to replace the default scrolling behavior by an animation effect.
Compatible with :
- Shell
- StyledText
- Canvas
- Gallery
-
Field Summary
Fields Modifier and Type Field Description (package private) AnimationRunneranimationRunner(package private) org.eclipse.swt.widgets.ListenercancelEffectIfUserSelection(package private) org.eclipse.swt.widgets.Scrollablecomponent(package private) intduration(package private) org.eclipse.swt.widgets.ScrollBarhorizontalScrollBar(package private) org.eclipse.swt.widgets.ListenermouseWheelListener(package private) IMovementmovement(package private) org.eclipse.swt.widgets.ScrollBarverticalScrollBar -
Constructor Summary
Constructors Constructor Description ScrollingSmoother(org.eclipse.swt.widgets.Scrollable c2, IMovement movement)Create a Scrolling Smoother instance over a scrollable widget.ScrollingSmoother(org.eclipse.swt.widgets.Scrollable c2, IMovement movement, int duration)Create a Scrolling Smoother instance over a scrollable widget. -
Method Summary
Modifier and Type Method Description intgetDuration()Get current effect duration (ms).protected org.eclipse.swt.widgets.ScrollBargetScrollbar(org.eclipse.swt.widgets.Event event)voidsetDuration(int duration)Set effect duration (ms).voidsetFPS(int fps)Set the FPS (frame per second) to use with the animator.voidsmoothControl(boolean enable)Enable or disable scrolling effect.
-
Field Details
-
component
org.eclipse.swt.widgets.Scrollable component -
verticalScrollBar
org.eclipse.swt.widgets.ScrollBar verticalScrollBar -
horizontalScrollBar
org.eclipse.swt.widgets.ScrollBar horizontalScrollBar -
movement
IMovement movement -
duration
int duration -
animationRunner
AnimationRunner animationRunner -
mouseWheelListener
org.eclipse.swt.widgets.Listener mouseWheelListener -
cancelEffectIfUserSelection
org.eclipse.swt.widgets.Listener cancelEffectIfUserSelection
-
-
Constructor Details
-
ScrollingSmoother
Create a Scrolling Smoother instance over a scrollable widget. This effect can then be activated usingsmoothControl(boolean).- Parameters:
c2-movement-- See Also:
smoothControl(boolean)
-
ScrollingSmoother
Create a Scrolling Smoother instance over a scrollable widget. This effect can then be activated usingsmoothControl(boolean).- Parameters:
c2-movement-duration-- See Also:
smoothControl(boolean)
-
-
Method Details
-
getDuration
public int getDuration()Get current effect duration (ms).- Returns:
-
setDuration
public void setDuration(int duration)Set effect duration (ms).- Parameters:
duration-
-
setFPS
public void setFPS(int fps)Set the FPS (frame per second) to use with the animator.- Parameters:
fps-
-
getScrollbar
protected org.eclipse.swt.widgets.ScrollBar getScrollbar(org.eclipse.swt.widgets.Event event) -
smoothControl
public void smoothControl(boolean enable)Enable or disable scrolling effect.- Parameters:
enable- true or false.
-