use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT in project lotro-companion by dmorcellet.
the class MainTestStashWindow method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
LotroTestUtils utils = new LotroTestUtils();
CharacterFile toon = utils.getMainToon();
// Copy gear to stash
ItemsStash stash = toon.getStash();
CharacterData data = toon.getInfosManager().getLastCharacterDescription();
CharacterEquipment gear = data.getEquipment();
for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
Item item = gear.getItemForSlot(slot);
if (item != null) {
Item clone = ItemFactory.clone(item);
stash.addItem(clone);
}
}
StashWindowController controller = new StashWindowController(toon);
controller.show();
}
use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT in project lotro-companion by dmorcellet.
the class AllEssencesEditionPanelController method initEditors.
private void initEditors() {
CharacterEquipment equipment = _toon.getEquipment();
for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
SingleItemEssencesEditionController controller = new SingleItemEssencesEditionController(_parent, slot);
Item item = equipment.getItemForSlot(slot);
controller.setItem(item);
_editors.add(controller);
}
}
use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT 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.character.CharacterEquipment.EQUIMENT_SLOT in project lotro-companion by dmorcellet.
the class EquipmentPanelController method initPositions.
private void initPositions() {
_iconPositions = new HashMap<EQUIMENT_SLOT, Dimension>();
int x = X_COLUMN_1;
int y = Y_START;
_iconPositions.put(EQUIMENT_SLOT.LEFT_EAR, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.NECK, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.LEFT_WRIST, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.LEFT_FINGER, new Dimension(x, y));
x = X_COLUMN_2;
y = Y_START;
_iconPositions.put(EQUIMENT_SLOT.RIGHT_EAR, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.POCKET, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.RIGHT_WRIST, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.RIGHT_FINGER, new Dimension(x, y));
x = X_COLUMN_3;
y = Y_START;
_iconPositions.put(EQUIMENT_SLOT.HEAD, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.BREAST, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.HANDS, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.LEGS, new Dimension(x, y));
x = X_COLUMN_4;
y = Y_START;
_iconPositions.put(EQUIMENT_SLOT.SHOULDER, new Dimension(x, y));
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.BACK, new Dimension(x, y));
y += DELTA_Y;
y += DELTA_Y;
_iconPositions.put(EQUIMENT_SLOT.FEET, new Dimension(x, y));
x = X_ROW;
y = Y_ROW;
_iconPositions.put(EQUIMENT_SLOT.MAIN_MELEE, new Dimension(x, y));
x += DELTA_X;
_iconPositions.put(EQUIMENT_SLOT.OTHER_MELEE, new Dimension(x, y));
x += DELTA_X;
_iconPositions.put(EQUIMENT_SLOT.RANGED, new Dimension(x, y));
x += DELTA_X;
_iconPositions.put(EQUIMENT_SLOT.TOOL, new Dimension(x, y));
x += DELTA_X;
_iconPositions.put(EQUIMENT_SLOT.CLASS_ITEM, new Dimension(x, y));
}
use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT 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();
}
Aggregations