From 5cb762fcd0948e23dc68d3f2ea56a48fc63a257a Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 12 Jul 2019 12:54:36 +0000 Subject: [PATCH] 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 --- .../PerformFishAnnualAnalyticsController.java | 7 ++- .../PerformFishAnalyticsController.java | 13 ++++- .../AnalyticsAnnualPanelResult.java | 4 +- .../viewbinder/AnalyticsPanelResult.java | 4 +- .../client/viewbinder/ShowResult.java | 10 ++-- src/main/webapp/PerformFishAnalytics.css | 53 ++++++++++++++++--- 6 files changed, 69 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/annualcontrollers/PerformFishAnnualAnalyticsController.java b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/annualcontrollers/PerformFishAnnualAnalyticsController.java index b479a43..efa5519 100644 --- a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/annualcontrollers/PerformFishAnnualAnalyticsController.java +++ b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/annualcontrollers/PerformFishAnnualAnalyticsController.java @@ -724,7 +724,7 @@ public class PerformFishAnnualAnalyticsController { @Override public void onSuccess(CSVFile result) { GWT.log("Displaying: "+result); - + String cssTableStyle = "simpletable"; String title = toTitle; switch (chartType) { case BOXPLOT: @@ -747,10 +747,13 @@ public class PerformFishAnnualAnalyticsController { break; case DEA_CHART: break; + case PERFORMFISH_SYNOPTICTABLE_BATCH: + cssTableStyle = "synoptictable"; + break; } ShowResult showResult = new ShowResult(title); - showResult.showCSVFile(result); + showResult.showCSVFile(result, cssTableStyle); container.add(showResult); } }); diff --git a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/controllers/PerformFishAnalyticsController.java b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/controllers/PerformFishAnalyticsController.java index 799871c..39a3f08 100644 --- a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/controllers/PerformFishAnalyticsController.java +++ b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/controllers/PerformFishAnalyticsController.java @@ -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> performFishRequestParameters) { GWT.log("Read perform fish response: "+performFishResponse); @@ -355,7 +361,7 @@ public class PerformFishAnalyticsController { final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1); //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 HTMLPanel panelContainer = submitRequestPanel.getContainerPanel(); @@ -735,6 +741,8 @@ public class PerformFishAnalyticsController { public void onSuccess(CSVFile result) { GWT.log("Displaying: "+result); + String cssTableStyle = "simpletable"; + String title = toTitle; switch (chartType) { case BOXPLOT: @@ -757,11 +765,12 @@ public class PerformFishAnalyticsController { case DEA_CHART: break; case PERFORMFISH_SYNOPTICTABLE_BATCH: + cssTableStyle = "synoptictable"; break; } ShowResult showResult = new ShowResult(title); - showResult.showCSVFile(result); + showResult.showCSVFile(result, cssTableStyle); container.add(showResult); } }); diff --git a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewannualbinder/AnalyticsAnnualPanelResult.java b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewannualbinder/AnalyticsAnnualPanelResult.java index 038e477..0f64b91 100644 --- a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewannualbinder/AnalyticsAnnualPanelResult.java +++ b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewannualbinder/AnalyticsAnnualPanelResult.java @@ -924,7 +924,7 @@ public class AnalyticsAnnualPanelResult extends Composite { @Override public void onSuccess(CSVFile result) { GWT.log("Displaying: "+result); - + String cssTableStyle = "simpletable"; String title = toTitle; switch (chartType) { case BOXPLOT: @@ -938,7 +938,7 @@ public class AnalyticsAnnualPanelResult extends Composite { } ShowResult showResult = new ShowResult(title); - showResult.showCSVFile(result); + showResult.showCSVFile(result, cssTableStyle); container.add(showResult); } }); diff --git a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/AnalyticsPanelResult.java b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/AnalyticsPanelResult.java index c1e59d9..58af06a 100644 --- a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/AnalyticsPanelResult.java +++ b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/AnalyticsPanelResult.java @@ -928,7 +928,7 @@ public KPI getKPIForName(String name){ @Override public void onSuccess(CSVFile result) { GWT.log("Displaying: "+result); - + String cssTableStyle = "simpletable"; String title = toTitle; switch (chartType) { case BOXPLOT: @@ -942,7 +942,7 @@ public KPI getKPIForName(String name){ } ShowResult showResult = new ShowResult(title); - showResult.showCSVFile(result); + showResult.showCSVFile(result, cssTableStyle); container.add(showResult); } }); diff --git a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/ShowResult.java b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/ShowResult.java index 2468620..d5c4518 100644 --- a/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/ShowResult.java +++ b/src/main/java/org/gcube/portlets/user/performfishanalytics/client/viewbinder/ShowResult.java @@ -50,7 +50,6 @@ public class ShowResult extends Composite { * Instantiates a new show result. * * @param title the title - * @param content the content */ public ShowResult(String title) { @@ -69,17 +68,16 @@ public class ShowResult extends Composite { theContent.add(new HTMLPanel(base64Content)); } - - /** - * Show csv file. + * Show 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(); - flexTable.setStyleName("simpletable"); + flexTable.setStyleName(cssStyleName); flexTable.getElement().getStyle().setMarginLeft(30, Unit.PX); flexTable.getElement().getStyle().setMarginRight(30, Unit.PX); diff --git a/src/main/webapp/PerformFishAnalytics.css b/src/main/webapp/PerformFishAnalytics.css index 3493dd2..15eb5c8 100644 --- a/src/main/webapp/PerformFishAnalytics.css +++ b/src/main/webapp/PerformFishAnalytics.css @@ -149,7 +149,7 @@ table.fixedtable td { table.fixedtable td { overflow: hidden; - width: 200px !important; + width: 200px !important; } .to-big-title { @@ -161,25 +161,23 @@ table.fixedtable td { text-align: center; } -.the-minimun-height{ +.the-minimun-height { min-height: 300px; } -.ext-margin-container{ - +.ext-margin-container { margin-left: 20px; - } -.selected-kpi-panel{ +.selected-kpi-panel { overflow-wrap: break-word; } -.form-horizontal .controls{ +.form-horizontal .controls { margin-left: 100px !important; } -.form-horizontal .control-label{ +.form-horizontal .control-label { width: 90px !important; } @@ -190,3 +188,42 @@ table.fixedtable td { the-central-table td { 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; +} \ No newline at end of file