Class ReadOnlyFormatControlDelegate

  • All Implemented Interfaces:
    javax.media.Control, javax.media.control.FormatControl

    public class ReadOnlyFormatControlDelegate
    extends Object
    implements javax.media.control.FormatControl
    Represents a wrapper of a specific FormatControl instance which does not allow setting its format using FormatControl.setFormat(Format).
    Author:
    Lubomir Marinov
    • Constructor Detail

      • ReadOnlyFormatControlDelegate

        public ReadOnlyFormatControlDelegate​(javax.media.control.FormatControl formatControl)
        Initializes a new ReadOnlyFormatControlDelegate instance which is to wrap a specific FormatControl in order to prevent calls to its FormatControl.setFormat(Format).
        Parameters:
        formatControl - the FormatControl which is to have calls to its FormatControl#setFormat(Format) prevented
    • Method Detail

      • getControlComponent

        public Component getControlComponent()
        Implements Control.getControlComponent().
        Specified by:
        getControlComponent in interface javax.media.Control
        Returns:
        a Component which represents UI associated with this instance if any; otherwise, null
      • getFormat

        public javax.media.Format getFormat()
        Gets the Format of the owner of this FormatControl. Delegates to the wrapped FormatControl.
        Specified by:
        getFormat in interface javax.media.control.FormatControl
        Returns:
        the Format of the owner of this FormatControl
      • getSupportedFormats

        public javax.media.Format[] getSupportedFormats()
        Gets the Formats supported by the owner of this FormatControl. Delegates to the wrapped FormatControl.
        Specified by:
        getSupportedFormats in interface javax.media.control.FormatControl
        Returns:
        an array of Formats supported by the owner of this FormatControl
      • isEnabled

        public boolean isEnabled()
        Implements FormatControl.isEnabled().
        Specified by:
        isEnabled in interface javax.media.control.FormatControl
        Returns:
        true if this track is enabled; otherwise, false
      • setEnabled

        public void setEnabled​(boolean enabled)
        Implements FormatControl.setEnabled(boolean).
        Specified by:
        setEnabled in interface javax.media.control.FormatControl
        Parameters:
        enabled - true if this track is to be enabled; otherwise, false
      • setFormat

        public javax.media.Format setFormat​(javax.media.Format format)
        Implements FormatControl.setFormat(Format). Not supported and just returns the currently set format if the specified Format is supported and null if it is not supported.
        Specified by:
        setFormat in interface javax.media.control.FormatControl
        Parameters:
        format - the Format to be set on this instance
        Returns:
        the currently set Format after the attempt to set it on this instance if format is supported by this instance and regardless of whether it was actually set; null if format is not supported by this instance