Changeset 76 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures
- Timestamp:
- 08/25/2017 12:22:28 PM (9 years ago)
- Location:
- trunk/src/scriptbuilder/structures
- Files:
-
- 23 edited
-
I_XML_Writable.java (modified) (2 diffs)
-
MyScriptHandler.java (modified) (3 diffs)
-
ScriptEvent.java (modified) (3 diffs)
-
ScriptIncident.java (modified) (3 diffs)
-
SimulationScript.java (modified) (4 diffs)
-
TimeSlice.java (modified) (1 diff)
-
XMLWriter.java (modified) (4 diffs)
-
events/ATMSEvaluationEvent.java (modified) (2 diffs)
-
events/ActivityLogEvaluationEvent.java (modified) (2 diffs)
-
events/AudioEvent.java (modified) (2 diffs)
-
events/CADEvaluationEvent.java (modified) (2 diffs)
-
events/CADEvent.java (modified) (2 diffs)
-
events/CCTVEvent.java (modified) (3 diffs)
-
events/CHPRadioEvent.java (modified) (2 diffs)
-
events/CMSEvaluationEvent.java (modified) (1 diff)
-
events/FacilitatorEvaluationEvent.java (modified) (2 diffs)
-
events/MaintenanceRadioEvent.java (modified) (1 diff)
-
events/ParamicsEvent.java (modified) (1 diff)
-
events/RadioEvaluationEvent.java (modified) (2 diffs)
-
events/TMTRadioEvent.java (modified) (1 diff)
-
events/TelephoneEvent.java (modified) (1 diff)
-
events/TowEvent.java (modified) (1 diff)
-
events/UnitEvent.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/I_XML_Writable.java
r46 r76 1 2 1 package scriptbuilder.structures; 3 2 … … 8 7 public interface I_XML_Writable 9 8 { 9 10 /** 11 * Translate this object's data into an appropriate XML string. 12 * 13 * @return an XML-compliant string representing this object's data 14 */ 10 15 String toXML(); 11 16 } -
trunk/src/scriptbuilder/structures/MyScriptHandler.java
r45 r76 241 241 /** 242 242 * Constructor. Initializes incident map. 243 */ 244 public MyScriptHandler(SimulationScript s) 245 { 246 script = s; 243 * 244 * @param scr the script into which the XML file is being read 245 */ 246 public MyScriptHandler(SimulationScript scr) 247 { 248 script = scr; 247 249 incidentMap = new TreeMap<Integer, ScriptIncident>(); 248 250 eventMap = new TreeMap<ELEMENT, I_ScriptEvent>(); … … 255 257 * Get the list of incidents that have been parsed from the script file. 256 258 * 257 * @return sVector of Incident objects.259 * @return Vector of Incident objects. 258 260 */ 259 261 public Vector<ScriptIncident> getIncidents() … … 265 267 * Get the list of units that have been parsed from the script file. 266 268 * 267 * @return sVector of Unit objects.269 * @return Vector of Unit objects. 268 270 */ 269 271 public ArrayList<Unit> getUnits() -
trunk/src/scriptbuilder/structures/ScriptEvent.java
r72 r76 18 18 * Compare the Script Events based on their type enum. 19 19 * 20 * @param othe other script event to be compared20 * @param a the other script event to be compared 21 21 * @return -1, 0, or 1 depending on if this event's type comes before, 22 22 * simultaneously, or after the other event's type in the enum list … … 130 130 } 131 131 132 /** 133 * Generate a new script event object of the specified type. 134 * 135 * @param t the type of the script event 136 * @return a new I_ScriptEvent object matching the given type 137 */ 132 138 public static I_ScriptEvent factoryByType(ScriptEventType t) 133 139 { … … 172 178 } 173 179 } 174 180 181 /** 182 * Determines if the event in question is an evaluation event. 183 * 184 * @param event the event to be checked 185 * @return true if the event implements I_EvaluationEvent 186 */ 175 187 public static boolean isEvaluationEvent(I_ScriptEvent event) 176 188 { -
trunk/src/scriptbuilder/structures/ScriptIncident.java
r58 r76 221 221 } 222 222 223 /** 224 * Write this incident, in proper XML form, to the file in question. 225 * 226 * @param f the destination savefile 227 */ 223 228 public void saveIncidentToFile(File f) 224 229 { … … 298 303 { 299 304 305 /** 306 * The slice which has received focus in this event. 307 */ 300 308 public TimeSlice slice; 301 309 … … 325 333 { 326 334 335 /** 336 * The incident which has received focus in this event. 337 */ 327 338 public ScriptIncident incident; 328 339 -
trunk/src/scriptbuilder/structures/SimulationScript.java
r65 r76 50 50 }; 51 51 52 /** 53 * The file to which this script will be saved. 54 */ 52 55 public File saveFile = null; 53 56 57 /** 58 * The name of this script. 59 */ 54 60 public String title = ""; 55 61 … … 160 166 } 161 167 168 /** 169 * Add a new incident to the script. 170 * 171 * @param sci the incident to be added. 172 * @return true if there was enough room to add this incident. 173 */ 162 174 public boolean addIncident(ScriptIncident sci) 163 175 { … … 170 182 } 171 183 184 /** 185 * Write this script, in proper XML format, to the file in question. 186 * 187 * @param f the destination savefile to be written. 188 */ 172 189 public void saveScriptToFile(File f) 173 190 { … … 262 279 } 263 280 281 /** 282 * Counts the number of incidents currently running. 283 * 284 * @return the number of non-null incidents currently in the script. A 285 * number between 0 and INCIDENT_FILL_COUNT, inclusive. 286 */ 264 287 public int incidentCount() 265 288 { -
trunk/src/scriptbuilder/structures/TimeSlice.java
r67 r76 42 42 * @param seconds Number of seconds from the beginning of the simulation 43 43 * that this timeslice occurs 44 * @param inc the incident to which this timeslice belongs. 44 45 */ 45 46 public TimeSlice(int seconds, ScriptIncident inc) -
trunk/src/scriptbuilder/structures/XMLWriter.java
r46 r76 8 8 { 9 9 10 /** 11 * XML-style opening tag. Example: if given string "my_tag", returns 12 * "<my_tag>". 13 * 14 * @param s the XML element to be included in the tag. 15 * @return the properly formatted tag 16 */ 10 17 public static String openTag(String s) 11 18 { … … 13 20 } 14 21 22 /** 23 * XML-style closing tag. Example: if given string "my_tag", returns 24 * "</my_tag>". 25 * 26 * @param s the XML element to be included in the tag. 27 * @return the properly formatted tag 28 */ 15 29 public static String closeTag(String s) 16 30 { … … 18 32 } 19 33 34 /** 35 * XML-style empty tag. Example: if given string "my_tag", returns 36 * "<my_tag/>". 37 * 38 * @param s the XML element to be included in the tag. 39 * @return the properly formatted tag 40 */ 20 41 public static String emptyTag(String s) 21 42 { … … 23 44 } 24 45 46 /** 47 * Creates a pair of XML open and close tags to wrap a simple line of data. 48 * Useful if only one element need be enclosed in this particular tag. 49 * 50 * @param s the data to be wrapped 51 * @param e the XML element represented by the data 52 * @return an XML string of the format <my_tag>some_data_goes_here</my_tag> 53 */ 25 54 public static String simpleTag(String s, ELEMENT e) 26 55 { -
trunk/src/scriptbuilder/structures/events/ATMSEvaluationEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public ATMSEvaluationEvent() 23 26 { … … 25 28 } 26 29 30 /** 31 * A list of the expected actions held by this evaluation event. 32 */ 27 33 public ArrayList<String> expectedAction = new ArrayList<String>(); 28 34 -
trunk/src/scriptbuilder/structures/events/ActivityLogEvaluationEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public ActivityLogEvaluationEvent() 23 26 { … … 25 28 } 26 29 30 /** 31 * A list of the expected actions held by this evaluation event. 32 */ 27 33 public ArrayList<String> expectedAction = new ArrayList<String>(); 28 34 -
trunk/src/scriptbuilder/structures/events/AudioEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public AudioEvent() 23 26 { … … 25 28 } 26 29 30 /** 31 * Length of the audio to be played, in seconds. 32 */ 27 33 public Integer audioLength = 0; 28 34 35 /** 36 * File path for the audio file. 37 */ 29 38 public String audioPath = ""; 30 39 -
trunk/src/scriptbuilder/structures/events/CADEvaluationEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public CADEvaluationEvent() 23 26 { … … 25 28 } 26 29 30 /** 31 * A list of the expected actions held by this evaluation event. 32 */ 27 33 public ArrayList<String> expectedAction = new ArrayList<String>(); 28 34 -
trunk/src/scriptbuilder/structures/events/CADEvent.java
r47 r76 21 21 { 22 22 23 /** 24 * Constructor. 25 */ 23 26 public CADEvent() 24 27 { … … 26 29 } 27 30 31 /** 32 * True if this CAD event has sub-events. 33 */ 28 34 public boolean hasSubEvents = false; 29 35 36 /** 37 * Description of this event. 38 */ 30 39 public String detail = ""; 31 40 -
trunk/src/scriptbuilder/structures/events/CCTVEvent.java
r46 r76 12 12 13 13 /** 14 * Data model for a CCTV event .(Just a stub; CCTV events aren't currently15 * used .)A CCTV event has, for now, a string message.14 * Data model for a CCTV event(Just a stub; CCTV events aren't currently 15 * used). A CCTV event has, for now, a string message. 16 16 * 17 17 * @author Bryan McGuffin … … 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public CCTVEvent() 23 26 { … … 25 28 } 26 29 30 /** 31 * The message represented by this event. 32 */ 27 33 public String message = ""; 28 34 -
trunk/src/scriptbuilder/structures/events/CHPRadioEvent.java
r46 r76 22 22 { 23 23 24 /** 25 * Constructor. 26 */ 24 27 public CHPRadioEvent() 25 28 { … … 27 30 } 28 31 32 /** 33 * List of the lines of dialog in this event. 34 */ 29 35 public ArrayList<String> lines = new ArrayList<String>(); 30 36 37 /** 38 * List of the corresponding roles for each line of dialog. 39 */ 31 40 public ArrayList<String> roles = new ArrayList<String>(); 32 41 42 /** 43 * Path for the audio file to be played during this event. 44 */ 33 45 public String radioFile = ""; 34 46 -
trunk/src/scriptbuilder/structures/events/CMSEvaluationEvent.java
r46 r76 21 21 { 22 22 23 /** 24 * Constructor. 25 */ 23 26 public CMSEvaluationEvent() 24 27 { -
trunk/src/scriptbuilder/structures/events/FacilitatorEvaluationEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public FacilitatorEvaluationEvent() 23 26 { … … 25 28 } 26 29 30 /** 31 * A list of the expected actions held by this evaluation event. 32 */ 27 33 public ArrayList<String> expectedAction = new ArrayList<String>(); 28 34 -
trunk/src/scriptbuilder/structures/events/MaintenanceRadioEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public MaintenanceRadioEvent() 23 26 { -
trunk/src/scriptbuilder/structures/events/ParamicsEvent.java
r47 r76 21 21 { 22 22 23 /** 24 * Constructor. 25 */ 23 26 public ParamicsEvent() 24 27 { -
trunk/src/scriptbuilder/structures/events/RadioEvaluationEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public RadioEvaluationEvent() 23 26 { … … 25 28 } 26 29 30 /** 31 * A list of the expected actions held by this evaluation event. 32 */ 27 33 public ArrayList<String> expectedAction = new ArrayList<String>(); 28 34 -
trunk/src/scriptbuilder/structures/events/TMTRadioEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public TMTRadioEvent() 23 26 { -
trunk/src/scriptbuilder/structures/events/TelephoneEvent.java
r46 r76 22 22 { 23 23 24 /** 25 * Constructor. 26 */ 24 27 public TelephoneEvent() 25 28 { -
trunk/src/scriptbuilder/structures/events/TowEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public TowEvent() 23 26 { -
trunk/src/scriptbuilder/structures/events/UnitEvent.java
r46 r76 20 20 { 21 21 22 /** 23 * Constructor. 24 */ 22 25 public UnitEvent() 23 26 {
Note: See TracChangeset
for help on using the changeset viewer.
