Interface GanttHeaderRendererHelper

All Superinterfaces:
Serializable
All Known Implementing Classes:
GanttDayHeaderHelper, GanttHourHeaderHelper, GanttMonthHeaderHelper, GanttMultyMonthHeaderHelper, GanttQuarterHeaderHelper, GanttThirdsHeaderHelper, GanttWeekHeaderHelper, GanttYearHeaderHelper

public interface GanttHeaderRendererHelper extends Serializable
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 Details

    • calculateBrickNumber

      int calculateBrickNumber(GanttViewConfiguration config)
      Parameters:
      config - the GanttViewConfiguration with 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

      String formatDate(GanttViewConfiguration config, Teacher teacher, Date date, double width)
      Parameters:
      config - the GanttViewConfiguration with the current user preference for the visualization
      teacher - t Teacher to do translations if needed
      date - the Date to format
      width -
      Returns:
      a String that represents the given Date for the specific time unit implementation
    • nextDate

      Date nextDate(Date date)
      Parameters:
      date - the current Date
      Returns:
      the next Date to render according to the specific time unit implementation
    • getRoundedBegin

      Date getRoundedBegin(GanttViewConfiguration config)
      Parameters:
      config - the GanttViewConfiguration with the current user preference for the visualization
      Returns:
      the begin date of the visible range rounded according to the specific time unit implementation
    • getRoundedEnd

      Date getRoundedEnd(GanttViewConfiguration config)
      Parameters:
      config - the GanttViewConfiguration with the current user preference for the visualization
      Returns:
      the end date of the visible range rounded according to the specific time unit implementation
    • getBoundingDates

      Date[] getBoundingDates(Date date, GanttViewConfiguration ganttViewConfiguration)
      Parameters:
      date - the target date
      ganttViewConfiguration - 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 String description to use to allow the user to select this time unit implementation or simply to describe it
    • calculateRowWidth

      double calculateRowWidth(GanttViewConfiguration config)
      Parameters:
      config - the GanttViewConfiguration with 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 - the GanttViewConfiguration with the current user preference for the visualization
      date - the date that the brick represents
      rangeBegin - the visible begin date
      rangeEnd - the visible end date
      Returns:
      the width in px to use for this brick