for (int i = 0; i < sorted.length; i++) {
int id = sorted[i];
if (id > limit && id < lineListModel.getSize()){
resould = true;
if (aply){
DiseaseLine tmp = lines.get(id - 1);
lines.set(id - 1, lines.get(id));
lines.set(id, tmp);
}
}
else{
limit = id + 1;
}
}
}
else{
limit = lineListModel.getSize() - 1;
for (int i = sorted.length - 1; i >= 0; i--) {
int id = sorted[i];
if (id >= 0 && id < limit){
resould = true;
if (aply){
DiseaseLine tmp = lines.get(id + 1);
lines.set(id + 1, lines.get(id));
lines.set(id, tmp);
}
}
else{