private static void parseDockers ( JSONObject modelJSON , Shape current ) throws JSONException { if ( modelJSON . has ( "dockers" ) ) { ArrayList < Point > dockers = new ArrayList < Point > ( ) ; JSONArray dockersObject = modelJSON . getJSONArray ( "dockers" ) ; for ( int i = 0 ; i < dockersObject . length ( ) ; i ++ ) { Double x = dockersObject . getJSONObject ( i ) . getDouble ( "x" ) ; Double y = dockersObject . getJSONObject ( i ) . getDouble ( "y" ) ; dockers . add ( new Point ( x , y ) ) ; } if ( dockers . size ( ) > 0 ) { current . setDockers ( dockers ) ; } } }
creates a point array of all dockers and add it to the current shape