use of delta.games.lotro.character.crafting.ProfessionStatus in project lotro-companion by dmorcellet.
the class CraftingSynopsisTableController method updateRowItems.
private void updateRowItems() {
_rowItems.clear();
for (CharacterFile toon : _toons) {
CraftingStatus craftingStatus = toon.getCraftingStatus();
List<Profession> professions = craftingStatus.getProfessions();
GuildStatus guildStatus = craftingStatus.getGuildStatus();
Profession guild = guildStatus.getProfession();
for (Profession profession : professions) {
ProfessionStatus professionStatus = craftingStatus.getProfessionStatus(profession, true);
GuildStatus displayedStatus = (profession == guild) ? guildStatus : null;
CraftingSynopsisItem item = new CraftingSynopsisItem(toon, professionStatus, displayedStatus);
_rowItems.add(item);
}
}
}
use of delta.games.lotro.character.crafting.ProfessionStatus in project lotro-companion by dmorcellet.
the class VocationEditionPanelController method updateProfessionsUi.
/**
* Update the UI for professions.
*/
private void updateProfessionsUi() {
Vocation vocation = _status.getVocation();
_vocationPanel.removeAll();
JComponent centerComponent = null;
List<Profession> professions = (vocation != null) ? vocation.getProfessions() : null;
if ((professions != null) && (professions.size() > 0)) {
_tabbedPane = GuiFactory.buildTabbedPane();
// Professions
for (Profession profession : professions) {
ProfessionStatus stats = _status.getProfessionStatus(profession, true);
ProfessionStatusPanelController craftingPanelController = _panels.get(profession);
if (craftingPanelController == null) {
craftingPanelController = new ProfessionStatusPanelController(stats);
_panels.put(profession, craftingPanelController);
}
JPanel craftingPanel = craftingPanelController.getPanel();
_tabbedPane.add(profession.getLabel(), craftingPanel);
}
// Clean other professions
for (Profession profession : Profession.getAll()) {
if (!professions.contains(profession)) {
_panels.remove(profession);
}
}
centerComponent = _tabbedPane;
} else {
JLabel centerLabel = new JLabel("No vocation!");
centerComponent = centerLabel;
_tabbedPane = null;
}
_vocationPanel.add(centerComponent, BorderLayout.CENTER);
_vocationPanel.revalidate();
_vocationPanel.repaint();
}
use of delta.games.lotro.character.crafting.ProfessionStatus in project lotro-companion by dmorcellet.
the class MainTestCraftingHistoryChart method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
Locale.setDefault(Locale.US);
LotroTestUtils utils = new LotroTestUtils();
// for(CharacterFile toon : utils.getAllFiles())
{
CharacterFile toon = utils.getMainToon();
CraftingStatus stats = toon.getCraftingStatus();
stats.dump(System.out);
List<Profession> professions = stats.getProfessions();
for (Profession profession : professions) {
ProfessionStatus stat = stats.getProfessionStatus(profession);
JFrame f = new JFrame();
ProfessionStatusPanelController controller = new ProfessionStatusPanelController(stat);
JPanel panel = controller.getPanel();
f.getContentPane().add(panel);
f.pack();
f.setVisible(true);
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}
}
Aggregations