use of delta.games.lotro.stats.traitPoints.TraitPointFilter in project lotro-companion by dmorcellet.
the class TraitPointsEditionPanelController method buildTables.
private void buildTables() {
_tableControllers = new ArrayList<TraitPointsTableController>();
_labels = new ArrayList<String>();
CharacterClass characterClass = _summary.getCharacterClass();
TraitPointsRegistry registry = TraitPoints.get().getRegistry();
List<TraitPoint> points = registry.getPointsForClass(characterClass);
Collections.sort(points, new TraitPointLabelComparator());
TraitPointsStatusListener listener = new TraitPointsStatusListener() {
@Override
public void statusUpdated() {
_summaryController.update();
}
};
String[] categories = { "Class", "Epic", "Quests", "Deeds" };
for (String category : categories) {
TraitPointFilter filter = new TraitPointFilter();
filter.setCategory(category);
List<TraitPoint> selectedPoints = new ArrayList<TraitPoint>();
for (TraitPoint point : points) {
if (filter.accept(point)) {
selectedPoints.add(point);
}
}
TraitPointsTableController tableController = new TraitPointsTableController(_status, selectedPoints);
_tableControllers.add(tableController);
_labels.add(category);
tableController.setListener(listener);
}
}
Aggregations