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