Examples of Stretch


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

        stretchesFunction.setResourceAllocation(givenResourceAllocation());
        return stretchesFunction;
    }

    private Stretch givenStretchAsChild() {
        Stretch result = new Stretch();
        stretchesFunction.addStretch(result);
        return result;
    }
View Full Code Here

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

        return result;
    }

    private Stretch givenStretchAsChild(BigDecimal lengthPercentage,
            BigDecimal amountWorkPercentage) {
        Stretch stretch = givenStretchAsChild();
        stretch.setLengthPercentage(lengthPercentage);
        stretch.setAmountWorkPercentage(amountWorkPercentage);
        return stretch;
    }
View Full Code Here

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

                    allocation, stretches);
            double[] dayPoints = Interval.getDayPointsFor(
                    allocation.getStartDate(), intervals);
            double[] hourPoints = Interval.getHoursPointsFor(taskHours
                    .intValue(), intervals);
            final Stretch lastStretch = stretches.get(stretches.size() - 1);
            return StretchesFunctionTypeEnum.hoursForEachDayUsingSplines(
                    dayPoints, hourPoints, allocation.getStartDate(),
                    lastStretch.getDateIn(allocation));
        }
View Full Code Here

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

        private final BigDecimal ONE_HUNDRED = BigDecimal.valueOf(100);

        @Override
        public void render(Listitem item, Object data) {
            Stretch stretch = (Stretch) data;

            item.setValue(stretch);
            item.setDisabled(stretch.isReadOnly());

            appendDate(item, stretch);
            appendLengthPercentage(item, stretch);
            appendAmountWorkPercentage(item, stretch);
            appendOperations(item, stretch);
View Full Code Here

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

            addConsolidatedStretchIfAny();
        }
    }

    private void addConsolidatedStretchIfAny() {
        Stretch consolidated = consolidatedStretchFor(resourceAllocation);
        if (consolidated != null) {
            stretchesFunction.setConsolidatedStretch(consolidated);
        }
    }
View Full Code Here

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

        if (stretches.isEmpty()) {
            return false;
        }

        Iterator<Stretch> iterator = stretches.iterator();
        Stretch previous = iterator.next();
        while (iterator.hasNext()) {
            Stretch current = iterator.next();
            if (current.getLengthPercentage().compareTo(
                    previous.getLengthPercentage()) <= 0) {
                return false;
            }
            if (current.getAmountWorkPercentage().compareTo(
                    previous.getAmountWorkPercentage()) <= 0) {
                return false;
            }
            previous = current;
        }
View Full Code Here

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

    private Stretch newStretch() {
        LocalDate startDate = getTaskStartDate();
        BigDecimal amountWorkPercent = BigDecimal.ZERO;

        Stretch consolidatedStretch = stretchesFunction
                .getConsolidatedStretch();
        if (consolidatedStretch != null) {
            startDate = consolidatedStretch.getDateIn(resourceAllocation)
                    .plusDays(1);
            amountWorkPercent = consolidatedStretch.getAmountWorkPercentage().add(BigDecimal.ONE.divide(BigDecimal.valueOf(100)));
        }
        return Stretch.create(startDate, resourceAllocation, amountWorkPercent);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.