ui: redesigned graph overview and use new list layouting within overview bundles

* overview bundles imitate style of bundled node type
* removed bundle for built-in types
* show contents of overview bundle in vertical list layouted with new ListLayouter
* nodes starting with the same letter are grouped with the letter displayed above
* pressing the letter key will scroll to the group
* also use this list layouting for namespace & package contents
* renamed BucketGrid to BucketLayouter
* moved used functions of GraphPostProcessor to GraphViewStyle and removed GraphPostProcessor

fortune cookie message = Don't be afraid to take that big step
This commit is contained in:
Eberhard Graether
2017-02-02 13:29:40 +01:00
parent 993d66727d
commit 52b0cd2017
34 changed files with 577 additions and 578 deletions
@@ -0,0 +1,71 @@
#ifndef BUCKET_LAYOUTER_H
#define BUCKET_LAYOUTER_H
#include <map>
#include "utility/math/Vector2.h"
#include "utility/types.h"
#include "component/controller/helper/DummyNode.h"
#include "data/graph/Edge.h"
struct DummyEdge;
class Bucket
{
public:
Bucket();
Bucket(int i, int j);
int getWidth() const;
int getHeight() const;
bool hasNode(std::shared_ptr<DummyNode> node) const;
void addNode(std::shared_ptr<DummyNode> node);
const DummyNode::BundledNodesSet& getNodes() const;
void preLayout(Vec2i viewSize);
void layout(int x, int y, int width, int height);
int i;
int j;
private:
int m_width;
int m_height;
DummyNode::BundledNodesSet m_nodes;
};
class BucketLayouter
{
public:
BucketLayouter(Vec2i viewSize);
void createBuckets(
std::vector<std::shared_ptr<DummyNode>>& nodes,
const std::vector<std::shared_ptr<DummyEdge>>& edges);
void layoutBuckets();
std::vector<std::shared_ptr<DummyNode>> getSortedNodes();
private:
std::shared_ptr<DummyNode> findTopMostDummyNodeRecursive(
std::vector<std::shared_ptr<DummyNode>>& nodes, Id tokenId, std::shared_ptr<DummyNode> top);
void addNode(std::shared_ptr<DummyNode> node);
bool addNode(std::shared_ptr<DummyNode> owner, std::shared_ptr<DummyNode> target, bool horizontal);
Bucket* getBucket(int i, int j);
Bucket* getBucket(std::shared_ptr<DummyNode> node);
Vec2i m_viewSize;
std::map<int, std::map<int, Bucket>> m_buckets;
int m_i1;
int m_j1;
int m_i2;
int m_j2;
};
#endif // BUCKET_LAYOUTER_H