1 package cz.cuni.amis.pogamut.usar2004.communication.messages.usarcommands;
2
3 import cz.cuni.amis.pogamut.base.communication.messages.*;
4 import cz.cuni.amis.pogamut.usar2004.communication.messages.datatypes.CustomTypes.*;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 public class SetViewpoint extends CommandMessage
33 {
34
35 public SetViewpoint(String Robot, String Name, String Client)
36 {
37 this.Robot = Robot;
38 this.Name = Name;
39 this.Client = Client;
40 }
41
42
43
44
45
46 public SetViewpoint()
47 {
48 }
49
50 protected String Type = "Camera";
51
52 public String getType()
53 {
54 return Type;
55 }
56
57 protected String Name = null;
58
59 public String getName()
60 {
61 return Name;
62 }
63
64 public SetViewpoint SetViewpointName(String Name)
65 {
66 this.Name = Name;
67 return this;
68 }
69
70 protected String Robot = null;
71
72 public String getRobot()
73 {
74 return Robot;
75 }
76
77 public SetViewpoint SetViewpointRobot(String Robot)
78 {
79 this.Robot = Robot;
80 return this;
81 }
82
83
84
85
86 protected String Client = null;
87
88 public String getClient()
89 {
90 return Client;
91 }
92
93 public SetViewpoint SetViewpointClient(String Client)
94 {
95 this.Client = Client;
96 return this;
97 }
98
99
100
101
102
103
104
105
106
107
108
109 public SetViewpoint(SetViewpoint original)
110 {
111 this.Name = original.Name;
112 this.Robot = original.Robot;
113 this.Client = original.Client;
114 }
115
116 @Override
117 public String toString()
118 {
119 return toMessage();
120 }
121
122 public String toHtmlString()
123 {
124 return super.toString()
125 + "<b>Type</b> : "
126 + String.valueOf(Type)
127 + " <br/> "
128 + "<b>Robot</b> : "
129 + String.valueOf(Robot)
130 + " <br/> "
131 + "<b>Name</b> : "
132 + String.valueOf(Name)
133 + " <br/> "
134 + "<b>Client</b> : "
135 + String.valueOf(Client)
136 + " <br/> "
137 + "";
138 }
139
140 public String toMessage()
141 {
142
143 StringBuilder buf = new StringBuilder();
144 buf.append("SET");
145
146 if(Type != null)
147 {
148 buf.append(" {Type ").append(Type).append("}");
149 }
150
151 if(Robot != null)
152 {
153 buf.append(" {Robot ").append(Robot).append("}");
154 }
155
156 if(Name != null)
157 {
158 buf.append(" {Name ").append(Name).append("}");
159 }
160
161 if(Client != null)
162 {
163 buf.append(" {Client ").append(Client.toString()).append("}");
164 }
165
166
167 return buf.toString();
168 }
169 }