Generate a string value corresponding to the altitude mode.


@param altitudeMode
@param sb
349859
public static void append(int altitudeMode, StringBuilder sb) {
        switch (altitudeMode) {
            case KML_CLAMPTOGROUND:
                sb.append("<kml:altitudeMode>clampToGround</kml:altitudeMode>");
                return;
            case KML_RELATIVETOGROUND:
                sb.append("<kml:altitudeMode>relativeToGround</kml:altitudeMode>");
                return;
            case KML_ABSOLUTE:
                sb.append("<kml:altitudeMode>absolute</kml:altitudeMode>");
                return;
            case GX_CLAMPTOSEAFLOOR:
                sb.append("<gx:altitudeMode>clampToSeaFloor</gx:altitudeMode>");
                return;
            case GX_RELATIVETOSEAFLOOR:
                sb.append("<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>");
                return;
            case NONE:
                return;
            default:
                throw new IllegalArgumentException("Supported altitude modes are: \n"
                        + " For KML profils: CLAMPTOGROUND = 1; RELATIVETOGROUND = 2; ABSOLUTE = 4;\n"
                        + "For GX profils: CLAMPTOSEAFLOOR = 8; RELATIVETOSEAFLOOR = 16; \n"
                        + " No altitude: NONE = 0");
        }
    }
978166
private void appendVarArgsString(StringBuilder sb, JSType paramType, boolean forAnnotations) {
    sb.append("...");
    paramType.appendAsNonNull(sb, forAnnotations);
  }
520520
public static final StringBuilder sprintf0d(StringBuilder sb, int value, int width) {
        long d = value;
        if (d < 0) {
            sb.append('-');
            d = -d;
            --width;
        }
        int n = 10;
        for (int i = 2; i < width; i++) {
            n *= 10;
        }
        for (int i = 1; i < width && d < n; i++) {
            sb.append('0');
            n /= 10;
        }
        sb.append(d);
        return sb;
    }
203819
private CmsPair<String, String> getDefaultValueToDisplay(CmsClientProperty prop, Mode mode) {

        if ((mode == Mode.structure) && !CmsStringUtil.isEmpty(prop.getResourceValue())) {
            String message = Messages.get().key(Messages.GUI_ORIGIN_SHARED_0);

            return CmsPair.create(prop.getResourceValue(), message);
        }
        CmsClientProperty inheritedProperty = m_handler.getInheritedProperty(prop.getName());
        if (CmsClientProperty.isPropertyEmpty(inheritedProperty)) {
            return null;
        }
        CmsPathValue pathValue = inheritedProperty.getPathValue(mode);
        String message = Messages.get().key(Messages.GUI_ORIGIN_INHERITED_1, inheritedProperty.getOrigin());
        return CmsPair.create(pathValue.getValue(), message);
    }
1091697
private void generateExtensionCheck(
        final StringBuilder sb,
        final char varName)
    {
        this.imports.add("io");
        this.imports.add("io/ioutil");
        sb.append(String.format(
            "\tif actingVersion > %1$s.SbeSchemaVersion() && blockLength > %1$s.SbeBlockLength() {\n" +
            "\t\tio.CopyN(ioutil.Discard, _r, int64(blockLength-%1$s.SbeBlockLength()))\n" +
            "\t}\n",
            varName));
    }
