Search in sources :

Example 1 with InfoCharacterDetails

use of gmgen.plugin.InfoCharacterDetails in project pcgen by PCGen.

the class Initiative method addTab.

/**
	 * <p>
	 * Adds a tab to the {@code tpaneInfo} member. All methods adding
	 * character tabs to {@code tpaneInfo} should call this method to do
	 * so, as it provides a standard setup for the text panes and installs
	 * hyperlink listeners.
	 * </p>
	 *
	 * @param cbt Combatant to add.
	 */
void addTab(final Combatant cbt) {
    javax.swing.JTextPane lp = new javax.swing.JTextPane();
    lp.setContentType("text/html");
    InfoCharacterDetails ic = new InfoCharacterDetails(cbt, lp);
    tpaneInfo.addTab(cbt.getName(), ic.getScrollPane());
    lp.setEditable(false);
    lp.addHyperlinkListener(new HyperlinkListener() {

        private final Combatant combatant = cbt;

        @Override
        public void hyperlinkUpdate(HyperlinkEvent e) {
            hyperLinkSelected(e, combatant);
        }
    });
}
Also used : InfoCharacterDetails(gmgen.plugin.InfoCharacterDetails) HyperlinkEvent(javax.swing.event.HyperlinkEvent) HyperlinkListener(javax.swing.event.HyperlinkListener) Combatant(gmgen.plugin.Combatant) PcgCombatant(gmgen.plugin.PcgCombatant) XMLCombatant(plugin.initiative.XMLCombatant)

Aggregations

Combatant (gmgen.plugin.Combatant)1 InfoCharacterDetails (gmgen.plugin.InfoCharacterDetails)1 PcgCombatant (gmgen.plugin.PcgCombatant)1 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 HyperlinkListener (javax.swing.event.HyperlinkListener)1 XMLCombatant (plugin.initiative.XMLCombatant)1