jadex.bdi.examples.puzzle.BoardControlPanel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
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