12 for (std::map<std::string, TreeDrawingListener*>::iterator it = listeners_.begin();
13 it != listeners_.end(); ++it)
15 for (
unsigned int j = 0; j < registeredTreeDrawings_.size(); ++j)
17 registeredTreeDrawings_[j]->removeTreeDrawingListener(it->second);
25 if (listeners_.find(propertyName) != listeners_.end())
26 throw Exception(
"TreeDrawingDisplayControler::addListener. A listener is already added with this name: " + propertyName +
".");
28 throw Exception(
"TreeDrawingDisplayControler::addListener. Trying to add a NULL listener!");
30 throw Exception(
"TreeDrawingDisplayControler::addListener. Trying to add a non-autonomous listener!");
31 listeners_[propertyName] = listener;
33 for (
unsigned int i = 0; i < registeredTreeDrawings_.size(); ++i)
35 registeredTreeDrawings_[i]->addTreeDrawingListener(listener);
static const std::string PROPERTY_BRANCH_LENGTHS
static const std::string PROPERTY_NODE_IDS
static const std::string PROPERTY_BOOTSTRAP_VALUES
static const std::string PROPERTY_LEAF_NAMES
virtual ~TreeDrawingDisplayControler()
void addListener(const std::string &propertyName, TreeDrawingListener *listener)
Add a listener to the controller. The controller then owns the object, and will copy or delete it whe...
Interface allowing to capture drawing events.
virtual bool isAutonomous() const =0
Tells if the listener is autonomous. If so, it will never be hard-copied or deleted.
Defines the basic types of data flow nodes.