public void widgetSelected(SelectionEvent e) {
    TableItem[] items = table.getSelection();
    GregorianCalendar first = null;
    GregorianCalendar last = null;
    for (int i = 0; i < items.length; i++) {
      File f = (File) items[i].getData();
      Manifest mf = null;
      try {
        mf =
            ArchiveManifestCache.getInstance()
                .getManifest(
                    (AbstractIncrementalFileSystemMedium)
                        Application.getInstance().getCurrentTarget().getMedium(),
                    f);
      } catch (ApplicationException e1) {
        Application.getInstance().handleException(e1);
      }
      if (mf != null && mf.getDate() != null) {
        GregorianCalendar date = mf.getDate();
        if (first == null || date.before(first)) {
          first = date;
        }
        if (last == null || date.after(last)) {
          last = date;
        }
      }
    }

    Application.getInstance().setCurrentDates(first, last);
  }
Esempio n. 2
0
  /**
   * Draws a time sync line on the plot at the specified time. We take the approach of plotting the
   * time sync line like another data series in preference to using Quinn-Curtis' line drawing
   * function.
   *
   * @param time at which to draw the time sync line.
   */
  void drawTimeSyncLineAtTime(GregorianCalendar time) {
    assert time != null;

    // Peg timesync line to the plot area by setting the time
    // parameter to be on the plot max or plot min.
    if (time.before(plot.getCurrentTimeAxisMin())) {
      time = plot.getCurrentTimeAxisMin();
    } else if (time.after(plot.getCurrentTimeAxisMax())) {
      time = plot.getCurrentTimeAxisMax();
    }

    syncTime = time;

    if (timeSyncLinePlot == null) {
      AbstractAxis timeAxis = plot.getTimeAxis();
      if (timeAxis instanceof XYAxis) { // Only decorate time-like axes; TODO: move to AbstractAxis?
        timeSyncLinePlot = new XYMarkerLine((XYAxis) timeAxis, time.getTimeInMillis());
        timeSyncLinePlot.setForeground(PlotConstants.TIME_SYNC_LINE_COLOR);
        XYPlotContents contents = plot.getPlotView().getContents();
        contents.add(timeSyncLinePlot);
        contents.revalidate();
      }
    } else {
      timeSyncLinePlot.setValue(time.getTimeInMillis());
    }
  }
 /*     */ private boolean esAnterior(Date date) /*     */ {
   /* 120 */ GregorianCalendar fecha = new GregorianCalendar();
   /* 121 */ fecha.setTimeInMillis(date.getTime());
   /* 122 */ GregorianCalendar hoy = new GregorianCalendar();
   /*     */
   /* 126 */ return (!hoy.before(fecha)) && /* 124 */ (hoy.get(6) != /* 125 */ fecha.get(6));
   /*     */ }
 public int getMonths(GregorianCalendar g1, GregorianCalendar g2) {
   int elapsed = 0;
   GregorianCalendar gc1, gc2;
   if (g2.after(g1)) {
     gc2 = (GregorianCalendar) g2.clone();
     gc1 = (GregorianCalendar) g1.clone();
   } else {
     gc2 = (GregorianCalendar) g1.clone();
     gc1 = (GregorianCalendar) g2.clone();
   }
   gc1.clear(Calendar.MILLISECOND);
   gc1.clear(Calendar.SECOND);
   gc1.clear(Calendar.MINUTE);
   gc1.clear(Calendar.HOUR_OF_DAY);
   gc1.clear(Calendar.DATE);
   gc2.clear(Calendar.MILLISECOND);
   gc2.clear(Calendar.SECOND);
   gc2.clear(Calendar.MINUTE);
   gc2.clear(Calendar.HOUR_OF_DAY);
   gc2.clear(Calendar.DATE);
   while (gc1.before(gc2)) {
     gc1.add(Calendar.MONTH, 1);
     elapsed++;
   }
   return elapsed;
 }
  /**
   * Calculates the elapsed time between 2 dates. The elapsed time calculated could either be in
   * years, months or days
   *
   * @param type (int) The variable type determines the calculation of the elapsed time to be based
   *     on either years, months or days. To compute the elapsed time in year input type set to
   *     Calendar.YEAR To compute the elapsed time in month input type set to Calendar.MONTH By
   *     default the elapsed time will compute in days
   * @param startDate start date
   * @param endDate end date
   * @return the elapsed time (int)
   */
  public static int getElapsedTime(int type, Date startDate, Date endDate) {
    int elapsed = 0;

    if ((startDate == null) || (endDate == null)) {
      return -1;
    }

    if (startDate.after(endDate)) {
      return -1;
    }

    GregorianCalendar gc1 = (GregorianCalendar) GregorianCalendar.getInstance();
    GregorianCalendar gc2 = (GregorianCalendar) gc1.clone();
    gc1.setTime(startDate);
    gc2.setTime(endDate);

    gc1.clear(Calendar.MILLISECOND);
    gc1.clear(Calendar.SECOND);
    gc1.clear(Calendar.MINUTE);
    gc1.clear(Calendar.HOUR_OF_DAY);
    gc2.clear(Calendar.MILLISECOND);
    gc2.clear(Calendar.SECOND);
    gc2.clear(Calendar.MINUTE);
    gc2.clear(Calendar.HOUR_OF_DAY);

    if ((type != Calendar.MONTH) && (type != Calendar.YEAR)) {
      type = Calendar.DATE;
    }

    if (type == Calendar.MONTH) {
      gc1.clear(Calendar.DATE);
      gc2.clear(Calendar.DATE);
    }

    if (type == Calendar.YEAR) {
      gc1.clear(Calendar.DATE);
      gc2.clear(Calendar.DATE);
      gc1.clear(Calendar.MONTH);
      gc2.clear(Calendar.MONTH);
    }

    while (gc1.before(gc2)) {
      gc1.add(type, 1);
      elapsed++;
    }

    return elapsed;
  }
  public static boolean needsToRenew(UserModel u) {
    if (u.isMember("Associate")) {
      return true;
    }

    GregorianCalendar cal = new GregorianCalendar();
    cal.set(Calendar.MONTH, Calendar.JANUARY);
    cal.set(Calendar.DAY_OF_MONTH, 20);
    cal.set(Calendar.YEAR, 2009);
    cal.set(Calendar.HOUR_OF_DAY, 1);
    cal.set(Calendar.MINUTE, 0);

    GregorianCalendar exp = new GregorianCalendar();
    exp.setTime(u.getExpiry());
    return exp.before(cal);
  }
