2015-07-24 16:59:31 +02:00
|
|
|
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
|
|
|
|
2016-05-31 15:50:31 +02:00
|
|
|
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingClientStateData;
|
2015-07-24 16:59:31 +02:00
|
|
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
2016-05-30 18:51:08 +02:00
|
|
|
import org.gcube.portlets.admin.accountingmanager.shared.exception.ChartDrawException;
|
|
|
|
|
|
|
|
import com.google.gwt.event.shared.EventBus;
|
2015-07-24 16:59:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accounting Chart 4 Task
|
|
|
|
*
|
|
|
|
* @author "Giancarlo Panichi" email: <a
|
|
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class AccountingChart4Task extends AccountingChartBuilder {
|
2016-05-30 18:51:08 +02:00
|
|
|
private EventBus eventBus;
|
2016-05-31 15:50:31 +02:00
|
|
|
private AccountingClientStateData accountingStateData;
|
2016-05-30 18:51:08 +02:00
|
|
|
|
2015-07-24 16:59:31 +02:00
|
|
|
|
2016-05-31 15:50:31 +02:00
|
|
|
public AccountingChart4Task(EventBus eventBus, AccountingClientStateData accountingStateData) {
|
2016-05-30 18:51:08 +02:00
|
|
|
this.eventBus=eventBus;
|
2015-07-24 16:59:31 +02:00
|
|
|
this.accountingStateData = accountingStateData;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-05-30 18:51:08 +02:00
|
|
|
public void buildChart() throws ChartDrawException {
|
2015-09-11 18:31:11 +02:00
|
|
|
AccountingChartPanel accountingChartPanel = null;
|
|
|
|
|
2015-07-24 16:59:31 +02:00
|
|
|
if (accountingStateData == null
|
|
|
|
|| accountingStateData.getAccountingType() == null
|
|
|
|
|| accountingStateData.getSeriesRequest() == null
|
|
|
|
|| accountingStateData.getSeriesResponse() == null) {
|
|
|
|
accountingChartSpec.setChart(accountingChartPanel);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-09-11 18:31:11 +02:00
|
|
|
if (!(accountingStateData.getSeriesResponse() instanceof SeriesStorage)) {
|
2015-07-24 16:59:31 +02:00
|
|
|
accountingChartSpec.setChart(accountingChartPanel);
|
|
|
|
return;
|
|
|
|
}
|
2015-09-11 18:31:11 +02:00
|
|
|
|
2016-02-15 14:35:02 +01:00
|
|
|
//StorageChart container=new StorageChart(accountingStateData);
|
2015-09-11 18:31:11 +02:00
|
|
|
|
2016-02-15 14:35:02 +01:00
|
|
|
//accountingChartPanel = new AccountingChartPanel(container);
|
2015-07-24 16:59:31 +02:00
|
|
|
|
|
|
|
accountingChartSpec.setChart(accountingChartPanel);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|