Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.PositionConstraintType


            TaskElement taskElement, LocalDate orderInitDate) {
        if (taskElement instanceof ITaskPositionConstrained) {
            ITaskPositionConstrained task = (ITaskPositionConstrained) taskElement;
            TaskPositionConstraint startConstraint = task
                    .getPositionConstraint();
            final PositionConstraintType constraintType = startConstraint
                    .getConstraintType();
            switch (constraintType) {
            case AS_SOON_AS_POSSIBLE:
                if (orderInitDate != null) {
                    return Collections
View Full Code Here


    public static List<Constraint<GanttDate>> getEndConstraintsFor(
            TaskElement taskElement, LocalDate deadline) {
        if (taskElement instanceof ITaskPositionConstrained) {
            ITaskPositionConstrained task = (ITaskPositionConstrained) taskElement;
            TaskPositionConstraint endConstraint = task.getPositionConstraint();
            PositionConstraintType type = endConstraint.getConstraintType();
            switch (type) {
            case AS_LATE_AS_POSSIBLE:
                if (deadline != null) {
                    return Collections
                            .singletonList(lessOrEqualThan(toGantt(deadline)));
View Full Code Here

            }

            private void updateTaskPositionConstraint(GanttDate endDate) {
                if (taskElement instanceof ITaskPositionConstrained) {
                    ITaskPositionConstrained task = (ITaskPositionConstrained) taskElement;
                    PositionConstraintType constraintType = task
                            .getPositionConstraint().getConstraintType();
                    if (constraintType
                            .compareTo(PositionConstraintType.FINISH_NOT_LATER_THAN) == 0
                            || constraintType
                                    .compareTo(PositionConstraintType.AS_LATE_AS_POSSIBLE) == 0) {
                        task.explicityMoved(taskElement.getIntraDayStartDate(),
                                toIntraDay(endDate));
                    }
                }
View Full Code Here

        startConstraint.setVisible(false);
    }

    private void showStartConstraintRow(ITaskPositionConstrained task) {
        startConstraint.setVisible(true);
        PositionConstraintType type = task.getPositionConstraint()
                .getConstraintType();
        startConstraintTypes.setSelectedItemApi(findComboWithType(type));
        updateStartConstraint(type);
    }
View Full Code Here

    }

    private boolean saveConstraintChanges() {
        TaskPositionConstraint taskConstraint = currentTaskElementAsTaskLeafConstraint()
                .getPositionConstraint();
        PositionConstraintType type = (PositionConstraintType) startConstraintTypes
                .getSelectedItemApi().getValue();
        IntraDayDate inputDate = type.isAssociatedDateRequired() ? IntraDayDate
                .startOfDay(LocalDate.fromDateFields(startConstraintDate
                        .getValue())) : null;
        if (taskConstraint.isValid(type, inputDate)) {
            taskConstraint.update(type, inputDate);
            //at this point we could call currentContext.recalculatePosition(currentTaskElement)
View Full Code Here

        startConstraintTypes.addEventListener(Events.ON_SELECT,
                new EventListener() {

                    @Override
                    public void onEvent(Event event) {
                        PositionConstraintType constraint = (PositionConstraintType) startConstraintTypes
                                .getSelectedItemApi().getValue();
                        constraintTypeChoosen(constraint);
                    }
                });
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.PositionConstraintType

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.