Exemple #1
0
  /**
   * Create a <use> element with a SYMBOL_FAILEDORDER at the given coordinates, sized
   * appropriately.
   */
  public static SVGUseElement createFailedOrderSymbol(MapInfo mapInfo, float x, float y) {
    MapMetadata.SymbolSize symbolSize =
        mapInfo.getMapMetadata().getSymbolSize(DefaultMapRenderer2.SYMBOL_FAILEDORDER);

    return SVGUtils.createUseElement(
        mapInfo.getDocument(),
        "#" + DefaultMapRenderer2.SYMBOL_FAILEDORDER,
        null, // no id
        null, // no special style
        x,
        y,
        symbolSize);
  } // createFailedOrderSymbol()
Exemple #2
0
  /**
   * Checks that support width is in-bounds. Note that negative widths are possible (see the base
   * move modifier; e.g., Loeb9). If the support is out-of-bounds (max), the largest width is
   * returned.
   *
   * <p>All negative widths are treated alike; DPB_LINE_WIDTH times the value of the smallest width
   * in the line-width list (index 0).
   */
  public static float getLineWidth(
      MapInfo mapInfo, String mmdElementName, String mmdElementType, int support) {
    int idx = support;
    if (support < 0) {
      idx = 0;
    }

    final float[] widths =
        mapInfo.getMapMetadata().getOrderParamFloatArray(mmdElementName, mmdElementType);
    if (support >= widths.length) {
      return widths[widths.length - 1];
    }

    return (support >= 0) ? widths[idx] : (widths[idx] * DPB_LINE_WIDTH);
  } // getLineWidth()