Package net.sourceforge.ganttproject.task

Examples of net.sourceforge.ganttproject.task.Task


    private void correctPositionBecauseOfSuperTasks() {
        TaskContainmentHierarchyFacade hierarchy = myTaskManager
                .getTaskHierarchy();
        Task[] tasks = myTaskManager.getTasks();
        for (int i = 0; i < tasks.length; i++) {
            Task task = tasks[i];
            Task[] nestedTasks = hierarchy.getNestedTasks(task);
            correctPositions(nestedTasks);
        }
    }
View Full Code Here


        if (tasks == null)
            return;
        TaskContainmentHierarchyFacade hierarchy = myTaskManager
                .getTaskHierarchy();
        for (int j = 0; j < tasks.length; j++) {
            Task nestedTask = tasks[j];
            GraphicalNode gn = getGraphicalNodeByID(nestedTask.getTaskID());
            int oldPosition = gn.col;
            changePosition(gn, oldPosition + 1);
            correctPositions(hierarchy.getNestedTasks(nestedTask));
        }
    }
View Full Code Here

            System.out.println("getProjectTextWidth begin");

        float res = 0.0f;
        for (Iterator it = lot.iterator(); it.hasNext();) {
            // get the name of the task
            Task task = (Task) it.next();
            float taskTextWidth = getTaskTextWidth(task);
            if (taskTextWidth > res) {
                res = taskTextWidth;
            }
        }
View Full Code Here

     * 1/4 inch (300 points @ 1200ppi)
     */
    private float getTaskTextWidth(Task task) {
        if (debug)
            System.out.println("getTaskTextWidth begin");
        Task t = task;
        float res = (float) t.getName().length() * (1.0f / 14.0f) * (1200.0f);

        Task[] children = task.getManager().getTaskHierarchy().getNestedTasks(
                task);

        for (int i = 0; i < children.length; i++) {
View Full Code Here

        GanttCalendar startDate = null, endDate = null;

        // Get project start, end times
        for (Iterator it = lot.iterator(); it.hasNext();) {
            // get the task
            Task task = (Task) (((DefaultMutableTreeNode) it.next())
                    .getUserObject());
            if (startDate == null && endDate == null) {
                startDate = task.getStart();
                endDate = task.getEnd();
            } else {
                if (task.getStart().compareTo(startDate) == -1) // before
                    startDate = task.getStart();
                if (task.getEnd().compareTo(startDate) == 1) // after
                    endDate = task.getEnd();
            }
        }
        // shift all dates by this amount to plot
        dateShift = startDate;
View Full Code Here

     * TaskGraphNodes.
     */
    private void load() {
        Task[] tasks = myTaskManager.getTasks();
        for (int i = 0; i < tasks.length; i++) {
            Task task = tasks[i];
            TaskGraphNode tgn = getTaskGraphNode(task);
            TaskDependencySlice dependencies = task.getDependenciesAsDependee();
            TaskDependency[] relationship = dependencies.toArray();
            for (int j = 0; j < relationship.length; j++) {
                Task successor = relationship[j].getDependant();
                tgn.addSuccessor(getTaskGraphNode(successor));
            }
        }

    }
View Full Code Here

    void save(IGanttProject project, TransformerHandler handler) throws SAXException {
        AttributesImpl attrs = new AttributesImpl();
        startElement("allocations", handler);
        Task[] tasks = project.getTaskManager().getTasks();
        for (int i = 0; i < tasks.length; i++) {
            Task task = tasks[i];
            ResourceAssignment[] assignments = task.getAssignments();
            for (int j = 0; j < assignments.length; j++) {
                int task_id = task.getTaskID();
                ResourceAssignment next = assignments[j];

                Role roleForAssignment = next.getRoleForAssignment();
                if (roleForAssignment == null) {
                    if (next.getResource() instanceof HumanResource) {
View Full Code Here

                if (getSelectedTask() != null)
                    setEditingTask(getSelectedTask());
                Mediator.getGanttProjectSingleton().getUndoManager()
                        .undoableEdit("New Task", new Runnable() {
                            public void run() {
                                Task t = Mediator
                                        .getGanttProjectSingleton()
                                        .newTask();

                                setEditingTask(t);
                            }
View Full Code Here

            parent = rootNode;

        treeModel.insertNodeInto(childNode, parent, parent.getChildCount());
        //forwardScheduling();

        Task task = (Task) (childNode.getUserObject());

        boolean res = true;

        if (parent == null)
            res = false;

        // test for expantion
        while (parent != null) {
            Task taskFather = (Task) (parent.getUserObject());
            if (!taskFather.getExpand()) {
                res = false;
                break;
            }
            parent = (DefaultMutableTreeNode) (parent.getParent());
        }
View Full Code Here

     * Retores the expand state of the node and its children.
     *
     * @param node
     */
    private void restoreExpand(TaskNode node) {
        Task task = (Task) node.getUserObject();
        boolean expand = task.getExpand();

        Enumeration enumeration = node.children();
        while (enumeration.hasMoreElements())
            restoreExpand((TaskNode) enumeration.nextElement());

        if (expand)
            getTreeTable().getTree().expandPath(new TreePath(node.getPath()));
        else
            getTreeTable().getTree().collapsePath(new TreePath(node.getPath()));
        task.setExpand(expand);
    }
View Full Code Here

TOP

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

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.