protected PanelStartGameDialog getNext() {
return new PanelLoading(getDialog(), null);
}
private final void initGui() {
GlobalProperties globalProp = Helpers.getGlobalProperties();
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
Vector<String> savedGames = getSavedGames();
savedGameList = new MyList<String>(savedGames);
savedGameList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
savedGameList.setLayoutOrientation(JList.VERTICAL);
JScrollPane listScroller = new JScrollPane(savedGameList);
listScroller.setPreferredSize(new Dimension(PREFERED_GAME_LIST_WIDTH,
PREFERED_GAME_LIST_HEIGHT));
this.add(listScroller);
JPanel buttonPanel = new JPanel(new FlowLayout());
JButton createButton = new JButton(Languages.getText("load"));
createButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
loadCampaign();
}
});
JButton cancelButton = new JButton(Languages.getText("cancel"));
cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
previousState();
}
});
buttonPanel.add(cancelButton);
buttonPanel.add(createButton);
String campaignName = globalProp.getLoadCampaign();
savedGameList.setSelectedValue(campaignName, true);
this.add(buttonPanel);
}