Search in sources :

Example 1 with TicketData

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;
}
Also used : TicketData(lab.ticket.model.TicketData) Component(java.awt.Component)

Aggregations

Component (java.awt.Component)1 TicketData (lab.ticket.model.TicketData)1