Example #1
0
 private void editSchedule(int row) {
   log.debug("Edit schedule");
   if (sef != null) {
     sef.dispose();
   }
   Schedule sch = sysList.get(row);
   LocationTrackPair ltp = getLocationTrackPair(row);
   if (ltp == null) {
     log.debug("Need location track pair");
     JOptionPane.showMessageDialog(
         null,
         MessageFormat.format(Bundle.getMessage("AssignSchedule"), new Object[] {sch.getName()}),
         MessageFormat.format(
             Bundle.getMessage("CanNotSchedule"), new Object[] {Bundle.getMessage("Edit")}),
         JOptionPane.ERROR_MESSAGE);
     return;
   }
   // use invokeLater so new window appears on top
   SwingUtilities.invokeLater(
       new Runnable() {
         @Override
         public void run() {
           sef = new ScheduleEditFrame(sch, ltp.getTrack());
         }
       });
 }
Example #2
0
 public void dispose() {
   if (sef != null) {
     sef.dispose();
   }
   scheduleManager.removePropertyChangeListener(this);
   removePropertyChangeSchedules();
   removePropertyChangeTracks();
 }