Files
Sourcetrail/src/lib/component/controller/Controller.h
T
Eberhard Graether 048fcb28b4 ui: moved subnode layouting from GraphView to GraphController
This change moves nested layouting of the Graph to GraphController. The DummyNodes get the correct size assigned, as
well as a visible flag. Mouse interaction with the Graph is now handled via the GraphController, which makes it
easier to undo them or reuse the changed state after graph updates.
2014-11-20 20:53:01 +01:00

33 lines
467 B
C++

#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "component/Component.h"
class Controller
{
public:
Controller();
virtual ~Controller();
void setComponent(Component* component);
protected:
template <typename ViewType>
ViewType* getView() const;
private:
Component* m_component;
};
template <typename ViewType>
ViewType* Controller::getView() const
{
if (m_component)
return m_component->getView<ViewType>();
return NULL;
}
#endif // CONTROLLER_H