Anda di halaman 1dari 2

SE2JA11 Java - Practical

Dr. Karsten Oster Lundqvist, Dr. Giuseppe Di Fatta

Practical Week 8 Artificial Life Simulator GUI


In this practical you are required to implement the Graphical User Interface for the Artificial Life Simulator to manage, run and visualise simulations of artificial life forms on 2D maps. You should extend the application developed during the previous weeks. User Interface: Please, notice that in this practical Swing-based (JFC) GUI must be used. You can use the Java console (stdin/stdout) only for displaying debugging information. The GUI has five menus (File, View, Edit, Simulation, Help) and menu items similarly to the previous practical (week 6). The GUI should also have a toolbar with JButtons to control the simulation (e.g., start, pause, reset, etc.). IMPORTANT: GUI based on Matisse in Netbeans or similar GUI builder tools in other IDEs will not be accepted: the GUI must be hand-coded by using the JFC API directly. Application Menu: The application should be organized in 5 menus as shown in figure.
File 1. New configuration (reset configuration, no file is created) 2. Open configuration file (using your own file format, e.g. CSV) 3. Save (using your own file format) 4. Save as (allows to change the file name) 5. Exit View 1. Display configuration 2. Edit configuration 3. Display info about life forms (e.g., list of <ID, name, position, energy>) 4. Display info about map (size, obstacles, food) Edit 1. Modify current life form parameters 2. Remove current life form 3. Add a new life form Simulation 1. Run 2. Stop 3. Pause/restart 4. Reset 5. Display map at each iteration: ON/OFF (toggle between ON and OFF) Help 1. Display info about application 2. Display info about author

Figure: Application Menu Configurations File: The application allows the user to save and load simulation configurations from files. A configuration is defined as the set of parameters required to set up and start a simulation. The application should also remember the last configuration file used when the application is restarted and should automatically load the last configuration when started. Inheritance: the code should make use of either an abstract class or an interface ALifeForm. The class ABug must either implement the interface or extend the abstract class.

University of Reading - School of Systems Engineering

SE2JA11 Java - Practical Week 8

Dr. Karsten Oster Lundqvist, Giuseppe Di Fatta

This marking sheet must be handed in by Friday 29 November 2013 10:30am in the School Student Information Centre (G47). This coursework is regarded as Minor.

Practical Week 8

Your full name: (capitalised)

Your username:

1 2 3 4 5 6 7 8 9

Classes: declarations of classes, attributes and methods are syntactically correct. (Indicate number of classes used.) Code style: using Generics, following Java code conventions, JavaDoc comments throughout the code. Overall OOP approach (Abstraction, Encapsulation) is sound. Appropriate use of access modifiers for classes, attributes and methods (Information Hiding). Inheritance: appropriate use of either Abstract Class or Interface. The GUI is implemented correctly by using the Event Dispatch Thread. Specify if using synchronous (timer) or asynchronous (multi-threaded) animation approach. The GUI has five Menus and functionalities of menu items work as expected. The GUI has a toolbar (start, pause, reset, etc.) to control the simulation. The application is complete and runs: a simulation can be run, stopped/paused, restarted. Quality of the GUI design: user-friendliness, richness, etc. Netbeans Matisse or other GUI builders are not allowed. Used JComponents: Specify if others:
JPanel JButton JLabel JTextArea JTextField JToolBar JComboBox JMenuBar JMenu JMenuItem JPopupMenu JTabbedPane JTable JList JTree JSpinner

Demonstrator's comments

10

Used event listener interfaces:


ActionListener

ItemListener

Specify if others:

Used LayoutManagers:
Flow Layout Grid Layout

Box Layout Border Layout

While you progress in your work, ask one of the teaching assistants to fill in the column marked demonstrators comments. If you have not completed all the work by 5 minutes before the end of the practical, ask the teaching assistant to indicate what you have done.

Demonstrator Name: (capitalised) Signed (demonstrator):


University of Reading - School of Systems Engineering

Date:

Signed (student):

Anda mungkin juga menyukai