ref 17252: Enable DEA Analysis

https://support.d4science.org/issues/17252

Updated DEA Analysis

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/performfish-analytics-portlet@182239 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2019-11-08 16:53:37 +00:00
parent cd34779008
commit 5ba3a81d18
15 changed files with 151 additions and 221 deletions

View File

@ -286,6 +286,7 @@
</executions> </executions>
<configuration> <configuration>
<webappDirectory>${webappDirectory}</webappDirectory> <webappDirectory>${webappDirectory}</webappDirectory>
<warName>${project.build.finalName}</warName>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -301,7 +302,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration> <configuration>
<descriptors> <descriptors>
<descriptor>${distroDirectory}/descriptor.xml</descriptor> <descriptor>${distroDirectory}/descriptor.xml</descriptor>

View File

@ -564,7 +564,6 @@ public class PerformFishAnnualAnalyticsController {
DeaAnnualPanelResult deaAnnualPanelResult = new DeaAnnualPanelResult(); DeaAnnualPanelResult deaAnnualPanelResult = new DeaAnnualPanelResult();
deaAnnualPanelResult.addSelectedKPIs(selectedKPI); deaAnnualPanelResult.addSelectedKPIs(selectedKPI);
deaAnnualPanelResult.addListFocusIds(focusIds);
deaAnnualPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters, deaAnnualPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters,
viewAnnualController.getForm().getBatchType()); viewAnnualController.getForm().getBatchType());
submitRequestPanel.addWidget(deaAnnualPanelResult); submitRequestPanel.addWidget(deaAnnualPanelResult);

View File

