Package de.xima.fc.gui.bean.statistics
Class StatisticsHistoryBean
- java.lang.Object
-
- de.xima.fc.gui.bean.statistics.AStatisticsBean
-
- de.xima.fc.gui.bean.statistics.StatisticsHistoryBean
-
- All Implemented Interfaces:
Serializable
@Named @ViewScoped public class StatisticsHistoryBean extends AStatisticsBean
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.xima.fc.gui.bean.statistics.AStatisticsBean
localeBean, MIME_TYPE_EXCEL, MIME_TYPE_PDF, SUFFIX_EXCEL, SUFFIX_IMAGE, SUFFIX_PDF, viewContext
-
-
Constructor Summary
Constructors Constructor Description StatisticsHistoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeChartStyle(EChartStyle chartStyle)
Method to change the chart style.void
changedDateRange()
void
changedTimeScale()
Called when the time interval has changed.void
decrementOffset()
Decrement the offset and update the model.org.primefaces.model.StreamedContent
downloadExcelFile()
Method to download the chart as an excel file.org.primefaces.model.StreamedContent
downloadPdfFile()
Method to download the chart as a PDF file.String
generateTimeRangeLabel(org.apache.commons.lang3.tuple.Pair<Calendar,Calendar> calPair)
Create the time range label for the current time interval.EChartStyle
getChartStyle()
List<EChartStyle>
getChartStyles()
Method to get all available chart styles.String
getChartWidgetVar()
String
getImageFilename()
org.primefaces.model.charts.ChartModel
getModel()
int
getOffset()
Projekt
getProject()
List<Projekt>
getProjectsByClient()
Method to get all projects of the client.List<Date>
getRange()
ETimeScale
getTimeScale()
List<ETimeScale>
getTimeScales()
Method to get all available time intervals.void
incrementOffset()
Increment the offset and update the model.void
resetRange()
Called when the range is reset or time interval changed.void
setChartStyle(EChartStyle chartStyle)
void
setModel(org.primefaces.model.charts.ChartModel model)
void
setOffset(int offset)
void
setProject(Projekt project)
void
setRange(List<Date> range)
void
setTimeScale(ETimeScale timeScale)
void
updateModel()
Update the model.-
Methods inherited from class de.xima.fc.gui.bean.statistics.AStatisticsBean
insertImageFilename
-
-
-
-
Method Detail
-
getProject
public Projekt getProject()
-
setProject
public void setProject(Projekt project)
-
setOffset
public void setOffset(int offset)
-
getOffset
public int getOffset()
-
getTimeScale
public ETimeScale getTimeScale()
-
setTimeScale
public void setTimeScale(ETimeScale timeScale)
-
getChartStyle
public EChartStyle getChartStyle()
-
setChartStyle
public void setChartStyle(EChartStyle chartStyle)
-
getModel
public org.primefaces.model.charts.ChartModel getModel()
-
setModel
public void setModel(org.primefaces.model.charts.ChartModel model)
-
incrementOffset
public void incrementOffset()
Increment the offset and update the model.
-
decrementOffset
public void decrementOffset()
Decrement the offset and update the model.
-
changedTimeScale
public void changedTimeScale()
Called when the time interval has changed.
-
changedDateRange
public void changedDateRange()
-
resetRange
public void resetRange()
Called when the range is reset or time interval changed.
-
getProjectsByClient
public List<Projekt> getProjectsByClient()
Method to get all projects of the client.- Returns:
- List of all projects of the client
-
getTimeScales
public List<ETimeScale> getTimeScales()
Method to get all available time intervals.- Returns:
- List of all available time intervals
-
getChartStyles
public List<EChartStyle> getChartStyles()
Method to get all available chart styles.- Returns:
- List of all available chart styles
-
changeChartStyle
public void changeChartStyle(EChartStyle chartStyle)
Method to change the chart style. Updates the model afterward.- Parameters:
chartStyle
- Chart style to change to
-
downloadExcelFile
public org.primefaces.model.StreamedContent downloadExcelFile()
Method to download the chart as an excel file.- Returns:
- StreamedContent with the image data
-
downloadPdfFile
public org.primefaces.model.StreamedContent downloadPdfFile()
Method to download the chart as a PDF file.- Returns:
- StreamedContent with the image data
-
getImageFilename
public String getImageFilename()
- Specified by:
getImageFilename
in classAStatisticsBean
- Returns:
- The file name for the image file.
-
getChartWidgetVar
public String getChartWidgetVar()
- Specified by:
getChartWidgetVar
in classAStatisticsBean
- Returns:
- The chart widget var.
-
generateTimeRangeLabel
public String generateTimeRangeLabel(org.apache.commons.lang3.tuple.Pair<Calendar,Calendar> calPair)
Create the time range label for the current time interval.- Returns:
- Time range label
-
updateModel
public void updateModel()
Update the model. First get the start and end time point. Then fetch and process the data. Lastly construct the chart data.
-
-