package sim;

import java.awt.*;

public class ModulePanel extends Panel
{
	public ModulePanel()
	{
		super();
		
		this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
		this.setBackground(MainWindow.BACKGROUND);
	}
	
	public void add(ModuleButton mb)
	{
		mb.setListener(WestPanel.MODE_CONTROL);
		super.add(mb);
	}
	
	public void initializeListeners(ModuleButton mb)
	{
		mb.setListener(WestPanel.MODE_CONTROL);
	}
	
	public void setEnabled(boolean b)
	{
		for(int i = 0; i < this.getComponentCount(); i++)
			((ModuleButton)this.getComponent(i)).setEnabled(b);
	}
}