All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bdi.examples.puzzle.BoardControlPanel Maven / Gradle / Ivy

Go to download

The Jadex BDI applications package contain several example applications, benchmarks and testcases using BDI agents.

There is a newer version: 2.4
Show newest version
package jadex.bdi.examples.puzzle;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JPanel;

/**
 *  The control part of
 */
public class BoardControlPanel extends JPanel
{
	//-------- constructors --------

	/**
	 *  Create a new board control panel.
	 */
	public BoardControlPanel(final IBoard board, BoardPanel bp)
	{
		bp.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				//System.out.println("Action event: "+e);
				Position p = (Position)e.getSource();

				List pmoves = board.getPossibleMoves();
				boolean moved = false;
				for(int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy