Package net.alteiar.campaign.player.tools

Examples of net.alteiar.campaign.player.tools.GlobalProperties


  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);
  }
View Full Code Here

TOP

Related Classes of net.alteiar.campaign.player.tools.GlobalProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.