public void onOkClick(View view) {
    AdvancedStyle style = getStyle();
    String alphaString, sizeString;

    // Shape of point
    String shape = (String) shapesSpinner.getSelectedItem();
    style.shape = shape;

    // Size of point
    sizeString = (String) sizeSpinner.getSelectedItem();
    try {
      style.size = Float.parseFloat(sizeString);
    } catch (NumberFormatException e) {
      Log.e("STYLE", "input parse error");
    }

    // Stroke color
    String color =
        String.format(
            "#%06X", (0xFFFFFF & colorSelStroke)); // Convert from hex to #RRGGBB format
    style.strokecolor = color;

    // Width of stroke
    String widthString = (String) widthSpinner.getSelectedItem();
    try {
      style.width = Float.parseFloat(widthString);
    } catch (NumberFormatException e) {
      Log.e("STYLE", "input parse error");
    }

    // Stroke alpha
    alphaString = (String) alphaSpinner.getSelectedItem();
    try {
      style.strokealpha = (Float.parseFloat(alphaString)) / 100f;
    } catch (NumberFormatException e) {
      Log.e("STYLE", "input parse error");
    }

    // Dash of stroke
    String dashed = (String) dashSpinner.getSelectedItem();
    if (dashed.equals(array[1])) style.dashed = true;
    else style.dashed = false;

    // Fill color
    color =
        String.format(
            "#%06X", (0xFFFFFF & colorSelFill)); // Convert from hex to #RRGGBB format
    style.fillcolor = color;

    // alpha spinner
    alphaString = (String) fillAlphaSpinner.getSelectedItem();
    try {
      style.fillalpha = (Float.parseFloat(alphaString)) / 100f;
    } catch (NumberFormatException e) {
      Log.e("STYLE", "input parse error");
    }

    updateStyle(style);
  }
Esempio n. 2
0
 public void drawPolygons(Symbolizer symbolizer) {
   AdvancedStyle astyle = new AdvancedStyle();
   astyle.dashed = symbolizer.dashed;
   astyle.decimationFactor = symbolizer.decimationFactor;
   astyle.fillalpha = symbolizer.fillalpha;
   astyle.fillcolor = symbolizer.fillcolor;
   astyle.shape = symbolizer.shape;
   astyle.strokealpha = symbolizer.strokealpha;
   astyle.strokecolor = symbolizer.strokecolor;
   astyle.size = symbolizer.size;
   astyle.textfield = symbolizer.textfield;
   astyle.textsize = symbolizer.textsize;
   astyle.width = symbolizer.width;
   this.drawPolygons(astyle);
 }
Esempio n. 3
0
 public void drawLines(Symbolizer symbolizer, byte currentZoomLevel) {
   AdvancedStyle astyle = new AdvancedStyle();
   astyle.dashed = symbolizer.dashed;
   astyle.decimationFactor = symbolizer.decimationFactor;
   astyle.fillalpha = symbolizer.fillalpha;
   astyle.fillcolor = symbolizer.fillcolor;
   astyle.shape = symbolizer.shape;
   astyle.strokealpha = symbolizer.strokealpha;
   astyle.strokecolor = symbolizer.strokecolor;
   astyle.size = symbolizer.size;
   astyle.textfield = symbolizer.textfield;
   astyle.textsize = symbolizer.textsize;
   astyle.textfillcolor = symbolizer.textfillcolor;
   astyle.textstrokecolor = symbolizer.textstrokecolor;
   astyle.width = symbolizer.width;
   astyle.label_minZoom = symbolizer.label_minZoom;
   this.drawLines(astyle, currentZoomLevel);
 }