use of gmgen.pluginmgr.messages.RequestAddPreferencesPanelMessage in project pcgen by PCGen.
the class GMGenSystem method handleMessage.
/**
* Message handler for the GMBus.
*
* @param message
* The message passed in from the bus
*/
@Override
public void handleMessage(PCGenMessage message) {
// A plugin is asking for the creation of a new tab
if (message instanceof RequestAddTabToGMGenMessage) {
RequestAddTabToGMGenMessage tmessage = (RequestAddTabToGMGenMessage) message;
Logging.debugPrint("Creating Tab " + GMGenSystemView.getTabPane().getTabCount());
theView.insertPane(tmessage.getName(), tmessage.getPane(), GMGenSystemView.getTabPane().getTabCount());
} else if (message instanceof RequestAddPreferencesPanelMessage) {
RequestAddPreferencesPanelMessage pmessage = (RequestAddPreferencesPanelMessage) message;
Logging.debugPrint("Creating Preferences Panel");
rootNode.addPanel(pmessage.getName(), pmessage.getPrefsPanel());
} else // A plugin is asking for the creation of a new option in the tool menu
if (message instanceof AddMenuItemToGMGenToolsMenuMessage) {
AddMenuItemToGMGenToolsMenuMessage mmessage = (AddMenuItemToGMGenToolsMenuMessage) message;
toolsMenu.add(mmessage.getMenuItem());
} else if (message instanceof GMGenBeingClosedMessage) {
setCloseSettings();
// Karianna 07/03/2008 - Added a call to exitForm passing in no
// window event
// TODO This sequence of calls simply hides GMGen as opposed to
// unloading it
exitForm(null);
}
}
use of gmgen.pluginmgr.messages.RequestAddPreferencesPanelMessage in project pcgen by PCGen.
the class InitiativePlugin method start.
/**
* Starts the plugin, registering itself with the {@code TabAddMessage}.
*/
@Override
public void start(PCGenMessageHandler mh) {
messageHandler = mh;
theView = new Initiative();
messageHandler.handleMessage(new RequestAddPreferencesPanelMessage(this, name, new PreferencesDamagePanel()));
messageHandler.handleMessage(new RequestAddPreferencesPanelMessage(this, name, new PreferencesMassiveDamagePanel()));
messageHandler.handleMessage(new RequestAddPreferencesPanelMessage(this, name, new PreferencesInitiativePanel()));
messageHandler.handleMessage(new RequestAddPreferencesPanelMessage(this, name, new PreferencesPerformancePanel()));
theView.setLog(LogUtilities.inst());
messageHandler.handleMessage(new RequestAddTabToGMGenMessage(this, name, getView()));
initMenus();
}
use of gmgen.pluginmgr.messages.RequestAddPreferencesPanelMessage in project pcgen by PCGen.
the class NotesPlugin method start.
/**
* Starts the plugin, registering itself with the {@code TabAddMessage}.
*/
@Override
public void start(PCGenMessageHandler mh) {
messageHandler = mh;
String name = NAME;
messageHandler.handleMessage(new RequestAddPreferencesPanelMessage(this, name, new PreferencesNotesPanel()));
theView = new NotesView(getDataDirectory(), this);
messageHandler.handleMessage(new RequestAddTabToGMGenMessage(this, name, getView()));
initMenus();
}
use of gmgen.pluginmgr.messages.RequestAddPreferencesPanelMessage in project pcgen by PCGen.
the class ExperienceAdjusterPlugin method start.
/**
* Starts the plugin, registering itself with the {@code TabAddMessage}.
*/
@Override
public void start(PCGenMessageHandler mh) {
messageHandler = mh;
eaModel = new ExperienceAdjusterModel(getDataDirectory());
eaView = new ExperienceAdjusterView(eaModel);
messageHandler.handleMessage(new RequestAddPreferencesPanelMessage(this, getLocalizedName(), new PreferencesExperiencePanel()));
initListeners();
update();
messageHandler.handleMessage(new RequestAddTabToGMGenMessage(this, getLocalizedName(), getView()));
initMenus();
}
Aggregations