本文整理汇总了Java中javax.media.RealizeCompleteEvent类的典型用法代码示例。如果您正苦于以下问题:Java RealizeCompleteEvent类的具体用法?Java RealizeCompleteEvent怎么用?Java RealizeCompleteEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RealizeCompleteEvent类属于javax.media包,在下文中一共展示了RealizeCompleteEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
public void controllerUpdate(ControllerEvent event) {
if (event instanceof RealizeCompleteEvent) {
_player.prefetch();
} else if (event instanceof PrefetchCompleteEvent) {
// get controls
_framePositioningControl = (FramePositioningControl) _player
.getControl("javax.media.control.FramePositioningControl");
if (_framePositioningControl == null) {
System.out.println("Error: FramePositioningControl!");
setState(ERROR);
return;
}
_frameGrabbingControl = (FrameGrabbingControl) _player
.getControl("javax.media.control.FrameGrabbingControl");
if (_frameGrabbingControl == null) {
System.out.println("Error: FrameGrabbingControl!");
setState(ERROR);
return;
}
setState(READY);
}
}
示例2: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* This controllerUpdate function must be defined in order to
* implement a ControllerListener interface. This
* function will be called whenever there is a media event.
*
* @param event
* the media event
*/
public synchronized void controllerUpdate(ControllerEvent event) {
if( event instanceof RealizeCompleteEvent ) {
Runnable r = new Runnable() {
public void run() {
// Add Control Panel Component
playerpanel.addControlComponent();
// Add Visual Component
playerpanel.addVisualComponent();
}
};
SwingUtilities.invokeLater(r);
} else
if (event instanceof EndOfMediaEvent) {
// End of the media -- rewind
player.setMediaTime(new Time(0));
}
}
示例3: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
public synchronized void controllerUpdate(ControllerEvent ce) {
if (ce instanceof RealizeCompleteEvent) {
realized = true;
} else if (ce instanceof ConfigureCompleteEvent) {
configured = true;
} else if (ce instanceof PrefetchCompleteEvent) {
prefetched = true;
} else if (ce instanceof EndOfMediaEvent) {
//System.out.println("EndOfMediaEvent: " + ce);
eom = true;
} else if (ce instanceof ControllerErrorEvent) {
System.err.println("ControllerErrorEvent: " + ce);
failed = true;
} else if (ce instanceof ControllerClosedEvent) {
//System.out.println("ControllerClosedEvent: " + ce);
closed = true;
} else {
return;
}
notifyAll();
}
示例4: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* Controller Listener.
*/
public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent ||
evt instanceof RealizeCompleteEvent ||
evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) {
p.setMediaTime(new Time(0));
//p.start();
//p.close();
//System.exit(0);
} else if (evt instanceof SizeChangeEvent) {
}
}
示例5: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* Controller Listener.
*/
public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent ||
evt instanceof RealizeCompleteEvent ||
evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) {
evt.getSourceController().stop();
evt.getSourceController().close();
}
}
示例6: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* Controller Listener.
*/
public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent ||
evt instanceof RealizeCompleteEvent ||
evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) {
p.close();
System.exit(0);
}
}
示例7: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* Controller Listener.
*/
public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent ||
evt instanceof RealizeCompleteEvent ||
evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) {
p.close();
//System.exit(0);
} else if (evt instanceof SizeChangeEvent) {
}
}
示例8: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* Controller Listener.
*/
public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent ||
evt instanceof RealizeCompleteEvent ||
evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) {
p.close();
} else if (evt instanceof SizeChangeEvent) {
}
}
示例9: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* Controller Listener.
*/
public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent
|| evt instanceof RealizeCompleteEvent
|| evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) {
processor.setMediaTime(Processor.RESET);
processor.start();
//processor.close();
//System.exit(0);
}
}
示例10: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/** Called by JMF when the Player has something to tell us about. */
public synchronized void controllerUpdate(ControllerEvent event) {
// System.out.println("controllerUpdate(" + event + ")");
if (event instanceof RealizeCompleteEvent) {
if ((visualComponent = thePlayer.getVisualComponent()) != null)
cp.add(BorderLayout.CENTER, visualComponent);
if ((controlComponent =
thePlayer.getControlPanelComponent()) != null)
cp.add(BorderLayout.SOUTH, controlComponent);
// resize the main window
if (parentFrame != null) {
parentFrame.pack();
parentFrame.setTitle(mediaName);
}
}
}
示例11: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* ControllerListener for the Players.
*/
public synchronized void controllerUpdate(ControllerEvent ce) {
Player p = (Player) ce.getSourceController();
if (p == null)
return;
// Get this when the internal players are realized.
if (ce instanceof RealizeCompleteEvent) {
p.start();
}
if (ce instanceof ControllerErrorEvent) {
p.removeControllerListener(this);
LOGGER.severe("Receiver internal error: " + ce);
}
}
示例12: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
public void controllerUpdate(ControllerEvent evt) {
if (evt instanceof ConfigureCompleteEvent
|| evt instanceof RealizeCompleteEvent
|| evt instanceof PrefetchCompleteEvent) {
synchronized (waitSync) {
stateTransitionOK = true;
waitSync.notifyAll();
}
} else if (evt instanceof ResourceUnavailableEvent) {
synchronized (waitSync) {
stateTransitionOK = false;
waitSync.notifyAll();
}
} else if (evt instanceof EndOfMediaEvent) {
evt.getSourceController().stop();
evt.getSourceController().close();
finished = true;
}
}
示例13: doRealizeAction
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
private boolean doRealizeAction() {
switch (state) {
case Unrealized:
state = Realizing;
notifyListeners(new TransitionEvent(this, Unrealized, Realizing, Realized));
/* fall thru */
case Realizing:
ControllerErrorEvent error = doRealize();
if (error == null) {
state = Realized;
notifyListeners(new RealizeCompleteEvent(this, Realizing, Realized, Realized));
} else {
notifyListeners(error);
return false;
}
break;
default:
notifyListeners(new RealizeCompleteEvent(this, state, state, state));
break;
}
return true;
}
示例14: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
/**
* ControllerListener for the Players.
*/
public synchronized void controllerUpdate(ControllerEvent ce) {
Player p = (Player) ce.getSourceController();
if (p == null)
return;
// Get this when the internal players are realized.
if (ce instanceof RealizeCompleteEvent) {
p.start();
}
if (ce instanceof ControllerErrorEvent) {
p.removeControllerListener(this);
LOGGER.error("Receiver internal error: " + ce);
}
}
示例15: controllerUpdate
import javax.media.RealizeCompleteEvent; //导入依赖的package包/类
public void controllerUpdate(ControllerEvent event) {
Player p = (Player) event.getSourceController();
if (event instanceof EndOfMediaEvent) {
p.setMediaTime(new Time(0));
}
else if (event instanceof RealizeCompleteEvent) {
cpc = p.getControlPanelComponent();
if (cpc != null)
SwingUtilities.invokeLater(new AddComponentsThread(cpc));
}
}