Esempio n. 7
0
 public void jButtonStart_actionPerformed(ActionEvent e) {
   GregorianCalendar now = new GregorianCalendar();
   if (now.before(new GregorianCalendar(2005, 12, 31))) {
     jButtonStop.setEnabled(true);
     server = new Server(this);
     server.start();
     //        System.out.println(System.getProperty("sun.boot.class.path"));
     statusBar.setText("Server is running...");
     jButtonStart.setEnabled(false);
     jButtonConfig.setEnabled(false);
   } else {
     JOptionPane.showMessageDialog(
         this,
         "Evaluation License has expired or is obsolete;\nplease contact vendor for renewal.",
         "License Error",
         JOptionPane.ERROR_MESSAGE);
   }
 }
Esempio n. 8
0
  public static Timetable calc(GregorianCalendar data) {
    GregorianCalendar limit = (GregorianCalendar) data.clone();

    // data is before 08:00 -> VAZIO
    limit.set(Calendar.HOUR_OF_DAY, 8);
    limit.set(Calendar.MINUTE, 0);

    if (data.before(limit)) return new Timetable(Horario.VAZIO, limit, Horario.CHEIO);

    // data is between 08:00 and 09:00 -> CHEIO
    limit.set(Calendar.HOUR_OF_DAY, 9);
    limit.set(Calendar.MINUTE, 0);

    if (data.before(limit)) return new Timetable(Horario.CHEIO, limit, Horario.PONTA);

    // data is between 09:00 and 10:30 -> PONTA
    limit.set(Calendar.HOUR_OF_DAY, 10);
    limit.set(Calendar.MINUTE, 30);

    if (data.before(limit)) return new Timetable(Horario.PONTA, limit, Horario.CHEIO);

    // data is between 10:30 and 18:00 -> CHEIO
    limit.set(Calendar.HOUR_OF_DAY, 18);
    limit.set(Calendar.MINUTE, 0);

    if (data.before(limit)) return new Timetable(Horario.CHEIO, limit, Horario.PONTA);

    // data is between 18:00 and 20:30 -> PONTA
    limit.set(Calendar.HOUR_OF_DAY, 20);
    limit.set(Calendar.MINUTE, 30);

    if (data.before(limit)) return new Timetable(Horario.PONTA, limit, Horario.CHEIO);

    // data is between 20:30 and 22:00 -> CHEIO
    limit.set(Calendar.HOUR_OF_DAY, 22);
    limit.set(Calendar.MINUTE, 0);

    if (data.before(limit)) return new Timetable(Horario.CHEIO, limit, Horario.VAZIO);

    // data is between 22:00 and 08:00 next morning -> VAZIO
    limit.add(Calendar.DAY_OF_YEAR, 1);
    limit.set(Calendar.HOUR_OF_DAY, 8);
    limit.set(Calendar.MINUTE, 0);
    return new Timetable(Horario.VAZIO, limit, Horario.CHEIO);
  }
