Search in sources :

Example 1 with StatCurvesChartConfiguration

use of delta.games.lotro.gui.character.stats.curves.StatCurvesChartConfiguration 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)

Aggregations

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