use of pcgen.core.doomsdaybook.DataValue in project pcgen by PCGen.
the class NameGenPanel method setPronounciationText.
private void setPronounciationText(Iterable<DataValue> data) {
StringBuilder proBuffer = new StringBuilder();
for (DataValue val : data) {
String aPronounciation = val.getSubValue("pronounciation");
if (aPronounciation == null) {
aPronounciation = val.getValue();
}
proBuffer.append(aPronounciation);
}
setPronounciationText(proBuffer.toString());
}
use of pcgen.core.doomsdaybook.DataValue in project pcgen by PCGen.
the class NameGenPanel method setNameText.
private void setNameText(Iterable<DataValue> data) {
StringBuilder nameBuffer = new StringBuilder();
for (DataValue val : data) {
nameBuffer.append(val.getValue());
}
setNameText(nameBuffer.toString());
}
use of pcgen.core.doomsdaybook.DataValue in project pcgen by PCGen.
the class NameGenPanel method generate.
/**
* Generate a Rule
* @return new Rule
*/
public Rule generate() {
try {
Rule rule;
if (chkStructure.isSelected()) {
RuleSet rs = (RuleSet) cbCatalog.getSelectedItem();
rule = rs.getRule();
} else {
rule = (Rule) cbStructure.getSelectedItem();
}
ArrayList<DataValue> aName = rule.getData();
setNameText(aName);
setMeaningText(aName);
setPronounciationText(aName);
return rule;
} catch (Exception e) {
Logging.errorPrint(e.getMessage(), e);
return null;
}
}
use of pcgen.core.doomsdaybook.DataValue 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);
}
}
use of pcgen.core.doomsdaybook.DataValue in project pcgen by PCGen.
the class NameGenPanel method setMeaningText.
private void setMeaningText(Iterable<DataValue> data) {
StringBuilder meaningBuffer = new StringBuilder();
for (DataValue val : data) {
//$NON-NLS-1$ // XML attribute no translation
String aMeaning = val.getSubValue("meaning");
if (aMeaning == null) {
aMeaning = val.getValue();
}
meaningBuffer.append(aMeaning);
}
setMeaningText(meaningBuffer.toString());
}
Aggregations