1 package com.smartdevicelink.proxy.rpc;
\r
3 import java.util.Hashtable;
\r
4 import java.util.Vector;
\r
6 import com.smartdevicelink.proxy.RPCRequest;
\r
7 import com.smartdevicelink.proxy.constants.Names;
\r
10 * This RPC is used to update the user with navigation information for the
\r
11 * constantly shown screen (base screen), but also for the alert type screen
\r
13 * Function Group: Navigation
\r
15 * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>
\r
18 * @since SmartDeviceLink 2.0
\r
19 * @see AlertManeuver
\r
20 * @see UpdateTurnList
\r
22 public class ShowConstantTBT extends RPCRequest {
\r
25 * Constructs a new ShowConstantTBT object
\r
27 public ShowConstantTBT() {
\r
28 super("ShowConstantTBT");
\r
32 * Constructs a new ShowConstantTBT object indicated by the Hashtable
\r
37 * The Hashtable to use
\r
39 public ShowConstantTBT(Hashtable hash) {
\r
44 * Sets a text for navigation text field 1
\r
46 * @param navigationText1
\r
47 * a String value representing a text for navigation text field 1
\r
49 * <b>Notes: </b>Maxlength=500
\r
51 public void setNavigationText1(String navigationText1) {
\r
52 if (navigationText1 != null) {
\r
53 parameters.put(Names.navigationText1, navigationText1);
\r
55 parameters.remove(Names.navigationText1);
\r
60 * Gets a text for navigation text field 1
\r
62 * @return String -a String value representing a text for navigation text
\r
65 public String getNavigationText1() {
\r
66 return (String) parameters.get(Names.navigationText1);
\r
70 * Sets a text for navigation text field 2
\r
72 * @param navigationText2
\r
73 * a String value representing a text for navigation text field 2
\r
75 * <b>Notes: </b>Maxlength=500
\r
77 public void setNavigationText2(String navigationText2) {
\r
78 if (navigationText2 != null) {
\r
79 parameters.put(Names.navigationText2, navigationText2);
\r
81 parameters.remove(Names.navigationText2);
\r
86 * Gets a text for navigation text field 2
\r
88 * @return String -a String value representing a text for navigation text
\r
91 public String getNavigationText2() {
\r
92 return (String) parameters.get(Names.navigationText2);
\r
96 * Sets a text field for estimated time of arrival
\r
99 * a String value representing a text field for estimated time of
\r
102 * <b>Notes: </b>Maxlength=500
\r
104 public void setEta(String eta) {
\r
106 parameters.put(Names.eta, eta);
\r
108 parameters.remove(Names.eta);
\r
113 * Gets a text field for estimated time of arrival
\r
115 * @return String -a String value representing a text field for estimated
\r
118 public String getEta() {
\r
119 return (String) parameters.get(Names.eta);
\r
123 * Sets a text field for total distance
\r
125 * @param totalDistance
\r
126 * a String value representing a text field for total distance
\r
128 * <b>Notes: </b>Maxlength=500
\r
130 public void setTotalDistance(String totalDistance) {
\r
131 if (totalDistance != null) {
\r
132 parameters.put(Names.totalDistance, totalDistance);
\r
134 parameters.remove(Names.totalDistance);
\r
139 * Gets a text field for total distance
\r
141 * @return String -a String value representing a text field for total
\r
144 public String getTotalDistance() {
\r
145 return (String) parameters.get(Names.totalDistance);
\r
149 * Sets an Image for turnicon
\r
154 public void setTurnIcon(Image turnIcon) {
\r
155 if (turnIcon != null) {
\r
156 parameters.put(Names.turnIcon, turnIcon);
\r
158 parameters.remove(Names.turnIcon);
\r
163 * Gets an Image for turnicon
\r
165 * @return Image -an Image value representing an Image for turnicon
\r
167 public Image getTurnIcon() {
\r
168 Object obj = parameters.get(Names.turnIcon);
\r
169 if (obj instanceof Image) {
\r
170 return (Image) obj;
\r
172 return new Image((Hashtable) obj);
\r
177 * Sets a Fraction of distance till next maneuver
\r
179 * @param distanceToManeuver
\r
180 * a Double value representing a Fraction of distance till next
\r
183 * <b>Notes: </b>Minvalue=0; Maxvalue=1000000000
\r
185 public void setDistanceToManeuver(Double distanceToManeuver) {
\r
186 if (distanceToManeuver != null) {
\r
187 parameters.put(Names.distanceToManeuver, distanceToManeuver);
\r
189 parameters.remove(Names.distanceToManeuver);
\r
194 * Gets a Fraction of distance till next maneuver
\r
196 * @return Double -a Double value representing a Fraction of distance till
\r
199 public Double getDistanceToManeuver() {
\r
200 return (Double) parameters.get(Names.distanceToManeuver);
\r
204 * Sets a Distance till next maneuver (starting from) from previous maneuver
\r
206 * @param distanceToManeuverScale
\r
207 * a Double value representing a Distance till next maneuver
\r
208 * (starting from) from previous maneuver
\r
210 * <b>Notes: </b>Minvalue=0; Maxvalue=1000000000
\r
212 public void setDistanceToManeuverScale(Double distanceToManeuverScale) {
\r
213 if (distanceToManeuverScale != null) {
\r
214 parameters.put(Names.distanceToManeuverScale, distanceToManeuverScale);
\r
216 parameters.remove(Names.distanceToManeuverScale);
\r
221 * Gets a Distance till next maneuver (starting from) from previous maneuver
\r
223 * @return Double -a Double value representing a Distance till next maneuver
\r
224 * (starting from) from previous maneuver
\r
226 public Double getDistanceToManeuverScale() {
\r
227 return (Double) parameters.get(Names.distanceToManeuverScale);
\r
231 * Sets a maneuver complete flag. If and when a maneuver has completed while
\r
232 * an AlertManeuver is active, the app must send this value set to TRUE in
\r
233 * order to clear the AlertManeuver overlay<br/>
\r
234 * If omitted the value will be assumed as FALSE
\r
237 * @param maneuverComplete
\r
240 public void setManeuverComplete(Boolean maneuverComplete) {
\r
241 if (maneuverComplete != null) {
\r
242 parameters.put(Names.maneuverComplete, maneuverComplete);
\r
244 parameters.remove(Names.maneuverComplete);
\r
249 * Gets a maneuver complete flag
\r
251 * @return Boolean -a Boolean value
\r
253 public Boolean getManeuverComplete() {
\r
254 return (Boolean) parameters.get(Names.maneuverComplete);
\r
258 * Sets Three dynamic SoftButtons available (first SoftButton is fixed to
\r
259 * "Turns"). If omitted on supported displays, the currently displayed
\r
260 * SoftButton values will not change
\r
262 * <b>Notes: </b>Minsize=0; Maxsize=3
\r
264 * @param softButtons a Vector<SoftButton> value
\r
266 public void setSoftButtons(Vector<SoftButton> softButtons) {
\r
267 if (softButtons != null) {
\r
268 parameters.put(Names.softButtons, softButtons);
\r
270 parameters.remove(Names.softButtons);
\r
275 * Gets Three dynamic SoftButtons available (first SoftButton is fixed to
\r
276 * "Turns"). If omitted on supported displays, the currently displayed
\r
277 * SoftButton values will not change
\r
278 * @return Vector<SoftButton> -a Vector<SoftButton> value
\r
280 public Vector<SoftButton> getSoftButtons() {
\r
281 if (parameters.get(Names.softButtons) instanceof Vector<?>) {
\r
282 Vector<?> list = (Vector<?>)parameters.get(Names.softButtons);
\r
283 if (list != null && list.size() > 0) {
\r
284 Object obj = list.get(0);
\r
285 if (obj instanceof SoftButton) {
\r
286 return (Vector<SoftButton>) list;
\r
287 } else if (obj instanceof Hashtable) {
\r
288 Vector<SoftButton> newList = new Vector<SoftButton>();
\r
289 for (Object hashObj : list) {
\r
290 newList.add(new SoftButton((Hashtable)hashObj));
\r