| Revision 3,
1.6 KB
checked in by jdalbey, 10 years ago
(diff) |
|
Initial Import of project files - cadclientgui
|
| Line | |
|---|
| 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 IncidentCallBacks 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_initial = ""; |
|---|
| 19 | private String init_comment = ""; |
|---|
| 20 | |
|---|
| 21 | private String initial; |
|---|
| 22 | private String comment; |
|---|
| 23 | |
|---|
| 24 | /* |
|---|
| 25 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 26 | */ |
|---|
| 27 | public IncidentCallBacks() { |
|---|
| 28 | initial = ""; |
|---|
| 29 | comment = ""; |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | public void resetCADDataSimulation(){ |
|---|
| 33 | initial = init_initial; |
|---|
| 34 | comment = init_comment; |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | public String getInitial() { |
|---|
| 38 | return initial; |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | public void setInitial(String initial) { |
|---|
| 42 | this.initial = initial; |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | public String getComment() { |
|---|
| 46 | return comment; |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | public void setComment(String comment) { |
|---|
| 50 | this.comment = comment; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | /* |
|---|
| 54 | * Called from the tmc.simulator.cadclient.data.Incident.java. Handles |
|---|
| 55 | * storing data based on script tag. |
|---|
| 56 | */ |
|---|
| 57 | public void readXMLNode(String tag_name, String value) { |
|---|
| 58 | if (tag_name.equals(CADDataEnums.INC_CALLBACK.INITIAL.tag)) { |
|---|
| 59 | init_initial = value; |
|---|
| 60 | setInitial(value); |
|---|
| 61 | } else if (tag_name.equals(CADDataEnums.INC_CALLBACK.COMMENT.tag)) { |
|---|
| 62 | init_comment = value; |
|---|
| 63 | setComment(value); |
|---|
| 64 | } |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.