47 for (std::map<std::string, TreeDrawingListener*>::iterator it = listeners_.begin();
48 it != listeners_.end(); ++it)
50 for (
unsigned int j = 0; j < registeredTreeDrawings_.size(); ++j)
51 registeredTreeDrawings_[j]->removeTreeDrawingListener(it->second);
58 if (listeners_.find(propertyName) != listeners_.end())
59 throw Exception(
"TreeDrawingDisplayControler::addListener. A listener is already added with this name: " + propertyName +
".");
61 throw Exception(
"TreeDrawingDisplayControler::addListener. Trying to add a NULL listener!");
62 if (!listener->isAutonomous())
63 throw Exception(
"TreeDrawingDisplayControler::addListener. Trying to add a non-autonomous listener!");
64 listeners_[propertyName] = listener;
66 for (
unsigned int i = 0; i < registeredTreeDrawings_.size(); ++i)
67 registeredTreeDrawings_[i]->addTreeDrawingListener(listener);
static const std::string PROPERTY_BOOTSTRAP_VALUES
static const std::string PROPERTY_LEAF_NAMES
static const std::string PROPERTY_BRANCH_LENGTHS
virtual ~TreeDrawingDisplayControler()
Interface allowing to capture drawing events.
void addListener(const std::string &propertyName, TreeDrawingListener *listener)
Add a listener to the controler. The controler then owns the object, and will copy or delete it when ...
static const std::string PROPERTY_NODE_IDS