jadex.bdibpmn.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-bdibpmn Show documentation
Show all versions of jadex-applications-bdibpmn Show documentation
The Jadex BDI-BPMN applications package contain
several example applications, benchmarks and
testcases using BDI agents that have BPMN plans.
package jadex.bdibpmn.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