Esempio n. 1
0
    private static Div generateCompletionShade(IDatesMapper datesMapper, LimitingResourceQueueElement queueElement) {

        int workableHours = queueElement
                .getLimitingResourceQueue()
                .getResource()
                .getCalendar()
                .getCapacityOn(PartialDay.wholeDay(queueElement.getEndDate()))
                .roundToHours();

        Long shadeWidth = (24 - workableHours) *
                DatesMapperOnInterval.MILISECONDS_PER_HOUR / datesMapper.getMilisecondsPerPixel();

        Long lShadeLeft = (workableHours - queueElement.getEndHour()) *
                DatesMapperOnInterval.MILISECONDS_PER_HOUR / datesMapper.getMilisecondsPerPixel();

        int shadeLeft = lShadeLeft.intValue() + shadeWidth.intValue();

        Div notWorkableHoursShade = new Div();

        notWorkableHoursShade.setContext("");
        notWorkableHoursShade.setSclass("limiting-completion");
        notWorkableHoursShade.setStyle("left: " + shadeLeft + "px; width: " + shadeWidth.intValue() + "px;");

        return notWorkableHoursShade;
    }
Esempio n. 2
0
 @Override
 public EffortDuration getWorkableTime() {
     if (getBaseCalendar() == null) {
         return null;
     }
     return getBaseCalendar().getCapacityOn(
             PartialDay.wholeDay(selectedDate));
 }
Esempio n. 3
0
 private void reattachAndLoadCalendar(TaskElement taskElement) {
   BaseCalendar calendar = taskElement.getCalendar();
   if (calendar == null) {
     return;
   }
   baseCalendarDAO.reattach(calendar);
   forceLoadCalendar(calendar);
   calendar.getCapacityOn(PartialDay.wholeDay(taskElement.getIntraDayStartDate().getDate()));
 }