| 1 | package tmcsim.client.cadclientgui.data; |
|---|
| 2 | |
|---|
| 3 | import java.io.Serializable; |
|---|
| 4 | |
|---|
| 5 | import tmcsim.client.cadclientgui.enums.CADDataEnums; |
|---|
| 6 | |
|---|
| 7 | /** |
|---|
| 8 | * This class is a further subdivision of Incident to hold data. |
|---|
| 9 | * |
|---|
| 10 | * @author Vincent |
|---|
| 11 | * |
|---|
| 12 | */ |
|---|
| 13 | public class IncidentGeneralInfo implements Serializable { |
|---|
| 14 | |
|---|
| 15 | /* The init variables are set only from the XML script (readXMLNode method) |
|---|
| 16 | * and are only used for resetCADDataSimulation purposes |
|---|
| 17 | */ |
|---|
| 18 | private String init_jurisdiction = ""; |
|---|
| 19 | private String init_alarm = ""; |
|---|
| 20 | private String init_agy = ""; |
|---|
| 21 | |
|---|
| 22 | private String jurisdiction; |
|---|
| 23 | private String alarm; |
|---|
| 24 | private String agy; |
|---|
| 25 | |
|---|
| 26 | /* |
|---|
| 27 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 28 | */ |
|---|
| 29 | public IncidentGeneralInfo() { |
|---|
| 30 | jurisdiction = ""; |
|---|
| 31 | alarm = ""; |
|---|
| 32 | agy = ""; |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | public void resetCADDataSimulation(){ |
|---|
| 36 | jurisdiction = init_jurisdiction; |
|---|
| 37 | alarm = init_alarm; |
|---|
| 38 | agy = init_agy; |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | public String getJurisdiction() { |
|---|
| 42 | return jurisdiction; |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | public void setJurisdiction(String jurisdiction) { |
|---|
| 46 | this.jurisdiction = jurisdiction; |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | public String getAlarm() { |
|---|
| 50 | return alarm; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | public void setAlarm(String alarm) { |
|---|
| 54 | this.alarm = alarm; |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | public String getAgy() { |
|---|
| 58 | return agy; |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | public void setAgy(String agy) { |
|---|
| 62 | this.agy = agy; |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | /* |
|---|
| 66 | * Called from the tmc.simulator.cadclient.data.Incident.java. Handles |
|---|
| 67 | * storing data based on script tag. |
|---|
| 68 | */ |
|---|
| 69 | public void readXMLNode(String tag_name, String value) { |
|---|
| 70 | if (tag_name.equals(CADDataEnums.INC_GEN_INFO.JURISDICTION.tag)) { |
|---|
| 71 | init_jurisdiction = value; |
|---|
| 72 | setJurisdiction(value); |
|---|
| 73 | } else if (tag_name.equals(CADDataEnums.INC_GEN_INFO.ALARM.tag)) { |
|---|
| 74 | init_alarm = value; |
|---|
| 75 | setAlarm(value); |
|---|
| 76 | } else if (tag_name.equals(CADDataEnums.INC_GEN_INFO.AGY.tag)) { |
|---|
| 77 | init_agy = value; |
|---|
| 78 | setAgy(value); |
|---|
| 79 | } |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | } |
|---|