void setStroke(String strokeText) {
    int opacityMask = strokeColor & 0xFF000000;
    if (strokeText.equals("none")) {
      stroke = false;
    } else if (strokeText.startsWith("#")) {
      stroke = true;
      strokeColor = opacityMask |
        (Integer.parseInt(strokeText.substring(1), 16)) & 0xFFFFFF;
    } else if (strokeText.startsWith("rgb")) {
      stroke = true;
      strokeColor = opacityMask | parseRGB(strokeText);
    } else if (strokeText.startsWith("url(#")) {
      strokeName = strokeText.substring(5, strokeText.length() - 1);
      Object strokeObject = findChild(strokeName);
      if (strokeObject instanceof Gradient) {
        strokeGradient = (Gradient) strokeObject;
        strokeGradientPaint = calcGradientPaint(strokeGradient); //, opacity);
      } else {
        System.err.println("url " + strokeName + " refers to unexpected data");
      }
    }
  }