Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.TaskElement$IDatesInterceptor


        return visitor.getTaskStatusData();
    }

    private void calculateTaskStatusStatistics() {
        AccumulateTasksStatusVisitor visitor = new AccumulateTasksStatusVisitor();
        TaskElement rootTask = getRootTask();
        if (this.getRootTask() == null) {
            throw new RuntimeException("Root task is null");
        }
        resetTasksStatusInGraph();
        rootTask.acceptVisitor(visitor);
        Map<TaskStatusEnum, Integer> count = visitor.getTaskStatusData();
        mapAbsoluteValuesToPercentages(count, taskStatusStats);
    }
View Full Code Here


        mapAbsoluteValuesToPercentages(count, taskStatusStats);
    }

    private void calculateTaskViolationStatusStatistics() {
        AccumulateTasksDeadlineStatusVisitor visitor = new AccumulateTasksDeadlineStatusVisitor();
        TaskElement rootTask = getRootTask();
        if (this.getRootTask() == null) {
            throw new RuntimeException("Root task is null");
        }
        rootTask.acceptVisitor(visitor);
        Map<TaskDeadlineViolationStatusEnum, Integer> count = visitor
                .getTaskDeadlineViolationStatusData();
        mapAbsoluteValuesToPercentages(count, taskDeadlineViolationStatusStats);
    }
View Full Code Here

            }
        }

        private void removeChildTask(OrderElement removedChild) {
            TaskSource taskSource = removedChild.getTaskSource();
            TaskElement childTask = taskSource.getTask();
            TaskGroup group = (TaskGroup) getThis().getTaskSource()
                    .getTask();
            group.remove(childTask);
            childTask.detachDependencies();
        }
View Full Code Here

    @Test
    public void taskGroupHasManyTaskElements() {
        List<TaskElement> tasks = taskGroup.getChildren();
        assertTrue("a task group has no task elements initially", tasks
                .isEmpty());
        TaskElement child1 = new Task();
        LocalDate start = new LocalDate(2000, 10, 20);
        child1.setIntraDayStartDate(IntraDayDate.startOfDay(start));
        child1.setIntraDayEndDate(IntraDayDate.startOfDay(start.plusDays(10)));
        taskGroup.addTaskElement(child1);

        TaskGroup child2 = createValidTaskGroup();
        taskGroup.addTaskElement(child2);
View Full Code Here

        IOnTransaction<Void> checkAllocatedHoursWereUpdated =
            new IOnTransaction<Void>() {

            @Override
            public Void execute() {
                TaskElement task1;
                try {
                    task1 = taskElementDAO.find(id);
                } catch (InstanceNotFoundException e) {
                    fail();
                    return null;
                }
                assertTrue(task1.getSumOfAssignedEffort().getHours() == 24);
                assertTrue(task1.getParent().getSumOfAssignedEffort().getHours() == 24);

                return null;
            }
        };
        transactionService.runOnTransaction(checkAllocatedHoursWereUpdated);
View Full Code Here

    private DateAndHour calculateLatestPlanningDate(LimitingResourceQueueElement element) {
        IntraDayDate result = null;
        Task task = element.getTask();

        for (Dependency each : task.getDependenciesWithThisOrigin()) {
            TaskElement destination = each.getDestination();
            result = (result == null) ? destination.getIntraDayStartDate()
                    : IntraDayDate.min(result,
                            destination.getIntraDayStartDate());
        }
        return (result != null) ? DateAndHour.from(result) : null;
    }
View Full Code Here

    public static ZoomLevel calculateDefaultLevel(
            PlannerConfiguration<TaskElement> configuration) {
        if (configuration.getData().isEmpty()) {
            return ZoomLevel.DETAIL_ONE;
        }
        TaskElement earliest = Collections.min(configuration.getData(),
                TaskElement
                .getByStartDateComparator());
        TaskElement latest = Collections.max(configuration.getData(),
                TaskElement.getByEndAndDeadlineDateComparator());

        LocalDate startDate = earliest.getStartAsLocalDate();
        LocalDate endDate = latest.getBiggestAmongEndOrDeadline();
        return ZoomLevel.getDefaultZoomByDates(startDate, endDate);
    }
View Full Code Here

            }
        }
    }

    private Order findOrderIn(IContextWithPlannerTask<TaskElement> context) {
        TaskElement topTask = context.getMapper().findAssociatedDomainObject(
                findTopMostTask(context));
        return topTask.getParent().getOrderElement().getOrder();
    }
View Full Code Here

                findTopMostTask(context));
        return topTask.getParent().getOrderElement().getOrder();
    }

    private OrderElement findOrderElementIn(IContextWithPlannerTask<TaskElement> context) {
        TaskElement topTask = context.getMapper().findAssociatedDomainObject(
                findTopMostTask(context));
        return topTask.getOrderElement();
    }
View Full Code Here

            @Override
            public boolean accpetsFilterPredicate(Task task) {
                if (predicate == null) {
                    return true;
                }
                TaskElement taskElement = (TaskElement) context.getMapper()
                        .findAssociatedDomainObject(task);
                return predicate.accepts(taskElement);
            }

        };
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.TaskElement$IDatesInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.