Search in sources :

Example 1 with RootNode

use of pcgen.facade.core.SpellSupportFacade.RootNode in project pcgen by PCGen.

the class SpellInfoHandler method valueChanged.

@Override
public void valueChanged(ListSelectionEvent e) {
    if (!e.getValueIsAdjusting()) {
        Object obj;
        if (e.getSource() == availableTable.getSelectionModel()) {
            obj = availableTable.getSelectedObject();
        } else {
            obj = selectedTable.getSelectedObject();
        }
        if (obj instanceof SpellNode) {
            SpellNode node = (SpellNode) obj;
            String text = character.getInfoFactory().getHTMLInfo(node.getSpell());
            currText = text;
            spellsPane.setText(text);
        } else if (obj instanceof RootNode) {
            RootNode node = (RootNode) obj;
            String text = character.getInfoFactory().getSpellBookInfo(node.getName());
            if (!StringUtils.isEmpty(text)) {
                currText = text;
                spellsPane.setText(text);
            }
        }
    }
}
Also used : SpellNode(pcgen.facade.core.SpellSupportFacade.SpellNode) RootNode(pcgen.facade.core.SpellSupportFacade.RootNode)

Aggregations

RootNode (pcgen.facade.core.SpellSupportFacade.RootNode)1 SpellNode (pcgen.facade.core.SpellSupportFacade.SpellNode)1