@ -172,8 +172,8 @@ public class PerformFishAnalyticsController {
selectedKPI.getSelectedPopulationType()); selectedKPI.getSelectedPopulationType());
int selectedKPIsSize = viewController.getSelectedKPIs().size(); int selectedKPIsSize = viewController.getSelectedKPIs().size();
// viewController.manageAlgorithmsSubmit(selectedKPIsSize); // viewController.manageAlgorithmsSubmit(selectedKPIsSize);
List<String> batchIds = viewController.getSelectedBatchID(); String selectedBatchId = viewController.getSelectedBatchID();
if (batchIds == null || batchIds.size() == 0) { if (selectedBatchId == null || selectedBatchId.isEmpty()) {
viewController.enableAllAlgorithmsForSubmit(false); viewController.enableAllAlgorithmsForSubmit(false);
} else } else
viewController.manageAlgorithmsSubmit(selectedKPIsSize); viewController.manageAlgorithmsSubmit(selectedKPIsSize);
@ -303,13 +303,13 @@ public class PerformFishAnalyticsController {
case BOXPLOT: case BOXPLOT:
// UNARY // UNARY
callAlgorithm(submitRequestEvent.getChartType(), viewController.getSelectedBatchID().get(0), callAlgorithm(submitRequestEvent.getChartType(), viewController.getSelectedBatchID(),
selectedKPI, null); selectedKPI, null);
break; break;
case SCATTER: case SCATTER:
if (selectedKPI.size() == 2) if (selectedKPI.size() == 2)
callAlgorithm(submitRequestEvent.getChartType(), viewController.getSelectedBatchID().get(0), callAlgorithm(submitRequestEvent.getChartType(), viewController.getSelectedBatchID(),
selectedKPI, null); selectedKPI, null);
else else
Window.alert("Something seems wrong... You must select exactly two KPIs to execute the " Window.alert("Something seems wrong... You must select exactly two KPIs to execute the "
@ -321,7 +321,7 @@ public class PerformFishAnalyticsController {
break; break;
case SPEEDOMETER: case SPEEDOMETER:
// UNARY // UNARY
callAlgorithm(submitRequestEvent.getChartType(), viewController.getSelectedBatchID().get(0), callAlgorithm(submitRequestEvent.getChartType(), viewController.getSelectedBatchID(),
selectedKPI, selectedKPI); selectedKPI, selectedKPI);
break; break;
case DEA_ANALYSIS: case DEA_ANALYSIS:
@ -494,7 +494,7 @@ public class PerformFishAnalyticsController {
dataInputsFormatter dataInputsFormatter
.append(PerformFishAnalyticsConstant.DM_CHARTTYPE_PARAM + "=" + DataMinerAlgorithms.CORRELATION + ";"); .append(PerformFishAnalyticsConstant.DM_CHARTTYPE_PARAM + "=" + DataMinerAlgorithms.CORRELATION + ";");
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FARMFILE_PARAM + "=" + batchTableURL + ";"); dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FARMFILE_PARAM + "=" + batchTableURL + ";");
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM + "=ID;"); dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM + "="+viewController.getSelectedBatchID()+";");
String kpiCodes = ""; String kpiCodes = "";
for (KPI kpi : viewController.getSelectedKPIs()) { for (KPI kpi : viewController.getSelectedKPIs()) {
@ -518,11 +518,9 @@ public class PerformFishAnalyticsController {
PerformFishResources.INSTANCE.batch_DEAANALYSIS().getText(), submitRequestPanel); PerformFishResources.INSTANCE.batch_DEAANALYSIS().getText(), submitRequestPanel);
viewController.noSpinner(tab); viewController.noSpinner(tab);
final List<KPI> selectedKPI = new ArrayList<KPI>(viewController.getSelectedKPIs()); final List<KPI> selectedKPI = new ArrayList<KPI>(viewController.getSelectedKPIs());
final List<String> batchIDs = new ArrayList<String>(viewController.getListBatchesID());
DeaPanelResult deaPanelResult = new DeaPanelResult(); DeaPanelResult deaPanelResult = new DeaPanelResult();
deaPanelResult.addSelectedKPIs(selectedKPI); deaPanelResult.addSelectedKPIs(selectedKPI);
deaPanelResult.addListFocusIds(batchIDs);
deaPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters, deaPanelResult.addParameters(PerformFishAnalyticsConstant.DATA_INPUTS, mapParameters,
viewController.getForm().getBatchType()); viewController.getForm().getBatchType());
submitRequestPanel.addWidget(deaPanelResult); submitRequestPanel.addWidget(deaPanelResult);
@ -652,9 +650,9 @@ public class PerformFishAnalyticsController {
private void callAlgorithm(DataMinerAlgorithms algorithm, String focusID, List<KPI> inputKPI, private void callAlgorithm(DataMinerAlgorithms algorithm, String focusID, List<KPI> inputKPI,
final List<KPI> outputKPI) { final List<KPI> outputKPI) {
List<String> listBatchID = viewController.getSelectedBatchID(); String selectedBatchID = viewController.getSelectedBatchID();
if (listBatchID == null || listBatchID.size() == 0) if (selectedBatchID == null || selectedBatchID.isEmpty())
Window.alert("Something seems wrong, no selected BatchID, try again"); Window.alert("Something seems wrong, no selected BatchID, try again");
// submitRequestPanel.getElement().addClassName("ext-horizontal-panel"); // submitRequestPanel.getElement().addClassName("ext-horizontal-panel");
@ -782,8 +780,7 @@ public class PerformFishAnalyticsController {
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_CHARTTYPE_PARAM + "=" + chartType + ";"); dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_CHARTTYPE_PARAM + "=" + chartType + ";");
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FARMFILE_PARAM + "=" + batchTableURL + ";"); dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FARMFILE_PARAM + "=" + batchTableURL + ";");
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM + "=" + focusID + ";"); dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM + "=" + focusID + ";");
// dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM+"=ID;");
if (inputKPI != null && inputKPI.size() > 0) { if (inputKPI != null && inputKPI.size() > 0) {
String kpiCodes = ""; String kpiCodes = "";
for (KPI kpi : inputKPI) { for (KPI kpi : inputKPI) {
@ -943,7 +940,7 @@ public class PerformFishAnalyticsController {
break; break;
case SPEEDOMETER: case SPEEDOMETER:
title = chartType.getTitle() + "<br>"; title = chartType.getTitle() + "<br>";
title += "Selected BATCH ID: " + focusID + "<br>"; title += "Selected Batch ID: " + focusID + "<br>";
title += "Normalized with respect to all batches in the VRE"; title += "Normalized with respect to all batches in the VRE";
break; break;
case DEA_CHART: case DEA_CHART:

View File

@ -551,7 +551,7 @@ public class PerformFishAnalyticsViewController {
* *
* @return the selected batch id * @return the selected batch id
*/ */
public List<String> getSelectedBatchID() { public String getSelectedBatchID() {
return batchIDAndListKPI.getSelectedBatchID(); return batchIDAndListKPI.getSelectedBatchID();

View File

@ -1 +1 @@
The correlation matrix is a table displaying the correlation between pairs of KPIs. Correlation coefficients are calculated using the Person parametric correation test and coloured according to the value in red (significant positive correlation), yellow (significant negative correlation), and in light blue (non-significant correlation). The Student t-test is used to determine the ranges of correlation for Pearson coefficients. The correlation matrix is a table displaying the correlation between pairs of KPIs. Correlation coefficients are calculated using the Person parametric correlation test and coloured according to the value in red (significant positive correlation), yellow (significant negative correlation), and in light blue (non-significant correlation). The Student t-test is used to determine the ranges of correlation for Pearson coefficients.

View File

@ -9,7 +9,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.gcube.portlets.user.performfishanalytics.client.DataMinerAlgorithms; import org.gcube.portlets.user.performfishanalytics.client.DataMinerAlgorithms;
import org.gcube.portlets.user.performfishanalytics.client.PerformFishAnalyticsConstant;
import org.gcube.portlets.user.performfishanalytics.client.PerformFishAnalyticsServiceAsync; import org.gcube.portlets.user.performfishanalytics.client.PerformFishAnalyticsServiceAsync;
import org.gcube.portlets.user.performfishanalytics.client.controllers.PerformFishAnalyticsController; import org.gcube.portlets.user.performfishanalytics.client.controllers.PerformFishAnalyticsController;
import org.gcube.portlets.user.performfishanalytics.client.event.CallAlgorithmEvent; import org.gcube.portlets.user.performfishanalytics.client.event.CallAlgorithmEvent;
@ -257,7 +256,7 @@ public class AnalyticsAnnualPanelResult extends Composite {
flexTable.setWidget(2, 0, new HTML("KPI:")); flexTable.setWidget(2, 0, new HTML("KPI:"));
flexTable.setWidget(2, 1, new HTML(KPINames)); flexTable.setWidget(2, 1, new HTML(KPINames));
uib_label_focus_id.setText("FOCUS ID");
} catch (Exception e) { } catch (Exception e) {
// silent // silent

View File

@ -14,17 +14,6 @@
addStyleNames="the_margin_top_bottom"> addStyleNames="the_margin_top_bottom">
<b:Label text="Parameters"></b:Label> <b:Label text="Parameters"></b:Label>
</g:VerticalPanel> </g:VerticalPanel>
<g:HorizontalPanel addStyleNames="the_margin_top">
<g:Label ui:field="uib_label_focus_id">Focus ID</g:Label>
<b:ControlGroup ui:field="cg_focus_id_correlation">
<b:Controls>
<b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation"
ui:field="field_list_focus_id_correlation" multipleSelect="false"
addStyleNames="the_margin_left">
</b:ListBox>
</b:Controls>
</b:ControlGroup>
</g:HorizontalPanel>
</g:VerticalPanel> </g:VerticalPanel>
<g:VerticalPanel ui:field="field_results" <g:VerticalPanel ui:field="field_results"
@ -32,6 +21,17 @@
<b:Label text="CORRELATION Matrix"></b:Label> <b:Label text="CORRELATION Matrix"></b:Label>
<g:VerticalPanel ui:field="uib_vp_correlation_results_container" <g:VerticalPanel ui:field="uib_vp_correlation_results_container"
addStyleNames="the_margin_left"> addStyleNames="the_margin_left">
<g:HorizontalPanel addStyleNames="the_margin_top">
<g:Label ui:field="uib_label_focus_id">Focus ID</g:Label>
<b:ControlGroup ui:field="cg_focus_id_correlation">
<b:Controls>
<b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation"
ui:field="field_list_focus_id_correlation" multipleSelect="false"
addStyleNames="the_margin_left">
</b:ListBox>
</b:Controls>
</b:ControlGroup>
</g:HorizontalPanel>
</g:VerticalPanel> </g:VerticalPanel>

View File

@ -41,7 +41,6 @@ import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
@ -74,15 +73,6 @@ public class DeaAnnualPanelResult extends Composite {
@UiField @UiField
VerticalPanel field_parameters_container; VerticalPanel field_parameters_container;
@UiField
Label uib_label_focus_id;
@UiField
ControlGroup cg_focus_id_correlation;
@UiField
ListBox field_list_focus_id_correlation;
@UiField @UiField
ComplexPanel alert_info; ComplexPanel alert_info;
@ -428,18 +418,7 @@ public class DeaAnnualPanelResult extends Composite {
return dataInputParameters; return dataInputParameters;
} }
/**
* Adds the list focus ids.
*
* @param listFocusIDs
* the list focus I ds
*/
public void addListFocusIds(List<String> listFocusIDs) {
for (String batchID : listFocusIDs) {
field_list_focus_id_correlation.addItem(batchID, batchID);
}
}
/** /**
* Show alert. * Show alert.
* *
@ -549,18 +528,18 @@ public class DeaAnnualPanelResult extends Composite {
// flexTable.setWidget(1, 0, new HTML("Level:")); // flexTable.setWidget(1, 0, new HTML("Level:"));
// flexTable.setWidget(1, 1, new // flexTable.setWidget(1, 1, new
// HTML(dataInputParameters.get(PerformFishAnalyticsConstant.DM_SCALEP_PARAM))); // HTML(dataInputParameters.get(PerformFishAnalyticsConstant.DM_SCALEP_PARAM)));
//flexTable.setWidget(1, 0, new HTML("Focus ID:"));
//flexTable.setWidget(1, 1, new HTML(dataInputParameters.get(PerformFishAnalyticsConstant.DM_FOCUS_PARAM)));
String KPINames = ""; String KPINames = "";
for (KPI kpi : selectedKPIs) { for (KPI kpi : selectedKPIs) {
KPINames += kpi.getName() + ", "; KPINames += kpi.getName() + ", ";
} }
KPINames = KPINames.substring(0, KPINames.length() - 2); KPINames = KPINames.substring(0, KPINames.length() - 2);
flexTable.setWidget(2, 0, new HTML("KPI:")); flexTable.setWidget(1, 0, new HTML("KPI:"));
flexTable.setWidget(2, 1, new HTML(KPINames)); flexTable.setWidget(1, 1, new HTML(KPINames));
// CHANGING LABEL TEXT TO SCAPE_PARAM
// uib_label_focus_id.setText(dataInputParameters.get(PerformFishAnalyticsConstant.DM_SCALEP_PARAM)
// + " ID");
fillDeaListBoxes(); fillDeaListBoxes();
@ -629,7 +608,7 @@ public class DeaAnnualPanelResult extends Composite {
hp.add(deaAnalysis); hp.add(deaAnalysis);
uib_vp_deanalanlysis_algorithm_container.add(hp); uib_vp_deanalanlysis_algorithm_container.add(hp);
// TODO
final FlexTable flexTable = new FlexTable(); final FlexTable flexTable = new FlexTable();
flexTable.setStyleName("colgrouptable"); flexTable.setStyleName("colgrouptable");
@ -753,7 +732,7 @@ public class DeaAnnualPanelResult extends Composite {
case BOXPLOT: case BOXPLOT:
break; break;
case SPEEDOMETER: case SPEEDOMETER:
title += " " + uib_label_focus_id.getText() + ": " + focusID; title += " Focus ID: " + focusID;
break; break;
case CORRELATION: case CORRELATION:
break; break;
@ -803,7 +782,7 @@ public class DeaAnnualPanelResult extends Composite {
title += " Statistics on all data"; title += " Statistics on all data";
break; break;
case SPEEDOMETER: case SPEEDOMETER:
title += " " + uib_label_focus_id.getText() + ": " + focusID; title += " Focus ID: " + focusID;
break; break;
case CORRELATION: case CORRELATION:
break; break;

View File

@ -14,18 +14,6 @@
addStyleNames="the_margin_top_bottom"> addStyleNames="the_margin_top_bottom">
<b:Label text="Parameters"></b:Label> <b:Label text="Parameters"></b:Label>
</g:VerticalPanel> </g:VerticalPanel>
<g:HorizontalPanel addStyleNames="the_margin_top">
<g:Label ui:field="uib_label_focus_id" addStyleNames="the_margin_left">Focus
ID</g:Label>
<b:ControlGroup ui:field="cg_focus_id_correlation">
<b:Controls>
<b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation"
ui:field="field_list_focus_id_correlation" multipleSelect="false"
addStyleNames="the_margin_left">
</b:ListBox>
</b:Controls>
</b:ControlGroup>
</g:HorizontalPanel>
</g:VerticalPanel> </g:VerticalPanel>
@ -108,9 +96,10 @@
<g:VerticalPanel ui:field="uib_vp_deanalanlysis_algorithm" <g:VerticalPanel ui:field="uib_vp_deanalanlysis_algorithm"
addStyleNames="the_margin_top_bottom" visible="false"> addStyleNames="the_margin_top_bottom" visible="false">
<b:Label text="DEA ANALYSIS Results" type="INFO"></b:Label> <b:Label text="DEA ANALYSIS Results" type="INFO"></b:Label>
<g:HorizontalPanel verticalAlignment="ALIGN_TOP" horizontalAlignment="ALIGN_LEFT"> <g:HorizontalPanel verticalAlignment="ALIGN_TOP"
horizontalAlignment="ALIGN_LEFT">
<g:VerticalPanel ui:field="uib_vp_deanalanlysis_algorithm_container" <g:VerticalPanel ui:field="uib_vp_deanalanlysis_algorithm_container"
addStyleNames="the_margin_left" horizontalAlignment="ALIGN_LEFT"> addStyleNames="the_margin_left" horizontalAlignment="ALIGN_LEFT">
</g:VerticalPanel> </g:VerticalPanel>
</g:HorizontalPanel> </g:HorizontalPanel>
</g:VerticalPanel> </g:VerticalPanel>

View File

@ -265,8 +265,7 @@ public class AnalyticsPanelResult extends Composite {
flexTable.setWidget(2, 1, new HTML(KPINames)); flexTable.setWidget(2, 1, new HTML(KPINames));
//CHANGING LABEL TEXT TO SCAPE_PARAM
uib_label_focus_id.setText(dataInputParameters.get(PerformFishAnalyticsConstant.DM_SCALEP_PARAM) + " ID");
}catch(Exception e){ }catch(Exception e){
//silent //silent

View File

@ -14,18 +14,6 @@
addStyleNames="the_margin_top_bottom"> addStyleNames="the_margin_top_bottom">
<b:Label text="Parameters"></b:Label> <b:Label text="Parameters"></b:Label>
</g:VerticalPanel> </g:VerticalPanel>
<g:HorizontalPanel addStyleNames="the_margin_top">
<g:Label ui:field="uib_label_focus_id" addStyleNames="the_margin_left">Focus
ID</g:Label>
<b:ControlGroup ui:field="cg_focus_id_correlation">
<b:Controls>
<b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation"
ui:field="field_list_focus_id_correlation" multipleSelect="false"
addStyleNames="the_margin_left">
</b:ListBox>
</b:Controls>
</b:ControlGroup>
</g:HorizontalPanel>
</g:VerticalPanel> </g:VerticalPanel>
<g:VerticalPanel ui:field="field_results" <g:VerticalPanel ui:field="field_results"
@ -33,6 +21,19 @@
<b:Label text="CORRELATION Matrix"></b:Label> <b:Label text="CORRELATION Matrix"></b:Label>
<g:VerticalPanel ui:field="uib_vp_correlation_results_container" <g:VerticalPanel ui:field="uib_vp_correlation_results_container"
addStyleNames="the_margin_left"> addStyleNames="the_margin_left">
<g:HorizontalPanel addStyleNames="the_margin_top">
<g:Label ui:field="uib_label_focus_id" addStyleNames="the_margin_left">Batch
ID</g:Label>
<b:ControlGroup ui:field="cg_focus_id_correlation">
<b:Controls>
<b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation"
ui:field="field_list_focus_id_correlation" multipleSelect="false"
addStyleNames="the_margin_left">
</b:ListBox>
</b:Controls>
</b:ControlGroup>
</g:HorizontalPanel>
</g:VerticalPanel> </g:VerticalPanel>
<g:VerticalPanel ui:field="field_unary_algorithm" <g:VerticalPanel ui:field="field_unary_algorithm"

View File

@ -37,29 +37,24 @@ import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
// TODO: Auto-generated Javadoc
/** /**
* The Class BatchIDAndListKPIView. * The Class BatchIDAndListKPIView.
* *
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* Feb 28, 2019 * Feb 28, 2019
*/ */
public class BatchIDAndListKPIView extends Composite { public class BatchIDAndListKPIView extends Composite {
/** The ui binder. */ /** The ui binder. */
private static BatchIDAndListKPIViewUiBinder uiBinder = private static BatchIDAndListKPIViewUiBinder uiBinder = GWT.create(BatchIDAndListKPIViewUiBinder.class);
GWT.create(BatchIDAndListKPIViewUiBinder.class);
/** /**
* The Interface BatchIDAndListKPIViewUiBinder. * The Interface BatchIDAndListKPIViewUiBinder.
* *
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) * @author Francesco Mangiacrapa at ISTI-CNR
* Feb 28, 2019 * (francesco.mangiacrapa@isti.cnr.it) Feb 28, 2019
*/ */
interface BatchIDAndListKPIViewUiBinder interface BatchIDAndListKPIViewUiBinder extends UiBinder<Widget, BatchIDAndListKPIView> {
extends UiBinder<Widget, BatchIDAndListKPIView> {
} }
/** The the panel container. */ /** The the panel container. */
@ -77,7 +72,7 @@ public class BatchIDAndListKPIView extends Composite {
/** The cg batch id. */ /** The cg batch id. */
@UiField @UiField
ControlGroup cg_batch_id; ControlGroup cg_batch_id;
/** The uib button load batches. */ /** The uib button load batches. */
@UiField @UiField
Button uib_button_load_batches; Button uib_button_load_batches;
@ -88,11 +83,9 @@ public class BatchIDAndListKPIView extends Composite {
/** The map parameters. */ /** The map parameters. */
private Map<String, List<String>> mapParameters; private Map<String, List<String>> mapParameters;
/** The list batches ID. */ /** The list batches ID. */
private List<String> listBatchesID = new ArrayList<String>(); private List<String> listBatchesID = new ArrayList<String>();
/** /**
* Instantiates a new batch id and list kpi view. * Instantiates a new batch id and list kpi view.
*/ */
@ -100,10 +93,9 @@ public class BatchIDAndListKPIView extends Composite {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
uib_list_batch_id.setEnabled(false); uib_list_batch_id.setEnabled(false);
uib_button_load_batches.addClickHandler(new ClickHandler() { uib_button_load_batches.addClickHandler(new ClickHandler() {
@Override @Override
public void onClick(ClickEvent event) { public void onClick(ClickEvent event) {
PerformFishAnalyticsController.eventBus.fireEvent(new LoadBatchesEvent()); PerformFishAnalyticsController.eventBus.fireEvent(new LoadBatchesEvent());
@ -111,13 +103,13 @@ public class BatchIDAndListKPIView extends Composite {
}); });
} }
/** /**
* Adds the. * Adds the.
* *
* @param w the w * @param w
* the w
*/ */
public void add(Widget w){ public void add(Widget w) {
the_panel_container.add(w); the_panel_container.add(w);
} }
@ -127,71 +119,54 @@ public class BatchIDAndListKPIView extends Composite {
* *
* @return the all batches ID * @return the all batches ID
*/ */
public List<String> getAllBatchesID(){ public List<String> getAllBatchesID() {
return listBatchesID; return listBatchesID;
} }
/**
* Gets the selected.
*
* @param listBox the list box
* @return the selected
*/
private List<String> getSelected(ListBox listBox){
if(listBox==null)
listBox = uib_list_batch_id;
List<String> selected = new ArrayList<String>();
for (int i=0; i<listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selected.add(listBox.getValue(i)); //reading the value
}
}
return selected;
}
/** /**
* Gets the selected batch id. * Gets the selected batch id.
* *
* @return the selected batch id * @return the selected batch id
*/ */
public List<String> getSelectedBatchID(){ public String getSelectedBatchID() {
return getSelected(uib_list_batch_id);
return uib_list_batch_id.getSelectedItemText();
} }
/** /**
* Manage perform fish service response. * Manage perform fish service response.
* *
* @param performFishResponse the perform fish response * @param performFishResponse
* @param mapParameters the map parameters * the perform fish response
* @param level the level * @param mapParameters
* the map parameters
* @param level
* the level
*/ */
public void managePerformFishServiceResponse( public void managePerformFishServiceResponse(PerformFishResponse performFishResponse,
PerformFishResponse performFishResponse, Map<String, List<String>> mapParameters, final POPULATION_LEVEL level) {
Map<String, List<String>> mapParameters, final POPULATION_LEVEL level) {
this.performFishResponse = performFishResponse; this.performFishResponse = performFishResponse;
this.mapParameters = mapParameters; this.mapParameters = mapParameters;
GWT.log("PerformFish Response: "+performFishResponse); GWT.log("PerformFish Response: " + performFishResponse);
String fileURL = performFishResponse.getMapParameters().get(PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL); String fileURL = performFishResponse.getMapParameters()
.get(PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL);
GWT.log("BatchesTable_internal is: "+fileURL); GWT.log("BatchesTable_internal is: " + fileURL);
//Resetting batch ID and panel error after calling Perform Fish Service // Resetting batch ID and panel error after calling Perform Fish Service
resetBatchIdStatus(); resetBatchIdStatus();
//Managing the Perform Fish Service Response // Managing the Perform Fish Service Response
if(fileURL==null){ if (fileURL == null) {
showAlert("No select found for "+PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL, AlertType.ERROR, false, the_panel_error); showAlert("No select found for " + PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL, AlertType.ERROR,
}else{ false, the_panel_error);
} else {
final LoaderIcon loader = new LoaderIcon("Loading Values..."); final LoaderIcon loader = new LoaderIcon("Loading Values...");
the_panel_container.insert(loader, 1); the_panel_container.insert(loader, 1);
//field_list_focus_id_dea.setEnabled(false); // field_list_focus_id_dea.setEnabled(false);
uib_list_batch_id.setEnabled(false); uib_list_batch_id.setEnabled(false);
PerformFishAnalyticsServiceAsync.Util.getInstance().readCSVFile(fileURL, new AsyncCallback<CSVFile>() { PerformFishAnalyticsServiceAsync.Util.getInstance().readCSVFile(fileURL, new AsyncCallback<CSVFile>() {
@ -209,35 +184,38 @@ public class BatchIDAndListKPIView extends Composite {
loader.setVisible(false); loader.setVisible(false);
the_panel_container.remove(loader); the_panel_container.remove(loader);
if(result==null){ if (result == null) {
showAlert("No value found for "+PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL, AlertType.ERROR, false, the_panel_error); showAlert("No value found for " + PerformFishAnalyticsConstant.BATCHES_TABLE_INTERNAL,
AlertType.ERROR, false, the_panel_error);
enableButtonLoadBatches(false); enableButtonLoadBatches(false);
return; return;
} }
//field_list_focus_id_dea.setEnabled(true); // field_list_focus_id_dea.setEnabled(true);
uib_list_batch_id.setEnabled(true); uib_list_batch_id.setEnabled(true);
//IT CAN BE "BATCH", "FARM", etc. // IT CAN BE "BATCH", "FARM", etc.
String theScalePParamValue = level.name(); String theScalePParamValue = level.name();
int indexOfTheScaleValue = result.getHeaderRow().getListValues().indexOf(theScalePParamValue); int indexOfTheScaleValue = result.getHeaderRow().getListValues().indexOf(theScalePParamValue);
if(indexOfTheScaleValue>-1){ if (indexOfTheScaleValue > -1) {
List<CSVRow> rows = result.getValueRows(); List<CSVRow> rows = result.getValueRows();
if(rows==null || rows.isEmpty()){ if (rows == null || rows.isEmpty()) {
PerformFishAnalyticsController.eventBus.fireEvent(new AddedBatchIdEvent()); PerformFishAnalyticsController.eventBus.fireEvent(new AddedBatchIdEvent());
return; return;
} }
for (CSVRow row : rows) { for (CSVRow row : rows) {
String valuePerScaleP = row.getListValues().get(indexOfTheScaleValue); String valuePerScaleP = row.getListValues().get(indexOfTheScaleValue);
//field_list_focus_id_dea.addItem(valuePerScaleP, valuePerScaleP); // field_list_focus_id_dea.addItem(valuePerScaleP,
// valuePerScaleP);
uib_list_batch_id.addItem(valuePerScaleP, valuePerScaleP); uib_list_batch_id.addItem(valuePerScaleP, valuePerScaleP);
listBatchesID.add(valuePerScaleP); listBatchesID.add(valuePerScaleP);
} }
uib_list_batch_id.addItem(PerformFishAnalyticsConstant.DM_FOCUS_ID_ALL_ITEM_TEXT, PerformFishAnalyticsConstant.DM_FOCUS_ID_ALL_ITEM_VALUE); uib_list_batch_id.addItem(PerformFishAnalyticsConstant.DM_FOCUS_ID_ALL_ITEM_TEXT,
PerformFishAnalyticsConstant.DM_FOCUS_ID_ALL_ITEM_VALUE);
listBatchesID.add(PerformFishAnalyticsConstant.DM_FOCUS_ID_ALL_ITEM_VALUE); listBatchesID.add(PerformFishAnalyticsConstant.DM_FOCUS_ID_ALL_ITEM_VALUE);
PerformFishAnalyticsController.eventBus.fireEvent(new AddedBatchIdEvent()); PerformFishAnalyticsController.eventBus.fireEvent(new AddedBatchIdEvent());
@ -246,12 +224,12 @@ public class BatchIDAndListKPIView extends Composite {
}); });
} }
} }
/** /**
* Reset batch id status. * Reset batch id status.
*/ */
public void resetBatchIdStatus() { public void resetBatchIdStatus() {
//Resetting batch ID and panel error after calling Perform Fish Service // Resetting batch ID and panel error after calling Perform Fish Service
uib_list_batch_id.clear(); uib_list_batch_id.clear();
the_panel_error.clear(); the_panel_error.clear();
listBatchesID.clear(); listBatchesID.clear();
@ -260,12 +238,16 @@ public class BatchIDAndListKPIView extends Composite {
/** /**
* Show alert. * Show alert.
* *
* @param error the error * @param error
* @param type the type * the error
* @param closable the closable * @param type
* @param panel the panel * the type
* @param closable
* the closable
* @param panel
* the panel
*/ */
private void showAlert(String error, AlertType type, boolean closable, ComplexPanel panel){ private void showAlert(String error, AlertType type, boolean closable, ComplexPanel panel) {
panel.clear(); panel.clear();
Alert alert = new Alert(error); Alert alert = new Alert(error);
alert.setType(type); alert.setType(type);
@ -274,30 +256,32 @@ public class BatchIDAndListKPIView extends Composite {
panel.add(alert); panel.add(alert);
} }
/** /**
* Show alert. * Show alert.
* *
* @param error the error * @param error
* @param type the type * the error
* @param closable the closable * @param type
* the type
* @param closable
* the closable
*/ */
public void showAlert(String error, AlertType type, boolean closable){ public void showAlert(String error, AlertType type, boolean closable) {
showAlert(error, type, closable, the_panel_error); showAlert(error, type, closable, the_panel_error);
} }
/** /**
* Show selection ok. * Show selection ok.
* *
* @param msg the msg * @param msg
* @param closable the closable * the msg
* @param closable
* the closable
*/ */
public void showSelectionOK(String msg, boolean closable){ public void showSelectionOK(String msg, boolean closable) {
showAlert(msg, AlertType.INFO, closable, the_panel_error); showAlert(msg, AlertType.INFO, closable, the_panel_error);
} }
/** /**
* Gets the control group batch id. * Gets the control group batch id.
* *
@ -308,7 +292,6 @@ public class BatchIDAndListKPIView extends Composite {
return cg_batch_id; return cg_batch_id;
} }
/** /**
* Gets the list box batch id. * Gets the list box batch id.
* *
@ -319,7 +302,6 @@ public class BatchIDAndListKPIView extends Composite {
return uib_list_batch_id; return uib_list_batch_id;
} }
/** /**
* Gets the perform fish response. * Gets the perform fish response.
* *
@ -330,7 +312,6 @@ public class BatchIDAndListKPIView extends Composite {
return performFishResponse; return performFishResponse;
} }
/** /**
* Gets the map parameters. * Gets the map parameters.
* *
@ -340,21 +321,21 @@ public class BatchIDAndListKPIView extends Composite {
return mapParameters; return mapParameters;
} }
/** /**
* Enable button load batches. * Enable button load batches.
* *
* @param enable the enable * @param enable
* the enable
*/ */
public void enableButtonLoadBatches(boolean enable) { public void enableButtonLoadBatches(boolean enable) {
uib_button_load_batches.setEnabled(enable); uib_button_load_batches.setEnabled(enable);
if(enable) if (enable)
uib_list_batch_id.setTitle("Click the 'Load Batches' button"); uib_list_batch_id.setTitle("Click the 'Load Batches' button");
else else
uib_list_batch_id.setTitle(""); uib_list_batch_id.setTitle("");
} }
} }

View File

@ -8,10 +8,10 @@
<g:HTMLPanel> <g:HTMLPanel>
<g:VerticalPanel ui:field="the_panel_container"> <g:VerticalPanel ui:field="the_panel_container">
<g:HorizontalPanel addStyleNames="the_margin_top"> <g:HorizontalPanel addStyleNames="the_margin_top">
<g:Label ui:field="uib_label_batch_id">BATCH ID</g:Label> <g:Label ui:field="uib_label_batch_id">Batch ID</g:Label>
<b:ControlGroup ui:field="cg_batch_id"> <b:ControlGroup ui:field="cg_batch_id">
<b:Controls> <b:Controls>
<b:ListBox name="Select BATCH ID" <b:ListBox name="Select Batch ID"
b:id="uib_list_batch_id" ui:field="uib_list_batch_id" b:id="uib_list_batch_id" ui:field="uib_list_batch_id"
multipleSelect="false" addStyleNames="the_margin_left"> multipleSelect="false" addStyleNames="the_margin_left">
</b:ListBox> </b:ListBox>

View File

@ -40,7 +40,6 @@ import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
@ -73,14 +72,14 @@ public class DeaPanelResult extends Composite {
@UiField @UiField
VerticalPanel field_parameters_container; VerticalPanel field_parameters_container;
@UiField // @UiField
Label uib_label_focus_id; // Label uib_label_focus_id;
@UiField // @UiField
ControlGroup cg_focus_id_correlation; // ControlGroup cg_focus_id_correlation;
@UiField // @UiField
ListBox field_list_focus_id_correlation; // ListBox field_list_focus_id_correlation;
@UiField @UiField
ComplexPanel alert_info; ComplexPanel alert_info;
@ -421,18 +420,6 @@ public class DeaPanelResult extends Composite {
return dataInputParameters; return dataInputParameters;
} }
/**
* Adds the list focus ids.
*
* @param listFocusIDs
* the list focus I ds
*/
public void addListFocusIds(List<String> listFocusIDs) {
for (String batchID : listFocusIDs) {
field_list_focus_id_correlation.addItem(batchID, batchID);
}
}
/** /**
* Show alert. * Show alert.
* *
@ -541,6 +528,8 @@ public class DeaPanelResult extends Composite {
flexTable.setWidget(0, 1, new HTML(toShowBatchTypeValue)); flexTable.setWidget(0, 1, new HTML(toShowBatchTypeValue));
flexTable.setWidget(1, 0, new HTML("Level:")); flexTable.setWidget(1, 0, new HTML("Level:"));
flexTable.setWidget(1, 1, new HTML(dataInputParameters.get(PerformFishAnalyticsConstant.DM_SCALEP_PARAM))); flexTable.setWidget(1, 1, new HTML(dataInputParameters.get(PerformFishAnalyticsConstant.DM_SCALEP_PARAM)));
//flexTable.setWidget(2, 0, new HTML("Batch ID:"));
//flexTable.setWidget(2, 1, new HTML(dataInputParameters.get(PerformFishAnalyticsConstant.DM_FOCUS_PARAM)));
String KPINames = ""; String KPINames = "";
for (KPI kpi : selectedKPIs) { for (KPI kpi : selectedKPIs) {
@ -550,13 +539,10 @@ public class DeaPanelResult extends Composite {
flexTable.setWidget(2, 0, new HTML("KPI:")); flexTable.setWidget(2, 0, new HTML("KPI:"));
flexTable.setWidget(2, 1, new HTML(KPINames)); flexTable.setWidget(2, 1, new HTML(KPINames));
// CHANGING LABEL TEXT TO SCAPE_PARAM
uib_label_focus_id.setText(dataInputParameters.get(PerformFishAnalyticsConstant.DM_SCALEP_PARAM) + " ID");
fillDeaListBoxes(); fillDeaListBoxes();
} catch (Exception e) { } catch (Exception e) {
// silent GWT.log("Error in addParameters for DeaResulPanel: " + e.getLocalizedMessage(), e);
} }
field_parameters_container.add(flexTable); field_parameters_container.add(flexTable);
@ -663,7 +649,7 @@ public class DeaPanelResult extends Composite {
GWT.log("Calling Dea Analysys... with input: " + inputKPI + " and output: " + outputKPI); GWT.log("Calling Dea Analysys... with input: " + inputKPI + " and output: " + outputKPI);
uib_vp_deanalanlysis_algorithm.setVisible(true); uib_vp_deanalanlysis_algorithm.setVisible(true);
callDataMinerServiceForChart(dataInputParameters, inputKPI, outputKPI, DataMinerAlgorithms.DEA_ANALYSIS, "ID", callDataMinerServiceForChart(dataInputParameters, inputKPI, outputKPI, DataMinerAlgorithms.DEA_ANALYSIS,
deaAnalysis); deaAnalysis);
} }
@ -793,8 +779,7 @@ public class DeaPanelResult extends Composite {
* the panel * the panel
*/ */
private void callDataMinerServiceForChart(Map<String, String> dataInputParameters, final List<KPI> inputKPI, private void callDataMinerServiceForChart(Map<String, String> dataInputParameters, final List<KPI> inputKPI,
final List<KPI> outputKPI, final DataMinerAlgorithms chartType, final String focusID, final List<KPI> outputKPI, final DataMinerAlgorithms chartType, final ComplexPanel panel) {
final ComplexPanel panel) {
GWT.log("Call DM wiht Selected KPI: " + inputKPI); GWT.log("Call DM wiht Selected KPI: " + inputKPI);
StringBuilder dataInputsFormatter = new StringBuilder(); StringBuilder dataInputsFormatter = new StringBuilder();
@ -834,6 +819,7 @@ public class DeaPanelResult extends Composite {
} }
final String focusID = dataInputParameters.get(PerformFishAnalyticsConstant.DM_FOCUS_PARAM);
dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM + "=" + focusID + ";"); dataInputsFormatter.append(PerformFishAnalyticsConstant.DM_FOCUS_PARAM + "=" + focusID + ";");
String dataInParameters = dataInputsFormatter.toString(); String dataInParameters = dataInputsFormatter.toString();

View File

@ -14,18 +14,18 @@
addStyleNames="the_margin_top_bottom"> addStyleNames="the_margin_top_bottom">
<b:Label text="Parameters"></b:Label> <b:Label text="Parameters"></b:Label>
</g:VerticalPanel> </g:VerticalPanel>
<g:HorizontalPanel addStyleNames="the_margin_top"> <!-- <g:HorizontalPanel addStyleNames="the_margin_top"> -->
<g:Label ui:field="uib_label_focus_id" addStyleNames="the_margin_left">Focus <!-- <g:Label ui:field="uib_label_focus_id" addStyleNames="the_margin_left">Focus -->
ID</g:Label> <!-- ID</g:Label> -->
<b:ControlGroup ui:field="cg_focus_id_correlation"> <!-- <b:ControlGroup ui:field="cg_focus_id_correlation"> -->
<b:Controls> <!-- <b:Controls> -->
<b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation" <!-- <b:ListBox name="Select Focus ID" b:id="field_list_focus_id_correlation" -->
ui:field="field_list_focus_id_correlation" multipleSelect="false" <!-- ui:field="field_list_focus_id_correlation" multipleSelect="false" -->
addStyleNames="the_margin_left"> <!-- addStyleNames="the_margin_left"> -->
</b:ListBox> <!-- </b:ListBox> -->
</b:Controls> <!-- </b:Controls> -->
</b:ControlGroup> <!-- </b:ControlGroup> -->
</g:HorizontalPanel> <!-- </g:HorizontalPanel> -->
</g:VerticalPanel> </g:VerticalPanel>