source: tmcsimulator-scriptbuilder/trunk/src/scriptbuilder/structures/ELEMENT.java @ 138

Revision 138, 2.5 KB checked in by bmcguffin, 8 years ago (diff)

Added support for incident color. Color is now read from the xml file; if no color field exists, it picks a random one. Upon saving the file, color is written out in RGB format. The DTD now contains a new field, COLOR, with three attributes: r, g, b.

Line 
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6package scriptbuilder.structures;
7
8/**
9 * Enumeration of every element which appears in the DTD as of 2017/07/01. They
10 * are in alphabetical order and broken up into 3 major sections.
11 *
12 * @author Bryan McGuffin
13 */
14public enum ELEMENT
15{
16    //These elements are the ones that have sub-elements in the DTD.
17    //They may or may not have character data attached.
18
19    TMC_SCRIPT,
20    ACTIVITY_LOG_EVALUATION,//EVENT
21    ADDITIONAL_INFO,
22    ATMS_EVALUATION,//EVENT
23    CAD_DATA,
24    CAD_EVALUATION,//EVENT
25    CAD_INCIDENT_EVENT,//EVENT
26    CARDFILE,
27    CHP_RADIO,//EVENT
28    CMS_EVALUATION,//EVENT
29    DIALOG,
30    FACILITATOR_EVALUATION,//EVENT
31    GENERAL,
32    GENERAL_INFO,
33    HEADER_INFO,
34    LOCATION,
35    LOCATION_INFO,
36    NEW_UNIT,
37    PARAMICS,//EVENT
38    RADIO_EVALUATION,
39    SAMPLE_MESSAGE,
40    SCRIPT_DATA,
41    SCRIPT_EVENT,
42    TELEPHONE,//EVENT
43    //These elements have no sub-elements, but all have character data.
44    ADDRESS,
45    AGY,
46    ALIAS,
47    AREA,
48    BADGE_NUM,
49    BEAT,
50    Beat,
51    CCTV_INFO,
52    CITY,
53    CMS_LINE,
54    COMMENT,
55    CURR_LOC,
56    DESTINATION,
57    DETAIL,
58    Direction,
59    EMS,
60    EXPECTED_ACTION,
61    FAX,
62    FIRE,
63    FullLoc,
64    ID,
65    INCIDENT,
66    Incident_type,
67    INSTRUCTOR,
68    Lane_number,
69    LAW,
70    LINE,
71    LOC,
72    Location_type,
73    MASTER_INC_NUM,
74    MAINTENANCE_RADIO,//EVENT
75    MISC_INFO,
76    NAME,
77    OFFICE,
78    OFFICER,
79    OOS,
80    P,
81    PHONE,
82    Postmile,
83    PRIMARY,
84    Route,
85    SERVICE,
86    STACK,
87    STATE,
88    STATUS,
89    Status,
90    STUDENT,
91    TEXT,
92    TIMER,
93    TIME_INDEX,
94    TITLE,
95    TMT_RADIO,//EVENT
96    TruncLoc,
97    TYPE,
98    Type,
99    TYPE_CODE,
100    UNIT_STATUS,
101    ZIP,
102    //These elements have no sub-elements or character data.
103    //They do have attributes.
104    AUDIO,//EVENT
105    COLOR,
106    TOW,//EVENT
107    UNIT,//EVENT
108    WITNESS;//EVENT
109
110    public String tag;
111
112    private ELEMENT()
113    {
114        this.tag = this.name();
115    }
116
117    /**
118     * Look up an element by its name.
119     *
120     * @param name the name of the element
121     * @return the element which has that name as its nametag, or null if none
122     * does
123     */
124    public static ELEMENT byName(String name)
125    {
126        for (ELEMENT e : ELEMENT.values())
127        {
128            if (e.tag.equals(name))
129            {
130                return e;
131            }
132        }
133        return null;
134    }
135}
Note: See TracBrowser for help on using the repository browser.