Search in sources :

Example 31 with DeedDescription

use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-companion by dmorcellet.

the class DeedLinksDisplayPanelController method buildController.

private void buildController(String label, DeedProxy proxy) {
    if (proxy != null) {
        String name = proxy.getName();
        final DeedDescription deed = proxy.getDeed();
        ActionListener listener = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                _parent.setDeed(deed);
            }
        };
        LocalHyperlinkAction action = new LocalHyperlinkAction(name, listener);
        HyperLinkController controller = new HyperLinkController(action);
        _labels.add(label);
        _links.add(controller);
    }
}
Also used : HyperLinkController(delta.common.ui.swing.labels.HyperLinkController) DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) ActionListener(java.awt.event.ActionListener) LocalHyperlinkAction(delta.common.ui.swing.labels.LocalHyperlinkAction) ActionEvent(java.awt.event.ActionEvent)

Example 32 with DeedDescription

use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-companion by dmorcellet.

the class DeedEditionWindowController method okImpl.

@Override
protected void okImpl() {
    DeedDescription deed = _panelController.getItem();
    DeedEvent event = new DeedEvent(DeedEventType.DEED_UPDATED, deed);
    EventsManager.invokeEvent(event);
}
Also used : DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) DeedEvent(delta.games.lotro.gui.deed.events.DeedEvent)

Example 33 with DeedDescription

use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-companion by dmorcellet.

the class MainTestRewardsDisplay method main.

/**
 * Main method for this test.
 * @param args Not used.
 */
public static void main(String[] args) {
    DeedsManager deedsManager = DeedsManager.getInstance();
    List<DeedDescription> deeds = deedsManager.getAll();
    for (int i = 0; i < 50; i++) {
        DeedDescription deed = deeds.get(i);
        Rewards rewards = deed.getRewards();
        ObjectsSet objects = rewards.getObjects();
        int lotroPoints = rewards.getLotroPoints();
        if ((objects.getNbObjectItems() > 0) || (lotroPoints > 0)) {
            RewardsPanelController panelCtrl = new RewardsPanelController(rewards);
            JPanel panel = panelCtrl.getPanel();
            JFrame frame = new JFrame();
            JPanel background = GuiFactory.buildBackgroundPanel(new BorderLayout());
            background.add(panel, BorderLayout.CENTER);
            frame.add(background);
            frame.pack();
            frame.setVisible(true);
        }
    }
}
Also used : JPanel(javax.swing.JPanel) DeedsManager(delta.games.lotro.lore.deeds.DeedsManager) DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame) Rewards(delta.games.lotro.common.Rewards) ObjectsSet(delta.games.lotro.common.objects.ObjectsSet)

Example 34 with DeedDescription

use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.

the class DeedsContainer method resolveProxies.

private void resolveProxies() {
    for (DeedDescription deed : _deeds) {
        DeedProxy previousProxy = deed.getPreviousDeedProxy();
        if (previousProxy != null) {
            resolveProxy(previousProxy);
        }
        DeedProxy nextProxy = deed.getNextDeedProxy();
        if (nextProxy != null) {
            resolveProxy(nextProxy);
        }
    }
}
Also used : DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) DeedProxy(delta.games.lotro.lore.deeds.DeedProxy)

Example 35 with DeedDescription

use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.

the class DeedsContainer method resolveProxy.

private void resolveProxy(DeedProxy proxy) {
    int idToSearch = proxy.getId();
    for (DeedDescription deed : _deeds) {
        if (deed.getIdentifier() == idToSearch) {
            proxy.setDeed(deed);
            proxy.setKey(deed.getKey());
            proxy.setName(deed.getName());
            break;
        }
    }
    if (proxy.getDeed() == null) {
        System.out.println("Unresolved deed: id=" + idToSearch);
    }
}
Also used : DeedDescription(delta.games.lotro.lore.deeds.DeedDescription)

Aggregations

DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)45 DeedProxy (delta.games.lotro.lore.deeds.DeedProxy)13 ArrayList (java.util.ArrayList)13 File (java.io.File)6 Rewards (delta.games.lotro.common.Rewards)5 DeedsManager (delta.games.lotro.lore.deeds.DeedsManager)4 HashSet (java.util.HashSet)4 DeedXMLParser (delta.games.lotro.lore.deeds.io.xml.DeedXMLParser)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 List (java.util.List)3 Title (delta.games.lotro.common.Title)2 Virtue (delta.games.lotro.common.Virtue)2 VirtueId (delta.games.lotro.common.VirtueId)2 ObjectItem (delta.games.lotro.common.objects.ObjectItem)2 ObjectsSet (delta.games.lotro.common.objects.ObjectsSet)2 DeedXMLWriter (delta.games.lotro.lore.deeds.io.xml.DeedXMLWriter)2 BorderLayout (java.awt.BorderLayout)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2