Examples of GanttCalendar


Examples of net.sourceforge.ganttproject.GanttCalendar

    public void testTaskScheduleEventIsSendOnTaskStartChange() {
        TaskManager taskManager = getTaskManager();
        Task task1 = taskManager.createTask();
        TaskListenerImpl listener = new TaskListenerImpl(taskManager);
        taskManager.addTaskListener(listener);
        GanttCalendar taskStart = task1.getStart().Clone();
        taskStart.add(-1);
        TaskMutator mutator = task1.createMutator();
        mutator.setStart(taskStart);
        mutator.commit();
        assertTrue("Listener has not been called on task start change",
                listener.hasBeenCalled());
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

import net.sourceforge.ganttproject.time.gregorian.GPTimeUnitStack;

public class TestOffsetCalculation extends TaskTestCase {
    public void testOffsetOfActivityStartingOnFriday() {
        Task task = getTaskManager().createTask();
        GanttCalendar monday = new GanttCalendar(2000, 0, 3);
        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);
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

    public void setProjectPlotTimes(float targetWidthPoints, float depthval) {
        if (debug)
            System.out.println("setProjectPlotTimes begin");
        float targetwidth = targetWidthPoints - fTtextwidth;

        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())
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

            if (yearAsString.equals("")) {
                project.getActiveCalendar().setPublicHoliDayType(month, date);
            } else {
                int year = Integer.parseInt(yearAsString);
                project.getActiveCalendar().setPublicHoliDayType(
                        new GanttCalendar(year, month - 1, date).getTime());
            }
        } catch (NumberFormatException e) {
            System.out
                    .println("ERROR in parsing XML File year is not numeric: "
                            + e.toString());
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

            handler.setResult(result);
            handler.startDocument();
            addAttribute("name", getProject().getProjectName(), attrs);
            addAttribute("company", getProject().getOrganization(), attrs);
            addAttribute("webLink", getProject().getWebLink(), attrs);
            addAttribute("view-date", new GanttCalendar(area.getViewState()
                    .getStartDate()).toXMLString(), attrs);
            addAttribute("view-index", "" + myUIFacade.getViewIndex(), attrs);
            //TODO for GP 2.0: move view configurations into <view> tag (see ViewSaver)
            addAttribute("gantt-divider-location", ""
                    + myUIFacade.getGanttDividerLocation(), attrs);
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

        // gtask.setStartFixed()
        // gtask.setTaskID()
        gtask.setWebLink(task.getHyperlink());
        Date taskStart = task.getStart();
        assert taskStart!=null : "Task="+task+" has null start";
        gtask.setStart(new GanttCalendar(taskStart));
//        gtask.setDuration(tm.createLength((long) duration.getDuration()));
        long longDuration = (long) Math.ceil(duration.convertUnits(TimeUnit.DAYS).getDuration());
        if (longDuration > 0) {
          gtask.setDuration(tm.createLength(longDuration));
        }
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

*/
public class GanttDaysOff {
    private final GanttCalendar myStart, myFinish;

    public GanttDaysOff(Date start, Date finish) {
        myStart = new GanttCalendar(start);
        myFinish = new GanttCalendar(finish);
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

    public GanttDaysOff(Date start, Date finish) {
        myStart = new GanttCalendar(start);
        myFinish = new GanttCalendar(finish);
    }
    public GanttDaysOff(GanttCalendar start, GanttCalendar finish) {
        myStart = new GanttCalendar(start.getYear(), start.getMonth(), start
                .getDate());
        myFinish = finish;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

                || date.equals(myFinish.getTime()) || (date.before(myFinish
                .getTime()) && date.after(myStart.getTime())));
    }

    public int isADayOffInWeek(Date date) {
        GanttCalendar start = myStart.Clone();
        GanttCalendar finish = myFinish.Clone();
        for (int i = 0; i < 7; i++) {
            start.add(-1);
            finish.add(-1);
            if (date.equals(start.getTime())
                    || date.equals(finish.getTime())
                    || (date.before(finish.getTime()) && date.after(start
                            .getTime())))
                return i + 1;
        }
        return -1;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.GanttCalendar

        }
        return getStateChangeDate(time, false);
    }

    public void setPublicHoliDayType(int month, int date) {
        setPublicHoliDayType(new GanttCalendar(1, month - 1, date).getTime());
        myStableHolidays.add(new GanttCalendar(1, month - 1, date).getTime());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.