Package org.esa.snap.rcp.quicklooks
Class DragScrollListener
java.lang.Object
org.esa.snap.rcp.quicklooks.DragScrollListener
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,EventListener
Listener to allow for iPhone like drag scrolling of a Component within a JScrollPane.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Empty implementationvoid
MouseDragged implementation.void
Empty implementationvoid
Empty implementationvoid
Emptyvoid
Mouse pressed implementationvoid
Mouse released implementation.void
setAnimationTiming
(int timing) Sets how frequently the animation will occur in milliseconds.void
setDamping
(double damping) Sets the animation damping.void
setDraggableElements
(int mask) Sets the Draggable elements - the Horizontal or Vertical Direction.void
setScrollingIntensity
(int intensity) Sets the scrolling intensity - the default value being 5.
-
Field Details
-
DRAGABLE_HORIZONTAL_SCROLL_BAR
public static final int DRAGABLE_HORIZONTAL_SCROLL_BAR- See Also:
-
DRAGABLE_VERTICAL_SCROLL_BAR
public static final int DRAGABLE_VERTICAL_SCROLL_BAR- See Also:
-
-
Constructor Details
-
DragScrollListener
-
-
Method Details
-
setDraggableElements
public void setDraggableElements(int mask) Sets the Draggable elements - the Horizontal or Vertical Direction. Onecan use a bitmasked 'or' (HORIZONTAL_SCROLL_BAR | VERTICAL_SCROLL_BAR ).
- Parameters:
mask
- One of HORIZONTAL_SCROLL_BAR, VERTICAL_SCROLL_BAR, or HORIZONTAL_SCROLL_BAR | VERTICAL_SCROLL_BAR
-
setScrollingIntensity
public void setScrollingIntensity(int intensity) Sets the scrolling intensity - the default value being 5. Note, that this has aninverse relationship to intensity (1 has the biggest difference, higher numbers having
less impact).
- Parameters:
intensity
- The new intensity value (Note the inverse relationship).
-
setAnimationTiming
public void setAnimationTiming(int timing) Sets how frequently the animation will occur in milliseconds. Defaultvalue is 30 milliseconds. 60+ will get a bit flickery.
- Parameters:
timing
- The timing, in milliseconds.
-
setDamping
public void setDamping(double damping) Sets the animation damping.- Parameters:
damping
- The new value
-
mouseEntered
Empty implementation- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
Empty implementation- Specified by:
mouseExited
in interfaceMouseListener
-
mousePressed
Mouse pressed implementation- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
Mouse released implementation. This determines if further animationis necessary and launches the appropriate times.
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseClicked
Empty implementation- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseDragged
MouseDragged implementation. Sets up timing and frame animation.- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseMoved
Empty- Specified by:
mouseMoved
in interfaceMouseMotionListener
-