Exemple #1
0
  @Override
  public void fillModel() {
    TimeRangeStepModel model = TimeRangeStepModel.getInstance();
    // there is a own time range defined
    if (timeRangeGroup.getSelection() == miscTimeRange.getModel()) {
      model.setTimeRangeTyp(TimeRangeStepModel.MISC_TIME_RANGE);
      SimpleDateFormat df = new SimpleDateFormat("dd-mm-yyyy");
      final GregorianCalendar fromDate = new GregorianCalendar();
      final GregorianCalendar toDate = new GregorianCalendar();
      try {
        fromDate.setTime(df.parse(fromDateTxt.getText()));
        toDate.setTime(df.parse(toDateTxt.getText()));
      } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      model.setFromDate(fromDate);
      model.setToDate(toDate);
    } else {
      if (timeRangeGroup.getSelection() == easterbreak.getModel()) {
        model.setTimeRangeTyp(TimeRangeStepModel.EASTERBREAK_TIME_RANGE);
      } else if (timeRangeGroup.getSelection() == winterbreakBtn.getModel()) {
        model.setTimeRangeTyp(TimeRangeStepModel.WINTERBREAK_TIME_RANGE);
      } else if (timeRangeGroup.getSelection() == summerbreakBtn.getModel()) {
        model.setTimeRangeTyp(TimeRangeStepModel.SUMMERBREAK_TIME_RANGE);
      } else if (timeRangeGroup.getSelection() == autumbreakBtn.getModel()) {
        model.setTimeRangeTyp(TimeRangeStepModel.AUTUMNBREAK_TIME_RANGE);
      }

      SwingUtilities.invokeLater(
          new Runnable() {

            @Override
            public void run() {
              EventCollector collector = EventCollector.getInstance();
              collector.setHolidayView();
            }
          });
    }
  }
Exemple #2
0
 @Override
 public InformationGatherStepModel getModel() {
   return TimeRangeStepModel.getInstance();
 }