-
- All Implemented Interfaces:
-
android.view.View.OnTouchListener
public class PanZoom implements View.OnTouchListener
Enables basic pan/zoom touch behavior for an XYPlot. By default boundaries there are no boundaries imposed on scrolling and zooming. You can provide these boundaries on your XYPlot using getOuterLimits. TODO: zoom using dynamic center point TODO: stretch both mode
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumPanZoom.Panpublic enumPanZoom.Zoompublic enumPanZoom.ZoomLimitLimits imposed on the zoom.
public classPanZoom.State
-
Field Summary
Fields Modifier and Type Field Description private PanZoom.Panpanprivate PanZoom.Zoomzoomprivate PanZoom.ZoomLimitzoomLimitprivate booleanisEnabledprivate View.OnTouchListenerdelegateprivate PanZoom.Statestate
-
Method Summary
Modifier and Type Method Description PanZoom.PangetPan()voidsetPan(PanZoom.Pan pan)PanZoom.ZoomgetZoom()voidsetZoom(PanZoom.Zoom zoom)PanZoom.ZoomLimitgetZoomLimit()voidsetZoomLimit(PanZoom.ZoomLimit zoomLimit)booleanisEnabled()View.OnTouchListenergetDelegate()voidsetDelegate(View.OnTouchListener delegate)Set a delegate to receive onTouch calls before this class does. PanZoom.StategetState()voidsetState(@NonNull() PanZoom.State state)static PanZoomattach(@NonNull() XYPlot plot)Convenience method for enabling pan/zoom behavior on an instance of XYPlot, usinga default behavior of BOTH and SCALE. static PanZoomattach(@NonNull() XYPlot plot, @NonNull() PanZoom.Pan pan, @NonNull() PanZoom.Zoom zoom)Old method for enabling pan/zoom behavior on an instance of XYPlot, usingthe default behavior of OUTER. static PanZoomattach(@NonNull() XYPlot plot, @NonNull() PanZoom.Pan pan, @NonNull() PanZoom.Zoom zoom, @NonNull() PanZoom.ZoomLimit limit)New method for enabling pan/zoom behavior on an instance of XYPlot. voidsetEnabled(boolean enabled)booleanonTouch(View view, MotionEvent event)voidreset()-
-
Method Detail
-
getPan
PanZoom.Pan getPan()
-
setPan
void setPan(PanZoom.Pan pan)
-
getZoom
PanZoom.Zoom getZoom()
-
setZoom
void setZoom(PanZoom.Zoom zoom)
-
getZoomLimit
PanZoom.ZoomLimit getZoomLimit()
-
setZoomLimit
void setZoomLimit(PanZoom.ZoomLimit zoomLimit)
-
isEnabled
boolean isEnabled()
-
getDelegate
View.OnTouchListener getDelegate()
-
setDelegate
void setDelegate(View.OnTouchListener delegate)
Set a delegate to receive onTouch calls before this class does. If the delegate wishesto consume the event, it should return true, otherwise it should return false. Returningfalse will not prevent future onTouch events from filtering through the delegate as it normallywould when attaching directly to an instance of View.
-
getState
PanZoom.State getState()
-
setState
void setState(@NonNull() PanZoom.State state)
-
attach
static PanZoom attach(@NonNull() XYPlot plot, @NonNull() PanZoom.Pan pan, @NonNull() PanZoom.Zoom zoom)
-
attach
static PanZoom attach(@NonNull() XYPlot plot, @NonNull() PanZoom.Pan pan, @NonNull() PanZoom.Zoom zoom, @NonNull() PanZoom.ZoomLimit limit)
New method for enabling pan/zoom behavior on an instance of XYPlot.
-
setEnabled
void setEnabled(boolean enabled)
-
onTouch
boolean onTouch(View view, MotionEvent event)
-
reset
void reset()
-
-
-
-