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.
This commit is contained in:
Eberhard Graether
2014-11-20 20:53:01 +01:00
parent 113aab8e60
commit 048fcb28b4
17 changed files with 831 additions and 459 deletions
+15 -5
View File
@@ -15,18 +15,28 @@ class Graph;
class GraphView : public View
{
public:
struct Metrics
{
Metrics();
int width;
int height;
float typeNameCharWidth;
float variableNameCharWidth;
float functionNameCharWidth;
};
GraphView(ViewLayout* viewLayout);
virtual ~GraphView();
virtual std::string getName() const;
virtual void rebuildGraph(
std::shared_ptr<Graph> graph,
std::vector<Id> activeTokenIds,
const std::vector<DummyNode>& nodes,
const std::vector<DummyEdge>& edges) = 0;
std::shared_ptr<Graph> graph, const std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges) = 0;
virtual void clear() = 0;
virtual Metrics getViewMetrics() const = 0;
};
#endif // GRAPH_VIEW_H