private void adjustSelections(Selection selection,String inserted){
  int dif=(selection.y - selection.x) - inserted.length();
  for (  Selection sel : this.selections) {
    sel.x=sel.x - dif;
    sel.y=sel.y - dif;
  }
}

private void adjustSelections ( Selection selection , String inserted ) { int dif = ( selection . y - selection . x ) - inserted . length ( ) ; for ( Selection sel : this . selections ) { sel . x = sel . x - dif ; sel . y = sel . y - dif ; } }
adjusts any getmodel selections to the fact that the given selections was just replaced by the given string .
