Task #17166 Synoptic table added to BATCH

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/performfish-analytics-portlet@181205 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-07-12 12:54:36 +00:00
parent 0934f0cb84
commit 5cb762fcd0
6 changed files with 69 additions and 22 deletions

View File

@ -724,7 +724,7 @@ public class PerformFishAnnualAnalyticsController {
@Override @Override
public void onSuccess(CSVFile result) { public void onSuccess(CSVFile result) {
GWT.log("Displaying: "+result); GWT.log("Displaying: "+result);
String cssTableStyle = "simpletable";
String title = toTitle; String title = toTitle;
switch (chartType) { switch (chartType) {
case BOXPLOT: case BOXPLOT:
@ -747,10 +747,13 @@ public class PerformFishAnnualAnalyticsController {
break; break;
case DEA_CHART: case DEA_CHART:
break; break;
case PERFORMFISH_SYNOPTICTABLE_BATCH:
cssTableStyle = "synoptictable";
break;
} }
ShowResult showResult = new ShowResult(title); ShowResult showResult = new ShowResult(title);
showResult.showCSVFile(result); showResult.showCSVFile(result, cssTableStyle);
container.add(showResult); container.add(showResult);
} }
}); });

View File

@ -331,6 +331,12 @@ public class PerformFishAnalyticsController {
} }
/**
* Call algorithm synoptic table batch.
*
* @param performFishResponse the perform fish response
* @param performFishRequestParameters the perform fish request parameters
*/
private void callAlgorithmSynopticTableBatch(final PerformFishResponse performFishResponse, final Map<String, List<String>> performFishRequestParameters) { private void callAlgorithmSynopticTableBatch(final PerformFishResponse performFishResponse, final Map<String, List<String>> performFishRequestParameters) {
GWT.log("Read perform fish response: "+performFishResponse); GWT.log("Read perform fish response: "+performFishResponse);
@ -355,7 +361,7 @@ public class PerformFishAnalyticsController {
final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1); final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
//submitRequestPanel.getElement().addClassName("ext-horizontal-panel"); //submitRequestPanel.getElement().addClassName("ext-horizontal-panel");
String tabTitle = chartType.getName().substring(0,1).toUpperCase()+chartType.getName().toLowerCase().substring(1,chartType.getName().length()); //CAMEL CASE String tabTitle = "Synoptic Table"; //CAMEL CASE
final Tab tab = viewController.createTab(submitRequestPanel, tabTitle+" #"+(viewController.currentNumberOfTab()+1)); final Tab tab = viewController.createTab(submitRequestPanel, tabTitle+" #"+(viewController.currentNumberOfTab()+1));
final HTMLPanel panelContainer = submitRequestPanel.getContainerPanel(); final HTMLPanel panelContainer = submitRequestPanel.getContainerPanel();
@ -735,6 +741,8 @@ public class PerformFishAnalyticsController {
public void onSuccess(CSVFile result) { public void onSuccess(CSVFile result) {
GWT.log("Displaying: "+result); GWT.log("Displaying: "+result);
String cssTableStyle = "simpletable";
String title = toTitle; String title = toTitle;
switch (chartType) { switch (chartType) {
case BOXPLOT: case BOXPLOT:
@ -757,11 +765,12 @@ public class PerformFishAnalyticsController {
case DEA_CHART: case DEA_CHART:
break; break;
case PERFORMFISH_SYNOPTICTABLE_BATCH: case PERFORMFISH_SYNOPTICTABLE_BATCH:
cssTableStyle = "synoptictable";
break; break;
} }
ShowResult showResult = new ShowResult(title); ShowResult showResult = new ShowResult(title);
showResult.showCSVFile(result); showResult.showCSVFile(result, cssTableStyle);
container.add(showResult); container.add(showResult);
} }
}); });

View File

