use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-tools by dmorcellet.
the class RelicsIndexPageParser method addGorgorothRelics.
private void addGorgorothRelics(RelicsManager relicsMgr) {
RelicsCategory category = findGorgorothCategory(relicsMgr);
if (category != null) {
LotroPlanMordorRelicsLoader relicsLoader = new LotroPlanMordorRelicsLoader();
List<Relic> relics = relicsLoader.loadGorgorothRelics();
for (Relic relic : relics) {
String name = relic.getName();
Relic oldOne = category.getByName(name);
if (oldOne != null) {
mergeRelics(oldOne, relic);
} else {
category.addRelic(relic);
}
}
}
}
use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-tools by dmorcellet.
the class LotroPlanMordorRelicsLoader method loadGorgorothRelics.
/**
* Load Gorgoroth relics.
* @return A list of relics.
*/
public List<Relic> loadGorgorothRelics() {
List<Relic> relics = new ArrayList<Relic>();
LotroPlanItemsDbLoader tableLoader = new LotroPlanItemsDbLoader();
List<Item> items = tableLoader.loadTable("mordor_relics.txt");
for (Item item : items) {
Relic relic = itemToRelic(item);
relics.add(relic);
}
return relics;
}
use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-companion by dmorcellet.
the class RelicChoiceWindowController method doShow.
private Relic doShow(RelicType type, Relic selectedRelic) {
// Ensure that the dialog is built
getDialog();
// Filter
if (type != null) {
_filter.setRelicType(type);
_filterController.setFilter();
}
// Set selection
_tableController.selectRelic(selectedRelic);
// Show modal
Relic chosenRelic = editModal();
return chosenRelic;
}
use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-companion by dmorcellet.
the class RelicChoiceWindowController method buildFormPanel.
@Override
protected JPanel buildFormPanel() {
RelicsManager relicsMgr = RelicsManager.getInstance();
List<Relic> relics = relicsMgr.getAllRelics();
JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
_tableController = new RelicsTableController(relics, _filter);
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ok();
}
};
_tableController.getTableController().addActionListener(al);
// Relics table
_panelController = new RelicChoicePanelController(_tableController);
JPanel tablePanel = _panelController.getPanel();
// Filter
_filterController = new RelicsFilterController(_filter, _panelController);
JPanel filterPanel = _filterController.getPanel();
TitledBorder filterBorder = GuiFactory.buildTitledBorder("Filter");
filterPanel.setBorder(filterBorder);
// Whole panel
GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
panel.add(filterPanel, c);
c.gridy = 1;
c.weighty = 1;
c.fill = GridBagConstraints.BOTH;
panel.add(tablePanel, c);
return panel;
}
use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-companion by dmorcellet.
the class RelicsEditionPanelController method update.
/**
* Update UI from the managed data.
*/
private void update() {
List<Relic> relics = _legAttrs.getRelics();
int nbRelics = relics.size();
for (int i = 0; i < nbRelics; i++) {
Relic relic = relics.get(i);
// Set relic icon
JButton button = _buttons.get(i);
ImageIcon icon = null;
if (relic != null) {
String filename = relic.getIconFilename();
icon = LotroIconsManager.getRelicIcon(filename);
} else {
icon = IconsManager.getIcon(ITEM_WITH_NO_ICON);
}
button.setIcon(icon);
// Text
String text = (relic != null) ? relic.getName() : "";
JLabel relicName = _relicNames.get(i);
relicName.setText(text);
}
}
Aggregations