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.
33 lines
467 B
C++
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
|