Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent event)
String strCmd;
Object objSource;
strCmd = event.getActionCommand ();
objSource = event.getSource ();
if ( strCmd == null && objSource instanceof MenuItem )
strCmd = ((MenuItem)objSource).getActionCommand ();
if ( strCmd == null )
return;
if ( strCmd.equals(VideoPanel.MENU_ZOOM_1_2) ) {
pack ();
}
else if ( strCmd.equals(VideoPanel.MENU_ZOOM_1_1) ) {
pack ();
}
else if ( strCmd.equals(VideoPanel.MENU_ZOOM_2_1) ) {
pack ();
}
else if ( strCmd.equals(VideoPanel.MENU_ZOOM_4_1) ) {
pack ();
}
|
public void | componentAdded(java.awt.event.ContainerEvent event)
if ( event.getChild() != areaImagePlaceholder
&& areaImagePlaceholder != null
&& areaImagePlaceholder.getParent() == panelContent )
panelContent.remove ( areaImagePlaceholder );
this.pack();
|
public void | componentRemoved(java.awt.event.ContainerEvent event)
if ( panelContent.getComponentCount() < 1
&& event.getChild() != areaImagePlaceholder )
setPlaceholder ();
else
this.pack ();
|
public synchronized void | controllerUpdate(javax.media.ControllerEvent event)
if ( event instanceof RealizeCompleteEvent ) {
processRealizeComplete ( (RealizeCompleteEvent) event );
}
else if ( event instanceof PrefetchCompleteEvent ) {
processPrefetchComplete ( (PrefetchCompleteEvent) event );
}
else if ( event instanceof ControllerErrorEvent ) {
processControllerError ( (ControllerErrorEvent) event );
}
else if ( event instanceof ControllerClosedEvent ) {
processControllerClosed ( (ControllerClosedEvent) event );
}
else if ( event instanceof DurationUpdateEvent ) {
Time t = ((DurationUpdateEvent)event).getDuration();
}
else if ( event instanceof CachingControlEvent ) {
processCachingControl ( (CachingControlEvent) event );
}
else if ( event instanceof StartEvent ) {
}
else if ( event instanceof MediaTimeSetEvent ) {
}
else if ( event instanceof TransitionEvent ) {
}
else if ( event instanceof RateChangeEvent ) {
}
else if ( event instanceof StopTimeChangeEvent ) {
}
else if ( event instanceof FormatChangeEvent ) {
processFormatChange ( (FormatChangeEvent) event );
}
else if ( event instanceof SizeChangeEvent ) {
}
else if ( event.getClass().getName().endsWith("ReplaceURLEvent") ) {
processReplaceURL ( event );
}
|
protected void | initFrame()
super.initFrame ();
this.setLayout ( new BorderLayout() );
panelContent = new JMPanel ( new BorderLayout() );
this.add ( panelContent, BorderLayout.CENTER );
panelContent.addContainerListener ( this );
setPlaceholder ();
|
protected void | killCurrentPlayer()
int i;
int nCount;
killCurrentView ();
// progressBarCache = null;
if ( mediaPlayerCurrent != null ) {
boolMediaClosed = false;
mediaPlayerCurrent.close ();
if ( boolErrorClose == false ) {
while ( boolMediaClosed == false ) {
try {
Thread.sleep ( 50 );
}
catch ( Exception exception ) {
}
}
}
mediaPlayerCurrent.removeControllerListener ( this );
mediaPlayerCurrent = null;
}
|
protected void | killCurrentView()
int i;
Component component;
panelVideo = null;
compControl = null;
i = panelContent.getComponentCount();
while ( i > 0 ) {
i--;
component = panelContent.getComponent ( i );
if ( component == areaImagePlaceholder )
continue;
panelContent.remove ( component );
}
|
public void | open(java.lang.String nameUrl)
MediaPlayer mediaPlayer;
boolean boolResult;
mediaPlayer = jmapps.util.JMFUtils.createMediaPlayer ( nameUrl, (Frame)this, null, null );
boolResult = open ( mediaPlayer );
|
public void | open(javax.media.protocol.DataSource dataSource)
MediaPlayer mediaPlayer;
boolean boolResult;
mediaPlayer = jmapps.util.JMFUtils.createMediaPlayer ( dataSource, (Frame)this );
boolResult = open ( mediaPlayer );
|
public boolean | open(javax.media.bean.playerbean.MediaPlayer mediaPlayer)
if ( mediaPlayer == null )
return ( false );
killCurrentPlayer ();
this.setCursor ( cursorWait );
mediaPlayerCurrent = mediaPlayer;
mediaPlayer.setPopupActive ( false );
mediaPlayer.setControlPanelVisible ( false );
mediaPlayer.addControllerListener ( this );
mediaPlayer.realize();
return ( true );
|
protected void | processCachingControl(javax.media.CachingControlEvent event)
CachingControl controlCaching;
Component progressBarCacheNew = null;
controlCaching = event.getCachingControl ();
if ( controlCaching == null )
return;
if ( progressBarCacheNew == null )
progressBarCacheNew = controlCaching.getControlComponent();
if ( progressBarCacheNew == null )
progressBarCacheNew = controlCaching.getProgressBarComponent();
if ( progressBarCacheNew == null )
return;
if ( progressBarCacheNew == progressBarCache )
return;
if ( mediaPlayerCurrent != null && mediaPlayerCurrent.getState() >= Player.Realized )
return;
killCurrentView ();
progressBarCache = progressBarCacheNew;
panelContent.add ( progressBarCache, BorderLayout.CENTER );
this.setCursor ( cursorNormal );
|
protected void | processControllerClosed(javax.media.ControllerClosedEvent event)
boolMediaClosed = true;
this.setCursor ( cursorNormal );
|
protected void | processControllerError(javax.media.ControllerErrorEvent event)
String strMessage;
this.setCursor ( cursorNormal );
strMessage = JMFI18N.getResource ( "jmstudio.error.controller" )
+ "\n" + event.getMessage();
MessageDialog.createErrorDialogModeless ( this, strMessage );
if ( boolMediaClosed == true ) {
boolErrorClose = true;
killCurrentPlayer ();
boolErrorClose = false;
}
boolMediaClosed = true;
|
protected void | processFormatChange(javax.media.format.FormatChangeEvent event)
killCurrentView ();
// Get the visual component
panelVideo = new VideoPanel ( mediaPlayerCurrent );
panelVideo.setZoom ( 1.0 );
panelVideo.addMenuZoomActionListener ( this );
panelContent.add ( panelVideo, BorderLayout.CENTER );
// Get the control component
compControl = mediaPlayerCurrent.getControlPanelComponent ();
if ( compControl != null) {
panelContent.add ( compControl, BorderLayout.SOUTH );
}
|
protected void | processPrefetchComplete(javax.media.PrefetchCompleteEvent event)
mediaPlayerCurrent.start();
|
protected void | processRealizeComplete(javax.media.RealizeCompleteEvent event)
killCurrentView ();
this.setCursor ( cursorNormal );
panelVideo = new VideoPanel ( mediaPlayerCurrent );
panelVideo.setZoom ( 1.0 );
panelVideo.addMenuZoomActionListener ( this );
panelContent.add ( panelVideo, BorderLayout.CENTER );
compControl = mediaPlayerCurrent.getControlPanelComponent ();
if ( compControl != null) {
panelContent.add ( compControl, BorderLayout.SOUTH );
}
mediaPlayerCurrent.prefetch ();
|
protected void | processReplaceURL(javax.media.ControllerEvent event)
Class classReplaceURLEvent;
Class classEvent;
Method methodGetUrl;
URL url;
killCurrentPlayer ();
try {
classReplaceURLEvent = Class.forName ( "com.ibm.media.ReplaceURLEvent" );
classEvent = event.getClass ();
classReplaceURLEvent.isAssignableFrom ( classEvent );
methodGetUrl = classEvent.getMethod ( "getURL", null );
url = (URL) methodGetUrl.invoke ( event, null );
open ( url.toString() );
}
catch (Exception e) {
}
catch (Error e) {
}
|
public void | setPlaceholder()
Image image;
if ( areaImagePlaceholder == null ) {
image = ImageArea.loadImage ( "playerPlaceholder.gif", (Component)this, true );
if ( image != null ) {
areaImagePlaceholder = new ImageArea ( image );
areaImagePlaceholder.setInsets ( 0, 0, 0, 0 );
}
}
if ( areaImagePlaceholder != null ) {
panelContent.removeAll ();
panelContent.add ( areaImagePlaceholder, BorderLayout.CENTER );
}
|
public void | windowClosed(java.awt.event.WindowEvent event)
killCurrentPlayer ();
|
public void | windowClosing(java.awt.event.WindowEvent event)
this.setVisible ( false );
|