Ejemplo n.º 1
0
  public void drawReturnAnimation() {
    // logd("******* drawReturnAnimation mAnimationFlag = " + mAnimationFlag + " *******");
    if ((mAnimationFlag & AnimationFlag.MASK) != 0) {
      if ((mAnimationFlag & AnimationFlag.ZOOM) != 0) {
        setZoom(mZoom + mDeltaZoom);
        // logd("mStdMinZoom,mStdMaxZoom =" + mStdMinZoom + "," + mStdMaxZoom);
        if (mZoom >= mStdMinZoom && mZoom <= mStdMaxZoom) {
          setZoom(mNewZoom);
          mAnimationFlag &= ~AnimationFlag.ZOOM;
        }
        mAnimationFlag = calculateNewPanXY(mAnimationFlag);
      }

      if ((mAnimationFlag & AnimationFlag.PANX) != 0) {
        setPanX(mPanX + mDeltaPanX);
        // logd("mStdMinPanX,mStdMaxPanX =" + mStdMinPanX + "," + mStdMaxPanX);
        if (floatEquel(mStdMinPanX, mStdMaxPanX)) {
          if (mPanX < mStdMinPanX) {
            setPanX(mNewPanX);
            mAnimationFlag &= ~AnimationFlag.PANX;
          }
        }
        if (mPanX >= mStdMinPanX && mPanX <= mStdMaxPanX) {
          setPanX(mNewPanX);
          mAnimationFlag &= ~AnimationFlag.PANX;
        }
      }

      if ((mAnimationFlag & AnimationFlag.PANY) != 0) {
        setPanY(mPanY + mDeltaPanY);
        // logd("mStdMinPanY,mStdMaxPanY =" + mStdMinPanY + "," + mStdMaxPanY);
        if (floatEquel(mStdMinPanY, mStdMaxPanY)) {
          if (mPanY < mStdMinPanY) {
            setPanY(mNewPanY);
            mAnimationFlag &= ~AnimationFlag.PANY;
          }
        }
        if (mPanY >= mStdMinPanY && mPanY <= mStdMaxPanY) {
          setPanY(mNewPanY);
          mAnimationFlag &= ~AnimationFlag.PANY;
        }
      }

      notifyObservers();
    }
  }
Ejemplo n.º 2
0
 // --双击处理---------------------------------------------------------------
 public void doubleClick() {
   float z = mZoom;
   if (floatEquel(mZoom, mStdMinZoom)) {
     z = mStdMaxZoom;
   } else {
     z = mStdMinZoom;
   }
   setZoom(z);
   notifyObservers();
 }