FileDocCategorySizeDatePackage
PacketSizeAdapter.javaAPI DocJMF 2.1.1e2525Mon May 12 12:20:56 BST 2003com.sun.media.controls

PacketSizeAdapter

public class PacketSizeAdapter extends Object implements PacketSizeControl
Implementation for PacketSizeControl

Fields Summary
protected Codec
owner
protected boolean
isSetable
protected int
packetSize
Component
component
String
CONTROL_STRING
Constructors Summary
public PacketSizeAdapter(Codec newOwner, int newPacketSize, boolean newIsSetable)



           
        packetSize= newPacketSize;
        owner = newOwner;
        isSetable = newIsSetable;
    
Methods Summary
public java.awt.ComponentgetControlComponent()

        if (component ==null ) {
            Panel componentPanel=new Panel();
            componentPanel.setLayout(new BorderLayout() );
            componentPanel.add("Center",new Label(CONTROL_STRING,Label.CENTER) );
            TextField tf=new TextField(packetSize+"",5);
            tf.setEditable(isSetable );

            tf.addActionListener( (ActionListener)new PacketSizeListner(tf)  );

            componentPanel.add("East",tf );
            componentPanel.invalidate();
            component=componentPanel;

        }
        return (Component)component;
    
public intgetPacketSize()
Retrieve the maximum packet size used by this encoder.

return
Maximum packet size used by this encoder.

        return packetSize;
    
public intsetPacketSize(int numBytes)
Sets the desired maximum data size on the data that is output by this encoder. This parameter is to be used as a means to convey the preferred size of individual data units (packets) that are output by this encoder. Returns the actual packet size that was set.

param
packetsize The number of bytes the maximum packet size is set to
return
the actual packet size set by the encoder

        return packetSize;