Code Search for Developers
 
 
  

NewTournamentAction.java from The Geronimo Project at Krugle


Show NewTournamentAction.java syntax highlighted

package geronimo.hoshigo.control.tournament;

import geronimo.hoshigo.control.MainController;
import geronimo.hoshigo.model.tournament.Tournament;
import geronimo.hoshigo.view.IconRegistry;
import geronimo.hoshigo.view.IconRegistry.IconSize;
import geronimo.hoshigo.view.newtournament.NewTournamentWizard;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.wizard.WizardDialog;

public class NewTournamentAction extends Action
{
	private static NewTournamentAction instance;

	private NewTournamentAction()
	{
		super();
		this.setText("&Nouveau tournoi@Ctrl+T");
		this.setToolTipText("Nouveau tournoi");
		this.setImageDescriptor(IconRegistry.getDescriptor("new_tournament",
				IconSize.SMALL));
	}


	/**
	 * Changement de tournoi actif
	 * @param tournament Nouveau tournoi actif
	 */
	public void setActiveTournament(Tournament tournament)
	{
	}

	
	public synchronized static NewTournamentAction getInstance()
	{
		if (instance == null)
		{
			instance = new NewTournamentAction();
		}
		return instance;
	}

	public void run()
	{
		NewTournamentWizard wizard = new NewTournamentWizard();
		WizardDialog dialog = new WizardDialog(MainController.getMainWindow()
				.getShell(), wizard);
		dialog.setBlockOnOpen(true);
		dialog.open();
		
		if(dialog.getReturnCode() == WizardDialog.OK)
		{
			Tournament tournament = new Tournament
			(
				wizard.getGobanSize(),
				wizard.getHandicap(),
				wizard.getKomi(),
				wizard.isFreeHandicap(),
				wizard.getProgramConfig(),
				wizard.getOptions(),
				wizard.getRefereeConfig()
			);
			tournament.start();
			
			MainController.getGameDirectory().addTournament(tournament);
		}
	}
}




See more files for this project here

The Geronimo Project

The Geronimo project concists of two software :\n- Geronimo Hoshigo : a playable graphical user interface to play Go\n- Geronimo Margo : a artificial intelligence program which plays Go

Project homepage: http://sourceforge.net/projects/geronimo
Programming language(s): Java,Pascal,Perl,PHP
License: gpl2

  CloseTournamentAction.java
  NewTournamentAction.java
  OpenTournamentAction.java
  SaveTournamentAction.java
  SaveTournamentAsAction.java
  TournamentActionManager.java