selectioncontroller.java

来自「Java mulitplayer strategy game. Adaptati」· Java 代码 · 共 49 行

JAVA
49
字号
/*
 * SelectionController.java
 *
 * Created on 16 pa焏ziernik 2005, 21:49
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package net.sf.jawp.gui.client;

import java.util.ArrayList;

import net.sf.jawp.api.domain.Planet;

/**
 * 
 * @author jarek
 */
public class SelectionController
{
	private final ArrayList<SelectionListener> listeners;

	/** Creates a new instance of SelectionController */
	public SelectionController()
	{
		this.listeners = new ArrayList<SelectionListener>(5);
	}

	public final void addListener(final SelectionListener listener)
	{
		this.listeners.add(listener);
	}

	public final void removeListener(final SelectionListener listener)
	{
		listeners.remove(listener);
	}

	public final void selectPlanet(final Planet p, final MouseButton button)
	{
		for (final SelectionListener list : this.listeners)
		{
			list.onPlanetSelected(p, button);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?