public static void replaceStyles(List<ShapeRecord> shapeRecords,int lineStyleIndex,int fillStyle0Index,int fillStyle1Index){
  if (shapeRecords != null && shapeRecords.size() > 0) {
    for (int i=0; i < shapeRecords.size(); i++) {
      ShapeRecord record=shapeRecords.get(i);
      if (record instanceof StyleChangeRecord) {
        StyleChangeRecord old_scr=(StyleChangeRecord)record;
        StyleChangeRecord new_scr=new StyleChangeRecord();
        if (fillStyle0Index > 0)         new_scr.setFillStyle0(fillStyle0Index);
        if (fillStyle1Index > 0)         new_scr.setFillStyle1(fillStyle1Index);
        if ((!old_scr.stateLineStyle) && (lineStyleIndex > 0))         new_scr.setLinestyle(lineStyleIndex);
 else         new_scr.setLinestyle(old_scr.linestyle);
        if (old_scr.stateMoveTo)         new_scr.setMove(old_scr.moveDeltaX,old_scr.moveDeltaY);
        shapeRecords.set(i,new_scr);
      }
    }
  }
}

public static void replaceStyles ( List < ShapeRecord > shapeRecords , int lineStyleIndex , int fillStyle0Index , int fillStyle1Index ) { if ( shapeRecords != null && shapeRecords . size ( ) > 0 ) { for ( int i = 0 ; i < shapeRecords . size ( ) ; i ++ ) { ShapeRecord record = shapeRecords . get ( i ) ; if ( record instanceof StyleChangeRecord ) { StyleChangeRecord old_scr = ( StyleChangeRecord ) record ; StyleChangeRecord new_scr = new StyleChangeRecord ( ) ; if ( fillStyle0Index > 0 ) new_scr . setFillStyle0 ( fillStyle0Index ) ; if ( fillStyle1Index > 0 ) new_scr . setFillStyle1 ( fillStyle1Index ) ; if ( ( ! old_scr . stateLineStyle ) && ( lineStyleIndex > 0 ) ) new_scr . setLinestyle ( lineStyleIndex ) ; else new_scr . setLinestyle ( old_scr . linestyle ) ; if ( old_scr . stateMoveTo ) new_scr . setMove ( old_scr . moveDeltaX , old_scr . moveDeltaY ) ; shapeRecords . set ( i , new_scr ) ; } } } }
replaces the style information for the all the stylechangerecords in a list of shaperecords .
