FileDocCategorySizeDatePackage
MSVisualComponent.javaAPI DocJMF 2.1.1e1633Mon May 12 12:21:20 BST 2003com.sun.media.amovie

MSVisualComponent

public class MSVisualComponent extends Canvas implements com.ms.awt.HeavyComponent

Fields Summary
AMController
amc
Constructors Summary
public MSVisualComponent(AMController amc)

	this.amc = amc;
    
Methods Summary
public voidaddNotify()

	super.addNotify();
	amc.peerExists = true;
	amc.setOwner( this );
	if (amc.amovie != null) {
	    getPreferredSize();
	    amc.amovie.setWindowPosition(0, 0, amc.outWidth, amc.outHeight);
	}
    
public java.awt.DimensiongetMinimumSize()

	return new Dimension(1, 1);
    
public java.awt.DimensiongetPreferredSize()

	if (amc.amovie != null) {
	    int width = amc.amovie.getVideoWidth();
	    int height = amc.amovie.getVideoHeight();
	    return new Dimension(width, height);
	} else {
	    return new Dimension(1, 1);
	}
    
public voidlayout()

	if (amc.amovie != null) {
	    int w = amc.amovie.getVideoWidth();
	    int h = amc.amovie.getVideoHeight();
	    if (amc.pwidth == -1) {
		amc.pwidth = w;
		amc.pheight = h;
		amc.outWidth = amc.pwidth;
		amc.outHeight = amc.pheight;
		// amc.sendSizeChangeEvent(amc.outWidth, amc.outHeight, 1.0F);
	    }
	    if (amc.peerExists) {
		amc.setOwner( this );
		amc.amovie.setWindowPosition(0, 0, amc.outWidth, amc.outHeight);
	    }
	}
    
public booleanneedsHeavyPeer()

	return true;
    
public voidremoveNotify()

	amc.peerExists = false;
	if (amc.amovie != null) {
	    amc.amovie.setVisible(0);
	    amc.amovie.setOwner(0);
	}
	super.removeNotify();