use of delta.games.lotro.lore.crafting.Profession in project lotro-companion by dmorcellet.
the class CraftingSynopsisFilterController method build.
private JPanel build() {
JPanel panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING));
// Professions
List<Profession> professions = Profession.getAll();
_professions = new ComboBoxController<Profession>();
_professions.addEmptyItem(" ");
for (Profession profession : professions) {
_professions.addItem(profession, profession.getLabel());
}
ItemSelectionListener<Profession> listener = new ItemSelectionListener<Profession>() {
@Override
public void itemSelected(Profession profession) {
_filter.setProfession(profession);
updateFilter();
}
};
_professions.addListener(listener);
panel.add(GuiFactory.buildLabel("Profession:"));
panel.add(_professions.getComboBox());
return panel;
}
use of delta.games.lotro.lore.crafting.Profession 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);
}
}
}
use of delta.games.lotro.lore.crafting.Profession in project lotro-companion by dmorcellet.
the class CraftingSynopsisTableController method buildProfessionColumn.
private TableColumnController<CraftingSynopsisItem, Profession> buildProfessionColumn() {
CellDataProvider<CraftingSynopsisItem, Profession> professionCell = new CellDataProvider<CraftingSynopsisItem, Profession>() {
@Override
public Profession getData(CraftingSynopsisItem item) {
return item.getProfession();
}
};
TableColumnController<CraftingSynopsisItem, Profession> professionColumn = new TableColumnController<CraftingSynopsisItem, Profession>("Profession", Profession.class, professionCell);
professionColumn.setWidthSpecs(50, 50, 50);
// Header renderer
JPanel emptyHeaderPanel = GuiFactory.buildBackgroundPanel(new GridBagLayout());
TableCellRenderer headerRenderer = buildSimpleCellRenderer(emptyHeaderPanel);
professionColumn.setHeaderCellRenderer(headerRenderer);
// Cell renderer
TableCellRenderer cellRenderer = buildProfessionCellRenderer();
professionColumn.setCellRenderer(cellRenderer);
// Comparator
ProfessionComparator comparator = new ProfessionComparator();
professionColumn.setComparator(comparator);
return professionColumn;
}
use of delta.games.lotro.lore.crafting.Profession in project lotro-companion by dmorcellet.
the class CraftingSynopsisTableController method buildProfessionCellRenderer.
private TableCellRenderer buildProfessionCellRenderer() {
TableCellRenderer renderer = new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
Profession profession = (Profession) value;
Icon icon = LotroIconsManager.getProfessionIcon(profession);
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setIcon(icon);
label.setToolTipText(profession.getLabel());
label.setText("");
return label;
}
};
return renderer;
}
use of delta.games.lotro.lore.crafting.Profession in project lotro-companion by dmorcellet.
the class VocationEditionPanelController method updateGuildUi.
/**
* Update the UI for guild edition.
*/
public void updateGuildUi() {
// Cleanup
if ((_guildStatus != null) && (_tabbedPane != null)) {
JPanel guildPanel = _guildStatus.getPanel();
_tabbedPane.remove(guildPanel);
}
GuildStatus guildStatus = _status.getGuildStatus();
Profession guild = guildStatus.getProfession();
// Add tab if needed
if (guild != null) {
_guildStatus = new FactionStatusPanelController(guildStatus.getFactionStatus());
JPanel guildPanel = _guildStatus.getPanel();
_tabbedPane.add("Guild", guildPanel);
_tabbedPane.setSelectedComponent(guildPanel);
}
}
Aggregations