当前位置: 首页>>代码示例>>Java>>正文


Java NSTimer类代码示例

本文整理汇总了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;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:18,代码来源:PLCamera.java

示例2: setTimer

import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setTimer(NSTimer newTimer)
{
	if(mTimer != null)
	{
		mTimer.invalidate();
		mTimer = null;
	}
	mTimer = newTimer;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:10,代码来源:PLTransitionBase.java

示例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;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:36,代码来源:PLTransitionBase.java

示例4: setAnimationTimer

import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setAnimationTimer(NSTimer timer)
{
	if(mAnimationTimer != null)
	{
		mAnimationTimer.invalidate();
		mAnimationTimer = null;
	}
	mAnimationTimer = timer;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:10,代码来源:PLCamera.java

示例5: setAnimationTimer

import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setAnimationTimer(NSTimer timer) 
{
	if(mAnimationTimer != null)
	{
		mAnimationTimer.invalidate();
		mAnimationTimer = null;
	}
	mAnimationTimer = timer;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:10,代码来源:PLView.java

示例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;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:32,代码来源:PLView.java

示例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);
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:34,代码来源:PLView.java

示例8: setAnimationTimer

import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected void setAnimationTimer(NSTimer timer)  {
	if(mAnimationTimer != null) {
		mAnimationTimer.invalidate();
		mAnimationTimer = null;
	}
	mAnimationTimer = timer;
}
 
开发者ID:marianmoldovan,项目名称:panoramagl,代码行数:8,代码来源:PLManager.java

示例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;
}
 
开发者ID:marianmoldovan,项目名称:panoramagl,代码行数:30,代码来源:PLManager.java

示例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);
}
 
开发者ID:marianmoldovan,项目名称:panoramagl,代码行数:32,代码来源:PLManager.java

示例11: getTimer

import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected NSTimer getTimer()
{
	return mTimer;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:5,代码来源:PLTransitionBase.java

示例12: getAnimationTimer

import com.panoramagl.ios.NSTimer; //导入依赖的package包/类
protected NSTimer getAnimationTimer()
{
	return mAnimationTimer;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:5,代码来源:PLCamera.java

示例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;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:50,代码来源:PLCamera.java

示例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;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:47,代码来源:PLCamera.java

示例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;
}
 
开发者ID:codedavid,项目名称:PanoramaGL,代码行数:50,代码来源:PLCamera.java


注:本文中的com.panoramagl.ios.NSTimer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。