Logo Search packages:      
Sourcecode: pcalendar version File versions  Download package

PCalDayInfo net::sf::linuxorg::pcal::engine::Engine::getDayInfo ( final Date  date ) [inline]

This is the main method of the entire application. The calendar day color and properties are determined here

Parameters:
date- the date being analyzed
Returns:
date information or NULL if no data available

Definition at line 181 of file Engine.java.

References dateTypes, net::sf::linuxorg::pcal::engine::DayInfoRecordsFactory::getDay1Info(), getDayInfoEstimated(), getDayInfoRecorded(), and getOvulationDayInfo().

Referenced by net::sf::linuxorg::pcal::bbtgui::BBTWidget::generateHorizontalLabels(), net::sf::linuxorg::pcal::MainWindow::refreshCalendar(), net::sf::linuxorg::pcal::engine::EngineTest::testAddBirthDate(), net::sf::linuxorg::pcal::engine::EngineTest::testAddPregnancyDate(), net::sf::linuxorg::pcal::engine::EngineTest::testAddStartDate(), net::sf::linuxorg::pcal::engine::EngineTest::testGetDayInfo(), net::sf::linuxorg::pcal::engine::EngineTest::testGetDayInfoWithOvulations(), and net::sf::linuxorg::pcal::engine::EngineTest::testRemoveDateRecord().

      {
            if(startDates.isEmpty()) {
                  // no data at all
                  return null;
            } else { 
                  PCalDayInfo info = null;

                  Integer rectype = dateTypes.get(date);
                  if(rectype != null) {
                        if(rectype == PCAL_TYPE_OVULATION) {
                              // ovulation is processed in other way
                              info = getOvulationDayInfo(date);
                              info.ovulation = true;
                        } else {
                              // this date is really in the database as day 1 (mens, pregnancy or birth)
                              info = DayInfoRecordsFactory.getDay1Info(rectype);
                        }
                  }
                  else
                        if(date.before(startDates.first())) {
                              // the requested date is before the recorded periods
                              return null;
                        } else {
                              Date last_date = startDates.last();
                              // is the date in the recorded period?
                              if(date.before(last_date)) {
                                    info = getDayInfoRecorded(date); 
                              } else {
                                    info = getDayInfoEstimated(date, last_date); 
                              }
                        }
                  return info;
            }
      }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index