1 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2
3
4 import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 public class DialogCommand
28 extends InfoMessage
29 implements IWorldEvent, IWorldChangeEvent
30
31 {
32
33
34 public static final String PROTOTYPE =
35 "DLGCMD {Id text} {SourceId text} {Command text} {Data text} ";
36
37
38
39
40
41
42 public DialogCommand()
43 {
44 }
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 public DialogCommand(
78 String Id, String SourceId, String Command, String Data
79 ) {
80
81 this.Id = Id;
82
83 this.SourceId = SourceId;
84
85 this.Command = Command;
86
87 this.Data = Data;
88
89 }
90
91
92
93
94
95
96 public DialogCommand(DialogCommand original) {
97
98 this.Id = original.getId()
99 ;
100
101 this.SourceId = original.getSourceId()
102 ;
103
104 this.Command = original.getCommand()
105 ;
106
107 this.Data = original.getData()
108 ;
109
110 this.SimTime = original.getSimTime();
111 }
112
113
114 protected long SimTime;
115
116
117
118
119 @Override
120 public long getSimTime() {
121 return SimTime;
122 }
123
124
125
126
127 protected void setSimTime(long SimTime) {
128 this.SimTime = SimTime;
129 }
130
131
132
133
134
135 protected
136 String Id =
137 null;
138
139
140
141
142 public String getId()
143 {
144 return Id;
145 }
146
147
148
149
150
151 protected
152 String SourceId =
153 null;
154
155
156
157
158 public String getSourceId()
159 {
160 return SourceId;
161 }
162
163
164
165
166
167 protected
168 String Command =
169 null;
170
171
172
173
174 public String getCommand()
175 {
176 return Command;
177 }
178
179
180
181
182
183 protected
184 String Data =
185 null;
186
187
188
189
190 public String getData()
191 {
192 return Data;
193 }
194
195
196 public String toString() {
197 return
198 super.toString() + "[" +
199
200 "Id = " + String.valueOf(getId()
201 ) + " | " +
202
203 "SourceId = " + String.valueOf(getSourceId()
204 ) + " | " +
205
206 "Command = " + String.valueOf(getCommand()
207 ) + " | " +
208
209 "Data = " + String.valueOf(getData()
210 ) + " | " +
211
212 "]";
213 }
214
215
216 public String toHtmlString() {
217 return super.toString() + "[<br/>" +
218
219 "<b>Id</b> = " + String.valueOf(getId()
220 ) + " <br/> " +
221
222 "<b>SourceId</b> = " + String.valueOf(getSourceId()
223 ) + " <br/> " +
224
225 "<b>Command</b> = " + String.valueOf(getCommand()
226 ) + " <br/> " +
227
228 "<b>Data</b> = " + String.valueOf(getData()
229 ) + " <br/> " +
230
231 "<br/>]";
232 }
233
234 public String toJsonLiteral() {
235 return "dialogcommand( "
236 +
237 (getId()
238 == null ? "null" :
239 "\"" + getId()
240 + "\""
241 )
242 + ", " +
243 (getSourceId()
244 == null ? "null" :
245 "\"" + getSourceId()
246 + "\""
247 )
248 + ", " +
249 (getCommand()
250 == null ? "null" :
251 "\"" + getCommand()
252 + "\""
253 )
254 + ", " +
255 (getData()
256 == null ? "null" :
257 "\"" + getData()
258 + "\""
259 )
260
261 + ")";
262 }
263
264
265
266
267
268
269
270
271
272
273 }
274