Package org.zkoss.ganttz.util

Examples of org.zkoss.ganttz.util.Interval


    public Interval getViewInterval() {
        return viewInterval;
    }

    public ZoomLevel getInitialZoomLevel() {
        Interval interval = getViewInterval();
        return ZoomLevel.getDefaultZoomByDates(
                new LocalDate(interval.getStart()),
                new LocalDate(interval.getFinish()));
    }
View Full Code Here


     * Will try to use today if possible
     * @return Today if there are values defined for that date. The last day in
     *         the interval otherwise
     */
    public LocalDate initialDateForIndicatorValues() {
        Interval chartInterval = getIndicatorsDefinitionInterval();
        LocalDate today = new LocalDate();
        return includes(chartInterval, today) ? today : chartInterval
                .getFinish().minusDays(1);
    }
View Full Code Here

            }
        };
    }

    private Interval intervalFromData() {
        Interval result = null;
        for (AllocationInput each : allocationInputs) {
            Interval intervalForInput = each.calculateInterval();
            result = result == null ? intervalForInput : result
                    .coalesce(intervalForInput);
        }
        return result;
    }
View Full Code Here

        }
        return result;
    }

    private Interval addMarginTointerval() {
        Interval interval = intervalFromData();
        // No global margin is added by default
        return interval;
    }
View Full Code Here

        }

        Interval calculateInterval() {
            List<ResourceAllocation<?>> all = getAllocationsSortedByStartDate();
            if (all.isEmpty()) {
                return new Interval(task.getStartDate(), task
                        .getEndDate());
            } else {
                LocalDate start = min(all.get(0)
                        .getStartConsideringAssignments(), all.get(0)
                        .getStartDate());
                LocalDate taskEndDate = LocalDate.fromDateFields(task
                        .getEndDate());
                LocalDate end = max(getEnd(all), taskEndDate);
                return new Interval(asDate(start), asDate(end));
            }
        }
View Full Code Here

        private ZoomLevel zoomLevel = ZoomLevel.DETAIL_ONE;

        @Override
        public Interval getCurrentPaginationInterval() {
            return new Interval(intervalStart.toDate(), intervalEnd.toDate());
        }
View Full Code Here

TOP

Related Classes of org.zkoss.ganttz.util.Interval

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.