Package net.sourceforge.ganttproject

Examples of net.sourceforge.ganttproject.GanttPreviousStateTask


            if (myModel.isPrevious()) {
                for (int i = 0; i < myPreviousStateCurrentlyProcessed.size(); i++) {
                    Object next = myPreviousStateCurrentlyProcessed.get(i);
                    // System.out.println (next + " : " + i);
                    if (next != null) {
                        GanttPreviousStateTask previousTask = (GanttPreviousStateTask) next;
                        drawPreviousStateTask(previousTask, i);
                    }
                }
                myPreviousStateCurrentlyProcessed = new ArrayList();
            }
View Full Code Here


            for (int i = 0; i < visibleTasks.size(); i++) {
                Task task = (Task) visibleTasks.get(i);
                int index = getPreviousStateTaskIndex(task);
                GPCalendar calendar = myModel.getTaskManager().getCalendar();
                if (index != -1) {
                    GanttPreviousStateTask previousStateTask = (GanttPreviousStateTask) myPreviousStateTasks
                            .get(index);
                    previousStateTask.setState(task, calendar);
                    if (previousStateTask.getStart().after(unitFinish)) {
                        myPreviousStateCurrentlyProcessed.add(null);
                    } else if (previousStateTask.getStart().getTime()
                            .compareTo(unitStart) >= 0
                            && previousStateTask.getStart().getTime()
                                    .compareTo(unitFinish) < 0)
                    // )|| previousStateTask.getEnd(
                    // calendar)
                    // .getTime().compareTo(unitStart) > 0
                    // && previousStateTask.getEnd(
                    // calendar)
                    // .getTime().compareTo(unitFinish) < 0)
                    {
                        myPreviousStateCurrentlyProcessed
                                .add(previousStateTask);
                        myPreviousStateTasks.remove(index);
                    }
                    // if just a part of the previous task is visible
                    else if (previousStateTask.getStart().getTime().compareTo(
                            unitStart) < 0
                            && (previousStateTask.getEnd(calendar).getTime()
                                    .compareTo(unitStart) > 0)) {
                        GanttCalendar newStart = new GanttCalendar(unitStart);
                        int id = previousStateTask.getId();
                        int duration = previousStateTask.getDuration()
                                - newStart.diff(previousStateTask.getStart());
                        int diff = newStart.diff(previousStateTask.getStart());
                        for (int j = 0; j < diff; j++) {
                            if (calendar.isNonWorkingDay(previousStateTask
                                    .getStart().newAdd(j).getTime())) {
                                duration++;
                            }
                        }
                        boolean isMilestone = previousStateTask.isMilestone();
                        boolean hasNested = previousStateTask.hasNested();
                        GanttPreviousStateTask partOfPreviousTask = new GanttPreviousStateTask(
                                id, newStart, duration, isMilestone, hasNested);
                        partOfPreviousTask.setState(task, calendar);
                        partOfPreviousTask.setIsAPart(true);
                        myPreviousStateCurrentlyProcessed
                                .add(partOfPreviousTask);
                        myPreviousStateTasks.remove(index);
                    } else
                        myPreviousStateCurrentlyProcessed.add(null);
View Full Code Here

        boolean nested = false;

        if (nestedAsString.equals("true"))
            nested = true;

        GanttPreviousStateTask task = new GanttPreviousStateTask(
                new Integer(id).intValue(), GanttCalendar.parseXMLDate(start),
                new Integer(duration).intValue(), meeting, nested);
        tasks.add(task);
    }
View Full Code Here

            addAttribute("name", nextState.getName(), attrs);
            startElement("previous-tasks", attrs, handler);
            // ArrayList list =
            // ((GanttPreviousState)previous.get(i)).getTasks();
            for (int j=0; j<stateTasks.size(); j++) {
                GanttPreviousStateTask task = (GanttPreviousStateTask)stateTasks.get(j);
                addAttribute("id", String.valueOf(task.getId()), attrs);
                addAttribute("start", task.getStart().toXMLString(), attrs);
                addAttribute("duration", String.valueOf(task.getDuration()), attrs);
                addAttribute("meeting", String.valueOf(task.isMilestone()), attrs);
                addAttribute("super", String.valueOf(task.hasNested()), attrs);
                emptyElement("previous-task", attrs, handler);

            }
            endElement("previous-tasks", handler);
        }
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.GanttPreviousStateTask

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.