/** * Removes a zoom listener. * * @param listener zoom listener */ public synchronized void removeZoomListener(ZoomListener listener) { if (mZoomIn != null) { mZoomIn.removeZoomListener(listener); mZoomOut.removeZoomListener(listener); } mTouchHandler.removeZoomListener(listener); }
/** * Adds a new zoom listener. * * @param listener zoom listener * @param onButtons the on buttons * @param onPinch the on pinch */ public void addZoomListener(ZoomListener listener, boolean onButtons, boolean onPinch) { if (onButtons) { if (mZoomIn != null) { mZoomIn.addZoomListener(listener); mZoomOut.addZoomListener(listener); } if (onPinch) { mTouchHandler.addZoomListener(listener); } } }
/** Do a chart zoom reset / fit zoom. */ public void zoomReset() { if (mFitZoom != null) { mFitZoom.apply(); mZoomIn.notifyZoomResetListeners(); repaint(); } }
/** Do a chart zoom out. */ public void zoomOut() { if (mZoomOut != null) { mZoomOut.apply(Zoom.ZOOM_AXIS_XY); repaint(); } }
/** Do a chart zoom in. */ public void zoomIn() { if (mZoomIn != null) { mZoomIn.apply(Zoom.ZOOM_AXIS_XY); repaint(); } }
/** * Sets the zoom rate. * * @param rate the zoom rate */ public void setZoomRate(float rate) { if (mZoomIn != null && mZoomOut != null) { mZoomIn.setZoomRate(rate); mZoomOut.setZoomRate(rate); } }