*
* @return list of columns to display by default
*/
- public Collection<FTSDataColumnI> getAllDefaulDisplayedDataColumns();
+ public Collection<FTSDataColumnI> getAllDefaultDisplayedFTSDataColumns();
/**
* Return list of FTSDataColumnI objects that can be used to perform a search
import jalview.fts.api.FTSDataColumnI;
import jalview.fts.api.FTSDataColumnI.FTSDataColumnGroupI;
import jalview.fts.api.FTSRestClientI;
+import jalview.fts.service.pdb.PDBFTSRestClient;
import java.util.ArrayList;
import java.util.Collection;
FTSRestClientI ftsRestClient)
{
this.ftsRestClient = ftsRestClient;
- Collection<FTSDataColumnI> defaultCols = ftsRestClient
- .getAllDefaulDisplayedDataColumns();
-
- structSummaryColumns.addAll(defaultCols);
-
+ structSummaryColumns = ((PDBFTSRestClient) ftsRestClient)
+ .getAllDefaultDisplayedStructureDataColumns();
allFTSDataColumns.addAll(ftsRestClient.getAllFTSDataColumns());
tbl_FTSDataColumnPrefs.setAutoCreateRowSorter(true);
{
case SEARCH_SUMMARY:
data[x++] = new Object[] {
- ftsRestClient.getAllDefaulDisplayedDataColumns()
+ ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
.contains(field),
field.getName(), field.getGroup() };
break;
break;
case PREFERENCES:
data[x++] = new Object[] { field.getName(),
- ftsRestClient.getAllDefaulDisplayedDataColumns()
+ ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
.contains(field),
structSummaryColumns.contains(field) };
break;
if (currentSource == PreferenceSource.SEARCH_SUMMARY)
{
updatePrefs(ftsRestClient
- .getAllDefaulDisplayedDataColumns(), ftsDataColumn,
+ .getAllDefaultDisplayedFTSDataColumns(), ftsDataColumn,
selected);
}
else if (currentSource == PreferenceSource.STRUCTURE_CHOOSER)
if (col == 1)
{
updatePrefs(ftsRestClient
- .getAllDefaulDisplayedDataColumns(), ftsDataColumn,
+ .getAllDefaultDisplayedFTSDataColumns(), ftsDataColumn,
selected);
}
else if (col == 2)
}
@Override
- public Collection<FTSDataColumnI> getAllDefaulDisplayedDataColumns()
+ public Collection<FTSDataColumnI> getAllDefaultDisplayedFTSDataColumns()
{
if (defaulDisplayedDataColumns == null
|| defaulDisplayedDataColumns.isEmpty())
txt_search.setEnabled(false);
cmb_searchTarget.setEnabled(false);
previousWantedFields = getFTSRestClient()
- .getAllDefaulDisplayedDataColumns()
+ .getAllDefaultDisplayedFTSDataColumns()
.toArray(new Object[0]);
}
if (sourceTabbedPane.getTitleAt(index).equals(searchTabTitle))
}
return Arrays.equals(getFTSRestClient()
- .getAllDefaulDisplayedDataColumns()
+ .getAllDefaultDisplayedFTSDataColumns()
.toArray(new Object[0]), previousWantedFields) ? false
: true;
String searchTarget = ((FTSDataColumnI) cmb_searchTarget
.getSelectedItem()).getCode();
wantedFields = PDBFTSRestClient.getInstance()
- .getAllDefaulDisplayedDataColumns();
+ .getAllDefaultDisplayedFTSDataColumns();
String searchTerm = decodeSearchTerm(txt_search.getText(),
searchTarget);
}
return instance;
}
+
+ private Collection<FTSDataColumnI> allDefaultDisplayedStructureDataColumns;
+
+ public Collection<FTSDataColumnI> getAllDefaultDisplayedStructureDataColumns()
+ {
+ if (allDefaultDisplayedStructureDataColumns == null
+ || allDefaultDisplayedStructureDataColumns.isEmpty())
+ {
+ allDefaultDisplayedStructureDataColumns = new ArrayList<FTSDataColumnI>();
+ allDefaultDisplayedStructureDataColumns.addAll(super
+ .getAllDefaultDisplayedFTSDataColumns());
+ }
+ return allDefaultDisplayedStructureDataColumns;
+ }
}
.getSelectedItem()).getAltCode();
wantedFields = UniProtFTSRestClient.getInstance()
- .getAllDefaulDisplayedDataColumns();
+ .getAllDefaultDisplayedFTSDataColumns();
String searchTerm = decodeSearchTerm(txt_search.getText(),
searchTarget);
{
long startTime = System.currentTimeMillis();
pdbRestCleint = PDBFTSRestClient.getInstance();
- Collection<FTSDataColumnI> wantedFields = pdbRestCleint
- .getAllDefaulDisplayedDataColumns();
+ Collection<FTSDataColumnI> wantedFields = pdbDocFieldPrefs
+ .getStructureSummaryFields();
discoveredStructuresSet = new LinkedHashSet<FTSData>();
HashSet<String> errors = new HashSet<String>();
if (discoveredStructuresSet != null
&& !discoveredStructuresSet.isEmpty())
{
- tbl_summary.setModel(FTSRestResponse.getTableModel(lastPdbRequest,
+ getResultTable().setModel(
+ FTSRestResponse.getTableModel(lastPdbRequest,
discoveredStructuresSet));
structuresDiscovered = true;
noOfStructuresFound = discoveredStructuresSet.size();
long startTime = System.currentTimeMillis();
pdbRestCleint = PDBFTSRestClient.getInstance();
lbl_loading.setVisible(true);
- Collection<FTSDataColumnI> wantedFields = pdbRestCleint
- .getAllDefaulDisplayedDataColumns();
+ Collection<FTSDataColumnI> wantedFields = pdbDocFieldPrefs
+ .getStructureSummaryFields();
Collection<FTSData> filteredResponse = new HashSet<FTSData>();
HashSet<String> errors = new HashSet<String>();
Collection<FTSData> reorderedStructuresSet = new LinkedHashSet<FTSData>();
reorderedStructuresSet.addAll(filteredResponse);
reorderedStructuresSet.addAll(discoveredStructuresSet);
- tbl_summary.setModel(FTSRestResponse.getTableModel(
+ getResultTable().setModel(
+ FTSRestResponse.getTableModel(
lastPdbRequest, reorderedStructuresSet));
- FTSRestResponse.configureTableColumn(tbl_summary, wantedFields);
- tbl_summary.getColumn("Ref Sequence").setPreferredWidth(120);
- tbl_summary.getColumn("Ref Sequence").setMinWidth(100);
- tbl_summary.getColumn("Ref Sequence").setMaxWidth(200);
+ FTSRestResponse.configureTableColumn(getResultTable(),
+ wantedFields);
+ getResultTable().getColumn("Ref Sequence").setPreferredWidth(120);
+ getResultTable().getColumn("Ref Sequence").setMinWidth(100);
+ getResultTable().getColumn("Ref Sequence").setMaxWidth(200);
// Update table selection model here
- tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1);
+ getResultTable().addRowSelectionInterval(0,
+ filterResponseCount - 1);
mainFrame.setTitle(MessageManager.formatMessage(
"label.structure_chooser_filter_time", totalTime));
}
String currentView = selectedFilterOpt.getView();
if (currentView == VIEWS_FILTER)
{
- if (tbl_summary.getSelectedRows().length > 0)
+ if (getResultTable().getSelectedRows().length > 0)
{
btn_view.setEnabled(true);
}
String currentView = selectedFilterOpt.getView();
if (currentView == VIEWS_FILTER)
{
- int pdbIdColIndex = tbl_summary.getColumn("PDB Id")
+ int pdbIdColIndex = getResultTable().getColumn("PDB Id")
.getModelIndex();
- int refSeqColIndex = tbl_summary.getColumn("Ref Sequence")
+ int refSeqColIndex = getResultTable().getColumn("Ref Sequence")
.getModelIndex();
- int[] selectedRows = tbl_summary.getSelectedRows();
+ int[] selectedRows = getResultTable().getSelectedRows();
PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
int count = 0;
ArrayList<SequenceI> selectedSeqsToView = new ArrayList<SequenceI>();
for (int row : selectedRows)
{
- String pdbIdStr = tbl_summary.getValueAt(row, pdbIdColIndex)
+ String pdbIdStr = getResultTable().getValueAt(row,
+ pdbIdColIndex)
.toString();
- SequenceI selectedSeq = (SequenceI) tbl_summary.getValueAt(row,
+ SequenceI selectedSeq = (SequenceI) getResultTable()
+ .getValueAt(row,
refSeqColIndex);
selectedSeqsToView.add(selectedSeq);
PDBEntry pdbEntry = selectedSeq.getPDBEntry(pdbIdStr);
{
String searchTerm = txt_search.getText().toLowerCase();
searchTerm = searchTerm.split(":")[0];
- System.out.println(">>>>> search term : " + searchTerm);
+ // System.out.println(">>>>> search term : " + searchTerm);
List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
FTSRestRequest pdbRequest = new FTSRestRequest();
pdbRequest.setAllowEmptySeq(false);
private JTabbedPane pnl_filter = new JTabbedPane();
- private FTSDataColumnPreferences pdbDocFieldPrefs = new FTSDataColumnPreferences(
+ protected FTSDataColumnPreferences pdbDocFieldPrefs = new FTSDataColumnPreferences(
PreferenceSource.STRUCTURE_CHOOSER,
PDBFTSRestClient.getInstance());
protected FTSDataColumnI[] previousWantedFields;
- protected JTable tbl_summary = new JTable()
+ private JTable tbl_summary = new JTable()
{
private boolean inLayout;
}
});
- scrl_foundStructures.setPreferredSize(new Dimension(500, 300));
- scrl_foundStructures
- .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+ scrl_foundStructures.setPreferredSize(new Dimension(800, 400));
- scrl_localPDB.setPreferredSize(new Dimension(500, 300));
+ scrl_localPDB.setPreferredSize(new Dimension(800, 400));
scrl_localPDB
.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
btn_cancel.setEnabled(false);
btn_view.setVisible(false);
btn_cancel.setVisible(false);
- previousWantedFields = PDBFTSRestClient.getInstance()
- .getAllDefaulDisplayedDataColumns()
- .toArray(new FTSDataColumnI[0]);
+ previousWantedFields = pdbDocFieldPrefs
+ .getStructureSummaryFields().toArray(
+ new FTSDataColumnI[0]);
}
if (sourceTabbedPane.getTitleAt(index)
.equals(foundStructureSummary))
}
};
pnl_filter.addChangeListener(changeListener);
- pnl_filter.setPreferredSize(new Dimension(500, 300));
+ pnl_filter.setPreferredSize(new Dimension(800, 400));
pnl_filter.add(foundStructureSummary, scrl_foundStructures);
pnl_filter.add(configureCols, pdbDocFieldPrefs);
mainFrame.setVisible(true);
mainFrame.setContentPane(this);
mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- Desktop.addInternalFrame(mainFrame, frameTitle, 800, 400);
+ Desktop.addInternalFrame(mainFrame, frameTitle, 900, 500);
}
public boolean wantedFieldsUpdated()
{
return true;
}
-
- return Arrays.equals(
- PDBFTSRestClient.getInstance()
- .getAllDefaulDisplayedDataColumns()
- .toArray(new FTSDataColumnI[0]),
- previousWantedFields) ? false : true;
+
+ FTSDataColumnI[] currentWantedFields = pdbDocFieldPrefs
+ .getStructureSummaryFields()
+ .toArray(new FTSDataColumnI[0]);
+ return Arrays.equals(currentWantedFields, previousWantedFields) ? false
+ : true;
}
}
}
+ public JTable getResultTable()
+ {
+ return tbl_summary;
+ }
public JComboBox<FilterOption> getCmbFilterOption()
{
return cmb_filterOption;
public void getPrimaryKeyColumIndexTest()
{
Collection<FTSDataColumnI> wantedFields = ftsRestClient
- .getAllDefaulDisplayedDataColumns();
+ .getAllDefaultDisplayedFTSDataColumns();
int foundIndex = -1;
try
{
@Test(groups = { "Functional" })
public void getAllDefaulDisplayedDataColumns()
{
- Assert.assertNotNull(ftsRestClient.getAllDefaulDisplayedDataColumns());
- Assert.assertTrue(!ftsRestClient.getAllDefaulDisplayedDataColumns()
+ Assert.assertNotNull(ftsRestClient.getAllDefaultDisplayedFTSDataColumns());
+ Assert.assertTrue(!ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
.isEmpty());
- Assert.assertEquals(ftsRestClient.getAllDefaulDisplayedDataColumns()
+ Assert.assertEquals(ftsRestClient.getAllDefaultDisplayedFTSDataColumns()
.size(), 7);
}
public void getDataColumnsFieldsAsCommaDelimitedString()
{
Collection<FTSDataColumnI> wantedFields = ftsRestClient
- .getAllDefaulDisplayedDataColumns();
+ .getAllDefaultDisplayedFTSDataColumns();
String actual = ftsRestClient
.getDataColumnsFieldsAsCommaDelimitedString(wantedFields);
Assert.assertEquals(actual,