// @TODO: the code below does not pick up domain information, but rather shows multiple hits for chain. could perhaps be improved?
// add the chain information to the table
for (int j = 0; j < chains.length; j++) {
XYDataPoint temp = new XYDataPoint(chains[j].getStartProtein(), chains[j].getEndProtein());
if (chains[j].getStartProtein() != chains[j].getEndProtein()) {
((DefaultTableModel) pdbChainsJTable.getModel()).addRow(new Object[]{
(j + 1),
chains[j].getBlock(),
temp,
(((double) chains[j].getEndProtein() - chains[j].getStartProtein()) / proteinSequenceLength) * 100
});
}
}
((JSparklinesIntervalChartTableCellRenderer) pdbChainsJTable.getColumn("PDB-Protein").getCellRenderer()).setMaxValue(proteinSequenceLength);
if (pdbChainsJTable.getRowCount() > 0) {
((TitledBorder) pdbChainsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "PDB Chains (" + pdbChainsJTable.getRowCount() + ")"
+ PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
} else {
((TitledBorder) pdbChainsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "PDB Chains"
+ PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
}
pdbChainsPanel.repaint();
if (pdbChainsJTable.getRowCount() > 0) {
pdbChainsJTable.setRowSelectionInterval(0, 0);
pdbChainsJTable.scrollRectToVisible(pdbChainsJTable.getCellRect(0, 0, false));
pdbChainsJTableMouseReleased(null);
}
} else {
((TitledBorder) pdbChainsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "PDB Chains"
+ PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
pdbChainsPanel.repaint();
}
// give the power back to the user ;)
this.setEnabled(true);
} else {
// open protein link in web browser
if (pdbMatchesJTable.getSelectedColumn() == pdbMatchesJTable.getColumn("PDB").getModelIndex() && evt.getButton() == MouseEvent.BUTTON1
&& ((String) pdbMatchesJTable.getValueAt(pdbMatchesJTable.getSelectedRow(), pdbMatchesJTable.getSelectedColumn())).lastIndexOf("<html>") != -1) {
String temp = currentlyDisplayedPdbFile.substring(currentlyDisplayedPdbFile.indexOf("\"") + 1);
currentlyDisplayedPdbFile = temp.substring(0, temp.indexOf("\""));
this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
BareBonesBrowserLaunch.openURL(currentlyDisplayedPdbFile);
this.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
}