Package net.sourceforge.ganttproject.time

Examples of net.sourceforge.ganttproject.time.TimeFrame


        ArrayList result = new ArrayList();
        int totalFramesWidth = 0;
        Date currentDate = myStartDate;
        do {

            TimeFrame currentFrame = myTimeUnitStack.createTimeFrame(
                    currentDate, getTopUnit(currentDate), myBottomUnit);
            if (exactDate != null
                    && currentFrame.getStartDate().before(exactDate)) {
                currentFrame.trimLeft(exactDate);
            }
            if (currentFrame.getStartDate().after(currentFrame.getFinishDate())) {
                throw new IllegalStateException("Frame is invalid:\n"+currentFrame+"\n date="+exactDate);
            }
            result.add(currentFrame);
            int frameWidth = myFrameWidthFunction
                    .getTimeFrameWidth(currentFrame);
            totalFramesWidth += frameWidth;
            currentDate = currentFrame.getFinishDate();

        } while (totalFramesWidth <= getBounds().getWidth());
        //
        return (TimeFrame[]) result.toArray(new TimeFrame[0]);
    }
View Full Code Here


                    startDate, endDate) };
        } else if (timeUnit.isConstructedFrom(myTimeUnitStack
                .getDefaultTimeUnit())) {
            java.util.List buf = new ArrayList();
            TimeUnit defaultUnit = myTimeUnitStack.getDefaultTimeUnit();
            TimeFrame innerFrame = myTimeUnitStack.createTimeFrame(startDate,
                    timeUnit, defaultUnit);
            // System.err.println("[ChartModelImpl] topUnit="+timeUnit+"
            // bottom="+defaultUnit+"
            // count="+innerFrame.getUnitCount(defaultUnit));
            f.createAlternance(defaultUnit, innerFrame, buf);
View Full Code Here

        GanttCalendar friday = new GanttCalendar(2000, 0, 7);
        task.setStart(friday);
        task.setDuration(getTaskManager().createLength(2));
        OffsetCalculatorImpl offsetCalculator = new OffsetCalculatorImpl(myStack);
        TimeUnitFunctionOfDate monthUnit = (TimeUnitFunctionOfDate) myStack.MONTH;
        TimeFrame weekTimeFrame = myStack.createTimeFrame(monday.getTime(), monthUnit.createTimeUnit(monday.getTime()), myStack.WEEK_AS_BOTTOM_UNIT);
        Offset[] offsets = offsetCalculator.calculateOffsets(weekTimeFrame, myStack.WEEK_AS_BOTTOM_UNIT, monday.getTime(), myStack.getDefaultTimeUnit(), 70);
        assertEquals("Unexpected offsets count", 7, offsets.length);
        TaskActivity fridayActivity = task.getActivities()[0];
        int pixelOffset = 0;
        for (int i=0; i<offsets.length; i++) {
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.time.TimeFrame

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.