use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedsContainer method writeSortedDeeds.
/**
* Write a XML file with a sorted list of deeds.
* @param deeds Deeds to sort and write.
* @param out Output file.
*/
public static void writeSortedDeeds(List<DeedDescription> deeds, File out) {
List<Comparator<DeedDescription>> comparators = new ArrayList<Comparator<DeedDescription>>();
comparators.add(new DeedNameComparator());
comparators.add(new DeedDescriptionComparator());
CompoundComparator<DeedDescription> comparator = new CompoundComparator<DeedDescription>(comparators);
Collections.sort(deeds, comparator);
DeedXMLWriter writer = new DeedXMLWriter();
writer.writeDeeds(out, deeds, EncodingNames.UTF_8);
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedsFileBuilder method doIt.
private void doIt() {
File loreDir = LotroCoreConfig.getInstance().getLoreDir();
File deedsDir = new File(loreDir, "deeds");
List<DeedDescription> deeds = new ArrayList<DeedDescription>();
DeedXMLParser parser = new DeedXMLParser();
for (File deedFile : deedsDir.listFiles()) {
List<DeedDescription> newDeeds = parser.parseXML(deedFile);
deeds.addAll(newDeeds);
}
File out = new File(loreDir, "deeds.xml");
DeedXMLWriter writer = new DeedXMLWriter();
writer.writeDeeds(out, deeds, EncodingNames.UTF_8);
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-companion by dmorcellet.
the class DeedExplorerPanelController method build.
private JPanel build() {
JPanel panel = GuiFactory.buildPanel(new BorderLayout());
TitledBorder itemsFrameBorder = GuiFactory.buildTitledBorder("Items");
panel.setBorder(itemsFrameBorder);
// Table
JTable table = _tableController.getTable();
JScrollPane scroll = GuiFactory.buildScrollPane(table);
panel.add(scroll, BorderLayout.CENTER);
// Stats
JPanel statsPanel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEFT));
_statsLabel = GuiFactory.buildLabel("-");
statsPanel.add(_statsLabel);
JButton choose = GuiFactory.buildButton("Choose columns...");
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
TableColumnsChooserController<DeedDescription> chooser = new TableColumnsChooserController<DeedDescription>(_parent, _tableController.getTableController());
chooser.editModal();
}
};
choose.addActionListener(al);
statsPanel.add(choose);
panel.add(statsPanel, BorderLayout.NORTH);
return panel;
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-companion by dmorcellet.
the class DeedsManagementController method actionPerformed.
/**
* Action implementation.
* @param event Source event.
*/
@Override
public void actionPerformed(ActionEvent event) {
String action = event.getActionCommand();
if (NEW_DEED_ID.equals(action)) {
startNewDeed();
} else if (REMOVE_DEED_ID.equals(action)) {
deleteDeed();
} else if (DeedsTableController.DOUBLE_CLICK.equals(action)) {
DeedDescription deed = (DeedDescription) event.getSource();
showToon(deed);
}
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-companion by dmorcellet.
the class DeedsManagementController method deleteDeed.
private void deleteDeed() {
GenericTableController<DeedDescription> controller = _deedsTable.getTableController();
DeedDescription file = controller.getSelectedItem();
if (file != null) {
/*
String serverName=file.getServerName();
String toonName=file.getName();
// Check deletion
int result=GuiFactory.showQuestionDialog(_parentController.getWindow(),"Do you really want to delete " + toonName+"@"+ serverName + "?","Delete?",JOptionPane.YES_NO_OPTION);
if (result==JOptionPane.OK_OPTION)
{
String id=CharacterFileWindowController.getIdentifier(serverName,toonName);
WindowController windowController=_mainWindowsManager.getWindow(id);
if (windowController!=null)
{
windowController.dispose();
}
CharactersManager manager=CharactersManager.getInstance();
manager.removeToon(file);
}
*/
}
}
Aggregations