489801
def mode_string_v10(msg):
    ''''''
    if msg.autopilot == mavlink.MAV_AUTOPILOT_PX4:
        return interpret_px4_mode(msg.base_mode, msg.custom_mode)
    if not msg.base_mode & mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED:
        return "Mode(0x%08x)" % msg.base_mode
    if msg.type in [ mavlink.MAV_TYPE_QUADROTOR, mavlink.MAV_TYPE_HEXAROTOR,
                     mavlink.MAV_TYPE_OCTOROTOR, mavlink.MAV_TYPE_TRICOPTER,
                     mavlink.MAV_TYPE_COAXIAL,
                     mavlink.MAV_TYPE_HELICOPTER ]:
        if msg.custom_mode in mode_mapping_acm:
            return mode_mapping_acm[msg.custom_mode]
    if msg.type == mavlink.MAV_TYPE_FIXED_WING:
        if msg.custom_mode in mode_mapping_apm:
            return mode_mapping_apm[msg.custom_mode]
    if msg.type == mavlink.MAV_TYPE_GROUND_ROVER:
        if msg.custom_mode in mode_mapping_rover:
            return mode_mapping_rover[msg.custom_mode]
    if msg.type == mavlink.MAV_TYPE_ANTENNA_TRACKER:
        if msg.custom_mode in mode_mapping_tracker:
            return mode_mapping_tracker[msg.custom_mode]
    return "Mode(%u)" % msg.custom_mode
