private void applySchedule() { TrainSchedule ts = trainScheduleManager.getScheduleById(getSelectedScheduleId()); if (ts != null) { for (Train train : trainManager.getTrainsByIdList()) { train.setBuildEnabled(ts.containsTrainId(train.getId())); } } }
private void updateCheckboxes(boolean selected) { TrainSchedule ts = trainScheduleManager.getScheduleById(getSelectedScheduleId()); if (ts != null) { for (Train train : trainManager.getTrainsByIdList()) { if (selected) { ts.addTrainId(train.getId()); } else { ts.removeTrainId(train.getId()); } } } }
public List<Train> getSortByList() { List<Train> sysList; String sortBy = getSortBy(); if (sortBy.equals(TrainsTableModel.IDCOLUMNNAME)) { sysList = trainManager.getTrainsByIdList(); } else if (sortBy.equals(TrainsTableModel.TIMECOLUMNNAME)) { sysList = trainManager.getTrainsByTimeList(); } else if (sortBy.equals(TrainsTableModel.DEPARTSCOLUMNNAME)) { sysList = trainManager.getTrainsByDepartureList(); } else if (sortBy.equals(TrainsTableModel.TERMINATESCOLUMNNAME)) { sysList = trainManager.getTrainsByTerminatesList(); } else if (sortBy.equals(TrainsTableModel.ROUTECOLUMNNAME)) { sysList = trainManager.getTrainsByRouteList(); } else if (sortBy.equals(TrainsTableModel.STATUSCOLUMNNAME)) { sysList = trainManager.getTrainsByStatusList(); } else if (sortBy.equals(TrainsTableModel.DESCRIPTIONCOLUMNNAME)) { sysList = trainManager.getTrainsByDescriptionList(); } else { sysList = trainManager.getTrainsByNameList(); } return sysList; }