#include <StateChangeNotifier.h>
State Change Listeners must be of type StateChangeListenerInterface.
Public Member Functions | |
StateChangeNotifier (StateChangeMode_e stateChangeMode=StateChangeMode_v100) | |
virtual | ~StateChangeNotifier () |
void | addListener (StateChangeListenerInterface *listener) |
Register a listener with the StateChangeNotifier. | |
void | removeListener (StateChangeListenerInterface *listener) |
Remove a listener from the StateChangeNotifier. | |
bool | isListening (StateChangeListenerInterface *listener) |
Checks to see if a particular listener is registered with the StateChangeNotifier. | |
bool | setMode (StateChangeMode_e mode) |
Sets the mode in which state changes are propagated to the registered listeners. | |
StateChangeMode_e | mode () |
Static Public Member Functions | |
static void | sendStateChange (StateChange_e stateChange, const Set &zoneSet=Set(), const Set &varSet=Set(), LgIndex_t index=TECUTILBADID) |
Inform Tecplot of a state change event. | |
Protected Member Functions | |
virtual void | onStateChanged (const StateChangeEventInterface &stateChangeEvent) |
This method is called by the Tecplot SDK whenever a state change event occurs. | |
void | notifyOfStateChanged (const StateChangeEventInterface &stateChangeEvent) |
Notify the listeners of the state change event. |
tecplot::toolbox::StateChangeNotifier::StateChangeNotifier | ( | StateChangeMode_e | stateChangeMode = StateChangeMode_v100 |
) |
virtual tecplot::toolbox::StateChangeNotifier::~StateChangeNotifier | ( | ) | [virtual] |
void tecplot::toolbox::StateChangeNotifier::addListener | ( | StateChangeListenerInterface * | listener | ) | [virtual] |
Register a listener with the StateChangeNotifier.
listener | Pointer to the listener class that has implemented the StateChangeListenerInterface |
OutOfMemoryException | OutOfMemoryException is thrown if listener could not be added. |
Implements tecplot::toolbox::StateChangeNotifierInterface.
void tecplot::toolbox::StateChangeNotifier::removeListener | ( | StateChangeListenerInterface * | listener | ) | [virtual] |
Remove a listener from the StateChangeNotifier.
listener | Pointer to the listener class that has implemented the StateChangeListenerInterface |
Implements tecplot::toolbox::StateChangeNotifierInterface.
bool tecplot::toolbox::StateChangeNotifier::isListening | ( | StateChangeListenerInterface * | listener | ) | [virtual] |
Checks to see if a particular listener is registered with the StateChangeNotifier.
listener | Pointer to the listener class that has implemented the StateChangeListenerInterface |
Implements tecplot::toolbox::StateChangeNotifierInterface.
bool tecplot::toolbox::StateChangeNotifier::setMode | ( | StateChangeMode_e | mode | ) | [virtual] |
Sets the mode in which state changes are propagated to the registered listeners.
mode | Mode you want state changes propagated to your listeners. Choose either StateChangeMode_v80, StateChangeMode_v100, or StateChangeMode_v113. See the section "Sending State Changes" in the "ADK User's Manual" for a complete description of the differences between these options. |
Implements tecplot::toolbox::StateChangeNotifierInterface.
StateChangeMode_e tecplot::toolbox::StateChangeNotifier::mode | ( | ) | [virtual] |
Implements tecplot::toolbox::StateChangeNotifierInterface.
static void tecplot::toolbox::StateChangeNotifier::sendStateChange | ( | StateChange_e | stateChange, | |
const Set & | zoneSet = Set() , |
|||
const Set & | varSet = Set() , |
|||
LgIndex_t | index = TECUTILBADID | |||
) | [static] |
Inform Tecplot of a state change event.
There are certain circumstances in which you will have to inform Tecplot of your changes. You application must sent state changes in the following circumstances:
+-------------------------+-------------------------------+-------------------+ |Circumstance | StateChange | Supplemental | | | | Information | +-------------------------+-------------------------------+-------------------+ |After a variable | | | |has been added and | StateChange_VarsAdded | None | |modified | | | +-------------------------+-------------------------------+-------------------+ | | | varSet (required) | | After a variable | StateChange_VarsAltered | zoneSet | | has been modified | | index (if only one| | | | value was altered)| +-------------------------+-------------------------------+-------------------+ |After the node map | | | |has been altered | StateChange_NodeMapsAltered | zoneSet (required)| +-------------------------+-------------------------------+-------------------+ |After a zone has | | | |been added and the | StateChange_ZonesAdded | zoneSet (required)| |field data has been | | | |modified | | | +-------------------------+-------------------------------+-------------------+ |After adding, removing | | | |or modifying one or | StateChange_Text | None | |more text elements | | | +-------------------------+-------------------------------+-------------------+ |After adding, removing | | | |or modifying one or | StateChange_Geom | None | |more geometry elements | | | +-------------------------+-------------------------------+-------------------+ |Add-On Developers only: | +-------------------------+-------------------------------+-------------------+ |After launch or dismissal| StateChange_ModalDialogLaunch | | |of a modal dialog | StateChange_ModalDialogDismiss| None | |(Windows only) | | | +-------------------------+-------------------------------+-------------------+
virtual void tecplot::toolbox::StateChangeNotifier::onStateChanged | ( | const StateChangeEventInterface & | stateChangeEvent | ) | [protected, virtual] |
This method is called by the Tecplot SDK whenever a state change event occurs.
Override this method if you wish to do something special with the state change notification. For instance you might create a custom StateChangeNotifier that only notifies of StateChange_Style notifications. Be sure to call notifyOfStateChanged to notifiy the listeners.
stateChangeEvent | The state change event information that corresponds to the current state change |
void tecplot::toolbox::StateChangeNotifier::notifyOfStateChanged | ( | const StateChangeEventInterface & | stateChangeEvent | ) | [protected] |
Notify the listeners of the state change event.
stateChangeEvent | The state change event information that corresponds to the state change |