mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Work in progress - updates channel component editors and changes
functionality so that the editor starts up without a channel displayed and as each channel row is selected in the channels table, the editor is updated with the channel configuration. Likewise, the channel editor is now a channel event listener on the channel model and will maintain channel state if the user changes channel configuration in any of the external channel controllers like the spectral display or the channel list.
This commit is contained in:
@@ -54,13 +54,15 @@ public class PlaylistEditor extends JPanel implements ListSelectionListener
|
||||
mChannelTable.getSelectionModel().addListSelectionListener( this );
|
||||
mChannelTable.setAutoCreateRowSorter( true );
|
||||
|
||||
TableFilterHeader channelHeaderFilter = new TableFilterHeader( mChannelTable );
|
||||
channelHeaderFilter.setAutoChoices( AutoChoices.ENABLED );
|
||||
TableFilterHeader channelHeaderFilter =
|
||||
new TableFilterHeader( mChannelTable, AutoChoices.ENABLED );
|
||||
channelHeaderFilter.setFilterOnUpdates( true );
|
||||
|
||||
JScrollPane channelScroller = new JScrollPane( mChannelTable );
|
||||
|
||||
JideSplitPane splitPane = new JideSplitPane( JideSplitPane.HORIZONTAL_SPLIT );
|
||||
splitPane.setDividerSize( 5 );
|
||||
splitPane.setShowGripper( true );
|
||||
splitPane.add( channelScroller );
|
||||
splitPane.add( mEditor );
|
||||
|
||||
@@ -73,15 +75,22 @@ public class PlaylistEditor extends JPanel implements ListSelectionListener
|
||||
//This limits event firing to only when selection is complete
|
||||
if( !event.getValueIsAdjusting() )
|
||||
{
|
||||
int index = mChannelTable.convertRowIndexToModel( mChannelTable.getSelectedRow() );
|
||||
|
||||
mLog.debug( "Index:" + index );
|
||||
int selectedRow = mChannelTable.getSelectedRow();
|
||||
|
||||
Channel channel = mChannelModel.getChannels().get( index );
|
||||
|
||||
if( channel != null )
|
||||
if( selectedRow != -1 )
|
||||
{
|
||||
mEditor.setChannel( channel );
|
||||
int index = mChannelTable.convertRowIndexToModel( mChannelTable.getSelectedRow() );
|
||||
|
||||
Channel channel = mChannelModel.getChannels().get( index );
|
||||
|
||||
if( channel != null )
|
||||
{
|
||||
mEditor.setChannel( channel );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mEditor.setChannel( null );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user