Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent event)
String strCmd;
strCmd = event.getActionCommand ();
if ( strCmd.equals(MENU_ZOOM_1_2) ) {
dScale = 0.5;
}
else if ( strCmd.equals(MENU_ZOOM_1_1) ) {
dScale = 1.0;
}
else if ( strCmd.equals(MENU_ZOOM_2_1) ) {
dScale = 2.0;
}
else if ( strCmd.equals(MENU_ZOOM_4_1) ) {
dScale = 4.0;
}
// mediaPlayer.setZoomTo ( "" + dScale + "f" );
this.invalidate ();
|
public void | addMenuZoomActionListener(java.awt.event.ActionListener listener)
if ( menuItemZoom_1_2 != null )
menuItemZoom_1_2.addActionListener ( listener );
if ( menuItemZoom_1_1 != null )
menuItemZoom_1_1.addActionListener ( listener );
if ( menuItemZoom_2_1 != null )
menuItemZoom_2_1.addActionListener ( listener );
if ( menuItemZoom_4_1 != null )
menuItemZoom_4_1.addActionListener ( listener );
|
public void | addNotify()
super.addNotify();
if (compVisual != null)
compVisual.addMouseListener(this);
|
private void | addPopupMenuZoom()
if ( compVisual == null )
return;
createPopupMenuZoom ();
compVisual.add ( menuZoom );
|
public void | componentHidden(java.awt.event.ComponentEvent event)
|
public void | componentMoved(java.awt.event.ComponentEvent event)
|
public void | componentResized(java.awt.event.ComponentEvent event)
resizeVisualComponent ();
|
public void | componentShown(java.awt.event.ComponentEvent event)
|
private void | createPopupMenuZoom()
if ( menuZoom != null )
return;
menuZoom = new PopupMenu ( MENU_ZOOM );
menuItemZoom_1_2 = new MenuItem ( MENU_ZOOM_1_2 );
menuZoom.add ( menuItemZoom_1_2 );
menuItemZoom_1_2.addActionListener ( this );
menuItemZoom_1_1 = new MenuItem ( MENU_ZOOM_1_1 );
menuZoom.add ( menuItemZoom_1_1 );
menuItemZoom_1_1.addActionListener ( this );
menuItemZoom_2_1 = new MenuItem ( MENU_ZOOM_2_1 );
menuZoom.add ( menuItemZoom_2_1 );
menuItemZoom_2_1.addActionListener ( this );
menuItemZoom_4_1 = new MenuItem ( MENU_ZOOM_4_1 );
menuZoom.add ( menuItemZoom_4_1 );
menuItemZoom_4_1.addActionListener ( this );
|
public java.awt.Component | getMediaPlayer()
return ( mediaPlayer );
|
public java.awt.Dimension | getPreferredSize()
Dimension dim;
if ( compVisual == null || mediaPlayer == null ) {
dim = new Dimension ( 320, 0 );
}
else {
// dim = mediaPlayer.getPreferredSize ();
dim = compVisual.getPreferredSize ();
dim.width = (int)(dim.width * dScale);
dim.height = (int)(dim.height * dScale);
}
return ( dim );
|
public java.awt.Component | getVisualComponent()
return ( mediaPlayer.getVisualComponent() /*compVisual*/ );
|
public double | getZoom()
return ( dScale );
|
public void | mouseClicked(java.awt.event.MouseEvent event)
if ( event.isPopupTrigger() )
menuZoom.show ( compVisual, event.getX(), event.getY() );
|
public void | mouseEntered(java.awt.event.MouseEvent event)
|
public void | mouseExited(java.awt.event.MouseEvent event)
|
public void | mousePressed(java.awt.event.MouseEvent event)
if ( event.isPopupTrigger() ) {
menuZoom.show ( compVisual, event.getX(), event.getY() );
}
|
public void | mouseReleased(java.awt.event.MouseEvent event)
if ( event.isPopupTrigger() ) {
menuZoom.show ( compVisual, event.getX(), event.getY() );
}
|
public void | removeMenuZoomActionListener(java.awt.event.ActionListener listener)
if ( menuItemZoom_1_2 != null )
menuItemZoom_1_2.removeActionListener ( listener );
if ( menuItemZoom_1_1 != null )
menuItemZoom_1_1.removeActionListener ( listener );
if ( menuItemZoom_2_1 != null )
menuItemZoom_2_1.removeActionListener ( listener );
if ( menuItemZoom_4_1 != null )
menuItemZoom_4_1.removeActionListener ( listener );
|
public void | removeNotify()
super.removeNotify();
if (compVisual != null)
compVisual.removeMouseListener(this);
|
public void | resizeVisualComponent()
Dimension dimThis;
dimThis = this.getSize ();
if ( mediaPlayer != null && mediaPlayer.getParent() == this )
mediaPlayer.setBounds ( 0, 0, dimThis.width, dimThis.height );
else if ( compVisual != null && compVisual.getParent() == this )
compVisual.setBounds ( 0, 0, dimThis.width, dimThis.height );
this.validate ();
|
public void | setMediaPlayer(javax.media.bean.playerbean.MediaPlayer mediaPlayer)
int i;
MonitorControl mc;
Control controls [];
Panel mainPanel;
Panel currentPanel;
Panel newPanel;
Component compControl;
this.removeAll ();
if ( compVisual != null ) // previous one
compVisual.removeMouseListener ( this );
this.mediaPlayer = mediaPlayer;
compVisual = mediaPlayer.getVisualComponent ();
if ( compVisual == null ) {
mc = (MonitorControl) mediaPlayer.getControl ( "javax.media.control.MonitorControl" );
if ( mc != null ) {
controls = mediaPlayer.getControls ();
mainPanel = new Panel ( new BorderLayout() );
currentPanel = mainPanel;
for ( i = 0; i < controls.length; i++ ) {
if ( !(controls[i] instanceof MonitorControl) )
continue;
mc = (MonitorControl) controls[i];
mc.setEnabled ( true );
compControl = mc.getControlComponent();
if ( compControl == null )
continue;
currentPanel.add ( compControl, BorderLayout.CENTER );
newPanel = new Panel ( new BorderLayout() );
currentPanel.add ( newPanel, BorderLayout.SOUTH );
currentPanel = newPanel;
}
compVisual = mainPanel;
this.add ( mainPanel );
}
}
else {
this.add ( mediaPlayer );
}
if ( compVisual == null )
return;
resizeVisualComponent ();
addPopupMenuZoom ();
|
public void | setZoom(double dScale)
this.dScale = dScale;
|