/** * Add the given project. * * @param project * the project to add * @param source * the source of the edit activity */ public final void addProject(final Project project, final Object source) { if (log.isDebugEnabled()) { log.debug("Adding project " + String.valueOf(project) + "."); } this.baralgaDAO.addProject(project); this.projectList.add(project); this.allProjectsList.add(project); final BaralgaEvent event = new BaralgaEvent(BaralgaEvent.PROJECT_ADDED, source); event.setData(project); notify(event); }
for (Project project : this.baralgaDAO.getActiveProjects()) { if (project.isActive()) { this.projectList.add(project);
/** * Fires an event that a projects property has changed. * * @param changedProject * the project that's changed * @param propertyChangeEvent * the event to fire */ public void fireProjectChangedEvent(final Project changedProject, final PropertyChangeEvent propertyChangeEvent) { final BaralgaEvent event = new BaralgaEvent(BaralgaEvent.PROJECT_CHANGED, this); event.setData(changedProject); event.setPropertyChangeEvent(propertyChangeEvent); this.baralgaDAO.updateProject(changedProject); notify(event); if (propertyChangeEvent.getPropertyName().equals(Project.PROPERTY_ACTIVE)) { if (changedProject.isActive()) { this.projectList.add(changedProject); } else { this.projectList.remove(changedProject); } } }
public void addHours(final ProjectActivity activity) { final HoursByProject newHoursByProject = new HoursByProject(activity.getProject(), activity.getDuration()); if (this.hoursByProjectList.contains(newHoursByProject)) { HoursByProject HoursByProject = this.hoursByProjectList.get(hoursByProjectList.indexOf(newHoursByProject)); HoursByProject.addHours(newHoursByProject.getHours()); } else { this.hoursByProjectList.add(newHoursByProject); } }
public void addHours(final ProjectActivity activity) { final HoursByDay newHoursByDay = new HoursByDay(activity.getStart(), activity.getDuration()); if (this.hoursByDayList.contains(newHoursByDay)) { HoursByDay HoursByDay = this.hoursByDayList.get(hoursByDayList.indexOf(newHoursByDay)); HoursByDay.addHours(newHoursByDay.getHours()); } else { this.hoursByDayList.add(newHoursByDay); } }
public void addHours(final ProjectActivity activity) { final DateTime dateTime = activity.getStart(); final HoursByMonth newHoursByMonth = new HoursByMonth(dateTime, activity.getDuration()); if (this.hoursByMonthList.contains(newHoursByMonth)) { HoursByMonth hoursByMonth = this.hoursByMonthList.get(hoursByMonthList.indexOf(newHoursByMonth)); hoursByMonth.addHours(newHoursByMonth.getHours()); } else { this.hoursByMonthList.add(newHoursByMonth); } }
public void addHours(final ProjectActivity activity) { final DateTime dateTime = activity.getStart(); final HoursByWeek newHoursByWeek = new HoursByWeek(dateTime, activity.getDuration()); if (this.hoursByWeekList.contains(newHoursByWeek)) { HoursByWeek hoursByWeek = this.hoursByWeekList.get(hoursByWeekList.indexOf(newHoursByWeek)); hoursByWeek.addHours(newHoursByWeek.getHours()); } else { this.hoursByWeekList.add(newHoursByWeek); } }
/** * Add given activity to the accumulated report. * * @param activity * the activity to be added */ public void acummulateActivity(final ProjectActivity activity) { AccumulatedProjectActivity newAccActivity = new AccumulatedProjectActivity(activity.getProject(), activity .getStart(), activity.getDuration()); if (this.accumulatedActivitiesByDay.contains(newAccActivity)) { final AccumulatedProjectActivity accActivity = this.accumulatedActivitiesByDay.get(accumulatedActivitiesByDay.indexOf(newAccActivity)); accActivity.addTime(newAccActivity.getTime()); } else { this.accumulatedActivitiesByDay.add(newAccActivity); } }
this.activitiesList.add(activity);
activitiesList.add(changedActivity);