Search in sources :

Example 6 with RuleSet

use of pcgen.core.doomsdaybook.RuleSet in project pcgen by PCGen.

the class NameGenPanel method NameButtonActionPerformed.

private void NameButtonActionPerformed(ActionEvent evt) {
    try {
        NameButton nb = (NameButton) evt.getSource();
        DataElement element = nb.getDataElement();
        element.getData();
        Rule rule = this.lastRule;
        if (rule == null) {
            if (chkStructure.isSelected()) {
                RuleSet rs = (RuleSet) cbCatalog.getSelectedItem();
                rule = rs.getLastRule();
            } else {
                rule = (Rule) cbStructure.getSelectedItem();
            }
            this.lastRule = rule;
        }
        ArrayList<DataValue> aName = rule.getLastData();
        setNameText(aName);
        setMeaningText(aName);
        setPronounciationText(aName);
    } catch (Exception e) {
        Logging.errorPrint(e.getMessage(), e);
    }
}
Also used : DataElement(pcgen.core.doomsdaybook.DataElement) RuleSet(pcgen.core.doomsdaybook.RuleSet) WeightedDataValue(pcgen.core.doomsdaybook.WeightedDataValue) DataValue(pcgen.core.doomsdaybook.DataValue) CRRule(pcgen.core.doomsdaybook.CRRule) HyphenRule(pcgen.core.doomsdaybook.HyphenRule) Rule(pcgen.core.doomsdaybook.Rule) SpaceRule(pcgen.core.doomsdaybook.SpaceRule) FileNotFoundException(java.io.FileNotFoundException) DataConversionException(org.jdom2.DataConversionException)

Aggregations

RuleSet (pcgen.core.doomsdaybook.RuleSet)6 FileNotFoundException (java.io.FileNotFoundException)3 DataConversionException (org.jdom2.DataConversionException)3 DataElement (pcgen.core.doomsdaybook.DataElement)3 Vector (java.util.Vector)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 Element (org.jdom2.Element)2 CRRule (pcgen.core.doomsdaybook.CRRule)2 DataValue (pcgen.core.doomsdaybook.DataValue)2 HyphenRule (pcgen.core.doomsdaybook.HyphenRule)2 Rule (pcgen.core.doomsdaybook.Rule)2 SpaceRule (pcgen.core.doomsdaybook.SpaceRule)2 WeightedDataValue (pcgen.core.doomsdaybook.WeightedDataValue)2 ArrayList (java.util.ArrayList)1 ComboBoxModel (javax.swing.ComboBoxModel)1 DataElementComperator (pcgen.core.doomsdaybook.DataElementComperator)1