本文整理汇总了Java中javax.media.StopTimeChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java StopTimeChangeEvent类的具体用法?Java StopTimeChangeEvent怎么用?Java StopTimeChangeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StopTimeChangeEvent类属于javax.media包,在下文中一共展示了StopTimeChangeEvent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStopTime
import javax.media.StopTimeChangeEvent; //导入依赖的package包/类
/**
* Sets the stop time for this AbstractController. Posts a
* StopTimeChangeEvent if the stop time given is different
* than the current stop time.
*
* @param mediaStopTime
* The time at which you want the
* <tt>Clock</tt> to stop, in <i>media
* time</i>.
*
* @exception NotRealizedError
* If the Controller is not Realized.
*
* @exception ClockStartedError
* If the Controller is Started.
*/
public synchronized void setStopTime(Time mediaStopTime) {
if(currentState == Unrealized ||
currentState == Realizing)
{
throw new NotRealizedError(
"Cannot set stop time on an unrealized Controller");
}
Time oldStopTime = getStopTime();
// If the stop time has changed, post an event
if( mediaStopTime.getNanoseconds() !=
oldStopTime.getNanoseconds() )
{
// Set in superclass
super.setStopTime(mediaStopTime);
// Post event
postEvent(
new StopTimeChangeEvent(this, mediaStopTime) );
}
}
示例2: controllerUpdate
import javax.media.StopTimeChangeEvent; //导入依赖的package包/类
/**
* Listen for RateChangeEvents or MediaTimeSetEvents and
* notify the StopTimeMonitor thread to recalculate its wait
* time. Also listen for StartEvents and StopEvents so that
* the monitor will know whether the controller is playing.
*
* @param e
* The ControllerEvent
*/
public synchronized void controllerUpdate(ControllerEvent e) {
if( e instanceof StopTimeChangeEvent ||
e instanceof RateChangeEvent ||
e instanceof MediaTimeSetEvent ||
e instanceof StartEvent ||
(e instanceof StopEvent && ! (e instanceof DeallocateEvent) ) )
{
wokenUp = true;
notifyAll();
}
}
示例3: postStopTimeChangeEvent
import javax.media.StopTimeChangeEvent; //导入依赖的package包/类
private void postStopTimeChangeEvent() {
notifyListeners(new StopTimeChangeEvent(this, getStopTime()));
}