001 /*
002 * SimuCS - Simulator to use with Classifier Systems
003 * MSc project - Oxford University
004 * by Benoit Isaac - Summer 2005
005 */
006
007 package simuLCS.graphics;
008 import java.awt.BorderLayout;
009
010 import javax.swing.JButton;
011
012 import simuLCS.Simulation;
013
014 /**
015 * Handles all the Customization Panel
016 * @author Benoit
017 *
018 */
019 public class G_PanelCustom extends G_Panel {
020
021 //Constants
022 // Several possible config depending on the type of entity modified
023 public static final int CONFIG_AGENT = 0;
024 public static final int CONFIG_THING = 1;
025
026 //public static final int CONFIG_TRANSFO = 2;
027
028 // Variable for GUI
029 G_MainWindow mainWindow ;
030 G_PanelDraw panelDraw ;
031 JButton btStart,btStop,btStep,btReset,btAddDuck;
032
033 private G_PanCustControls panControls ;
034 private G_PanCustTab panTabbed ;
035
036
037 // to know which entity to modify
038
039
040
041 public G_PanelCustom(G_MainWindow win, Simulation s) {
042 super();
043 mainWindow = win;
044 linkMainWindow(win);
045 pointerCustom = this;
046 linkSimulation(s);
047 // selectedEntities = new Set();
048
049 setLayout(new BorderLayout());
050
051 panControls = new G_PanCustControls();
052 panControls.setOpaque(true);
053 // addSubPanel(panControls);
054
055 panTabbed = new G_PanCustTab();
056 panTabbed.setOpaque(true);
057 // addSubPanel(panTabbed);
058
059 add(panControls,BorderLayout.NORTH);
060 add(panTabbed,BorderLayout.CENTER);
061 }
062
063 public void linkPanelDraw(G_PanelDraw pan) {
064 panelDraw = pan;
065 }
066
067
068 public void updateTabAgents(){
069 // System.out.println("in updateTab:"+selectedEntities);
070 this.repaint();
071 // panTabbed.getTabAgents().paintMe();
072 }
073
074
075
076
077 /**
078 * @return
079 */
080 public G_PanCustControls getPanControls() {
081 return panControls;
082 }
083
084 }