2016-04-06 18:28:32 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2016-04-22 15:49:49 +02:00
|
|
|
package org.gcube.portlets.user.dataminermanager.client.experiments;
|
2016-04-06 18:28:32 +02:00
|
|
|
|
|
|
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
|
|
|
import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
2016-04-21 21:42:53 +02:00
|
|
|
import org.gcube.portlets.user.dataminermanager.client.events.ComputationReadyEvent;
|
|
|
|
import org.gcube.portlets.user.dataminermanager.client.events.ResubmitComputationExecutionEvent;
|
2019-09-27 19:46:36 +02:00
|
|
|
import org.gcube.portlets.user.dataminermanager.client.info.ServiceInfoPanel;
|
2018-05-03 16:24:26 +02:00
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.Operator;
|
2016-04-06 18:28:32 +02:00
|
|
|
|
2016-04-07 20:13:35 +02:00
|
|
|
import com.allen_sauer.gwt.log.client.Log;
|
2016-04-06 18:28:32 +02:00
|
|
|
import com.sencha.gxt.widget.core.client.TabItemConfig;
|
|
|
|
import com.sencha.gxt.widget.core.client.TabPanel;
|
|
|
|
|
|
|
|
/**
|
2016-04-07 20:13:35 +02:00
|
|
|
*
|
2017-05-12 11:58:15 +02:00
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
2016-04-06 18:28:32 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class WorkflowPanel extends TabPanel {
|
2019-09-30 18:40:46 +02:00
|
|
|
private static final String OPERATOR = "Operator";
|
|
|
|
private static final String COMPUTATIONS_EXECUTION = "Computations Execution";
|
|
|
|
private static final String SERVICE_INFO = "Service Profile";
|
|
|
|
|
|
|
|
|
2016-04-07 20:13:35 +02:00
|
|
|
private ComputationExecutionPanel computationExecutionPanel;
|
2016-04-06 18:28:32 +02:00
|
|
|
private ComputationPanel computationPanel;
|
2019-10-03 11:26:37 +02:00
|
|
|
private ServiceInfoPanel serviceInfoPanel;
|
2016-04-06 18:28:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public WorkflowPanel() {
|
|
|
|
super();
|
2016-04-07 20:13:35 +02:00
|
|
|
init();
|
|
|
|
create();
|
2016-04-06 18:28:32 +02:00
|
|
|
bind();
|
2016-04-07 20:13:35 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void init() {
|
2016-04-06 18:28:32 +02:00
|
|
|
setBodyBorder(false);
|
2016-04-07 20:13:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private void create() {
|
|
|
|
|
2019-09-30 18:40:46 +02:00
|
|
|
TabItemConfig tabWorkFlowLcItemConf = new TabItemConfig(OPERATOR,
|
2016-05-02 19:58:14 +02:00
|
|
|
false);
|
2016-04-07 20:13:35 +02:00
|
|
|
tabWorkFlowLcItemConf.setIcon(DataMinerManager.resources
|
|
|
|
.folderExplore());
|
|
|
|
computationPanel = new ComputationPanel();
|
|
|
|
computationPanel
|
2016-04-21 21:42:53 +02:00
|
|
|
.addComputationReadyEventHandler(new ComputationReadyEvent.ComputationReadyEventHandler() {
|
2016-04-07 20:13:35 +02:00
|
|
|
|
|
|
|
@Override
|
2016-04-21 21:42:53 +02:00
|
|
|
public void onReady(ComputationReadyEvent event) {
|
2016-05-02 19:58:14 +02:00
|
|
|
Log.debug("StartComputationEvent Received:" + event);
|
|
|
|
startComputation(event.getOperator());
|
2016-04-08 20:34:05 +02:00
|
|
|
|
2016-04-07 20:13:35 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
add(computationPanel, tabWorkFlowLcItemConf);
|
|
|
|
|
2016-04-06 18:28:32 +02:00
|
|
|
TabItemConfig tabComputationPanelItemConf = new TabItemConfig(
|
2019-09-30 18:40:46 +02:00
|
|
|
COMPUTATIONS_EXECUTION, false);
|
2016-04-07 20:13:35 +02:00
|
|
|
tabComputationPanelItemConf.setIcon(DataMinerManager.resources
|
|
|
|
.folderExplore());
|
|
|
|
computationExecutionPanel = new ComputationExecutionPanel();
|
|
|
|
add(computationExecutionPanel, tabComputationPanelItemConf);
|
2019-09-27 19:46:36 +02:00
|
|
|
|
2019-10-03 11:26:37 +02:00
|
|
|
TabItemConfig tabServiceInfoPanelItemConf = new TabItemConfig(
|
2019-09-30 18:40:46 +02:00
|
|
|
SERVICE_INFO, false);
|
2019-10-03 11:26:37 +02:00
|
|
|
tabServiceInfoPanelItemConf.setIcon(DataMinerManager.resources
|
2019-09-27 19:46:36 +02:00
|
|
|
.folderExplore());
|
2019-10-03 11:26:37 +02:00
|
|
|
serviceInfoPanel = new ServiceInfoPanel();
|
|
|
|
add(serviceInfoPanel, tabServiceInfoPanelItemConf);
|
2016-04-06 18:28:32 +02:00
|
|
|
|
|
|
|
setActiveWidget(computationPanel);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2016-04-07 20:13:35 +02:00
|
|
|
private void bind() {
|
2016-05-02 19:58:14 +02:00
|
|
|
EventBusProvider.INSTANCE
|
|
|
|
.addHandler(
|
|
|
|
ResubmitComputationExecutionEvent.getType(),
|
|
|
|
new ResubmitComputationExecutionEvent.ResubmitComputationExecutionEventHandler() {
|
|
|
|
@Override
|
|
|
|
public void onResubmit(
|
|
|
|
ResubmitComputationExecutionEvent event) {
|
|
|
|
resubmitComputation();
|
|
|
|
}
|
|
|
|
});
|
2016-04-06 18:28:32 +02:00
|
|
|
}
|
2016-05-02 19:58:14 +02:00
|
|
|
|
2016-04-21 21:42:53 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2016-05-02 19:58:14 +02:00
|
|
|
private void resubmitComputation() {
|
2016-04-21 21:42:53 +02:00
|
|
|
setActiveWidget(computationExecutionPanel);
|
|
|
|
}
|
2016-04-06 18:28:32 +02:00
|
|
|
|
|
|
|
/**
|
2016-04-07 20:13:35 +02:00
|
|
|
* @param computationTitle
|
|
|
|
* @param operator
|
2016-04-06 18:28:32 +02:00
|
|
|
*
|
|
|
|
*/
|
2016-05-02 19:58:14 +02:00
|
|
|
private void startComputation(Operator op) {
|
2016-04-08 20:34:05 +02:00
|
|
|
setActiveWidget(computationExecutionPanel);
|
2016-05-02 19:58:14 +02:00
|
|
|
computationExecutionPanel.startNewComputation(op);
|
|
|
|
|
2016-04-06 18:28:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void addOperator(Operator op) {
|
2016-04-07 20:13:35 +02:00
|
|
|
setActiveWidget(computationPanel);
|
2016-04-08 20:34:05 +02:00
|
|
|
computationPanel.addOperator(op);
|
2016-04-07 20:13:35 +02:00
|
|
|
|
2016-04-06 18:28:32 +02:00
|
|
|
}
|
2016-05-02 19:58:14 +02:00
|
|
|
|
2016-04-06 18:28:32 +02:00
|
|
|
}
|