Interface GanttHeaderRendererHelper
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
GanttDayHeaderHelper,GanttHourHeaderHelper,GanttMonthHeaderHelper,GanttMultyMonthHeaderHelper,GanttQuarterHeaderHelper,GanttThirdsHeaderHelper,GanttWeekHeaderHelper,GanttYearHeaderHelper
Helper class to isolate the rendering operation
over a specific time unit.
The class that implements this class are specialization
of a specific unit time.
-
Method Summary
Modifier and TypeMethodDescriptionintdoublecalculateBrickWidth(GanttViewConfiguration config, Date date, Date rangeBegin, Date rangeEnd) doubleformatDate(GanttViewConfiguration config, Teacher teacher, Date date, double width) Date[]getBoundingDates(Date date, GanttViewConfiguration ganttViewConfiguration) getRoundedEnd(GanttViewConfiguration config)
-
Method Details
-
calculateBrickNumber
- Parameters:
config- theGanttViewConfigurationwith the current user preference for the visualization- Returns:
- the number of brick to render according to the configuration and the specific time unit implemented
-
formatDate
- Parameters:
config- theGanttViewConfigurationwith the current user preference for the visualizationteacher- tTeacherto do translations if neededdate- theDateto formatwidth-- Returns:
- a String that represents the given
Datefor the specific time unit implementation
-
nextDate
-
getRoundedBegin
- Parameters:
config- theGanttViewConfigurationwith the current user preference for the visualization- Returns:
- the begin date of the visible range rounded according to the specific time unit implementation
-
getRoundedEnd
- Parameters:
config- theGanttViewConfigurationwith the current user preference for the visualization- Returns:
- the end date of the visible range rounded according to the specific time unit implementation
-
getBoundingDates
- Parameters:
date- the target dateganttViewConfiguration- the gantt view configuration- Returns:
- the bounding dates that holds the target date, according to the specific time unit implementation. For example, if the target date is 01/01/2012 05:09 with brick type hour, and the implementation is for the day, the bounding dates will be [01/01/2012 00:00, 01/01/2012 23:59]
- Throws:
UnsupportedOperationException- not all the combination of types are allowed, so if you ask, for a date of type week, the bounding dates of time unit hours an exception will be thrown.
-
getDescription
String getDescription()- Returns:
- a
Stringdescription to use to allow the user to select this time unit implementation or simply to describe it
-
calculateRowWidth
- Parameters:
config- theGanttViewConfigurationwith the current user preference for the visualization- Returns:
- the with in px to use for a gantt row
-
calculateBrickWidth
double calculateBrickWidth(GanttViewConfiguration config, Date date, Date rangeBegin, Date rangeEnd) - Parameters:
config- theGanttViewConfigurationwith the current user preference for the visualizationdate- the date that the brick representsrangeBegin- the visible begin daterangeEnd- the visible end date- Returns:
- the width in px to use for this brick
-