-
- 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 enum
PanZoom.Pan
public enum
PanZoom.Zoom
public enum
PanZoom.ZoomLimit
Limits imposed on the zoom.
public class
PanZoom.State
-
Field Summary
Fields Modifier and Type Field Description private PanZoom.Pan
pan
private PanZoom.Zoom
zoom
private PanZoom.ZoomLimit
zoomLimit
private boolean
isEnabled
private View.OnTouchListener
delegate
private PanZoom.State
state
-
Method Summary
Modifier and Type Method Description PanZoom.Pan
getPan()
void
setPan(PanZoom.Pan pan)
PanZoom.Zoom
getZoom()
void
setZoom(PanZoom.Zoom zoom)
PanZoom.ZoomLimit
getZoomLimit()
void
setZoomLimit(PanZoom.ZoomLimit zoomLimit)
boolean
isEnabled()
View.OnTouchListener
getDelegate()
void
setDelegate(View.OnTouchListener delegate)
Set a delegate to receive onTouch calls before this class does. PanZoom.State
getState()
void
setState(@NonNull() PanZoom.State state)
static PanZoom
attach(@NonNull() XYPlot plot)
Convenience method for enabling pan/zoom behavior on an instance of XYPlot, usinga default behavior of BOTH and SCALE. static PanZoom
attach(@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 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. void
setEnabled(boolean enabled)
boolean
onTouch(View view, MotionEvent event)
void
reset()
-
-
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()
-
-
-
-