Package net.sourceforge.ganttproject.task.algorithm

Examples of net.sourceforge.ganttproject.task.algorithm.RecalculateTaskScheduleAlgorithm


        TaskDependency dep = taskManager
                .getDependencyCollection()
                .createDependency(task2, task1, new FinishStartConstraintImpl());
        //
        task1.setEnd(new GanttCalendar(2000, 01, 04));
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
        alg.run(task1);
        //
        assertEquals("Unexpected start of supertask=" + supertask,
                new GanttCalendar(2000, 01, 01), supertask.getStart());
        assertEquals("Unexpected end of supertask=" + supertask,
                new GanttCalendar(2000, 01, 05), supertask.getEnd());
View Full Code Here


        return (TaskNode) cloneChildNode;

    }

    public void forwardScheduling() {
        RecalculateTaskScheduleAlgorithm alg = getTaskManager()
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
        try {
            alg.run();
        } catch (TaskDependencyException e) {
          myUIFacade.showErrorDialog(e);
        }
    }
View Full Code Here

            public void dependencyRemoved(TaskDependencyEvent e) {
                repaint();
            }

            private void adjustDependencies(Task task) {
                RecalculateTaskScheduleAlgorithm alg = myTaskManager
                        .getAlgorithmCollection()
                        .getRecalculateTaskScheduleAlgorithm();
                if (!alg.isRunning()) {
                    try {
                        alg.run(task);
                    } catch (TaskDependencyException e) {
                      if (!GPLogger.log(e)) {
                        e.printStackTrace(System.err);
                      }
                      getUIFacade().showErrorDialog(e);
View Full Code Here

                new FinishStartConstraintImpl());
        taskManager.getDependencyCollection().createDependency(task2, task1,
                new FinishStartConstraintImpl());
        task1.setEnd(new GanttCalendar(2000, 01, 03));
        //
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
        alg.run(task1);
        //
        assertEquals("Unexpected value of end of task=" + task3,
                new GanttCalendar(2000, 01, 05), task3.getEnd());
    }
View Full Code Here

        //
        // and expect:
        // task1 XX
        // task3 X
        // task2 XX
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
        alg.run(task1);
        assertEquals("Unexpected value of start of task=" + task3,
                new GanttCalendar(2000, 01, 03), task3.getStart());
        //
        // decrease length of task1 again
        task1.setEnd(new GanttCalendar(2000, 01, 02));
        //
        // we expect:
        // task1 X
        // task3 X
        // task2 XX
        //
        // because task3 depends on task2 with "finish-start" constraint
        alg = taskManager.getAlgorithmCollection()
                .getRecalculateTaskScheduleAlgorithm();
        alg.run(task1);
        assertEquals("Unexpected value of start of task=" + task3,
                new GanttCalendar(2000, 01, 03), task3.getStart());
    }
View Full Code Here

        // forward:
        //
        // task1 xxxxx
        // task2 xxx
        task1.setEnd(new GanttCalendar(2000, 01, 05));
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
        alg.run(task1);
        assertEquals("Unexpected end of task=" + task2, new GanttCalendar(2000,
                01, 05), task2.getEnd());
    }
View Full Code Here

        // task2 ___x_____
        TaskLength task1Duration = task1.getDuration();
        task1.setStart(new GanttCalendar(2000, 01, 04));
        task1.setDuration(task1Duration);
        //
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
        alg.run(task1);
        assertEquals("Unexpected start of task=" + task2, new GanttCalendar(
                2000, 01, 04), task2.getStart());
    }
View Full Code Here

        // task2 _xx______
        TaskLength task1Duration = task1.getDuration();
        task1.setStart(new GanttCalendar(2000, 01, 04));
        task1.setDuration(task1Duration);
        //
        RecalculateTaskScheduleAlgorithm alg = taskManager
                .getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm();
        alg.run(task1);
        assertEquals("Unexpected end of task=" + task2, new GanttCalendar(2000,
                01, 04), task2.getEnd());

    }
View Full Code Here

        AdjustTaskBoundsAlgorithm alg3 = new AdjustTaskBoundsAlgorithm() {
            protected TaskContainmentHierarchyFacade createContainmentFacade() {
                return TaskManagerImpl.this.getTaskHierarchy();
            }
        };
        RecalculateTaskScheduleAlgorithm alg2 = new RecalculateTaskScheduleAlgorithm(
                alg3) {
            protected TaskContainmentHierarchyFacade createContainmentFacade() {
                return TaskManagerImpl.this.getTaskHierarchy();
            }
        };
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.task.algorithm.RecalculateTaskScheduleAlgorithm

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.