+ /**
+ * Populates the filter combo-box options dynamically depending on discovered
+ * structures
+ */
+ protected void populateFilterComboBox()
+ {
+ if (isStructuresDiscovered())
+ {
+ cmb_filterOption.addItem(new FilterOption("Best Quality",
+ PDBDocField.OVERALL_QUALITY.getCode(), VIEWS_FILTER));
+ cmb_filterOption.addItem(new FilterOption("Best UniProt Coverage",
+ PDBDocField.UNIPROT_COVERAGE.getCode(), VIEWS_FILTER));
+ cmb_filterOption.addItem(new FilterOption("Highest Resolution",
+ PDBDocField.RESOLUTION.getCode(), VIEWS_FILTER));
+ cmb_filterOption.addItem(new FilterOption("Highest Protein Chain",
+ PDBDocField.PROTEIN_CHAIN_COUNT.getCode(), VIEWS_FILTER));
+ cmb_filterOption.addItem(new FilterOption("Highest Bound Molecules",
+ PDBDocField.BOUND_MOLECULE_COUNT.getCode(), VIEWS_FILTER));
+ cmb_filterOption.addItem(new FilterOption("Highest Polymer Residues",
+ PDBDocField.POLYMER_RESIDUE_COUNT.getCode(), VIEWS_FILTER));
+ }
+ cmb_filterOption.addItem(new FilterOption("Enter PDB Id", "-",
+ VIEWS_ENTER_ID));
+ cmb_filterOption.addItem(new FilterOption("From File", "-",
+ VIEWS_FROM_FILE));
+ }
+
+ /**
+ * Updates the displayed view based on the selected filter option
+ */
+ protected void updateCurrentView()
+ {
+ FilterOption selectedOption = ((FilterOption) cmb_filterOption
+ .getSelectedItem());
+ layout_switchableViews.show(pnl_switchableViews,
+ selectedOption.getView());
+ chk_invertFilter.setEnabled(false);
+ if (selectedOption.getView() == VIEWS_FILTER)
+ {
+ chk_invertFilter.setEnabled(true);
+ filterResultSet(selectedOption.getValue());
+ }
+ }
+
+ /**
+ * Handles the state change event for the 'filter' combo-box and 'invert'
+ * check-box
+ */
+ @Override
+ protected void stateChanged(ItemEvent e)
+ {
+ if (e.getSource() instanceof JCheckBox)
+ {
+ updateCurrentView();
+ }
+ else
+ {
+ if (e.getStateChange() == ItemEvent.SELECTED)
+ {
+ updateCurrentView();
+ }
+ }
+
+ }
+
+
+ public boolean isStructuresDiscovered()
+ {
+ return structuresDiscovered;
+ }
+
+ public void setStructuresDiscovered(boolean structuresDiscovered)
+ {
+ this.structuresDiscovered = structuresDiscovered;
+ }
+
+ public Collection<PDBResponseSummary> getDiscoveredStructuresSet()
+ {
+ return discoveredStructuresSet;
+ }