src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java
/**
     * Creates all the controls (including encoding) for a type(AUDIO or VIDEO)
     *
     * @param type the type.
     * @return the build Component.
     */
Creates all the controls (including encoding) for a type(AUDIO or VIDEO)
@param type the type.
@return the build Component.
Creates all the controls ( including encoding ) for a type ( AUDIO or VIDEO ) @param type the type . @return the build Component .
private Component createControls(int type)
    {
        ConfigurationService cfg = NeomediaActivator.getConfigurationService();
        Component devicesComponent = null;
        Component encodingsComponent = null;
        Component videoComponent = null;
        int compCount = 0;
        if (cfg == null || !cfg.getBoolean(DEVICES_DISABLED_PROP, false))
        {
            compCount++;
            devicesComponent = createBasicControls(type);
        }
        if (cfg == null || !cfg.getBoolean(ENCODINGS_DISABLED_PROP, false))
        {
            compCount++;
            encodingsComponent = createEncodingControls(type, null);
        }
        if ((type == DeviceConfigurationComboBoxModel.VIDEO)
                && ((cfg == null)
                    || !cfg.getBoolean(
                            VIDEO_MORE_SETTINGS_DISABLED_PROP,
                            false)))
        {
            compCount++;
            videoComponent = createVideoAdvancedSettings();
        }
        ResourceManagementService res = NeomediaActivator.getResources();
        Container container;
        if (compCount < 2)
        {
            container = new TransparentPanel(new BorderLayout());
            if (devicesComponent != null)
                container.add(devicesComponent);
            else if (encodingsComponent != null)
                container.add(encodingsComponent);
            else if (videoComponent != null)
                container.add(videoComponent);
        }
        else
        {
            container = new SIPCommTabbedPane();
            SIPCommTabbedPane tabbedPane = (SIPCommTabbedPane) container;
            int index = 0;
            if (devicesComponent != null)
            {
                tabbedPane.insertTab(
                        res.getI18NString("impl.media.configform.DEVICES"),
                        null,
                        devicesComponent,
                        null,
                        index);
                index = 1;
            }
            if (encodingsComponent != null)
            {
                if (tabbedPane.getTabCount() >= 1)
                    index = 1;
                tabbedPane.insertTab(
                        res.getI18NString("impl.media.configform.ENCODINGS"),
                        null,
                        encodingsComponent,
                        null,
                        index);
            }
            if (videoComponent != null)
            {
                if (tabbedPane.getTabCount() >= 2)
                    index = 2;
                tabbedPane.insertTab(
                        res.getI18NString(
                            "impl.media.configform.VIDEO_MORE_SETTINGS"),
                        null,
                        videoComponent,
                        null,
                        index);
            }
        }
        return container;
    }
private Component createControls ( int type ) { ConfigurationService cfg = NeomediaActivator . getConfigurationService ( ) ; Component devicesComponent = null ; Component encodingsComponent = null ; Component videoComponent = null ; int compCount = 0 ; if ( cfg == null || ! cfg . getBoolean ( DEVICES_DISABLED_PROP , false ) ) { compCount ++ ; devicesComponent = createBasicControls ( type ) ; } if ( cfg == null || ! cfg . getBoolean ( ENCODINGS_DISABLED_PROP , false ) ) { compCount ++ ; encodingsComponent = createEncodingControls ( type , null ) ; } if ( ( type == DeviceConfigurationComboBoxModel . VIDEO ) && ( ( cfg == null ) || ! cfg . getBoolean ( VIDEO_MORE_SETTINGS_DISABLED_PROP , false ) ) ) { compCount ++ ; videoComponent = createVideoAdvancedSettings ( ) ; } ResourceManagementService res = NeomediaActivator . getResources ( ) ; Container container ; if ( compCount < 2 ) { container = new TransparentPanel ( new BorderLayout ( ) ) ; if ( devicesComponent != null ) container . add ( devicesComponent ) ; else if ( encodingsComponent != null ) container . add ( encodingsComponent ) ; else if ( videoComponent != null ) container . add ( videoComponent ) ; } else { container = new SIPCommTabbedPane ( ) ; SIPCommTabbedPane tabbedPane = ( SIPCommTabbedPane ) container ; int index = 0 ; if ( devicesComponent != null ) { tabbedPane . insertTab ( res . getI18NString ( "impl.media.configform.DEVICES" ) , null , devicesComponent , null , index ) ; index = 1 ; } if ( encodingsComponent != null ) { if ( tabbedPane . getTabCount ( ) >= 1 ) index = 1 ; tabbedPane . insertTab ( res . getI18NString ( "impl.media.configform.ENCODINGS" ) , null , encodingsComponent , null , index ) ; } if ( videoComponent != null ) { if ( tabbedPane . getTabCount ( ) >= 2 ) index = 2 ; tabbedPane . insertTab ( res . getI18NString ( "impl.media.configform.VIDEO_MORE_SETTINGS" ) , null , videoComponent , null , index ) ; } } return container ; }
Creates all the controls (including encoding) for a type(AUDIO or VIDEO)
 @param type the type.
Creates all the controls ( including encoding ) for a type ( AUDIO or VIDEO ) @param type the type .
// If we only have one configuration form we don't need to create a // tabbed pane.