use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class EssenceChoice method chooseEssence.
/**
* Choose an essence.
* @param parent Parent controller.
* @return An essence item or <code>null</code>.
*/
public static Item chooseEssence(WindowController parent) {
List<Item> essences = ItemsManager.getInstance().getEssences();
EssenceFilterController filterController = new EssenceFilterController(_filter);
TypedProperties prefs = null;
if (parent != null) {
prefs = parent.getUserProperties(ItemChoiceWindowController.ESSENCE_CHOOSER_PROPERTIES_ID);
}
ItemChoiceWindowController choiceCtrl = new ItemChoiceWindowController(parent, prefs, essences, _filter, filterController);
Item ret = choiceCtrl.editModal();
return ret;
}
use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class CraftingSynopsisWindowController method dispose.
/**
* Release all managed resources.
*/
@Override
public void dispose() {
saveBoundsPreferences();
super.dispose();
if (_panelController != null) {
Preferences preferences = Config.getInstance().getPreferences();
TypedProperties props = preferences.getPreferences(CRAFTING_PREFERENCES_NAME);
List<String> toonIds = new ArrayList<String>();
for (CharacterFile toon : _panelController.getTableController().getToons()) {
toonIds.add(toon.getIdentifier());
}
props.setStringList(TOON_NAME_PREFERENCE, toonIds);
_panelController.dispose();
_panelController = null;
}
}
use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class ReputationSynopsisWindowController method dispose.
/**
* Release all managed resources.
*/
@Override
public void dispose() {
saveBoundsPreferences();
super.dispose();
if (_panelController != null) {
Preferences preferences = Config.getInstance().getPreferences();
TypedProperties props = preferences.getPreferences(REPUTATION_PREFERENCES_NAME);
List<String> toonIds = new ArrayList<String>();
for (CharacterFile toon : _panelController.getTableController().getToons()) {
toonIds.add(toon.getIdentifier());
}
props.setStringList(TOON_NAME_PREFERENCE, toonIds);
_panelController.dispose();
_panelController = null;
}
}
use of delta.common.utils.misc.TypedProperties in project lotro-companion by dmorcellet.
the class NewToonDialogController method buildNewToonPanel.
private JPanel buildNewToonPanel() {
JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
// Toon name
_toonName = GuiFactory.buildTextField("");
_toonName.setColumns(TOON_NAME_SIZE);
// Server
_server = CharacterUiUtils.buildServerCombo();
TypedProperties props = Config.getInstance().getParameters();
String defaultServer = props.getStringProperty("default.server", null);
if (defaultServer != null) {
_server.selectItem(defaultServer);
}
// Class
_class = new CharacterClassController();
// Race
_race = CharacterUiUtils.buildRaceCombo(false);
ItemSelectionListener<Race> listener = new ItemSelectionListener<Race>() {
@Override
public void itemSelected(Race race) {
_class.setRace(race);
}
};
_race.addListener(listener);
// Sex
_sex = CharacterUiUtils.buildSexCombo();
Insets insets = new Insets(5, 5, 5, 5);
GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, insets, 0, 0);
panel.add(GuiFactory.buildLabel("Name:"), gbc);
gbc.gridx = 0;
gbc.gridy = 1;
panel.add(GuiFactory.buildLabel("Server:"), gbc);
gbc.gridx = 0;
gbc.gridy = 2;
panel.add(GuiFactory.buildLabel("Race:"), gbc);
gbc.gridx = 0;
gbc.gridy = 3;
panel.add(GuiFactory.buildLabel("Class:"), gbc);
gbc.gridx = 0;
gbc.gridy = 4;
panel.add(GuiFactory.buildLabel("Sex:"), gbc);
gbc.gridx = 1;
gbc.gridy = 0;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
panel.add(_toonName, gbc);
gbc.gridx = 1;
gbc.gridy = 1;
panel.add(_server.getComboBox(), gbc);
gbc.gridx = 1;
gbc.gridy = 2;
panel.add(_race.getComboBox(), gbc);
gbc.gridx = 1;
gbc.gridy = 3;
panel.add(_class.getComboBoxController().getComboBox(), gbc);
gbc.gridx = 1;
gbc.gridy = 4;
panel.add(_sex.getComboBox(), gbc);
return panel;
}
Aggregations