1086495
public void generate(StringBuilder sb) {
    final String plot = title.replaceAll(" ", "");
    sb.append("<script type=\"text/javascript\" src='/h2o/js/d3.v3.min.js'></script>");
    sb.append("<div>");
    sb.append("<script>\n");
    sb.append("$(document).on(\"click\", \"#pl" + plot + "\", function() { $(\"#plot" + plot + "\").toggleClass(\"hide\");});\n");
    sb.append("</script>\n");
    if (hide_toggle) {
    sb.append("<button class = 'btn btn-inverse btn-mini' id = \"pl" + plot +"\">" + link + "</button>\n");
    sb.append("<div class=\"hide\" id=\"" + "plot" + plot + "\">");
    } else {
      sb.append("<div id=\"" + "plot" + plot + "\">");
    }
    sb.append("<style type=\"text/css\">");
    sb.append(".axis path," +
            ".axis line {\n" +
            "fill: none;\n" +
            "stroke: black;\n" +
            "shape-rendering: crispEdges;\n" +
            "}\n" +
            ".axis text {\n" +
            "font-family: sans-serif;\n" +
            "font-size: " + font_size + "px;\n" +
            "}\n");
    sb.append("</style>");
    sb.append("<div id=\"" + "plot" + plot + "\" style=\"display:inline;\">");
    sb.append("<script type=\"text/javascript\">");
    sb.append("//Width and height\n");
    sb.append("var w = " + width + ";\n"+
            "var h = " + height + ";\n"+
            "var padding = " + padding + ";\n"
    );
    sb.append("var dataset = [");

    for(int c = 0; c < x.length; c++) {
      if (c == 0) {
        sb.append("["+String.valueOf(x[c])+",").append(RequestBuilders.ElementBuilder.format(y[c])).append("]");
      }
      sb.append(", ["+String.valueOf(x[c])+",").append(RequestBuilders.ElementBuilder.format(y[c])).append("]");
    }
    sb.append("];");

    sb.append(
            "//Create scale functions\n"+
                    "var xScale = d3.scale.linear()\n"+
                    ".domain([0, d3.max(dataset, function(d) { return d[0]; })])\n"+
                    ".range([padding, w - padding * 2]);\n"+

                    "var yScale = d3.scale.linear()"+
                    ".domain([0, d3.max(dataset, function(d) { return d[1]; })])\n"+
                    ".range([h - padding, padding]);\n"+

                    "var rScale = d3.scale.linear()"+
                    ".domain([0, d3.max(dataset, function(d) { return d[1]; })])\n"+
                    ".range([2, 5]);\n"+


                    "var lineFunction = d3.svg.line().interpolate(\"ordinal\")\n"+
                   ".x(function(d) {return xScale(d[0]); })\n"+
                    ".y(function(d) { return yScale(d[1]); });\n"+

                    "//Define X axis\n"+
                    "var xAxis = d3.svg.axis()\n"+
                    ".scale(xScale)\n"+
                    ".orient(\"bottom\")\n"+
                    ".ticks(5);\n"+

                    "//Define Y axis\n"+
                    "var yAxis = d3.svg.axis()\n"+
                    ".scale(yScale)\n"+
                    ".orient(\"left\")\n"+
                    ".ticks(5);\n"+

                    "//Create SVG element\n"+
                    "var svg = d3.select(\"#" + "plot" + plot + "\")\n"+
                    ".append(\"svg\")\n"+
                    ".attr(\"width\", w)\n"+
                    ".attr(\"height\", h);\n"+

                    "//Create circles\n"+
                    "svg.selectAll(\"circle\")\n"+
                    ".data(dataset)\n"+
                    ".enter()\n"+
                    ".append(\"circle\")\n"+
                    ".attr(\"cx\", function(d) {\n"+
                    "return xScale(d[0]);\n"+
                    "})\n"+
                    ".attr(\"cy\", function(d) {\n"+
                    "return yScale(d[1]);\n"+
                    "})\n"+
                    ".attr(\"r\", function(d) {\n"+
                    "return 2;\n"+//rScale(d[1]);\n"+
                    "});\n"+

                    "/*"+
                    "//Create labels\n"+
                    "svg.selectAll(\"text\")"+
                    ".data(dataset)"+
                    ".enter()"+
                    ".append(\"text\")"+
                    ".text(function(d) {"+
                    "return d[0] + \",\" + d[1];"+
                    "})"+
                    ".attr(\"x\", function(d) {"+
                    "return xScale(d[0]);"+
                    "})"+
                    ".attr(\"y\", function(d) {"+
                    "return yScale(d[1]);"+
                    "})"+
                    ".attr(\"font-family\", \"sans-serif\")"+
                    ".attr(\"font-size\", \"11px\")"+
                    ".attr(\"fill\", \"red\");"+
                    "*/\n"+

                    "//Create X axis\n"+
                    "svg.append(\"g\")"+
                    ".attr(\"class\", \"axis\")"+
                    ".attr(\"transform\", \"translate(0,\" + (h - padding) + \")\")"+
                    ".call(xAxis);\n"+

                    "//X axis label\n"+
                    "d3.select('#" + "plot" + plot + " svg')"+
                    ".append(\"text\")"+
                    ".attr(\"x\",w/2)"+
                    ".attr(\"y\",h - 5)"+
                    ".attr(\"text-anchor\", \"middle\")"+
                    ".text(\"" + xaxislabel + "\");\n"+

                    "//Create Y axis\n"+
                    "svg.append(\"g\")"+
                    ".attr(\"class\", \"axis\")"+
                    ".attr(\"transform\", \"translate(\" + padding + \",0)\")"+
                    ".call(yAxis);\n"+

                    "//Y axis label\n"+
                    "d3.select('#" + "plot" + plot + " svg')"+
                    ".append(\"text\")"+
                    ".attr(\"x\",150)"+
                    ".attr(\"y\",-2)"+
                    ".attr(\"transform\", \"rotate(90)\")"+
                    //".attr(\"transform\", \"translate(0,\" + (h - padding) + \")\")"+
                    ".attr(\"text-anchor\", \"middle\")"+
                    ".text(\"" + yaxislabel + "\");\n"+

                    "//Title\n"+
                    "d3.select('#" + "plot" + plot + " svg')"+
                    ".append(\"text\")"+
                    ".attr(\"x\",w/2)"+
                    ".attr(\"y\",padding - 20)"+
                    ".attr(\"text-anchor\", \"middle\")"+
                    ".text(\"" + title + "\");\n");

    if (ordinal_interpolation) {
      sb.append("var linesGroup = svg.append(\"g\").attr(\"class\", \"line\");\n"+
              "linesGroup.append(\"path\")\n"+
              ".attr(\"d\", lineFunction(dataset))\n"+
              ".attr(\"class\", \"lines\")\n"+
              ".attr(\"fill\", \"none\")\n"+
              ".attr(\"stroke\", function(d, i) {\n"+
              "return linedata.color;\n"+
              "});\n");
    }
    sb.append("</script>");
    sb.append("</div>");
    sb.append("</script>");
    sb.append("</div>");
    sb.append("<style>");
    sb.append(".line {\n" +
            "          fill: none;\n" +
            "          stroke: steelblue;\n" +
            "          stroke-width: 1.5px;\n" +
            "        }");
    sb.append("</style>");
    sb.append("</div>");
  }
