jadex.micro.examples.mandelbrot.MandelbrotPanel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-micro Show documentation
Show all versions of jadex-applications-micro Show documentation
The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.
package jadex.micro.examples.mandelbrot;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import jadex.bridge.IExternalAccess;
import jadex.bridge.service.IService;
import jadex.bridge.service.types.appstore.IAppGui;
import jadex.commons.future.IFuture;
import jadex.commons.gui.SGUI;
/**
*
*/
public class MandelbrotPanel extends JPanel implements IAppGui
{
/** The agent. */
protected IExternalAccess agent;
/** The service. */
protected IMandelbrotService service;
/** The display panel. */
protected DisplayPanel dispanel;
/**
*
*/
public MandelbrotPanel()
{
this.setLayout(new BorderLayout());
// this.add(new JButton("test"), BorderLayout.CENTER);
}
/**
*
*/
public IFuture init(IExternalAccess agent, IService service)
{
this.agent = agent;
this.service = (IMandelbrotService)service;
dispanel = new DisplayPanel(agent, this.service);
this.add(dispanel, BorderLayout.CENTER);
return IFuture.DONE;
}
/**
*
*/
public IFuture shutdown()
{
return IFuture.DONE;
}
/**
*
*/
public static void main(String[] args)
{
JFrame fr = new JFrame();
fr.add(new MandelbrotPanel());
fr.setLocation(SGUI.calculateMiddlePosition(fr));
fr.pack();
fr.setVisible(true);
}
}