Search in sources :

Example 1 with LocalHyperlinkAction

use of delta.common.ui.swing.labels.LocalHyperlinkAction in project lotro-companion by dmorcellet.

the class DetailedCharacterStatsPanelController method buildLabelForStat.

private JLabel buildLabelForStat(String text, STAT stat) {
    JLabel label = null;
    if (stat != null) {
        final StatCurvesChartConfiguration config = (_statCurvesMgr != null) ? _statCurvesMgr.getConfigForStat(stat) : null;
        if (config != null) {
            ActionListener al = new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    _statCurvesMgr.showStatCurvesWindow(config);
                }
            };
            LocalHyperlinkAction action = new LocalHyperlinkAction(text, al);
            HyperLinkController controller = new HyperLinkController(action);
            label = controller.getLabel();
        }
    }
    if (label == null) {
        label = GuiFactory.buildLabel(text);
    }
    return label;
}
Also used : HyperLinkController(delta.common.ui.swing.labels.HyperLinkController) ActionListener(java.awt.event.ActionListener) LocalHyperlinkAction(delta.common.ui.swing.labels.LocalHyperlinkAction) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) StatCurvesChartConfiguration(delta.games.lotro.gui.character.stats.curves.StatCurvesChartConfiguration)

Example 2 with LocalHyperlinkAction

use of delta.common.ui.swing.labels.LocalHyperlinkAction 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)

Aggregations

HyperLinkController (delta.common.ui.swing.labels.HyperLinkController)2 LocalHyperlinkAction (delta.common.ui.swing.labels.LocalHyperlinkAction)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 StatCurvesChartConfiguration (delta.games.lotro.gui.character.stats.curves.StatCurvesChartConfiguration)1 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)1 JLabel (javax.swing.JLabel)1