Esempio n. 9
0
  public void actionPerformed(ActionEvent aE) {
    if (aE.getSource() == plotButton) {
      if (sourceTable.sourceListModel.isSelectionEmpty() == false
          && sourceTable.getValueAt(sourceTable.getSelectedRow(), 0) != null) {
        // Build dates
        final GregorianCalendar startDate = new GregorianCalendar();
        final GregorianCalendar endDate = new GregorianCalendar();
        startDate.setTimeZone(TimeZone.getTimeZone("GMT+10"));
        endDate.setTimeZone(TimeZone.getTimeZone("GMT+10"));
        try {
          Calendar now = GregorianCalendar.getInstance();
          now.setTimeZone(TimeZone.getTimeZone("GMT+10"));
          now.set(Calendar.HOUR_OF_DAY, 0);
          now.set(Calendar.MINUTE, 0);
          now.set(Calendar.SECOND, 0);
          now.set(Calendar.MILLISECOND, 0);
          if (week.isSelected()) {
            startDate.setTimeInMillis(now.getTimeInMillis() - ((long) 7 * 24 * 60 * 60 * 1000));
            endDate.setTimeInMillis(now.getTimeInMillis());
          } else if (month.isSelected()) {
            startDate.setTimeInMillis(now.getTimeInMillis() - ((long) 28 * 24 * 60 * 60 * 1000));
            endDate.setTimeInMillis(now.getTimeInMillis());
          } else if (thisMonth.isSelected()) {
            Calendar monthStart = new GregorianCalendar();
            monthStart.setTimeZone(TimeZone.getTimeZone("GMT+10"));
            monthStart.setTimeInMillis(now.getTimeInMillis());
            if (monthStart.get(Calendar.DAY_OF_MONTH) == 1) {
              monthStart.set(Calendar.MONTH, monthStart.get(Calendar.MONTH) - 1);
            }
            monthStart.set(Calendar.DAY_OF_MONTH, 1);
            startDate.setTimeInMillis(monthStart.getTimeInMillis());
            endDate.setTimeInMillis(now.getTimeInMillis());
          } else {
            startDate.setTime(dateParser.parse(startDateS.getSelectedItem().toString() + " 00:00"));
            endDate.setTime(dateParser.parse(endDateS.getSelectedItem().toString() + " 00:00"));
            endDate.add(Calendar.DATE, 1); // for "inclusive"
          }
          // SimpleDateFormat sqlDateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          // sqlDateFormatter.setTimeZone(TimeZone.getTimeZone("GMT+10"));
          // System.out.println(sqlDateFormatter.format(startDate.getTimeInMillis())+"
          // "+sqlDateFormatter.format(endDate.getTimeInMillis()));

          if (startDate.before(endDate)) {
            loadingLayerUI.start();

            final Thread fetchMissingData =
                new Thread( // Thread to fetch missing Data in
                    new Runnable() {
                      public void run() {
                        missingPlotter.setData(
                            dbConn,
                            siteTable.getValueAt(siteTable.getSelectedRow(), 0).toString(),
                            getSelectedSources(sourceTable.getSelectedRows()),
                            startDate.getTimeInMillis(),
                            endDate.getTimeInMillis(),
                            1440);
                      }
                    });

            fetchMissingData.start(); // Fetch Missing Data

            new Thread(
                    new Runnable() { // new Thread to wait for missing data to complete and then
                                     // ungrey window
                      public void run() {
                        try {
                          fetchMissingData.join();
                        } catch (InterruptedException e) {
                          e.printStackTrace();
                        }
                        loadingLayerUI.stop();
                      }
                    })
                .start();

          } else {
            JOptionPane.showMessageDialog(null, "Error: Start date must be before End Date.");
          }
        } catch (ParseException e) {
          e.printStackTrace();
          JOptionPane.showMessageDialog(
              null, "Error: could not build valid dates from the selection made.");
        }
      } else {
        JOptionPane.showMessageDialog(
            null,
            "Error Code 002\r\nPlease select a file to Analyse.",
            "Error",
            JOptionPane.ERROR_MESSAGE);
      }
    }
  }
  /**
   * Contract: get routes from shedule with StationInfos from filter; check that arrival station in
   * selected route is after departure station; if exist start or end of date range in the filter
   * then check date conditions
   *
   * @param filter contains two StationInfo and range of dates between arrival and departure
   * @return SheduleItems that satisfy the conditions
   */
  @Transactional(readOnly = true)
  public List<SheduleItemEntity> searchBetweenStations(StationsFilter filter) {
    List<SheduleItemEntity> sheduleItemsList = new ArrayList<SheduleItemEntity>();

    List<StationInfoEntity> stationInfoList = new ArrayList<StationInfoEntity>();
    stationInfoList.add(filter.getStationInfoFrom());
    stationInfoList.add(filter.getStationInfoTo());
    for (SheduleItemEntity sheduleItem : this.sheduleDAO.getByStations(stationInfoList)) {
      StationEntity stationFrom = null;
      StationEntity stationTo = null;
      for (StationEntity station : sheduleItem.getRoute().getStationsList()) {
        if (station.getStationInfo().equals(filter.getStationInfoFrom())) {
          stationFrom = station;
        }
        if (station.getStationInfo().equals(filter.getStationInfoTo())) {
          stationTo = station;
        }
      }

      if ((stationTo != null)
          && (stationFrom != null)
          && (stationTo.getTimeOffset() > stationFrom.getTimeOffset())) {
        GregorianCalendar depDateStationFrom = new GregorianCalendar();
        depDateStationFrom.setTime(sheduleItem.getDepartureDate());
        depDateStationFrom.add(Calendar.MINUTE, stationFrom.getTimeOffset());

        GregorianCalendar depDateStationTo = new GregorianCalendar();
        depDateStationTo.setTime(sheduleItem.getDepartureDate());
        depDateStationTo.add(Calendar.MINUTE, stationTo.getTimeOffset());

        GregorianCalendar fromDate = null;
        boolean isAfterDepDateFrom = false;
        if (filter.getStartDate() != null) {
          fromDate = new GregorianCalendar();
          fromDate.setTime(filter.getStartDate());
          isAfterDepDateFrom = depDateStationFrom.after(fromDate);
        }

        GregorianCalendar toDate = null;
        boolean isBeforeDepDateTo = false;
        if (filter.getEndDate() != null) {
          toDate = new GregorianCalendar();
          toDate.setTime(filter.getEndDate());
          isBeforeDepDateTo = depDateStationTo.before(toDate);
        }

        boolean needAddSheduleItem = false;
        if (fromDate != null && toDate != null && isAfterDepDateFrom && isBeforeDepDateTo) {
          needAddSheduleItem = true;
        } else if (fromDate != null && toDate == null && isAfterDepDateFrom) {
          needAddSheduleItem = true;
        } else if (fromDate == null && toDate != null && isBeforeDepDateTo) {
          needAddSheduleItem = true;
        } else if (fromDate == null && toDate == null) {
          needAddSheduleItem = true;
        }

        if (needAddSheduleItem) {
          try {
            SheduleItemEntity cloneSheduleItem = (SheduleItemEntity) sheduleItem.clone();
            cloneSheduleItem.getRoute().getStationsList().clear();
            cloneSheduleItem.getRoute().getStationsList().add(stationFrom);
            cloneSheduleItem.getRoute().getStationsList().add(stationTo);
            sheduleItemsList.add(cloneSheduleItem);
          } catch (CloneNotSupportedException exc) {
            exc.printStackTrace();
            LOGGER.warn(exc);
          }
        }
      }
    }

    return sheduleItemsList;
  }
    boolean tooOld() {
      GregorianCalendar now = new GregorianCalendar();

      now.add(Calendar.MINUTE, -10);
      return timestamp.before(now);
    }
 /**
  * @param ticker The ticker of the stock to look up.
  * @param startdate The first date of the range of dates over which to search.
  * @return A retrieval.CSV that contains the given stock's data over the past year.
  * @throws ConnectionException if it has problems connecting to Yahoo.
  * @throws exceptions.MissingCSVDataException if Yahoo does not have any data for the given stock.
  * @throws exceptions.InvalidStartDateException if the start date is equal to or after the current
  *     date.
  */
 public synchronized YahooCSV getStockData(String ticker, GregorianCalendar startdate)
     throws ConnectionException, MissingCSVDataException, InvalidStartDateException {
   // Make sure that the start date is before today!
   GregorianCalendar today = new GregorianCalendar();
   if (!startdate.before(today)) {
     throw new InvalidStartDateException("The start date must be before the current date.");
   }
   // This connection loop will re-connect to Yahoo if the initial and
   // subsequent attempts fail.
   boolean connectionsuccess = false;
   while (!connectionsuccess) {
     try {
       String contents =
           client
               .getPage(
                   new StringBuilder("http://real-chart.finance.yahoo.com/table.csv?s=")
                       .append(ticker)
                       .append("&a=")
                       .append(startdate.get(Calendar.MONTH))
                       .append("&b=")
                       .append(startdate.get(Calendar.DATE))
                       .append("&c=")
                       .append(startdate.get(Calendar.YEAR))
                       .toString())
               .getWebResponse()
               .getContentAsString();
       if (contents.charAt(0) == '<') {
         // There is no stock data for the given ticker, and Yahoo
         // has responded with an error page rather than a CSV.
         throw new MissingCSVDataException("No data exists for this stock");
       }
       final YahooCSV csv = new YahooCSV(contents, ticker);
       connectionsuccess = true;
       client.close();
       System.out.println(ticker + " connected to Yahoo.");
       return csv;
     } catch (UnknownHostException uhe) {
       // Connection error.
       System.out.println(
           new StringBuilder("Exception in ")
               .append("retrieval.InternetConnection.getStockData(")
               .append(ticker)
               .append(")")
               .toString());
       System.out.println(uhe.toString());
       System.out.println("Waiting to reconnect.");
       try {
         Thread.sleep(5000);
       } catch (Exception e) {
         System.out.println(
             new StringBuilder("Exception in ")
                 .append("retrieval.InternetConnection.getStockData(")
                 .append(ticker)
                 .append(")")
                 .toString());
         System.out.println(uhe.toString());
       }
     } catch (MissingCSVDataException mcsvde) {
       // There is no CSV data for this stock.
       System.out.println(
           new StringBuilder("Exception in ")
               .append("retrieval.InternetConnection.getStockData(")
               .append(ticker)
               .append(")")
               .toString());
       System.out.println(mcsvde.toString());
       connectionsuccess = true;
       client.close();
     } catch (Exception e) {
       System.out.println(
           new StringBuilder("Exception in ")
               .append("retrieval.InternetConnection.getStockData(")
               .append(ticker)
               .append(")")
               .toString());
       System.out.println(e.toString());
     }
   }
   throw new ConnectionException(
       new StringBuilder("Unable to find CSV File for ").append(ticker).toString());
 }
  @Override
  protected Object doInBackground() throws Exception {
    ReleaseNotifierDialog.ovaReleased.clear();
    ReleaseNotifierDialog.filmReleased.clear();
    String oggi = MAMUtil.today();
    GregorianCalendar today = MAMUtil.getDate(oggi);
    GregorianCalendar lastControlDate = null;
    if (!AnimeIndex.appProp.getProperty("Date_Release").equalsIgnoreCase("none"))
      lastControlDate = MAMUtil.getDate(AnimeIndex.appProp.getProperty("Date_Release"));
    GregorianCalendar animeDate = null;
    Object[] ovaArray = AnimeIndex.ovaModel.toArray();
    for (int i = 0; i < ovaArray.length; i++) {
      String name = (String) ovaArray[i];
      AnimeData data = AnimeIndex.ovaMap.get(name);
      String releaseDate = data.getFinishDate();
      String secondaryReleaseDate = data.getReleaseDate();

      if (releaseDate.contains("?") || today.before(MAMUtil.getDate(releaseDate))) {
        if (!secondaryReleaseDate.contains("?")) animeDate = MAMUtil.getDate(secondaryReleaseDate);
      } else animeDate = MAMUtil.getDate(releaseDate);
      if (animeDate != null) {
        if (AnimeIndex.openReleaseDialog == true)
          if (AnimeIndex.exitDateMap.containsKey(name))
            if (MAMUtil.getDate(AnimeIndex.exitDateMap.get(name)).equals(today))
              if (animeDate.before(today) || animeDate.equals(today)) {
                ReleaseNotifierDialog.ovaReleased.addElement(name);
                if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                  AnimeData newData =
                      new AnimeData(
                          data.getCurrentEpisode(),
                          data.getTotalEpisode(),
                          data.getFansub(),
                          data.getNote(),
                          data.getImageName(),
                          "Rilasciato",
                          data.getId(),
                          data.getLinkName(),
                          data.getLink(),
                          data.getAnimeType(),
                          data.getReleaseDate(),
                          data.getFinishDate(),
                          data.getDurationEp(),
                          data.getBd());
                  AnimeIndex.ovaMap.put(name, newData);
                }
              }

        if (lastControlDate != null) {
          if (animeDate.after(lastControlDate)) {
            if (AnimeIndex.exitDateMap.containsKey(name)) {
              if (MAMUtil.getDate(AnimeIndex.exitDateMap.get(name)).before(animeDate)) {
                if (animeDate.before(today) || animeDate.equals(today)) {
                  ReleaseNotifierDialog.ovaReleased.addElement(name);
                  AnimeIndex.exitDateMap.put(name, oggi);
                  if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                    AnimeData newData =
                        new AnimeData(
                            data.getCurrentEpisode(),
                            data.getTotalEpisode(),
                            data.getFansub(),
                            data.getNote(),
                            data.getImageName(),
                            "Rilasciato",
                            data.getId(),
                            data.getLinkName(),
                            data.getLink(),
                            data.getAnimeType(),
                            data.getReleaseDate(),
                            data.getFinishDate(),
                            data.getDurationEp(),
                            data.getBd());
                    AnimeIndex.ovaMap.put(name, newData);
                  }
                }
              }
            } else if (animeDate.before(today) || animeDate.equals(today)) {
              ReleaseNotifierDialog.ovaReleased.addElement(name);
              AnimeIndex.exitDateMap.put(name, oggi);
              if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                AnimeData newData =
                    new AnimeData(
                        data.getCurrentEpisode(),
                        data.getTotalEpisode(),
                        data.getFansub(),
                        data.getNote(),
                        data.getImageName(),
                        "Rilasciato",
                        data.getId(),
                        data.getLinkName(),
                        data.getLink(),
                        data.getAnimeType(),
                        data.getReleaseDate(),
                        data.getFinishDate(),
                        data.getDurationEp(),
                        data.getBd());
                AnimeIndex.ovaMap.put(name, newData);
              }
            }
          }
        } else if (AnimeIndex.exitDateMap.containsKey(name)) {
          if (MAMUtil.getDate(AnimeIndex.exitDateMap.get(name)).before(animeDate)) {
            if (animeDate.before(today) || animeDate.equals(today)) {
              ReleaseNotifierDialog.ovaReleased.addElement(name);
              AnimeIndex.exitDateMap.put(name, oggi);
              if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                AnimeData newData =
                    new AnimeData(
                        data.getCurrentEpisode(),
                        data.getTotalEpisode(),
                        data.getFansub(),
                        data.getNote(),
                        data.getImageName(),
                        "Rilasciato",
                        data.getId(),
                        data.getLinkName(),
                        data.getLink(),
                        data.getAnimeType(),
                        data.getReleaseDate(),
                        data.getFinishDate(),
                        data.getDurationEp(),
                        data.getBd());
                AnimeIndex.ovaMap.put(name, newData);
              }
            }
          }
        } else if (animeDate.before(today) || animeDate.equals(today)) {
          ReleaseNotifierDialog.ovaReleased.addElement(name);
          AnimeIndex.exitDateMap.put(name, oggi);
          if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
            AnimeData newData =
                new AnimeData(
                    data.getCurrentEpisode(),
                    data.getTotalEpisode(),
                    data.getFansub(),
                    data.getNote(),
                    data.getImageName(),
                    "Rilasciato",
                    data.getId(),
                    data.getLinkName(),
                    data.getLink(),
                    data.getAnimeType(),
                    data.getReleaseDate(),
                    data.getFinishDate(),
                    data.getDurationEp(),
                    data.getBd());
            AnimeIndex.ovaMap.put(name, newData);
          }
        }
      }
    }

    animeDate = null;
    Object[] filmArray = AnimeIndex.filmModel.toArray();
    for (int i = 0; i < filmArray.length; i++) {
      String name = (String) filmArray[i];
      AnimeData data = AnimeIndex.filmMap.get(name);
      String releaseDate = data.getFinishDate();
      String secondaryReleaseDate = data.getReleaseDate();

      if (releaseDate.contains("?") || today.before(MAMUtil.getDate(releaseDate))) {
        if (!secondaryReleaseDate.contains("?")) animeDate = MAMUtil.getDate(secondaryReleaseDate);
      } else animeDate = MAMUtil.getDate(releaseDate);
      if (animeDate != null) {
        if (AnimeIndex.openReleaseDialog == true)
          if (AnimeIndex.exitDateMap.containsKey(name))
            if (MAMUtil.getDate(AnimeIndex.exitDateMap.get(name)).equals(today))
              if (animeDate.before(today) || animeDate.equals(today)) {
                ReleaseNotifierDialog.filmReleased.addElement(name);
                if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                  AnimeData newData =
                      new AnimeData(
                          data.getCurrentEpisode(),
                          data.getTotalEpisode(),
                          data.getFansub(),
                          data.getNote(),
                          data.getImageName(),
                          "Rilasciato",
                          data.getId(),
                          data.getLinkName(),
                          data.getLink(),
                          data.getAnimeType(),
                          data.getReleaseDate(),
                          data.getFinishDate(),
                          data.getDurationEp(),
                          data.getBd());
                  AnimeIndex.filmMap.put(name, newData);
                }
              }

        if (lastControlDate != null) {
          if (animeDate.after(lastControlDate)) {
            if (AnimeIndex.exitDateMap.containsKey(name)) {
              if (MAMUtil.getDate(AnimeIndex.exitDateMap.get(name)).before(animeDate)) {
                if (animeDate.before(today) || animeDate.equals(today)) {
                  ReleaseNotifierDialog.filmReleased.addElement(name);
                  AnimeIndex.exitDateMap.put(name, oggi);
                  if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                    AnimeData newData =
                        new AnimeData(
                            data.getCurrentEpisode(),
                            data.getTotalEpisode(),
                            data.getFansub(),
                            data.getNote(),
                            data.getImageName(),
                            "Rilasciato",
                            data.getId(),
                            data.getLinkName(),
                            data.getLink(),
                            data.getAnimeType(),
                            data.getReleaseDate(),
                            data.getFinishDate(),
                            data.getDurationEp(),
                            data.getBd());
                    AnimeIndex.filmMap.put(name, newData);
                  }
                }
              }
            } else if (animeDate.before(today) || animeDate.equals(today)) {
              ReleaseNotifierDialog.filmReleased.addElement(name);
              AnimeIndex.exitDateMap.put(name, oggi);
              if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                AnimeData newData =
                    new AnimeData(
                        data.getCurrentEpisode(),
                        data.getTotalEpisode(),
                        data.getFansub(),
                        data.getNote(),
                        data.getImageName(),
                        "Rilasciato",
                        data.getId(),
                        data.getLinkName(),
                        data.getLink(),
                        data.getAnimeType(),
                        data.getReleaseDate(),
                        data.getFinishDate(),
                        data.getDurationEp(),
                        data.getBd());
                AnimeIndex.filmMap.put(name, newData);
              }
            }
          }
        } else if (AnimeIndex.exitDateMap.containsKey(name)) {
          if (MAMUtil.getDate(AnimeIndex.exitDateMap.get(name)).before(animeDate)) {
            if (animeDate.before(today) || animeDate.equals(today)) {
              ReleaseNotifierDialog.filmReleased.addElement(name);
              AnimeIndex.exitDateMap.put(name, oggi);
              if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
                AnimeData newData =
                    new AnimeData(
                        data.getCurrentEpisode(),
                        data.getTotalEpisode(),
                        data.getFansub(),
                        data.getNote(),
                        data.getImageName(),
                        "Rilasciato",
                        data.getId(),
                        data.getLinkName(),
                        data.getLink(),
                        data.getAnimeType(),
                        data.getReleaseDate(),
                        data.getFinishDate(),
                        data.getDurationEp(),
                        data.getBd());
                AnimeIndex.filmMap.put(name, newData);
              }
            }
          }
        } else if (animeDate.before(today) || animeDate.equals(today)) {
          ReleaseNotifierDialog.filmReleased.addElement(name);
          AnimeIndex.exitDateMap.put(name, oggi);
          if (!data.getDay().equalsIgnoreCase("Rilasciato")) {
            AnimeData newData =
                new AnimeData(
                    data.getCurrentEpisode(),
                    data.getTotalEpisode(),
                    data.getFansub(),
                    data.getNote(),
                    data.getImageName(),
                    "Rilasciato",
                    data.getId(),
                    data.getLinkName(),
                    data.getLink(),
                    data.getAnimeType(),
                    data.getReleaseDate(),
                    data.getFinishDate(),
                    data.getDurationEp(),
                    data.getBd());
            AnimeIndex.filmMap.put(name, newData);
          }
        }
      }
    }
    if (ReleaseNotifierDialog.ovaReleased.isEmpty()) {
      ReleaseNotifierDialog.ovaReleased.addElement("Nessun Anime Rilasciato");
      enableOav = false;
    } else enableOav = true;
    if (ReleaseNotifierDialog.filmReleased.isEmpty()) {
      ReleaseNotifierDialog.filmReleased.addElement("Nessun Anime Rilasciato");
      enableFilm = false;
    } else enableFilm = true;
    return null;
  }