Package net.sourceforge.ganttproject.task

Examples of net.sourceforge.ganttproject.task.TaskLength


        // shift task1 forward. We expect that task2 will also be shifted
        // forward
        //
        // task1 ___xxx___
        // task2 ___x_____
        TaskLength task1Duration = task1.getDuration();
        task1.setStart(new GanttCalendar(2000, 01, 04));
        task1.setDuration(task1Duration);
        //
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
View Full Code Here


        // shift task1 forward. We expect that task2 will also be shifted
        // forward
        //
        // task1 ___xxx___
        // task2 _xx______
        TaskLength task1Duration = task1.getDuration();
        task1.setStart(new GanttCalendar(2000, 01, 04));
        task1.setDuration(task1Duration);
        //
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
View Full Code Here

        if (dateStart.after(dateEnd)) {
            Date tmp = (Date) dateStart.clone();
            dateStart = (Date) dateEnd.clone();
            dateEnd = tmp;
        }
        TaskLength printedLength = getTaskManager().createLength(
                getViewState().getBottomTimeUnit(), dateStart, dateEnd);
        int chartWidth = (int) ((printedLength.getLength(getViewState()
                .getBottomTimeUnit()) + 1) * getViewState()
                .getBottomUnitWidth());
        if (chartWidth<getWidth()) {
            chartWidth = getWidth();
        }
View Full Code Here

        return getTaskManager().getProjectStart();
    }

    public Date getEndDate() {
        // return this.end.getTime();
        TaskLength projectLength = getTaskManager().getProjectLength();
        GanttCalendar pstart = new GanttCalendar(getTaskManager()
                .getProjectStart());
        pstart.add((int) projectLength.getLength());
        GanttCalendar end = pstart.Clone();
        return end.getTime();
    }
View Full Code Here

                    Date startDate, Date endDate) {
                c.setTime(startDate);
                int startDayOfWeek = c.get(Calendar.DAY_OF_WEEK);
                c.setTime(endDate);
                int endDayOfWeek = c.get(Calendar.DAY_OF_WEEK);
                TaskLength duration = myTaskManager.createLength(timeUnit,
                        startDate, endDate);
                DayType dayType = getTaskManager().getCalendar()
                        .getWeekDayType(startDayOfWeek);
                dayType = getTaskManager().getCalendar().getDayTypeDate(
                        startDate);
                return new DayTypeAlternance(dayType, duration, endDate);
            }
            void createAlternance(TimeUnit timeUnit, TimeFrame timeFrame, List output) {
                DayType startType = null;
                Date startDate = null;
                int unitCount = timeFrame.getUnitCount(timeUnit);
                for (int i=0; i<unitCount; i++) {
                    Date start = timeFrame.getUnitStart(timeUnit, i);
                    c.setTime(start);
                    int startDayOfWeek = c.get(Calendar.DAY_OF_WEEK);
                    DayType dayType = getTaskManager().getCalendar().getWeekDayType(startDayOfWeek);
                    if (startType==null) {
                        startType = dayType;
                        startDate = start;
                    }
                    if (startType!=dayType) {
                        Date end = timeFrame.getUnitFinish(timeUnit,i-1);
                        TaskLength duration = myTaskManager.createLength(timeUnit, startDate, end);
                        output.add(new DayTypeAlternance(startType, duration, end));
                        startType = dayType;
                        startDate = start;
                    }
                }
                Date end = timeFrame.getUnitFinish(timeUnit,unitCount-1);
                TaskLength duration = myTaskManager.createLength(timeUnit, startDate, end);
                output.add(new DayTypeAlternance(startType, duration, end));

            }

        }
View Full Code Here

     *         bottom line time units
     */
    public TaskLength getVisibleLength() {
        double pixelsLength = getBounds().getWidth();
        float unitsLength = (float) (pixelsLength / getBottomUnitWidth());
        TaskLength result = getTaskManager().createLength(getBottomUnit(),
                unitsLength);
        return result;
    }
View Full Code Here

                    Date startDate, Date endDate) {
                c.setTime(startDate);
                int startDayOfWeek = c.get(Calendar.DAY_OF_WEEK);
                c.setTime(endDate);
                int endDayOfWeek = c.get(Calendar.DAY_OF_WEEK);
                TaskLength duration = myTaskManager.createLength(timeUnit,
                        startDate, endDate);
                DayType dayType = getTaskManager().getCalendar()
                        .getWeekDayType(startDayOfWeek);
                dayType = getTaskManager().getCalendar().getDayTypeDate(
                        startDate);
View Full Code Here

                        startType = dayType;
                        startDate = start;
                    }
                    if (startType!=dayType) {
                        Date end = timeFrame.getUnitFinish(timeUnit,i-1);
                        TaskLength duration = myTaskManager.createLength(timeUnit, startDate, end);
                        output.add(new DayTypeAlternance(startType, duration, end));
                        startType = dayType;
                        startDate = start;
                    }
                }
                Date end = timeFrame.getUnitFinish(timeUnit,unitCount-1);
                TaskLength duration = myTaskManager.createLength(timeUnit, startDate, end);
                output.add(new DayTypeAlternance(startType, duration, end));

            }
View Full Code Here

    case 5:
      ((TaskNode) node).setEnd((GanttCalendar) value);
      break;
    case 6:
            Task task = (Task) ((TaskNode) node).getUserObject();
      TaskLength tl = task.getDuration();
      ((TaskNode) node).setDuration(task.getManager().createLength(tl.getTimeUnit(),
          ((Integer) value).intValue()));
      break;
    case 7:
      ((TaskNode) node).setCompletionPercentage(((Integer) value)
          .intValue());
View Full Code Here

        }

        public void apply(MouseEvent event) {
            float absoluteDiff = getLengthDiff(event);
            float relativeDiff = myPreviousAbsoluteDiff - absoluteDiff;
            TaskLength diff = getTaskManager().createLength(
                    getViewState().getBottomTimeUnit(), relativeDiff);

            float daysF = diff.getLength(getTimeUnitStack()
                    .getDefaultTimeUnit());

            int days = (int) daysF;
            if (days == 0) {
                return;
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.task.TaskLength

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.