public class ChartPanAndZoomBehavior extends ChartBehavior
RadCartesianChartView
instance.Constructor and Description |
---|
ChartPanAndZoomBehavior()
Creates a new instance of the
ChartPanAndZoomBehavior class. |
Modifier and Type | Method and Description |
---|---|
void |
addPanZoomListener(PanZoomListener listener) |
DeferredZoomPresenter |
getDeferredZoomPresenter()
Gets the
DeferredZoomPresenter . |
boolean |
getHandleDoubleTap()
Gets whether a double-tap gesture will be handled by the behavior to reset the
current Zoom and PanOffset values.
|
int |
getPanMode()
Gets the
ChartPanZoomMode value that specifies how the chart will respond
to a pan gesture. |
int |
getZoomMode()
Gets the
ChartPanZoomMode value that specifies how the chart will respond to
a zoom gesture. |
ChartZoomStrategy |
getZoomStrategy()
Gets the current
ChartZoomStrategy . |
boolean |
isPinching()
Gets value that indicates whether the behavior is processing a pinch gesture.
|
boolean |
isZoomed() |
boolean |
onDoubleTap(MotionEvent event)
Invoked when a double tap gesture occurs on the owner chart.
|
boolean |
onDrag(MotionEvent event,
MotionEvent event2,
RadSize distance,
boolean isInHold)
Invoked when a drag gesture occurs on the owner chart.
|
boolean |
onPinch(ChartScaleGestureDetector detector,
MotionEvent pinchEvent)
Invoked when a pinch gesture occurs on the owner chart.
|
void |
onPinchComplete()
Called when the pinch gesture finishes.
|
void |
removePanZoomListener(PanZoomListener listener) |
void |
reset()
Resets the behavior.
|
void |
setDeferredZoomPresenter(DeferredZoomPresenter value)
Sets the
DeferredZoomPresenter . |
void |
setHandleDoubleTap(boolean value)
Sets whether a double-tap gesture will be handled by the behavior to reset the
current Zoom and PanOffset values.
|
void |
setPanMode(int value)
Sets the
ChartPanZoomMode value that specifies how the chart will respond
to a pan gesture. |
void |
setPanOffsetToChart(double offsetX,
double offsetY) |
void |
setZoomMode(int value)
Sets the
ChartPanZoomMode value that specifies how the chart will respond to
a zoom gesture. |
void |
setZoomStrategy(ChartZoomStrategy value)
Sets the
ChartZoomStrategy . |
void |
setZoomToChart(double scale,
double centerX,
double centerY) |
void |
setZoomToChart(double scaleX,
double scaleY,
double centerX,
double centerY) |
attach, chart, detach, onDown, onHold, onTap, onUp
getValue, resetPropertyValue, setValue, setValue
public ChartPanAndZoomBehavior()
ChartPanAndZoomBehavior
class.public void addPanZoomListener(PanZoomListener listener)
public void removePanZoomListener(PanZoomListener listener)
public ChartZoomStrategy getZoomStrategy()
ChartZoomStrategy
.public void setZoomStrategy(ChartZoomStrategy value)
ChartZoomStrategy
.public boolean getHandleDoubleTap()
public void setHandleDoubleTap(boolean value)
value
- the new handle state.public int getZoomMode()
ChartPanZoomMode
value that specifies how the chart will respond to
a zoom gesture.public void setZoomMode(int value)
ChartPanZoomMode
value that specifies how the chart will respond to
a zoom gesture.value
- the new zoom mode.public int getPanMode()
ChartPanZoomMode
value that specifies how the chart will respond
to a pan gesture.public void setPanMode(int value)
ChartPanZoomMode
value that specifies how the chart will respond
to a pan gesture.value
- the new pan mode.public boolean isPinching()
public DeferredZoomPresenter getDeferredZoomPresenter()
DeferredZoomPresenter
.public void setDeferredZoomPresenter(DeferredZoomPresenter value)
DeferredZoomPresenter
.public void onPinchComplete()
ChartBehavior
onPinchComplete
in class ChartBehavior
public boolean onDrag(MotionEvent event, MotionEvent event2, RadSize distance, boolean isInHold)
ChartBehavior
onDrag
in class ChartBehavior
event
- Information for the event that started the gesture.event2
- Information for the event that caused the current drag gesturedistance
- The distance travelled since the previous gesture. This is NOT the distance between initialEvent and currentEvent.public void reset()
ChartBehavior
reset
in class ChartBehavior
public boolean isZoomed()
public void setPanOffsetToChart(double offsetX, double offsetY)
public void setZoomToChart(double scale, double centerX, double centerY)
public void setZoomToChart(double scaleX, double scaleY, double centerX, double centerY)
public boolean onDoubleTap(MotionEvent event)
ChartBehavior
onDoubleTap
in class ChartBehavior
event
- An object that contains gesture information.public boolean onPinch(ChartScaleGestureDetector detector, MotionEvent pinchEvent)
ChartBehavior
onPinch
in class ChartBehavior
detector
- The scale detector that detected this gesture.pinchEvent
- The MotionEvent that represents this pinch gesture.