本文整理汇总了Java中com.panoramagl.ios.NSTimer类的典型用法代码示例。如果您正苦于以下问题:Java NSTimer类的具体用法?Java NSTimer怎么用?Java NSTimer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NSTimer类属于com.panoramagl.ios包,在下文中一共展示了NSTimer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internalStartAnimation
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
/**animation methods*/
protected boolean internalStartAnimation(Object sender, NSTimer timer, PLCameraAnimationType type)
{
if(!mIsAnimating)
{
mIsAnimating = true;
mAnimationType = type;
this.setAnimationTimer(timer);
if(mInternalListener != null)
mInternalListener.didBeginAnimation(sender, this, type);
if(mListener != null)
mListener.didBeginAnimation(sender, this, type);
return true;
}
return false;
}
示例2: setTimer
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setTimer(NSTimer newTimer)
{
if(mTimer != null)
{
mTimer.invalidate();
mTimer = null;
}
mTimer = newTimer;
}
示例3: start
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
@Override
public boolean start(PLIView view, PLIPanorama newPanorama)
{
if(mIsRunning || view == null || view.getPanorama() == null || newPanorama == null)
return false;
mIsRunning = true;
mView = view;
mCurrentPanorama = view.getPanorama();
mCurrentPanoramaCamera = new PLCamera(mCurrentPanorama.getCamera());
mIsPanoramaLocked = mCurrentPanorama.isLocked();
mNewPanorama = newPanorama;
mNewPanoramaCamera = new PLCamera(mNewPanorama.getCamera());
mProgressPercentage = 0;
if(!mIsPanoramaLocked)
mCurrentPanorama.setLocked(true);
this.beforeStarting(mView, mCurrentPanorama, mNewPanorama, mCurrentPanoramaCamera, mNewPanoramaCamera);
this.setTimer
(
NSTimer.scheduledTimerWithTimeInterval
(
1.0f / this.iterationsPerSecond(),
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
process();
}
},
null,
true
)
);
return true;
}
示例4: setAnimationTimer
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setAnimationTimer(NSTimer timer)
{
if(mAnimationTimer != null)
{
mAnimationTimer.invalidate();
mAnimationTimer = null;
}
mAnimationTimer = timer;
}
示例5: setAnimationTimer
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setAnimationTimer(NSTimer timer)
{
if(mAnimationTimer != null)
{
mAnimationTimer.invalidate();
mAnimationTimer = null;
}
mAnimationTimer = timer;
}
示例6: startAnimation
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
/**animation methods*/
@Override
public boolean startAnimation()
{
if(!mIsAnimating)
{
if(mRenderer != null)
mRenderer.start();
this.setAnimationTimer
(
NSTimer.scheduledTimerWithTimeInterval
(
mAnimationInterval,
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
drawView();
}
},
null,
true
)
);
mIsAnimating = true;
return true;
}
return false;
}
示例7: startInertia
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
/**inertia methods*/
protected void startInertia()
{
if(this.isLocked() || mIsValidForInertia || mIsValidForTransition || (mListener != null && !mListener.onShouldRunInertia(this, mStartPoint, mEndPoint)))
return;
mIsValidForInertia = true;
float interval = mInertiaInterval / PLMath.distanceBetweenPoints(mStartPoint, mEndPoint);
if(interval < 0.01f)
{
mInertiaStepValue = 0.01f / interval;
interval = 0.01f;
}
else
mInertiaStepValue = 1.0f;
mInertiaTimer = NSTimer.scheduledTimerWithTimeInterval
(
interval,
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
inertia();
}
},
null,
true
);
if(mListener != null)
mListener.onDidBeginInertia(this, mStartPoint, mEndPoint);
}
示例8: setAnimationTimer
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setAnimationTimer(NSTimer timer) {
if(mAnimationTimer != null) {
mAnimationTimer.invalidate();
mAnimationTimer = null;
}
mAnimationTimer = timer;
}
示例9: startAnimation
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
/**animation methods*/
@Override
public boolean startAnimation() {
if(!mIsAnimating) {
if(mRenderer != null)
mRenderer.start();
this.setAnimationTimer
(
NSTimer.scheduledTimerWithTimeInterval
(
mAnimationInterval,
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
drawView();
}
},
null,
true
)
);
mIsAnimating = true;
return true;
}
return false;
}
示例10: startInertia
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
/**inertia methods*/
protected void startInertia() {
if(this.isLocked() || mIsValidForInertia || mIsValidForTransition || (mListener != null && !mListener.onShouldRunInertia(this, mStartPoint, mEndPoint)))
return;
mIsValidForInertia = true;
float interval = mInertiaInterval / PLMath.distanceBetweenPoints(mStartPoint, mEndPoint);
if(interval < 0.01f) {
mInertiaStepValue = 0.01f / interval;
interval = 0.01f;
}
else
mInertiaStepValue = 1.0f;
mInertiaTimer = NSTimer.scheduledTimerWithTimeInterval
(
interval,
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
inertia();
}
},
null,
true
);
if(mListener != null)
mListener.onDidBeginInertia(this, mStartPoint, mEndPoint);
}
示例11: getTimer
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected NSTimer getTimer()
{
return mTimer;
}
示例12: getAnimationTimer
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected NSTimer getAnimationTimer()
{
return mAnimationTimer;
}
示例13: setFov
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
@Override
public boolean setFov(Object sender, float fov, boolean animated)
{
if(mIsNotLocked)
{
if(animated)
{
if(!mIsAnimating && mIsFovEnabled)
{
float newFov = PLMath.normalizeFov(fov, mFovRange);
if(mFov != newFov)
{
this.internalStartAnimation
(
sender,
NSTimer.scheduledTimerWithTimeInterval
(
PLConstants.kCameraFovAnimationTimerInterval,
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
PLCamera camera = (PLCamera)userInfo[0];
PLFovAnimatedData data = (PLFovAnimatedData)userInfo[1];
data.currentFov += data.fovStep;
camera.setInternalFov(data.sender, data.currentFov, true, false, true);
data.currentStep++;
if(data.currentStep >= data.maxStep)
{
camera.internalStopAnimation(data.sender);
camera.setInternalFov(data.sender, data.maxFov, true, true, true);
}
}
},
new Object[] { this, PLFovAnimatedData.PLFovAnimatedDataMake(sender, this, newFov, PLConstants.kCameraFovAnimationMaxStep) },
true
),
PLCameraAnimationType.PLCameraAnimationTypeFov
);
return true;
}
}
}
else
return this.setInternalFov(sender, fov, false, true, false);
}
return false;
}
示例14: lookAt
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
@Override
public boolean lookAt(Object sender, float pitch, float yaw, boolean animated)
{
if(mIsNotLocked)
{
if(animated)
{
if(!mIsAnimating && this.isPitchEnabled() && this.isYawEnabled())
{
this.internalStartAnimation
(
sender,
NSTimer.scheduledTimerWithTimeInterval
(
PLConstants.kCameraLookAtAnimationTimerInterval,
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
PLCamera camera = (PLCamera)userInfo[0];
PLLookAtAnimatedData data = (PLLookAtAnimatedData)userInfo[1];
data.currentPitch += data.pitchStep;
data.currentYaw += data.yawStep;
camera.internalLookAt(data.sender, data.currentPitch, data.currentYaw, true, false, true);
data.currentStep++;
if(data.currentStep >= data.maxStep)
{
camera.internalStopAnimation(data.sender);
camera.internalLookAt(data.sender, data.maxPitch, data.maxYaw, true, true, true);
}
}
},
new Object[] { this, PLLookAtAnimatedData.PLLookAtAnimatedDataMake(sender, this, pitch, yaw, PLConstants.kCameraLookAtAnimationMaxStep) },
true
),
PLCameraAnimationType.PLCameraAnimationTypeLookAt
);
return true;
}
}
else
return this.internalLookAt(sender, pitch, yaw, false, true, false);
}
return false;
}
示例15: lookAtAndFov
import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
@Override
public boolean lookAtAndFov(Object sender, float pitch, float yaw, float fov, boolean animated)
{
if(mIsNotLocked)
{
if(animated)
{
if(!mIsAnimating && this.isPitchEnabled() && this.isYawEnabled() && mIsFovEnabled)
{
this.internalStartAnimation
(
sender,
NSTimer.scheduledTimerWithTimeInterval
(
PLConstants.kCameraLookAtAnimationTimerInterval,
new NSTimer.Runnable()
{
@Override
public void run(NSTimer target, Object[] userInfo)
{
PLCamera camera = (PLCamera)userInfo[0];
PLLookAtAndFovAnimatedData data = (PLLookAtAndFovAnimatedData)userInfo[1];
data.currentPitch += data.pitchStep;
data.currentYaw += data.yawStep;
data.currentFov += data.fovStep;
camera.internalLookAt(data.sender, data.currentPitch, data.currentYaw, true, false, true);
camera.setInternalFov(data.sender, data.currentFov, true, false, true);
data.currentStep++;
if(data.currentStep >= data.maxStep)
{
camera.internalStopAnimation(data.sender);
camera.internalLookAt(data.sender, data.maxPitch, data.maxYaw, true, true, true);
camera.setInternalFov(data.sender, data.maxFov, true, true, true);
}
}
},
new Object[] { this, PLLookAtAndFovAnimatedData.PLLookAtAndFovAnimatedDataMake(sender, this, pitch, yaw, fov, PLConstants.kCameraLookAtAnimationMaxStep) },
true
),
PLCameraAnimationType.PLCameraAnimationTypeLookAt
);
return true;
}
}
else
return (this.internalLookAt(sender, pitch, yaw, false, true, false) && this.setInternalFov(sender, fov, false, true, false));
}
return false;
}