/** Updates the item selection in the selected tab. */ public void updateSelectionInTab() { indexLabel.setForeground(Color.BLACK); if (types.get(jumpType).get(currentSelection.get(jumpType)) == Type.PROTEIN) { peptideShakerGUI.setSelectedItems( possibilities.get(jumpType).get(currentSelection.get(jumpType)), PeptideShakerGUI.NO_SELECTION, PeptideShakerGUI.NO_SELECTION); peptideShakerGUI.updateSelectionInCurrentTab(); } else if (types.get(jumpType).get(currentSelection.get(jumpType)) == Type.PEPTIDE) { peptideShakerGUI.setSelectedItems( PeptideShakerGUI.NO_SELECTION, possibilities.get(jumpType).get(currentSelection.get(jumpType)), PeptideShakerGUI.NO_SELECTION); if (peptideShakerGUI.getSelectedTab() == PeptideShakerGUI.MODIFICATIONS_TAB_INDEX && !peptideShakerGUI .getDisplayedPeptides() .contains(possibilities.get(jumpType).get(currentSelection.get(jumpType)))) { // warn the user that the current selection is not in the tab indexLabel.setForeground(Color.RED); } else { peptideShakerGUI.updateSelectionInCurrentTab(); } } else { peptideShakerGUI.setSelectedItems( PeptideShakerGUI.NO_SELECTION, PeptideShakerGUI.NO_SELECTION, possibilities.get(jumpType).get(currentSelection.get(jumpType))); peptideShakerGUI.updateSelectionInCurrentTab(); } String label = "(" + (currentSelection.get(jumpType) + 1) + " of " + possibilities.get(jumpType).size() + ")"; indexLabel.setText(label); lastLabel.put(jumpType, label); }