logic: rewrote messages handling token activation for correct restoring on undo

* saving search query to undo stack with MessageSearch
* saving node and edge with name to undo stack with MessageActivateNode and MessageActivateEdge
* added FeatureController that handels distribution of MessageActivateTokens
* clearing views when refreshing or changing project
* clearing undo stack when changing project
* added StorageCache derived from StorageAccessProxy
This commit is contained in:
Eberhard Graether
2015-06-19 00:20:50 +02:00
parent d6269f9608
commit a527a3c34d
47 changed files with 726 additions and 268 deletions
+20 -1
View File
@@ -6,6 +6,7 @@
#include "data/graph/token_component/TokenComponentAggregation.h"
#include "data/graph/token_component/TokenComponentAccess.h"
#include "utility/logging/logging.h"
#include "utility/utilityString.h"
Edge::Edge(EdgeType type, Node* from, Node* to)
: m_type(type)
@@ -67,6 +68,24 @@ std::string Edge::getName() const
return getTypeString() + ":" + getFrom()->getFullName() + "->" + getTo()->getFullName();
}
void Edge::splitName(const std::string& name, EdgeType* type, std::string* fromName, std::string* toName)
{
EdgeTypeMask mask = 1;
std::string typeStr = utility::substrBefore(name, ':');
while (typeStr != getTypeString(static_cast<EdgeType>(mask)))
{
mask = mask << 1;
}
*type = static_cast<EdgeType>(mask);
std::string names = utility::substrAfter(name, ':');
*fromName = utility::substrBefore(names, '-');
*toName = utility::substrAfter(utility::substrAfter(names, '-'), '>');
}
bool Edge::isNode() const
{
return false;
@@ -110,7 +129,7 @@ void Edge::addComponentAccess(std::shared_ptr<TokenComponentAccess> component)
}
}
std::string Edge::getTypeString(EdgeType type) const
std::string Edge::getTypeString(EdgeType type)
{
switch (type)
{