public abstract class AxisDragModifierBase extends GestureModifierBase
XAxisDragModifier
,
YAxisDragModifier
Modifier and Type | Class and Description |
---|---|
static class |
AxisDragModifierBase.AxisDragMode
Defines enumeration constants for mode of the
AxisDragModifierBase |
Constructor and Description |
---|
AxisDragModifierBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyRelativeScaleToRange(com.scichart.data.model.IRange applyTo,
com.scichart.data.model.IRange fromRange,
IAxis axis)
When overridden in a derived class, applies relative scale to the associated
IRange which is given in the input parameters. |
protected abstract void |
applyScaleToRange(com.scichart.data.model.IRange applyTo,
float xDelta,
float yDelta,
boolean isSecondHalf,
IAxis axis)
When overridden in a derived class, calculates an output
IRange to apply to the associated IAxis which is given in the input parameters. |
protected abstract java.lang.Iterable<IAxis> |
getApplicableAxes()
Gets the
Iterable collection of the IAxis to which this modifier may be applicable on. |
AxisDragModifierBase.AxisDragMode |
getDragMode()
Gets the
AxisDragModifierBase.AxisDragMode of the AxisDragModifierBase . |
protected boolean |
getIsSecondHalf(float x,
float y,
android.graphics.RectF axisBounds,
boolean isHorizontalAxis)
Gets whether the specified mouse point is within the second (right-most or top-most) half of the Axis bounds.
|
float |
getMinTouchArea()
Gets minimal area of recognition (min height for horizontal axis or min width for vertical), where user click or touch triggers zoom behavior.
|
protected void |
onCancel(android.view.MotionEvent e)
Called when
MotionEvent.ACTION_CANCEL event occurs |
boolean |
onDown(android.view.MotionEvent e) |
boolean |
onScroll(android.view.MotionEvent e1,
android.view.MotionEvent e2,
float distanceX,
float distanceY) |
protected void |
onUp(android.view.MotionEvent e)
Called when
MotionEvent.ACTION_UP event occurs |
protected abstract void |
performPan(float xDelta,
float yDelta,
boolean isSecondHalf,
IAxis axis)
Performs a pan on the associated
IAxis which is given in the input parameters. |
protected void |
performScale(float xDelta,
float yDelta,
boolean isSecondHalf,
IAxis axis)
Performs a Scale on the associated
IAxis which is given in the input parameters. |
void |
setDragMode(AxisDragModifierBase.AxisDragMode dragMode)
Sets the
AxisDragModifierBase.AxisDragMode of the AxisDragModifierBase . |
void |
setMinTouchArea(float minTouchArea)
Sets minimal area of recognition (min height for horizontal axis or min width for vertical), where user click or touch triggers zoom behavior.
|
attachTo, detach, getOriginalTouchEvent, onDoubleTap, onDoubleTapEvent, onFling, onLongPress, onShowPress, onSingleTapConfirmed, onSingleTapUp, onTouch
applyThemeProvider, getContext, getEventsGroupTag, getIsEnabled, getMasterModifier, getModifierSurface, getParentSurface, getPointRelativeTo, getReceiveHandledEvents, getRenderableSeries, getRenderableSeriesArea, getServices, getXAxes, getXAxis, getXAxis, getYAxes, getYAxis, getYAxis, isAttached, isWithinSourceBounds, onAnnotationsCollectionChanged, onAnnotationsDrasticallyChanged, onGenericMotion, onIsEnabledChanged, onParentSurfaceResized, onRenderableSeriesCollectionChanged, onRenderableSeriesDrasticallyChanged, onRenderSurfaceRendered, onSelectedSeriesCollectionChanged, onXAxesCollectionChanged, onXAxesDrasticallyChanged, onYAxesCollectionChanged, onYAxesDrasticallyChanged, setEventsGroupTag, setIsEnabled, setReceiveHandledEvents
@NonNull public final AxisDragModifierBase.AxisDragMode getDragMode()
AxisDragModifierBase.AxisDragMode
of the AxisDragModifierBase
.
This modifier may be used to scale or pan the AxisCore.visibleRange
creating a scrolling or panning effect.AxisDragModifierBase.AxisDragMode
which is used.public final void setDragMode(@NonNull AxisDragModifierBase.AxisDragMode dragMode)
AxisDragModifierBase.AxisDragMode
of the AxisDragModifierBase
.
This modifier may be used to scale or pan the AxisCore.visibleRange
creating a scrolling or panning effect.dragMode
- The new AxisDragModifierBase.AxisDragMode
of the AxisDragModifierBase
.public final float getMinTouchArea()
public final void setMinTouchArea(float minTouchArea)
minTouchArea
- The minimal area of recognition, where user click or touch triggers zoom behavior.public boolean onDown(android.view.MotionEvent e)
onDown
in interface android.view.GestureDetector.OnGestureListener
onDown
in class GestureModifierBase
protected void onUp(android.view.MotionEvent e)
MotionEvent.ACTION_UP
event occursonUp
in class GestureModifierBase
e
- The MotionEvent
instanceprotected void onCancel(android.view.MotionEvent e)
MotionEvent.ACTION_CANCEL
event occursonCancel
in class GestureModifierBase
e
- The MotionEvent
instancepublic boolean onScroll(android.view.MotionEvent e1, android.view.MotionEvent e2, float distanceX, float distanceY)
onScroll
in interface android.view.GestureDetector.OnGestureListener
onScroll
in class GestureModifierBase
protected void performScale(float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
IAxis
which is given in the input parameters.xDelta
- The x delta value.yDelta
- The y delta value.isSecondHalf
- Boolean flag to determine which side of the axis is scaled.axis
- The IAxis
instance on which the scale operation will be performed.protected abstract void applyScaleToRange(com.scichart.data.model.IRange applyTo, float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
IRange
to apply to the associated IAxis
which is given in the input parameters.applyTo
- The IRange
instance which will be scaled.xDelta
- The x delta value.yDelta
- The y delta value.isSecondHalf
- Boolean flag to determine which side of the axis is scaled.axis
- The IAxis
instance being operated on.protected void applyRelativeScaleToRange(com.scichart.data.model.IRange applyTo, com.scichart.data.model.IRange fromRange, IAxis axis)
IRange
which is given in the input parameters.
A relative range is defined as one that affects the AxisCore.growBy
, not the AxisCore.visibleRange
.
This is used in cases where the XAxis or YAxis has AxisCore.autoRangeProperty
value set to AutoRange.Always
,
and you still want to be able to drag the axis and to set a constant, relative margin of spacing around the upper and lower bounds of the data.applyTo
- The IRange
instance which will be scaled.fromRange
- The input range, expecting a VisibleRangeaxis
- The IAxis
instance being operated on.protected abstract void performPan(float xDelta, float yDelta, boolean isSecondHalf, IAxis axis)
IAxis
which is given in the input parameters.xDelta
- The x delta value.yDelta
- The y delta value.isSecondHalf
- Boolean flag to determine which side of the axis is panned.axis
- The IAxis
instance being operated on.protected abstract java.lang.Iterable<IAxis> getApplicableAxes()
Iterable
collection of the IAxis
to which this modifier may be applicable on.IAxis
which this modifier may be applicable on.protected boolean getIsSecondHalf(float x, float y, android.graphics.RectF axisBounds, boolean isHorizontalAxis)
x
- The x value of the MotionEvent
.y
- The y value of the MotionEvent
.axisBounds
- The axis bounds.isHorizontalAxis
- Value, which indicates whether current axis is horizontal or not.