1195315
private void appendOptionalArgString(StringBuilder sb, JSType paramType, boolean forAnnotations) {
    if (paramType.isUnionType()) {
      // Remove the optionality from the var arg.
      paramType =
          paramType
              .toMaybeUnionType()
              .getRestrictedUnion(registry.getNativeType(JSTypeNative.VOID_TYPE));
    }
    paramType.appendAsNonNull(sb, forAnnotations).append("=");
  }
66872
public void setMode(ArrayList<Long> tokens, String mode){
        JSONObject jobj = new JSONObject();
        try {
            // int a[] = {256265, 408065, 779521, 738561, 177665, 25601};
            JSONArray list = new JSONArray();
            JSONArray listMain = new JSONArray();
            listMain.put(0, mode);
            for(int i=0; i< tokens.size(); i++){
                list.put(i, tokens.get(i));
            }
            listMain.put(1, list);
            jobj.put("a", mSetMode);
            jobj.put("v", listMain);
            for(int i = 0; i < tokens.size(); i++){
                modeMap.put(tokens.get(i), mode);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }

        if(ws != null) {
            ws.sendText(jobj.toString());
        }
    }
749652
protected void _appendPathDesc(StringBuilder sb)
    {
        if (_path == null) {
            return;
        }
        Iterator<Reference> it = _path.iterator();
        while (it.hasNext()) {
            sb.append(it.next().toString());
            if (it.hasNext()) {
                sb.append("->");
            }
        }
    }
941648
public static void appendKMLCoordinates(Coordinate[] coords, StringBuilder sb) {
        sb.append("<coordinates>");
        for (int i = 0; i < coords.length; i++) {
            Coordinate coord = coords[i];
            sb.append(coord.x).append(",").append(coord.y);
            if (!Double.isNaN(coord.z)) {
                sb.append(",").append(coord.z);
            }
            if (i < coords.length - 1) {
                sb.append(" ");
            }
        }
        sb.append("</coordinates>");
    }
772818
public void setHeight(String height) {

        try {
            m_height = Integer.parseInt(height);
        } catch (NumberFormatException e) {
            m_height = -1;
        }

    }
929438
public void setMode(final String mode) {
        this.mode = Strings.toLowerCase(mode);
        if (mode == null || !MODES.contains(mode)) {
            throw new IllegalArgumentException("Invalid mode [" + mode + "]");
        }
    }
1099220
private void addFMPiece(StringBuilder sb, int value, int pad) {
        String val = Integer.toString(value);
        pad -= val.length();
        
        while (pad-- > 0) {
            sb.append('0');
        }
        
        sb.append(val);
    }
384225
public void setTerminalMode(int mode, int value) throws SshException {
		try {

			encodedModes.write(mode);

			if (version == 1 && mode <= 127) {
				encodedModes.write(value);
			} else {
				encodedModes.writeInt(value);
			}

		} catch (IOException ex) {
			throw new SshException(SshException.INTERNAL_ERROR, ex);
		}
	}
136666
protected void appendText(StringBuilder sb, Text aNode) {
        sb.append("<")
            .append(aNode.getParentNode().getNodeName())
            .append(" ...>");

        if (aNode instanceof CDATASection) {
            sb.append("<![CDATA[")
                .append(aNode.getNodeValue())
                .append("]]>");
        } else {
            sb.append(aNode.getNodeValue());
        }

        sb.append("</")
            .append(aNode.getParentNode().getNodeName())
            .append(">");
    }
1149347
public StringBuilder toMsg(StringBuilder sb,  String attErrJson) throws APIException {
		return toMsg(sb,errDF.newData().in(TYPE.JSON).load(attErrJson).asObject());
	}