Package net.sourceforge.ganttproject

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


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

    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

            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

            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

        // 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

*/
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

    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

                || 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

        }
        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

Related Classes of net.sourceforge.ganttproject.GanttCalendar

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.