Package com.projity.pm.calendar

Examples of com.projity.pm.calendar.WorkCalendar.compare()


      return;
    WorkCalendar cal = getEffectiveWorkCalendar();

    boolean firstBar = (cal.compare(getStart(),start,false) == 0);
    long startOffset = cal.compare(start,getStart(),false);
    long endOffset = cal.compare(end,getStart(),false);
    Interval range = getRangeThatIntervalCanBeMoved(start,startOffset,startOffset);


    if (extendDuration > 0)
      extendDuration = Math.min(extendDuration,endOffset - startOffset);
View Full Code Here


   * @see com.projity.pm.scheduling.Schedule#moveInterval(java.lang.Object, long, long, com.projity.pm.scheduling.ScheduleInterval)
   */
  public void moveInterval(Object eventSource, long start, long end, ScheduleInterval oldInterval, boolean isChild) {
    WorkCalendar cal = getEffectiveWorkCalendar();
    start = cal.adjustInsideCalendar(start,false);
    boolean shifting = cal.compare(start,oldInterval.getStart(),false) != 0;
    long assignmentStart = getEarliestAssignmentStart();
    long amountFromStart = cal.compare(oldInterval.getStart(),assignmentStart,false); // possible that they are not the same but there is no working time between them
    if (shifting && amountFromStart == 0L) { // see if first bar shifted -The first bar is drawn from the first assignment and not from the task start.
      // To figure out the new task start, see how much the shift of this bar is, then apply that difference to the task start
      long shift = cal.compare(start,assignmentStart,false);
View Full Code Here

  public void moveInterval(Object eventSource, long start, long end, ScheduleInterval oldInterval, boolean isChild) {
    WorkCalendar cal = getEffectiveWorkCalendar();
    start = cal.adjustInsideCalendar(start,false);
    boolean shifting = cal.compare(start,oldInterval.getStart(),false) != 0;
    long assignmentStart = getEarliestAssignmentStart();
    long amountFromStart = cal.compare(oldInterval.getStart(),assignmentStart,false); // possible that they are not the same but there is no working time between them
    if (shifting && amountFromStart == 0L) { // see if first bar shifted -The first bar is drawn from the first assignment and not from the task start.
      // To figure out the new task start, see how much the shift of this bar is, then apply that difference to the task start
      long shift = cal.compare(start,assignmentStart,false);
      long newTaskStart = cal.add(getStart(),shift,false);
      setStart(newTaskStart);
View Full Code Here

    boolean shifting = cal.compare(start,oldInterval.getStart(),false) != 0;
    long assignmentStart = getEarliestAssignmentStart();
    long amountFromStart = cal.compare(oldInterval.getStart(),assignmentStart,false); // possible that they are not the same but there is no working time between them
    if (shifting && amountFromStart == 0L) { // see if first bar shifted -The first bar is drawn from the first assignment and not from the task start.
      // To figure out the new task start, see how much the shift of this bar is, then apply that difference to the task start
      long shift = cal.compare(start,assignmentStart,false);
      long newTaskStart = cal.add(getStart(),shift,false);
      setStart(newTaskStart);
    } else {
      long amount =cal.compare(end,oldInterval.getEnd(),false);
      if (amount == 0L) // skip if nothing moved
View Full Code Here

      // To figure out the new task start, see how much the shift of this bar is, then apply that difference to the task start
      long shift = cal.compare(start,assignmentStart,false);
      long newTaskStart = cal.add(getStart(),shift,false);
      setStart(newTaskStart);
    } else {
      long amount =cal.compare(end,oldInterval.getEnd(),false);
      if (amount == 0L) // skip if nothing moved
        return;

      Iterator i = getAssignments().iterator();
      Assignment assignment;
View Full Code Here

        .getPredecessor();
    ScheduleWindow successor = (ScheduleWindow) dependency.getSuccessor();
    long t = 0;
    WorkCalendar cal = dependency.getEffectiveWorkCalendar();
    if (dependency.getDependencyType() == DependencyType.FS) {
      t = cal.compare(cal.add(successor.getEarlyStart(),
          -dependency.getLeadValue(), true), predecessor
          .getEarlyFinish(), false);
    } else if (dependency.getDependencyType() == DependencyType.FF) {
      t = cal.compare(cal.add(successor.getEarlyFinish(),
          -dependency.getLeadValue(), true), predecessor
View Full Code Here

    if (dependency.getDependencyType() == DependencyType.FS) {
      t = cal.compare(cal.add(successor.getEarlyStart(),
          -dependency.getLeadValue(), true), predecessor
          .getEarlyFinish(), false);
    } else if (dependency.getDependencyType() == DependencyType.FF) {
      t = cal.compare(cal.add(successor.getEarlyFinish(),
          -dependency.getLeadValue(), true), predecessor
          .getEarlyFinish(), false);
    } else if (dependency.getDependencyType() == DependencyType.SS) {
      t = cal.compare(cal.add(successor.getEarlyStart(),
          -dependency.getLeadValue(), true), predecessor
View Full Code Here

    } else if (dependency.getDependencyType() == DependencyType.FF) {
      t = cal.compare(cal.add(successor.getEarlyFinish(),
          -dependency.getLeadValue(), true), predecessor
          .getEarlyFinish(), false);
    } else if (dependency.getDependencyType() == DependencyType.SS) {
      t = cal.compare(cal.add(successor.getEarlyStart(),
          -dependency.getLeadValue(), true), predecessor
          .getEarlyStart(), false);
    } else if (dependency.getDependencyType() == DependencyType.SF) {
      t = cal.compare(cal.add(successor.getEarlyFinish(),
          -dependency.getLeadValue(), true), predecessor
View Full Code Here

    } else if (dependency.getDependencyType() == DependencyType.SS) {
      t = cal.compare(cal.add(successor.getEarlyStart(),
          -dependency.getLeadValue(), true), predecessor
          .getEarlyStart(), false);
    } else if (dependency.getDependencyType() == DependencyType.SF) {
      t = cal.compare(cal.add(successor.getEarlyFinish(),
          -dependency.getLeadValue(), true), predecessor
          .getEarlyStart(), false);
    }
    return t;
  }
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.