FileDocCategorySizeDatePackage
MFormatPane.javaAPI DocJMF 2.1.1e3786Mon May 12 12:21:00 BST 2003com.sun.media.customizer

MFormatPane

public class MFormatPane extends JPanel
This class defines the media format page. It list all the file format supported by jmf 2.x
version
2.0

Fields Summary
public static final int
AU
public static final int
AIFF
public static final int
GSM
public static final int
WAV
public static final int
MP2
public static final int
MP3
public static final int
MOV
public static final int
AVI
public static final int
MPEG
public static final int
MVR
public static final int
MIDI
public static final int
RMF
public static final int
CDAUDIO
JCheckBox[]
mformats
boolean[]
resultMFormat
Constructors Summary
public MFormatPane()


      
	mformats[AU] = new JCheckBox(I18N.getResource("MFormatPane.AU"), false);
	mformats[AIFF] = new JCheckBox(I18N.getResource("MFormatPane.AIFF"), false);
	mformats[GSM] = new JCheckBox(I18N.getResource("MFormatPane.GSM"), false);
	mformats[MP2] = new JCheckBox(I18N.getResource("MFormatPane.MP2"), false);
	mformats[MP3] = new JCheckBox(I18N.getResource("MFormatPane.MP3"), false);
	mformats[WAV] = new JCheckBox(I18N.getResource("MFormatPane.WAV"), false);
	mformats[MOV] = new JCheckBox(I18N.getResource("MFormatPane.MOV"), false);
	mformats[AVI] = new JCheckBox(I18N.getResource("MFormatPane.AVI"), false);
	mformats[MPEG] = new JCheckBox(I18N.getResource("MFormatPane.MPEG"), false);
	mformats[MVR] = new JCheckBox(I18N.getResource("MFormatPane.MVR"), false);
	mformats[MIDI] = new JCheckBox(I18N.getResource("MFormatPane.MIDI"), false);
	mformats[RMF] = new JCheckBox(I18N.getResource("MFormatPane.RMF"), false);
	mformats[CDAUDIO] = new JCheckBox(I18N.getResource("MFormatPane.CDAUDIO"), false);

	setLayout(new GridLayout(5,3));
        this.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), I18N.getResource("MFormatPane.TITLE")));

	for ( int i = 0; i < 13; i++) {
	    mformats[i].setEnabled(false);
	    add(mformats[i]);
	}
    
Methods Summary
public voiddisableAll()

	for ( int i = 0; i < 13; i++)
	    mformats[i].setEnabled(false);
    
public boolean[]getState()

	for (int i = 0; i < 13; i++) {
	    if (mformats[i].isEnabled() && mformats[i].isSelected())
		resultMFormat[i] = true;
	    else 
		resultMFormat[i] = false;
	} 
	return (resultMFormat);
    
public voidsetHighlight(boolean[] funcs, boolean[] protocols, int release)

	// mvr/swf/spl/midi/rmf only supported in playback
	boolean value = (protocols[ProtocolPane.FILE] ||
	                protocols[ProtocolPane.HTTP] ||
	                protocols[ProtocolPane.HTTPS] ||
	                protocols[ProtocolPane.FTP] ) &&
	                funcs[GeneralPane.PLAY];
	mformats[MVR].setEnabled(value);
	mformats[MIDI].setEnabled(value);
	mformats[RMF].setEnabled(value);
	
	// mpeg only supported when loading from files and transmitting
	// can't play or dump into file
	value = (funcs[GeneralPane.RTPTRANS] && protocols[ProtocolPane.RTP] )
                || (release > 1 );
	mformats[MPEG].setEnabled(value);
	
	// other media formats
	value = ( protocols[ProtocolPane.FILE] ||
	          protocols[ProtocolPane.HTTP] ||
	          protocols[ProtocolPane.HTTPS] ||
		  protocols[ProtocolPane.FTP] ) &&
	          funcs[GeneralPane.MFILE];
	for ( int i = AU; i <= AVI; i++)
	    mformats[i].setEnabled(value);

	value = ( release == 3 );
	mformats[CDAUDIO].setEnabled(value);

	mformats[MP3].setEnabled(false);