예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 /**
  * 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);
     }
   }
 }
예제 #3
0
 /** Do a chart zoom reset / fit zoom. */
 public void zoomReset() {
   if (mFitZoom != null) {
     mFitZoom.apply();
     mZoomIn.notifyZoomResetListeners();
     repaint();
   }
 }
예제 #4
0
 /** Do a chart zoom out. */
 public void zoomOut() {
   if (mZoomOut != null) {
     mZoomOut.apply(Zoom.ZOOM_AXIS_XY);
     repaint();
   }
 }
예제 #5
0
 /** Do a chart zoom in. */
 public void zoomIn() {
   if (mZoomIn != null) {
     mZoomIn.apply(Zoom.ZOOM_AXIS_XY);
     repaint();
   }
 }
예제 #6
0
 /**
  * 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);
   }
 }