use of plugin.initiative.PObjectModel in project pcgen by PCGen.
the class Initiative method hyperLinkSelected.
/**
* <p>Called when a hyperlink is selected in one of the text panes in {@code tpaneInfo}.
* Used to generate attack/skill, etc. dialogs.</p>
*
* @param e {@code HyperLinkEvent} that called this method.
* @param cbt {@code PcgCombatant} to perform action for.
*/
private void hyperLinkSelected(HyperlinkEvent e, InitHolder cbt) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
PObjectModel model = PObjectModel.Factory(e.getDescription());
if (model != null) {
if ((model instanceof AttackModel) && (cbt instanceof PcgCombatant)) {
InitHolder pcgcbt = cbt;
performAttack((AttackModel) model, pcgcbt);
} else if (model instanceof CheckModel) {
performCheck((CheckModel) model);
} else if (model instanceof SpellModel) {
castSpell((SpellModel) model, cbt);
} else if (model instanceof SaveModel) {
performSave((SaveModel) model, cbt);
} else if ((model instanceof DiceRollModel) && (cbt instanceof PcgCombatant)) {
performDiceRoll((DiceRollModel) model);
}
}
}
}
Aggregations