X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDasSourceBrowser.java;h=afacb41f3d9eab4c72664bf12b33227b083943f9;hb=df9b85c1cf39894039018499fe802406cc37f209;hp=0f4cf5f0b7da83fc828ac2a47332e18ccf090bc3;hpb=bf2bf43c980b18a26b724d2a2d51dddc1a79a185;p=jalview.git diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java index 0f4cf5f..afacb41 100755 --- a/src/jalview/gui/DasSourceBrowser.java +++ b/src/jalview/gui/DasSourceBrowser.java @@ -51,9 +51,9 @@ public class DasSourceBrowser extends GDasSourceBrowser displayFullDetails(null); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - capabilities.addListSelectionListener(this); - coords1.addListSelectionListener(this); - coords2.addListSelectionListener(this); + filter1.addListSelectionListener(this); + filter2.addListSelectionListener(this); + filter3.addListSelectionListener(this); //Ask to be notified of selection changes. ListSelectionModel rowSM = table.getSelectionModel(); @@ -273,49 +273,53 @@ public class DasSourceBrowser extends GDasSourceBrowser private void setCapabilities(DasSource[] sources) { - Vector vcapabilities = new Vector(); - Vector vcoords = new Vector(); - Vector vcoords2 = new Vector(); + Vector authority = new Vector(); + Vector type = new Vector(); + Vector label = new Vector(); - vcapabilities.addElement("All"); - vcoords.addElement("All"); - vcoords2.addElement("All"); + authority.addElement("Any"); + type.addElement("Any"); + label.addElement("Any"); + label.addElement("NOT IMPLEMENTED YET"); + filter3.setEnabled(false); for (int i = 0; i < sources.length; i++) { DasSource ds = sources[i]; - String[] scap = ds.getCapabilities(); - for (int s = 0; s < scap.length; s++) - { - if (!vcapabilities.contains(scap[s])) - { - vcapabilities.addElement(scap[s]); - } - } DasCoordinateSystem[] dcs = ds.getCoordinateSystem(); for (int j = 0; j < dcs.length; j++) { - if (!vcoords.contains(dcs[j].getCategory())) - vcoords.addElement(dcs[j].getCategory()); + if (!type.contains(dcs[j].getCategory())) + type.addElement(dcs[j].getCategory()); + + if (!authority.contains(dcs[j].getName())) + authority.addElement(dcs[j].getName()); + } - if (!vcoords2.contains(dcs[j].getName())) - vcoords2.addElement(dcs[j].getName()); + String[] slabels = ds.getLabels(); + for (int s = 0; s < slabels.length; s++) + { + if (!label.contains(slabels[s])) + { + label.addElement(slabels[s]); + } } + } - capabilities.setListData(vcapabilities); - coords1.setListData(vcoords); - coords2.setListData(vcoords2); + filter1.setListData(authority); + filter2.setListData(type); + filter3.setListData(label); javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { - capabilities.setSelectedIndex(0); - coords1.setSelectedIndex(0); - coords2.setSelectedIndex(0); + filter1.setSelectedIndex(0); + filter2.setSelectedIndex(0); + filter3.setSelectedIndex(0); } }); } @@ -553,7 +557,7 @@ public class DasSourceBrowser extends GDasSourceBrowser { ds = dasSources[i]; - if (!selectedInList(capabilities, ds.getCapabilities())) + if (!selectedInList(filter3, ds.getLabels())) { continue; } @@ -561,10 +565,10 @@ public class DasSourceBrowser extends GDasSourceBrowser DasCoordinateSystem[] dcs = ds.getCoordinateSystem(); for (int j = 0; j < dcs.length; j++) { - if (selectedInList(coords1, new String[] - {dcs[j].getCategory()}) - && selectedInList(coords2, new String[] - {dcs[j].getName()})) + if (selectedInList(filter1, new String[] + {dcs[j].getName()}) + && selectedInList(filter2, new String[] + {dcs[j].getCategory()})) { names.add(ds.getNickname()); selected.add(new Boolean( @@ -590,7 +594,7 @@ public class DasSourceBrowser extends GDasSourceBrowser Object[] selection = list.getSelectedValues(); for (int i = 0; i < selection.length; i++) { - if (selection[i].equals("All")) + if (selection[i].equals("Any")) return true; for (int j = 0; j < items.length; j++)