* This method creates the data vectors for the left and right tables
* (left = nzb files, right = download file queue).
*/
protected void createDataTables()
{
DownloadFileListPopupListener dlFileListener = null;
DownloadFileListKeyListener dlFileKeyListener = null;
// create left JTable (nzb files)
nzbListTab = new JTable(nzbFileQueueTabModel)
{
public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
{
super.changeSelection(rowIndex, columnIndex, !extend, extend);
}
};
nzbListTab.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
nzbListTab.getTableHeader().setReorderingAllowed(false);
nzbListTab.addMouseListener(new NzbFileListPopupListener(this, nzbListTab));
nzbListTab.setDragEnabled(true);
nzbListTab.setDropMode(DropMode.INSERT_ROWS);
nzbListTab.setTransferHandler(new TableRowTransferHandler(nzbListTab, this));
nzbListTab.setRowHeight(23);
// set table cell renderers (left)
ProgressRenderer cellRenderer = new ProgressRenderer(true);
nzbListTab.getColumnModel().getColumn(0).setCellRenderer(cellRenderer);
// set table header renderers (left)
nzbListTab.getColumnModel().getColumn(0).setHeaderRenderer(
new AlignedTableHeaderRenderer(SwingConstants.CENTER));
// create right JTable (files to download)
filesToDownloadTab = new JTable(filesToDownloadTabModel);
filesToDownloadTab.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
dlFileListener = new DownloadFileListPopupListener(this, filesToDownloadTab);
dlFileKeyListener = new DownloadFileListKeyListener(this, filesToDownloadTab);
filesToDownloadTab.addMouseListener(dlFileListener);
filesToDownloadTab.addKeyListener(dlFileKeyListener);
filesToDownloadTab.getSelectionModel().addListSelectionListener(dlFileListener);
filesToDownloadTab.getColumnModel().getColumn(0).setMinWidth(333);