private void parseAttributres(String str){
  if (str.indexOf("[Flat ") != -1) {
    m_type=TYPE_FLAT;
    m_primaryColor=ThemeUtils.parseColor(str,new ColorUIResource(m_primaryColor));
  }
 else   if (str.indexOf("[Gradient ") != -1) {
    m_type=TYPE_GRADIENT;
    m_primaryColor=ThemeUtils.parseColor(str.substring(str.indexOf(" Upper=") + 7,str.indexOf(",Lower=")),new ColorUIResource(m_primaryColor));
    m_secondaryColor=ThemeUtils.parseColor(str.substring(str.indexOf(",Lower=") + 7,str.indexOf(",Start=")),new ColorUIResource(m_secondaryColor));
    m_startPoint=Integer.parseInt(str.substring(str.indexOf(",Start=") + 7,str.indexOf(",RDistance=")));
    setGradientRepeatDistance(str.substring(str.indexOf(",RDistance=") + 11,str.lastIndexOf(']')));
  }
 else   if (str.indexOf("[Line ") != -1) {
    m_type=TYPE_LINES;
    m_primaryColor=ThemeUtils.parseColor(str.substring(str.indexOf(" Color=") + 7,str.indexOf(",BackColor=")),new ColorUIResource(m_primaryColor));
    m_secondaryColor=ThemeUtils.parseColor(str.substring(str.indexOf(",BackColor=") + 11,str.indexOf(",Width=")),new ColorUIResource(m_secondaryColor));
    setLineWidth(str.substring(str.indexOf(",Width=") + 7,str.indexOf(",Distance=")));
    setLineDistance(str.substring(str.indexOf(",Distance=") + 10,str.lastIndexOf(']')));
  }
 else   if (str.indexOf("[Texture ") != -1) {
    m_type=TYPE_TEXTURE;
    setTextureURL(str.substring(str.indexOf(" GraphURL=") + 10,str.indexOf(",Taint=")));
    m_primaryColor=ThemeUtils.parseColor(str.substring(str.indexOf(",Taint=") + 7,str.indexOf(",Alpha=")),new ColorUIResource(m_primaryColor));
    setTextureCompositeAlpha(str.substring(str.indexOf(",Alpha=") + 7,str.lastIndexOf(']')));
  }
}

private void parseAttributres ( String str ) { if ( str . indexOf ( "[Flat " ) != - 1 ) { m_type = TYPE_FLAT ; m_primaryColor = ThemeUtils . parseColor ( str , new ColorUIResource ( m_primaryColor ) ) ; } else if ( str . indexOf ( "[Gradient " ) != - 1 ) { m_type = TYPE_GRADIENT ; m_primaryColor = ThemeUtils . parseColor ( str . substring ( str . indexOf ( " Upper=" ) + 7 , str . indexOf ( ",Lower=" ) ) , new ColorUIResource ( m_primaryColor ) ) ; m_secondaryColor = ThemeUtils . parseColor ( str . substring ( str . indexOf ( ",Lower=" ) + 7 , str . indexOf ( ",Start=" ) ) , new ColorUIResource ( m_secondaryColor ) ) ; m_startPoint = Integer . parseInt ( str . substring ( str . indexOf ( ",Start=" ) + 7 , str . indexOf ( ",RDistance=" ) ) ) ; setGradientRepeatDistance ( str . substring ( str . indexOf ( ",RDistance=" ) + 11 , str . lastIndexOf ( ']' ) ) ) ; } else if ( str . indexOf ( "[Line " ) != - 1 ) { m_type = TYPE_LINES ; m_primaryColor = ThemeUtils . parseColor ( str . substring ( str . indexOf ( " Color=" ) + 7 , str . indexOf ( ",BackColor=" ) ) , new ColorUIResource ( m_primaryColor ) ) ; m_secondaryColor = ThemeUtils . parseColor ( str . substring ( str . indexOf ( ",BackColor=" ) + 11 , str . indexOf ( ",Width=" ) ) , new ColorUIResource ( m_secondaryColor ) ) ; setLineWidth ( str . substring ( str . indexOf ( ",Width=" ) + 7 , str . indexOf ( ",Distance=" ) ) ) ; setLineDistance ( str . substring ( str . indexOf ( ",Distance=" ) + 10 , str . lastIndexOf ( ']' ) ) ) ; } else if ( str . indexOf ( "[Texture " ) != - 1 ) { m_type = TYPE_TEXTURE ; setTextureURL ( str . substring ( str . indexOf ( " GraphURL=" ) + 10 , str . indexOf ( ",Taint=" ) ) ) ; m_primaryColor = ThemeUtils . parseColor ( str . substring ( str . indexOf ( ",Taint=" ) + 7 , str . indexOf ( ",Alpha=" ) ) , new ColorUIResource ( m_primaryColor ) ) ; setTextureCompositeAlpha ( str . substring ( str . indexOf ( ",Alpha=" ) + 7 , str . lastIndexOf ( ']' ) ) ) ; } }
parse string representation and set attributes
