Object w = attrs.getAttribute(Attribute.HEIGHT); if (w != null) return Integer.parseInt(w.toString());
if (spans[axis] != null) return spans[axis].getValue();
  public float getPreferredSpan(int axis)  {    AttributeSet attrs = getAttributes();        Image image = getImage();    if (axis == View.X_AXIS)      {        Object w = attrs.getAttribute(Attribute.WIDTH);        if (w != null)          return Integer.parseInt(w.toString());        else if (image != null)          return image.getWidth(getContainer());        else          return getNoImageIcon().getIconWidth();      }    else if (axis == View.Y_AXIS)      {        Object w = attrs.getAttribute(Attribute.HEIGHT);        if (w != null)          return Integer.parseInt(w.toString());        else if (image != null)          return image.getHeight(getContainer());        else          return getNoImageIcon().getIconHeight();      }    else      throw new IllegalArgumentException("axis " + axis);  }