mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Moves audio panel into the channel state list panel so that we don't
have to use a split pane.
This commit is contained in:
@@ -124,9 +124,6 @@ public class AudioChannelPanel extends JPanel
|
||||
mFromAlias.setForeground( mLabelColor );
|
||||
add( mFromAlias,"wrap" );
|
||||
|
||||
JSeparator separator = new JSeparator( JSeparator.HORIZONTAL );
|
||||
separator.setBackground( Color.DARK_GRAY );
|
||||
add( separator, "span,growx" );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSeparator;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import settings.SettingsManager;
|
||||
@@ -21,17 +22,30 @@ public class AudioChannelsPanel extends JPanel
|
||||
setBackground( Color.BLACK );
|
||||
|
||||
List<AudioOutput> outputs = controller.getAudioOutputs();
|
||||
|
||||
for( AudioOutput audioOutput: controller.getAudioOutputs() )
|
||||
|
||||
for( int x = 0; x < outputs.size(); x++ )
|
||||
{
|
||||
add( new AudioChannelPanel( settingsManager, audioOutput ), "wrap" );
|
||||
add( new AudioChannelPanel( settingsManager, outputs.get( x ) ), "wrap" );
|
||||
|
||||
if( x < outputs.size() - 1 )
|
||||
{
|
||||
addSeparator();
|
||||
}
|
||||
}
|
||||
|
||||
/* Add an empty channel panel so that the panel is sized appropriately
|
||||
* for either a single channel or two channels */
|
||||
if( outputs.size() == 1 )
|
||||
{
|
||||
addSeparator();
|
||||
add( new AudioChannelPanel( settingsManager, null ), "wrap" );
|
||||
}
|
||||
}
|
||||
|
||||
private void addSeparator()
|
||||
{
|
||||
JSeparator separator = new JSeparator( JSeparator.HORIZONTAL );
|
||||
separator.setBackground( Color.DARK_GRAY );
|
||||
add( separator, "span,growx" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class ControllerPanel extends JPanel
|
||||
channelProcessingManager );
|
||||
|
||||
mChannelStateList = new ChannelList( channelModel, channelProcessingManager,
|
||||
settingsManager );
|
||||
settingsManager, mAudioPanel );
|
||||
|
||||
mChannelController = new ChannelController( channelModel, channelMapModel,
|
||||
sourceManager, aliasModel );
|
||||
@@ -156,20 +156,20 @@ public class ControllerPanel extends JPanel
|
||||
|
||||
JScrollPane channelStateListScroll = new JScrollPane();
|
||||
channelStateListScroll.getViewport().setView( mChannelStateList );
|
||||
channelStateListScroll.setPreferredSize( new Dimension( 200, 300 ) );
|
||||
channelStateListScroll.setPreferredSize( new Dimension( 400, 500 ) );
|
||||
|
||||
JideSplitPane audioChannelListSplit = new JideSplitPane( JideSplitPane.VERTICAL_SPLIT );
|
||||
audioChannelListSplit.setDividerSize( 5 );
|
||||
audioChannelListSplit.add( mAudioPanel );
|
||||
audioChannelListSplit.add( channelStateListScroll );
|
||||
// JideSplitPane audioChannelListSplit = new JideSplitPane( JideSplitPane.VERTICAL_SPLIT );
|
||||
// audioChannelListSplit.setDividerSize( 5 );
|
||||
// audioChannelListSplit.add( mAudioPanel );
|
||||
// audioChannelListSplit.add( channelStateListScroll );
|
||||
|
||||
//Set preferred size to influence the split between these panels
|
||||
audioChannelListSplit.setPreferredSize( new Dimension( 400, 500 ) );
|
||||
// audioChannelListSplit.setPreferredSize( new Dimension( 400, 500 ) );
|
||||
mTabbedPane.setPreferredSize( new Dimension( 880, 500 ) );
|
||||
|
||||
JideSplitPane channelSplit = new JideSplitPane( JideSplitPane.HORIZONTAL_SPLIT );
|
||||
channelSplit.setDividerSize( 5 );
|
||||
channelSplit.add( audioChannelListSplit );
|
||||
channelSplit.add( channelStateListScroll );
|
||||
channelSplit.add( mTabbedPane );
|
||||
|
||||
add( channelSplit );
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.miginfocom.swing.MigLayout;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import audio.AudioPanel;
|
||||
import settings.ColorSetting.ColorSettingName;
|
||||
import settings.ColorSettingMenuItem;
|
||||
import settings.ColorSettingResetMenuItem;
|
||||
@@ -60,24 +61,32 @@ public class ChannelList extends JPanel implements ChannelEventListener
|
||||
private ChannelModel mChannelModel;
|
||||
private ChannelProcessingManager mChannelProcessingManager;
|
||||
private SettingsManager mSettingsManager;
|
||||
private AudioPanel mAudioPanel;
|
||||
|
||||
public ChannelList( ChannelModel channelModel,
|
||||
ChannelProcessingManager channelProcessingManager,
|
||||
SettingsManager settingsManager )
|
||||
SettingsManager settingsManager,
|
||||
AudioPanel audioPanel )
|
||||
{
|
||||
mChannelModel = channelModel;
|
||||
mChannelProcessingManager = channelProcessingManager;
|
||||
mSettingsManager = settingsManager;
|
||||
mAudioPanel = audioPanel;
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init()
|
||||
{
|
||||
setLayout( new MigLayout( "insets 0 0 0 0", "[grow,fill]", "[]0[]") );
|
||||
setLayout( new MigLayout( "insets 0 0 0 0,wrap 1", "[grow,fill]", "[]0[]") );
|
||||
setBackground( Color.BLACK );
|
||||
|
||||
addMouseListener( new ListSelectionListener() );
|
||||
|
||||
add( mAudioPanel );
|
||||
|
||||
JSeparator separator = new JSeparator( JSeparator.HORIZONTAL );
|
||||
add( separator );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,7 +112,7 @@ public class ChannelList extends JPanel implements ChannelEventListener
|
||||
ChannelPanel channelPanel = new ChannelPanel( mChannelModel,
|
||||
mChannelProcessingManager, mSettingsManager, channel );
|
||||
|
||||
add( channelPanel, "wrap" );
|
||||
add( channelPanel );
|
||||
|
||||
mDisplayedPanels.put( channel, channelPanel );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user