refresh(partition, filter.getParts());
}
}
private void refresh(Partition partition, List<Part> currentParts) {
final DefaultListModel model = new DefaultListModel();
Set<Part> filterParts = new HashSet<Part>(currentParts);
Part[] parts = partition.getParts();
Arrays.sort(parts);
for (int i = 0; i < parts.length; i++) {
final Part p = parts[parts.length - 1 - i];
PartWrapper pw = new PartWrapper(p, p.getColor());
pw.setEnabled(filterParts.contains(p));
model.add(i, pw);
}
list.setModel(model);
}