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 * Updates the list of next maneuvers, which can be requested by the user
\r
11 * pressing the softbutton "Turns" on the Navigation base screen. Three
\r
12 * softbuttons are predefined by the system: Up, Down, Close
\r
14 * Function Group: Navigation
\r
16 * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>
\r
19 * @since SmartDeviceLink 2.0
\r
20 * @see ShowConstantTBT
\r
22 public class UpdateTurnList extends RPCRequest {
\r
25 * Constructs a new UpdateTurnList object
\r
27 public UpdateTurnList() {
\r
28 super("UpdateTurnList");
\r
32 * Constructs a new UpdateTurnList object indicated by the Hashtable
\r
37 * The Hashtable to use
\r
39 public UpdateTurnList(Hashtable hash) {
\r
44 * Sets a list of turns to be shown to the user
\r
47 * a Vector<Turn> value representing a list of turns to be shown
\r
50 * <b>Notes: </b>Minsize=1; Maxsize=100
\r
52 public void setTurnList(Vector<Turn> turnList) {
\r
53 if (turnList != null) {
\r
54 parameters.put(Names.turnList, turnList);
\r
56 parameters.remove(Names.turnList);
\r
61 * Gets a list of turns to be shown to the user
\r
63 * @return Vector<Turn> -a Vector value representing a list of turns
\r
65 public Vector<Turn> getTurnList() {
\r
66 if (parameters.get(Names.turnList) instanceof Vector<?>) {
\r
67 Vector<?> list = (Vector<?>)parameters.get(Names.turnList);
\r
68 if (list != null && list.size() > 0) {
\r
69 Object obj = list.get(0);
\r
70 if (obj instanceof Turn) {
\r
71 return (Vector<Turn>) list;
\r
72 } else if (obj instanceof Hashtable) {
\r
73 Vector<Turn> newList = new Vector<Turn>();
\r
74 for (Object hashObj : list) {
\r
75 newList.add(new Turn((Hashtable)hashObj));
\r
85 * Sets soft buttons in the screen. If omitted on supported displays,
\r
86 * app-defined SoftButton will be left blank
\r
88 * <b>Notes: </b>Minsize=0; Maxsize=1
\r
90 * @param softButtons a Vector value
\r
92 public void setSoftButtons(Vector<SoftButton> softButtons) {
\r
93 if (softButtons != null) {
\r
94 parameters.put(Names.softButtons, softButtons);
\r
96 parameters.remove(Names.softButtons);
\r
101 * Gets soft buttons in the screen
\r
102 * @return Vector -a Vector<SoftButton> value
\r
104 public Vector<SoftButton> getSoftButtons() {
\r
105 if (parameters.get(Names.softButtons) instanceof Vector<?>) {
\r
106 Vector<?> list = (Vector<?>)parameters.get(Names.softButtons);
\r
107 if (list != null && list.size() > 0) {
\r
108 Object obj = list.get(0);
\r
109 if (obj instanceof SoftButton) {
\r
110 return (Vector<SoftButton>) list;
\r
111 } else if (obj instanceof Hashtable) {
\r
112 Vector<SoftButton> newList = new Vector<SoftButton>();
\r
113 for (Object hashObj : list) {
\r
114 newList.add(new SoftButton((Hashtable)hashObj));
\r