private int[] toIntArray(String str){
  int[] retVal=new int[4];
  str=str + ",";
  int rlen=retVal.length;
  for (int i=0; i < rlen; i++) {
    retVal[i]=Integer.parseInt(str.substring(0,str.indexOf(",")));
    str=str.substring(str.indexOf(",") + 1,str.length());
  }
  return retVal;
}

private int [ ] toIntArray ( String str ) { int [ ] retVal = new int [ 4 ] ; str = str + "," ; int rlen = retVal . length ; for ( int i = 0 ; i < rlen ; i ++ ) { retVal [ i ] = Integer . parseInt ( str . substring ( 0 , str . indexOf ( "," ) ) ) ; str = str . substring ( str . indexOf ( "," ) + 1 , str . length ( ) ) ; } return retVal ; }
this method is used to parse the margin and the padding