@ -924,7 +924,7 @@ public class AnalyticsAnnualPanelResult extends Composite {
@Override @Override
public void onSuccess(CSVFile result) { public void onSuccess(CSVFile result) {
GWT.log("Displaying: "+result); GWT.log("Displaying: "+result);
String cssTableStyle = "simpletable";
String title = toTitle; String title = toTitle;
switch (chartType) { switch (chartType) {
case BOXPLOT: case BOXPLOT:
@ -938,7 +938,7 @@ public class AnalyticsAnnualPanelResult extends Composite {
} }
ShowResult showResult = new ShowResult(title); ShowResult showResult = new ShowResult(title);
showResult.showCSVFile(result); showResult.showCSVFile(result, cssTableStyle);
container.add(showResult); container.add(showResult);
} }
}); });

View File

@ -928,7 +928,7 @@ public KPI getKPIForName(String name){
@Override @Override
public void onSuccess(CSVFile result) { public void onSuccess(CSVFile result) {
GWT.log("Displaying: "+result); GWT.log("Displaying: "+result);
String cssTableStyle = "simpletable";
String title = toTitle; String title = toTitle;
switch (chartType) { switch (chartType) {
case BOXPLOT: case BOXPLOT:
@ -942,7 +942,7 @@ public KPI getKPIForName(String name){
} }
ShowResult showResult = new ShowResult(title); ShowResult showResult = new ShowResult(title);
showResult.showCSVFile(result); showResult.showCSVFile(result, cssTableStyle);
container.add(showResult); container.add(showResult);
} }
}); });

View File

@ -50,7 +50,6 @@ public class ShowResult extends Composite {
* Instantiates a new show result. * Instantiates a new show result.
* *
* @param title the title * @param title the title
* @param content the content
*/ */
public ShowResult(String title) { public ShowResult(String title) {
@ -69,17 +68,16 @@ public class ShowResult extends Composite {
theContent.add(new HTMLPanel(base64Content)); theContent.add(new HTMLPanel(base64Content));
} }
/** /**
* Show csv file. * Show CSV file.
* *
* @param csvFile the csv file * @param csvFile the csv file
* @param cssStyleName the css style name
*/ */
public void showCSVFile(CSVFile csvFile){ public void showCSVFile(CSVFile csvFile, String cssStyleName){
final FlexTable flexTable = new FlexTable(); final FlexTable flexTable = new FlexTable();
flexTable.setStyleName("simpletable"); flexTable.setStyleName(cssStyleName);
flexTable.getElement().getStyle().setMarginLeft(30, Unit.PX); flexTable.getElement().getStyle().setMarginLeft(30, Unit.PX);
flexTable.getElement().getStyle().setMarginRight(30, Unit.PX); flexTable.getElement().getStyle().setMarginRight(30, Unit.PX);

View File

@ -149,7 +149,7 @@ table.fixedtable td {
table.fixedtable td { table.fixedtable td {
overflow: hidden; overflow: hidden;
width: 200px !important; width: 200px !important;
} }
.to-big-title { .to-big-title {
@ -161,25 +161,23 @@ table.fixedtable td {
text-align: center; text-align: center;
} }
.the-minimun-height{ .the-minimun-height {
min-height: 300px; min-height: 300px;
} }
.ext-margin-container{ .ext-margin-container {
margin-left: 20px; margin-left: 20px;
} }
.selected-kpi-panel{ .selected-kpi-panel {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.form-horizontal .controls{ .form-horizontal .controls {
margin-left: 100px !important; margin-left: 100px !important;
} }
.form-horizontal .control-label{ .form-horizontal .control-label {
width: 90px !important; width: 90px !important;
} }
@ -190,3 +188,42 @@ table.fixedtable td {
the-central-table td { the-central-table td {
padding: 2px; padding: 2px;
} }
table.synoptictable {
font-family: verdana, arial, sans-serif;
font-size: 10px;
border-collapse: collapse;
margin-top: 20px;
background-color: #FFF;
text-align: center;
}
table.synoptictable td {
padding: 5px;
border-left: 1px solid #e3e3e3;
border-right: 1px solid #e3e3e3;
}
table.synoptictable tr:first-child td {
border-left: none;
border-right: none;
font-size: 16px
}
table.synoptictable tr:first-child {
font-weight: bold;
border-left: none;
border-right: none;
}
table.synoptictable tr:nth-child(even) {
background-color: #f2f2f2;
}
table.synoptictable td:first-child {
border-left: none;
}
table.synoptictable td:last-child {
border-right: none;
}