public static float [ ] dashFromString ( String dashPattern ) { if ( dashPattern . trim ( ) . length ( ) > 0 ) { String [ ] split = dashPattern . split ( "," ) ; if ( split . length > 1 ) { float [ ] dash = new float [ split . length ] ; for ( int i = 0 ; i < split . length ; i ++ ) { try { float tmpDash = Float . parseFloat ( split [ i ] . trim ( ) ) ; dash [ i ] = tmpDash ; } catch ( NumberFormatException e ) { // GPLog.error("Style", "Can't convert to dash pattern: " + dashPattern, e); return null ; } } return dash ; } } return null ; }
Convert string to dash .