|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ksu.cis.macr.simulator.display.SimDisplay
public class SimDisplay
Field Summary | |
---|---|
private javax.swing.JList |
agentList
|
private java.util.HashMap<java.lang.Integer,edu.ksu.cis.macr.simulator.remote.DisplayData> |
agents
Stores states of each agent/object in the simulator |
private boolean |
auto1
|
boolean |
auto2
|
private javax.swing.JButton |
autoButton
|
java.awt.Color |
background
|
private java.util.HashMap<java.lang.String,java.awt.Color> |
colors
Mapping of COlors to object names |
private java.io.BufferedReader |
config
IO reader for the display configuration file |
private javax.swing.JButton |
downSleepButton
|
private edu.ksu.cis.macr.simulator.environment.Environment |
environ
Reference to Evironment object. |
private java.util.HashSet<java.lang.String> |
forbid
Culled from the config File. |
private boolean |
go
|
private javax.swing.JButton |
goButton
|
private GPanel |
gpanel
|
private java.util.HashMap<java.lang.String,java.lang.String> |
icons
Culled from the config file. |
private java.util.HashSet<java.lang.String> |
list
Culled from the config File. |
private javax.swing.DefaultListModel |
listModel
List model for the agent list. |
private int |
listnum
|
private javax.swing.JFrame |
menu
Menu display frame. |
private java.util.HashMap<java.lang.Integer,edu.ksu.cis.macr.simulator.remote.DisplayData> |
newAgents
Stores the data from the changelist. |
private java.lang.String |
oldSelected
|
private javax.swing.JPanel |
pane
|
private int |
pHeight
|
private int |
pWidth
|
private javax.swing.JScrollPane |
scrollPane
Holds the agent list in the menu display. |
private javax.swing.JButton |
setSleepButton
|
private javax.swing.JButton |
showButton
|
private javax.swing.JButton |
snapButton
|
private javax.swing.JLabel |
statusBar
|
private java.lang.String |
Title
|
private javax.swing.JButton |
unZoomButton
|
private javax.swing.JButton |
upSleepButton
|
Constructor Summary | |
---|---|
SimDisplay(edu.ksu.cis.macr.simulator.environment.Environment environ,
java.lang.String filename)
Constructor for Display. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
actionPerformed(ActionEvent event) Action listener for all button on menu display. |
private void |
autoUpdate(int wait)
starts autoUpdate timer thread. |
private void |
displayData(int x)
Displays dialog containing info on agent. |
private void |
downSleep()
decreases environment sleeptime by one |
private int |
findSelected(java.lang.String sel)
returns unique id number of selected object chosen from the agentlist |
java.util.HashMap<java.lang.Integer,edu.ksu.cis.macr.simulator.remote.DisplayData> |
getAgents()
Returns all display data to be displayed |
private java.awt.Color |
getColor(java.lang.String color)
maps ascii color name to Color object use lower case letters for each name dark gray is default . |
void |
getData()
Obtains changelist from the environment Stores info and updates both the list and GDisplay |
private void |
pause()
Pauses the Simulator |
private void |
setConfig(java.lang.String filename)
Reads config file and builds data structures. |
private void |
setSleep()
sets environment sleeptime value received from user via an Input Dialog |
private void |
unpause()
unpauses the simulator |
private void |
updateList()
Intelligently adds agents to the agent list. |
private void |
upSleep()
increases environment sleeptime by one |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.HashMap<java.lang.Integer,edu.ksu.cis.macr.simulator.remote.DisplayData> agents
private java.util.HashMap<java.lang.Integer,edu.ksu.cis.macr.simulator.remote.DisplayData> newAgents
private edu.ksu.cis.macr.simulator.environment.Environment environ
private java.io.BufferedReader config
private javax.swing.JFrame menu
private javax.swing.JButton snapButton
private javax.swing.JButton goButton
private javax.swing.JButton showButton
private javax.swing.JButton autoButton
private javax.swing.JButton unZoomButton
private javax.swing.JButton downSleepButton
private javax.swing.JButton upSleepButton
private javax.swing.JButton setSleepButton
private javax.swing.JLabel statusBar
private java.lang.String Title
private javax.swing.JScrollPane scrollPane
private java.util.HashMap<java.lang.String,java.lang.String> icons
private java.util.HashSet<java.lang.String> forbid
private java.util.HashSet<java.lang.String> list
private java.util.HashMap<java.lang.String,java.awt.Color> colors
private javax.swing.JList agentList
private javax.swing.JPanel pane
private GPanel gpanel
private javax.swing.DefaultListModel listModel
private boolean go
private boolean auto1
public boolean auto2
private int listnum
private int pWidth
private int pHeight
private java.lang.String oldSelected
public java.awt.Color background
Constructor Detail |
---|
public SimDisplay(edu.ksu.cis.macr.simulator.environment.Environment environ, java.lang.String filename)
environ
- Simulator Environment referencefilename
- name and path of display configuration file.Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
private void setConfig(java.lang.String filename)
filename
- : name of configuration file (with path if necessary)private void autoUpdate(int wait)
wait
- sleep time in millisecondspublic void getData()
private void updateList()
private int findSelected(java.lang.String sel)
sel
- name of object in agentlist.private void displayData(int x)
x
- id number of agentpublic java.util.HashMap<java.lang.Integer,edu.ksu.cis.macr.simulator.remote.DisplayData> getAgents()
private java.awt.Color getColor(java.lang.String color)
private void downSleep()
private void upSleep()
private void setSleep()
private void pause()
private void unpause()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |