Search in sources :

Example 1 with FileMenuSaveMessage

use of gmgen.pluginmgr.messages.FileMenuSaveMessage in project pcgen by PCGen.

the class ExperienceAdjusterPlugin method handleMessage.

/**
	 * listens to messages from the GMGen system, and handles them as needed
	 * @param message the source of the event from the system
	 */
@Override
public void handleMessage(PCGenMessage message) {
    if (message instanceof CombatHasBeenInitiatedMessage) {
        if (message.getSource() == this) {
            CombatHasBeenInitiatedMessage cmessage = (CombatHasBeenInitiatedMessage) message;
            if (initList == null) {
                initList = cmessage.getCombat();
            }
            eaModel.setCombat(initList);
        }
        update();
    } else if (message instanceof FocusOrStateChangeOccurredMessage) {
        if (isActive()) {
            experienceToolsItem.setEnabled(false);
            if (initList == null) {
                messageHandler.handleMessage(new CombatHasBeenInitiatedMessage(this));
            }
            update();
        } else {
            experienceToolsItem.setEnabled(true);
        }
    } else if (message instanceof FileMenuSaveMessage) {
        if (isActive()) {
            handleExportButton();
        }
    }
}
Also used : FileMenuSaveMessage(gmgen.pluginmgr.messages.FileMenuSaveMessage) FocusOrStateChangeOccurredMessage(pcgen.pluginmgr.messages.FocusOrStateChangeOccurredMessage) CombatHasBeenInitiatedMessage(gmgen.pluginmgr.messages.CombatHasBeenInitiatedMessage)

Aggregations

CombatHasBeenInitiatedMessage (gmgen.pluginmgr.messages.CombatHasBeenInitiatedMessage)1 FileMenuSaveMessage (gmgen.pluginmgr.messages.FileMenuSaveMessage)1 FocusOrStateChangeOccurredMessage (pcgen.pluginmgr.messages.FocusOrStateChangeOccurredMessage)1