private Gradient doGradient(boolean isLinear, Attributes atts) {
   Gradient gradient = new Gradient();
   gradient.id = getStringAttr("id", atts);
   gradient.isLinear = isLinear;
   if (isLinear) {
     gradient.x1 = getFloatAttr("x1", atts, 0f);
     gradient.x2 = getFloatAttr("x2", atts, 0f);
     gradient.y1 = getFloatAttr("y1", atts, 0f);
     gradient.y2 = getFloatAttr("y2", atts, 0f);
   } else {
     gradient.x = getFloatAttr("cx", atts, 0f);
     gradient.y = getFloatAttr("cy", atts, 0f);
     gradient.radius = getFloatAttr("r", atts, 0f);
   }
   String transform = getStringAttr("gradientTransform", atts);
   if (transform != null) {
     gradient.matrix = parseTransform(transform);
   }
   String xlink = getStringAttr("href", atts);
   if (xlink != null) {
     if (xlink.startsWith("#")) {
       xlink = xlink.substring(1);
     }
     gradient.xlink = xlink;
   }
   return gradient;
 }
 public Gradient createChild(Gradient g) {
   Gradient child = new Gradient();
   child.id = g.id;
   child.xlink = id;
   child.isLinear = g.isLinear;
   child.x1 = g.x1;
   child.x2 = g.x2;
   child.y1 = g.y1;
   child.y2 = g.y2;
   child.x = g.x;
   child.y = g.y;
   child.radius = g.radius;
   child.positions = positions;
   child.colors = colors;
   child.matrix = matrix;
   if (g.matrix != null) {
     if (matrix == null) {
       child.matrix = g.matrix;
     } else {
       Matrix m = new Matrix(matrix);
       m.preConcat(g.matrix);
       child.matrix = m;
     }
   }
   return child;
 }