use of lab.ticket.model.TicketData in project 12306-hunter by xautlx.
the class TicketMainFrame method bindUItoModel.
/**
* 绑定UI数据到模型对象
* @return
*/
private TicketData bindUItoModel() {
TicketData ticketData = new TicketData();
ticketData.setTrainFrom(textTrainFrom.getText());
ticketData.setTrainTo(textTrainTo.getText());
ticketData.setPrimaryTrainDate(textPrimaryTrainDate.getText());
ticketData.setExtraTrainDates(textExtraTrainDates.getText());
for (Component component : userPanelContainer.getComponents()) {
ticketData.getUserDatas().add(((UserPanel) component).bindUItoModel());
}
for (Component component : passengerPanelContainer.getComponents()) {
ticketData.getPassengerDatas().add(((PassengerPanel) component).bindUItoModel());
}
return ticketData;
}
Aggregations