Code Search for Developers
 
 
  

CloseTournamentAction.java from The Geronimo Project at Krugle


Show CloseTournamentAction.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 org.eclipse.jface.action.Action;

/**
 * Action de fermeture d'une partie. On ne peut fermer qu'un match amical
 * @author Geronimo
 */
public class CloseTournamentAction extends Action
{
	private static CloseTournamentAction instance;
	private Tournament tournament = null;
	
	/**
	 * Création de l'action. Privé car on n'autorise qu'une seule instance
	 * de la classe.
	 */
	private CloseTournamentAction()
	{
		super();
		this.setText("&Fermer le tournoi@Ctrl+Q");
		this.setToolTipText("Fermer le tournoi");
		this.setImageDescriptor(IconRegistry.getDescriptor("close_tournament",IconSize.SMALL));
		this.setEnabled(false);
	}
	
	/**
	 * Accès à l'instance de la classe.
	 * @return Retourne l'instance
	 */
	public synchronized static CloseTournamentAction getInstance()
	{
		// Creation de l'instance au premier appel
		if(instance == null)
		{
			instance = new CloseTournamentAction();
		}
		return instance;
	}
	
	/**
	 * Changement de tournoi actif
	 * @param tournament Nouveau tournoi actif
	 */
	public void setActiveTournament(Tournament tournament)
	{
		this.tournament = tournament;
		this.setEnabled(tournament != null);
	}

	/**
	 * Lancement de l'action. Supprime la partie du répertoire
	 */
	public void run()
	{
		if(this.tournament != null)
		{
			MainController.getGameDirectory().removeTournament(this.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