Author: kono
Date: 2011-01-20 16:52:06 -0800 (Thu, 20 Jan 2011)
New Revision: 23535
Modified:
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/task/ShowBiomartGUIAction.java
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartAttrMappingPanel.java
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartMainDialog.java
Log:
Modified:
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/task/ShowBiomartGUIAction.java
===================================================================
---
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/task/ShowBiomartGUIAction.java
2011-01-21 00:51:55 UTC (rev 23534)
+++
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/task/ShowBiomartGUIAction.java
2011-01-21 00:52:06 UTC (rev 23535)
@@ -56,11 +56,8 @@
@Override
public void actionPerformed(ActionEvent ae) {
// Lazy instantiation. This process depends on network
connection.
- if (dialog == null) {
- // Prepare repository data.
-
+ if (dialog == null) {
logger.debug("BioMart Dialog initialization process
start.");
- //initDataSource();
dialog = new BiomartMainDialog(client, taskManager,
appManager, tblManager, app);
logger.info("BioMart Client dialog initialized.");
}
@@ -70,37 +67,4 @@
logger.info("BioMart Client initialized.");
}
-
-
- private List<String> initDataSource() {
- final ValuedTask<LoadRepositoryResult> firstTask = new
LoadRepositoryTask(client.getRestClient());
- final ValuedTaskExecutor<LoadRepositoryResult> ex =
- new ValuedTaskExecutor<LoadRepositoryResult>(firstTask);
- final BioMartTaskFactory tf = new BioMartTaskFactory(ex);
- taskManager.setParent(dialog);
- taskManager.execute(tf);
-
- LoadRepositoryResult result;
- List<String> dsList = null;
-
- //FIXME
- try {
- result = ex.get();
-
-// this.datasourceMap = result.getDatasourceMap();
- dsList = result.getSortedDataSourceList();
- System.out.println("GOT datasource list from task: " +
dsList);
-// for (String ds : dsList)
-// this.databaseComboBox.addItem(ds);
-
- } catch (CancellationException e) {
- e.printStackTrace();
- } catch (InterruptedException e) {
- e.printStackTrace();
- } catch (ExecutionException e) {
- e.printStackTrace();
- }
-
- return dsList;
- }
}
Modified:
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartAttrMappingPanel.java
===================================================================
---
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartAttrMappingPanel.java
2011-01-21 00:51:55 UTC (rev 23534)
+++
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartAttrMappingPanel.java
2011-01-21 00:52:06 UTC (rev 23535)
@@ -48,6 +48,7 @@
import javax.swing.Icon;
import javax.swing.ImageIcon;
+import org.cytoscape.io.webservice.biomart.BiomartClient;
import org.cytoscape.io.webservice.biomart.BiomartQuery;
import org.cytoscape.io.webservice.biomart.rest.Attribute;
import org.cytoscape.io.webservice.biomart.rest.BiomartRestClient;
@@ -72,9 +73,7 @@
import org.cytoscape.work.ValuedTaskExecutor;
import org.cytoscape.work.swing.GUITaskManager;
-/**
- *
- */
+
public class BiomartAttrMappingPanel extends AttributeImportPanel {
private static final long serialVersionUID = 3574198525811249639L;
@@ -105,8 +104,8 @@
private final CyTableManager tblManager;
private final Window parent;
-
- private final BiomartRestClient restClient;
+
+ private final BiomartClient client;
/**
* Creates a new BiomartNameMappingPanel object.
@@ -117,13 +116,13 @@
* DOCUMENT ME!
* @throws Exception
*/
- public BiomartAttrMappingPanel(final BiomartRestClient client,
+ public BiomartAttrMappingPanel(final BiomartClient client,
final TaskManager taskManager,
final CyApplicationManager appManager,
final CyTableManager tblManager, final Window parent) {
super(LOGO, "Biomart", "Import Settings");
- this.restClient = client;
+ this.client = client;
this.taskManager = taskManager;
this.appManager = appManager;
this.tblManager = tblManager;
@@ -148,13 +147,13 @@
loadMartServiceList();
// Load available filters for current source.
- //loadFilter();
+ loadFilter();
}
public void loadMartServiceList() {
final ValuedTask<LoadRepositoryResult> firstTask = new
LoadRepositoryTask(
- restClient);
+ client.getRestClient());
ValuedTaskExecutor<LoadRepositoryResult> ex = new
ValuedTaskExecutor<LoadRepositoryResult>(
firstTask);
final BioMartTaskFactory tf = new BioMartTaskFactory(ex);
@@ -232,7 +231,7 @@
System.out.println("Calling attribute update task.");
final ImportAttributeListTaskFactory tf = new
ImportAttributeListTaskFactory(
- datasourceName, restClient);
+ datasourceName, client.getRestClient());
final ImportAttributeListTask firstTask =
(ImportAttributeListTask) tf
.getTaskIterator().next();
taskManager.executeAndWait(tf);
@@ -263,7 +262,6 @@
}
}
- System.out.println("!!!!!!!!! attribute update task
1.");
this.attrNameMap.put(selectedDBName, names);
Collections.sort(order);
@@ -281,7 +279,7 @@
} else if (type.equals(SourceType.FILTER)) {
final ImportFilterTaskFactory tf = new
ImportFilterTaskFactory(
- datasourceName, restClient);
+ datasourceName, client.getRestClient());
final ImportFilterTask firstTask = (ImportFilterTask) tf
.getTaskIterator().next();
tf.setTask(firstTask);
@@ -404,25 +402,11 @@
// return mappedKeys;
// }
- private BiomartQuery importAttributesFromService(Dataset dataset,
- Attribute[] attrs, Filter[] filters, String keyInHeader,
- String keyAttrName) {
+
- final String query = XMLQueryBuilder.getQueryString(dataset,
attrs,
- filters);
-
- return new BiomartQuery(query, keyAttrName);
-
-
- // AttributeImportQuery qObj = new AttributeImportQuery(query2,
key,
- // keyAttrName);
-
- }
-
@Override
protected void importAttributes() {
-
-
+ taskManager.execute(client);
}
public BiomartQuery getTableImportQuery() {
@@ -490,5 +474,15 @@
return importAttributesFromService(dataset, attrs, filters,
keyInHeader,
keyAttrName);
}
+
+ private BiomartQuery importAttributesFromService(Dataset dataset,
+ Attribute[] attrs, Filter[] filters, String keyInHeader,
+ String keyAttrName) {
+ final String query = XMLQueryBuilder.getQueryString(dataset,
attrs,
+ filters);
+
+ return new BiomartQuery(query, keyAttrName);
+ }
+
}
Modified:
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartMainDialog.java
===================================================================
---
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartMainDialog.java
2011-01-21 00:51:55 UTC (rev 23534)
+++
core3/webservice-biomart-client/trunk/src/main/java/org/cytoscape/io/webservice/biomart/ui/BiomartMainDialog.java
2011-01-21 00:52:06 UTC (rev 23535)
@@ -39,13 +39,11 @@
import java.awt.GridLayout;
import javax.swing.JDialog;
-import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import org.cytoscape.application.swing.CySwingApplication;
import org.cytoscape.io.webservice.biomart.BiomartClient;
-import org.cytoscape.io.webservice.biomart.rest.BiomartRestClient;
import org.cytoscape.model.CyTableManager;
import org.cytoscape.session.CyApplicationManager;
import org.cytoscape.work.TaskManager;
@@ -89,7 +87,7 @@
tunablePanel.add(tPanel);
- panel = new BiomartAttrMappingPanel(client.getRestClient(),
taskManager, appManager, tblManager, app.getJFrame());
+ panel = new BiomartAttrMappingPanel(client, taskManager,
appManager, tblManager, app.getJFrame());
client.setGUI(panel);
tabs.addTab("Query", panel);
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.