private void transferPaintBoxStateData(SimStateDataInterface rcv, SimStateDataInterface src){

      SimPaintBox [] source = src.getPaintBoxArray();
      SimPaintBox [] receiver = rcv.getPaintBoxArray();
      int i;

      if(source==null){
         rcv.setPaintBoxArray(null);
         return;
      }

      if(receiver!=null && source!=null && receiver.length==source.length){
         for(i=0; i<source.length; i++){
            if(source[i].getPaintBoxID() != receiver[i].getPaintBoxID())
               break;
         }

         if(i==source.length){
            // all paint box ID's matched
            // so the code makes sure to copy all state data
            // and then it's done
            for(i=0; i<source.length; i++)
                receiver[i].copyStateData(source[i]);
            return;
         }
      }

      receiver = new SimPaintBox[source.length];
      for(i=0; i<source.length; i++)
         receiver[i] = new SimPaintBox(source[i]);
      rcv.setPaintBoxArray(receiver);
   }