switched some spaces to tabs (again)
This commit is contained in:
parent
560f72110d
commit
9256eaa10d
|
@ -63,20 +63,20 @@ public class OrderableListPanel extends JPanel implements ModelChangeListener {
|
||||||
* Updates removed and new relations in the listModel. Does it in a special way to preserve existing ordering in the
|
* Updates removed and new relations in the listModel. Does it in a special way to preserve existing ordering in the
|
||||||
* list, so user has to do minimal re-sorting.
|
* list, so user has to do minimal re-sorting.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onModelChanged() {
|
public void onModelChanged() {
|
||||||
if (this.model == null) return;
|
if (this.model == null) return;
|
||||||
Set<Relation> newRelations = new HashSet<>(model.getRelations());
|
Set<Relation> newRelations = new HashSet<>(model.getRelations());
|
||||||
newRelations.removeAll(listModel.getList());
|
newRelations.removeAll(listModel.getList());
|
||||||
|
|
||||||
Set<Relation> removedRelations = new HashSet<>(listModel.getList());
|
Set<Relation> removedRelations = new HashSet<>(listModel.getList());
|
||||||
removedRelations.removeAll(model.getRelations());
|
removedRelations.removeAll(model.getRelations());
|
||||||
|
|
||||||
listModel.removeAll(removedRelations);
|
listModel.removeAll(removedRelations);
|
||||||
listModel.addAll(newRelations);
|
listModel.addAll(newRelations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Relation> getOrderList() {
|
public ArrayList<Relation> getOrderList() {
|
||||||
return new ArrayList<>(listModel.getList());
|
return new ArrayList<>(listModel.getList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue