use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EquipmentPanelController method handleCopyToStash.
private void handleCopyToStash(EQUIMENT_SLOT slot) {
CharacterEquipment equipment = _toonData.getEquipment();
SlotContents contents = equipment.getSlotContents(slot, false);
if (contents != null) {
Item item = contents.getItem();
if (item != null) {
ItemsStash stash = _toon.getStash();
Item newItem = ItemFactory.clone(item);
stash.addItem(newItem);
Integer stashId = newItem.getStashIdentifier();
item.setStashIdentifier(stashId);
_toon.saveStash();
// Broadcast stash update event...
CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_STASH_UPDATED, _toon, null);
EventsManager.invokeEvent(event);
}
}
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EquipmentPanelController method updateIcons.
/**
* Update contents.
*/
private void updateIcons() {
for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
Item item = getItemForSlot(slot);
EquipmentSlotIconController iconController = _icons.get(slot);
iconController.setItem(item);
JButton button = _buttons.get(slot);
ImageIcon icon = iconController.getIcon();
button.setIcon(icon);
String tooltipText = iconController.getTooltip();
button.setToolTipText(tooltipText);
}
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EquipmentPanelController method handleEditItem.
private void handleEditItem(EQUIMENT_SLOT slot) {
Item item = getItemForSlot(slot);
if (item != null) {
ItemEditionWindowController ctrl = new ItemEditionWindowController(_parentWindow, item);
ctrl.show(true);
refreshToon();
}
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EquipmentPanelController method buildRightClickListener.
private MouseListener buildRightClickListener() {
class PopClickListener extends MouseAdapter {
@Override
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger())
doPop(e);
}
@Override
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger())
doPop(e);
}
private void doPop(MouseEvent e) {
EQUIMENT_SLOT slot = findSlotForButton((Component) e.getSource());
Item item = getItemForSlot(slot);
_contextMenu.getComponent(0).setEnabled(item != null);
_contextMenu.show(e.getComponent(), e.getX(), e.getY());
}
}
return new PopClickListener();
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EquipmentPanelController method getItemForSlot.
private Item getItemForSlot(EQUIMENT_SLOT slot) {
CharacterEquipment equipment = _toonData.getEquipment();
Item item = equipment.getItemForSlot(slot);
return item;
}
Aggregations