コード例 #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;
    }
コード例 #2
0
 @Override
 public List<GenericDayAssignment> distributeForDay(PartialDay day, EffortDuration effort) {
   List<GenericDayAssignment> result = new ArrayList<GenericDayAssignment>();
   for (ResourceWithAssignedDuration each : hoursDistributor.distributeForDay(day, effort)) {
     result.add(GenericDayAssignment.create(day.getDate(), each.duration, each.resource));
   }
   return result;
 }
コード例 #3
0
ファイル: BaseCalendarModel.java プロジェクト: Kuew/libreplan
 @Override
 public EffortDuration getWorkableTime() {
     if (getBaseCalendar() == null) {
         return null;
     }
     return getBaseCalendar().getCapacityOn(
             PartialDay.wholeDay(selectedDate));
 }
コード例 #4
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()));
 }