use of delta.games.lotro.lore.reputation.FactionsRegistry in project lotro-companion by dmorcellet.
the class ReputationSynopsisTableController method buildDataProvider.
private DataProvider<Faction> buildDataProvider() {
FactionsRegistry registry = FactionsRegistry.getInstance();
List<Faction> factions = registry.getAll();
DataProvider<Faction> ret = new ListDataProvider<Faction>(factions);
return ret;
}
use of delta.games.lotro.lore.reputation.FactionsRegistry in project lotro-companion by dmorcellet.
the class ReputationDeedsDisplayController method buildPanel.
private JPanel buildPanel() {
JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
FactionsRegistry registry = FactionsRegistry.getInstance();
int y = 0;
List<ReputationDeed> deeds = registry.getReputationDeeds();
for (ReputationDeed deed : deeds) {
String deedName = deed.getName();
JLabel label = GuiFactory.buildLabel(deedName + ":");
label.setToolTipText("Status for the '" + deedName + "' deed");
GridBagConstraints c = new GridBagConstraints(0, y, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
panel.add(label, c);
c.gridx++;
c.weightx = 1.0;
c.fill = GridBagConstraints.HORIZONTAL;
JLabel countLabel = GuiFactory.buildLabel("NN / NN");
panel.add(countLabel, c);
_countLabels.add(countLabel);
y++;
}
return panel;
}
use of delta.games.lotro.lore.reputation.FactionsRegistry in project lotro-tools by dmorcellet.
the class LotroCompendiumDeedsLoader method handleReputation.
@SuppressWarnings("unchecked")
private void handleReputation(Rewards rewards, List<Object> reputationItems) {
// reputation={{val="+700 with Iron Garrison Guards"}}
if (reputationItems == null) {
return;
}
FactionsRegistry registry = FactionsRegistry.getInstance();
Reputation reputation = rewards.getReputation();
for (Object reputationItem : reputationItems) {
Map<String, Object> reputationMap = (Map<String, Object>) reputationItem;
String reputationStr = (String) reputationMap.get("val");
int spaceIndex = reputationStr.indexOf(" ");
Integer value = NumericTools.parseInteger(reputationStr.substring(0, spaceIndex));
String factionStr = reputationStr.substring(spaceIndex + 1).trim();
if (factionStr.startsWith("with "))
factionStr = factionStr.substring(5);
Faction faction = registry.getByName(factionStr);
if ((faction != null) && (value != null)) {
ReputationItem repItem = new ReputationItem(faction);
repItem.setAmount(value.intValue());
reputation.add(repItem);
} else {
System.out.println("Not handled [" + reputationStr + "]");
}
}
}
use of delta.games.lotro.lore.reputation.FactionsRegistry in project lotro-companion by dmorcellet.
the class CharacterReputationDialogController method buildPanel.
private JPanel buildPanel() {
JPanel panel = GuiFactory.buildPanel(new BorderLayout());
// Top: reputation deeds
JPanel topPanel = buildTopPanel();
panel.add(topPanel, BorderLayout.NORTH);
// Center: faction levels
FactionsRegistry registry = FactionsRegistry.getInstance();
JTabbedPane tabs = GuiFactory.buildTabbedPane();
List<String> categories = registry.getFactionCategories();
for (String category : categories) {
List<Faction> factions = registry.getFactionsForCategory(category);
JPanel reputationPanel = buildReputationPanelForCategory(category, factions);
JPanel tabPanel = GuiFactory.buildPanel(new BorderLayout());
tabPanel.setOpaque(true);
tabPanel.setBackground(Color.RED);
tabPanel.add(reputationPanel, BorderLayout.CENTER);
tabs.add(category, tabPanel);
}
TitledBorder factionsBorder = GuiFactory.buildTitledBorder("Factions");
tabs.setBorder(factionsBorder);
panel.add(tabs, BorderLayout.CENTER);
return panel;
}
use of delta.games.lotro.lore.reputation.FactionsRegistry in project lotro-companion by dmorcellet.
the class ReputationSynopsisFilterController method getCategories.
private String[] getCategories() {
FactionsRegistry registry = FactionsRegistry.getInstance();
List<String> categories = registry.getFactionCategories();
String[] ret = categories.toArray(new String[categories.size()]);
return ret;
}
Aggregations