@Override
  public void handleDoubleClick(int row) {
    if (row == -1 || row == table.getRowCount()) return;

    EventTableModel<VisualSearchResult> results = table.getEventTableModel();
    VisualSearchResult result = results.getElementAt(row);

    if (result.getDownloadState() == BasicDownloadState.DOWNLOADED
        || result.getDownloadState() == BasicDownloadState.DOWNLOADING) {
      navigator.getNavItem(NavCategory.DOWNLOAD, MainDownloadPanel.NAME).select(result);
    } else if (result.getDownloadState() == BasicDownloadState.LIBRARY) {
      libraryNavigator.selectInLibrary(result.getUrn(), result.getCategory());
    } else {
      resultPanel.download(results.getElementAt(row));
    }
  }
Пример #2
0
  @Override
  public Component prepareRenderer(
      final TableCellRenderer renderer, final int row, final int column) {
    Component component = super.prepareRenderer(renderer, row, column);
    boolean isSelected = isCellSelected(row, column);
    MarketOrder marketOrder = tableModel.getElementAt(row);
    String columnName =
        (String) this.getTableHeader().getColumnModel().getColumn(column).getHeaderValue();

    if (columnName.equals(MarketTableFormat.EXPIRES.getColumnName())) {
      if (marketOrder.getExpires().before(new Date())) {
        if (isSelected) {
          component.setBackground(this.getSelectionBackground().darker());
        } else {
          component.setBackground(new Color(255, 200, 200));
        }
      }
    }
    return component;
  }