From: <nic...@us...> - 2003-09-02 09:08:52
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/scratchpad/org/krysalis/jcharts/gantt In directory sc8-pr-cvs1:/tmp/cvs-serv13645/src/scratchpad/org/krysalis/jcharts/gantt Modified Files: DateHandler.java PlanRenderer.java Log Message: Make day "cleaning" private to DateHandler Index: DateHandler.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/scratchpad/org/krysalis/jcharts/gantt/DateHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DateHandler.java 2 Sep 2003 08:54:19 -0000 1.2 --- DateHandler.java 2 Sep 2003 09:08:46 -0000 1.3 *************** *** 130,135 **** public int getDayDiff(Date start, Date end) { return (int) ! ((DateHandler.cleanDay(start).getTime() ! - DateHandler.cleanDay(end).getTime() + 43200000) / 86400000); --- 130,135 ---- public int getDayDiff(Date start, Date end) { return (int) ! ((cleanDay(start).getTime() ! - cleanDay(end).getTime() + 43200000) / 86400000); *************** *** 142,159 **** //calculate the date ! this.currentDate = DateHandler.cleanDay(new Date()); this.currentTime = currentDate.getTime(); ! this.startDate = DateHandler.cleanDay(startDate); ! this.endDate = DateHandler.cleanDay(endDate); ! lastWeek = DateHandler.cleanDay(startDate); ! future = DateHandler.cleanDay(endDate); lw = Calendar.getInstance(); if (lastWeek == null || future == null) { int dow = lw.get(Calendar.DAY_OF_WEEK); lw.add(Calendar.DATE, -dow - 6); ! lastWeek = DateHandler.cleanDay(lw.getTime()); lw.add(Calendar.DATE, 5 * 7); ! future = DateHandler.cleanDay(lw.getTime()); } totalDays = --- 142,159 ---- //calculate the date ! this.currentDate = cleanDay(new Date()); this.currentTime = currentDate.getTime(); ! this.startDate = cleanDay(startDate); ! this.endDate = cleanDay(endDate); ! lastWeek = cleanDay(startDate); ! future = cleanDay(endDate); lw = Calendar.getInstance(); if (lastWeek == null || future == null) { int dow = lw.get(Calendar.DAY_OF_WEEK); lw.add(Calendar.DATE, -dow - 6); ! lastWeek = cleanDay(lw.getTime()); lw.add(Calendar.DATE, 5 * 7); ! future = cleanDay(lw.getTime()); } totalDays = *************** *** 165,177 **** } ! public static Date cleanDay(long date) { return DateHandler.cleanDay(new Date(date)); } ! public static Date cleanDay(int date) { return DateHandler.cleanDay(new Date(date)); } ! public static Date cleanDay(Date date) { date.setHours(0); date.setMinutes(0); --- 165,177 ---- } ! private static Date cleanDay(long date) { return DateHandler.cleanDay(new Date(date)); } ! private static Date cleanDay(int date) { return DateHandler.cleanDay(new Date(date)); } ! private static Date cleanDay(Date date) { date.setHours(0); date.setMinutes(0); Index: PlanRenderer.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/scratchpad/org/krysalis/jcharts/gantt/PlanRenderer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PlanRenderer.java 2 Sep 2003 08:54:20 -0000 1.2 --- PlanRenderer.java 2 Sep 2003 09:08:47 -0000 1.3 *************** *** 250,255 **** int type = currentAction.getType(); ! Date start = DateHandler.cleanDay(currentAction.getStartDate()); ! Date end = DateHandler.cleanDay(currentAction.getEndDate()); if (end.after(dh.getLastWeek()) && start.before(dh.getFuture())) { --- 250,255 ---- int type = currentAction.getType(); ! Date start = currentAction.getStartDate(); ! Date end = currentAction.getEndDate(); if (end.after(dh.getLastWeek()) && start.before(dh.getFuture())) { *************** *** 307,313 **** RowItem fragment = (RowItem) fragments.get(i); ! Date fragmentStart = ! DateHandler.cleanDay(fragment.getStartDate()); ! Date fragmentEnd = DateHandler.cleanDay(fragment.getEndDate()); int fragmentDays = dh.getDayDiff(fragmentEnd, fragmentStart); --- 307,312 ---- RowItem fragment = (RowItem) fragments.get(i); ! Date fragmentStart = fragment.getStartDate(); ! Date fragmentEnd = fragment.getEndDate(); int fragmentDays = dh.getDayDiff(fragmentEnd, fragmentStart); *************** *** 348,353 **** for (int i = 0; i < milestonesSize; i++) { int multiplicity = ((Integer) multiplicities.get(i)).intValue(); ! Date milestoneStart = ! DateHandler.cleanDay((Date) milestones.get(i)); int daysToStartMilestone = --- 347,351 ---- for (int i = 0; i < milestonesSize; i++) { int multiplicity = ((Integer) multiplicities.get(i)).intValue(); ! Date milestoneStart = (Date) milestones.get(i); int daysToStartMilestone = |