tecplot::toolbox::StateChangeNotifier Class Reference

#include <StateChangeNotifier.h>

Inheritance diagram for tecplot::toolbox::StateChangeNotifier:

tecplot::toolbox::StateChangeNotifierInterface

Detailed Description

Handles State Change Notification events and passes those events on to registered listeners.

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.


Constructor & Destructor Documentation

tecplot::toolbox::StateChangeNotifier::StateChangeNotifier ( StateChangeMode_e  stateChangeMode = StateChangeMode_v100  ) 

virtual tecplot::toolbox::StateChangeNotifier::~StateChangeNotifier (  )  [virtual]


Member Function Documentation

void tecplot::toolbox::StateChangeNotifier::addListener ( StateChangeListenerInterface listener  )  [virtual]

Register a listener with the StateChangeNotifier.

Note:
Tecplot must be locked when calling this method. Override lockStart and lockFinish methods to provide locking as a convenience.
Parameters:
listener Pointer to the listener class that has implemented the StateChangeListenerInterface
Exceptions:
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.

Note:
Tecplot must be locked when calling this method. Override lockStart and lockFinish methods to provide locking as a convenience.
Parameters:
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.

Parameters:
listener Pointer to the listener class that has implemented the StateChangeListenerInterface
Returns:
true if the listener is registered, false otherwise.

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.

Note:
Tecplot must be locked when calling this method. Override lockStart and lockFinish methods to provide locking as a convenience.
Parameters:
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.
Returns:
Returns true is successful, false otherwise

Implements tecplot::toolbox::StateChangeNotifierInterface.

StateChangeMode_e tecplot::toolbox::StateChangeNotifier::mode (  )  [virtual]

Returns:
The current mode for which the listeners are registerd to receive the state change notifications.

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)           |                               |                   |
     +-------------------------+-------------------------------+-------------------+
     

Parameters:
stateChange The state change which is to be sent to Tecplot
zoneSet Set of affected zones (if required)
varSet Set of affected variables (if required)
index Index value of the value changed (if required)

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.

Parameters:
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.

Parameters:
stateChangeEvent The state change event information that corresponds to the state change


Generated on Tue Mar 12 02:24:47 2013 for Tecplot by  doxygen 1.5.5