Envision
A visual programming IDE for object-oriented languages
|
Public Types | |
enum | NameChangeVisualization { Summary = 0x1 , NameText = 0x2 , References = 0x4 } |
using | NameChangeVisualizationFlags = QFlags< NameChangeVisualization > |
Public Member Functions | |
DiffManager (QString project, QList< Model::SymbolMatcher > contextUnitMatcherPriorityList, Model::NodeIdType targetNodeID={}) | |
DiffFramesAndSetup | computeDiffFramesAndOverlays (QString oldVersion, QString newVersion, Visualization::ViewItem *viewItem) |
void | highlightChangedParts (QString oldVersion, QString newVersion, Model::TreeManager *manager) |
void | showDiff (QString oldVersion, QString newVersion) |
void | showNodeHistory (Model::NodeIdType targetNodeID, QList< QString > versions) |
Static Public Member Functions | |
static void | clear () |
static QString | createHTMLCommitInfo (const FilePersistence::GitRepository *repository, QString revision) |
static void | setNameChangeVisualizationFlags (NameChangeVisualizationFlags nameChangeVisualizationFlags) |
static bool | toggleNameChangeHighlights (Visualization::Item *target, QKeySequence keySequence, Interaction::ActionRegistry::InputState inputState) |
Private Member Functions | |
bool | areInTargetNodeSubtree (Model::Node *oldNode, Model::Node *newNode, const DiffSetup &diffSetup) |
Check if at least one of the nodes oldNode or newNode is in the targetNode subtree. More... | |
void | computeDiff (QString oldVersion, QString newVersion, QList< ChangeWithNodes > &changesWithNodes, QSet< Model::NodeIdType > &changedNodesToVisualize, DiffSetup &diffSetup) |
Inserts for entries of changes a ChangeWithNodes in changesWithNodes. More... | |
QString | computeNameChangeInformation (const DiffSetup &diffSetup) |
QList< DiffFrame * > | createDiffFrames (DiffSetup &diffSetup, QSet< Model::NodeIdType > diffFrameNodeIds, const QList< ChangeWithNodes > &changesWithNodes) |
Returns a list of DiffFrame created from the ids from diffFrameNodeIds. More... | |
void | createOverlaysForChanges (QList< ChangeWithNodes > changesWithNodes, Visualization::ViewItem *viewItem, DiffSetup diffSetup, Visualization::Item *anchorItem) |
Model::TreeManager * | createTreeManagerFromVersion (FilePersistence::GitRepository *repository, QString version) |
Creates a TreeManager from version using repository. More... | |
QSet< Model::Node * > | findAllNodesWithDirectParentPresent (QHash< Model::Node *, FilePersistence::ChangeType > &nodes) |
Returns all nodes which have their direct parent present in nodes if the change type of the node matches the one of the parent node. More... | |
bool | findChangedNode (Model::TreeManager *treeManager, Model::NodeIdType id, Model::NodeIdType &resultId) |
Searches in treeManager for a node with id and tries to get its first ancestor of type symbol_. More... | |
DiffSetup | initializeDiffPrerequisites (QString oldVersion, QString newVersion) |
bool | processNameChange (Model::Node *oldNode, Model::Node *newNode, const DiffSetup &diffSetup) |
void | processNameTextChanges (FilePersistence::IdToChangeDescriptionHash &changes, const DiffSetup &diffSetup) |
void | removeDirectChildrenOfNodesInContainer (QList< ChangeWithNodes > &container) |
Deletes all nodes in container if their direct parent is also in container and has the same change type. More... | |
void | removeNodesWithAncestorPresent (QSet< Model::NodeIdType > &container) |
Removes all nodes which have an ancestor present in container. More... | |
VersionNodes | retrieveVersionNodesForId (const Model::NodeIdType &id, const DiffSetup &diffSetup) |
Static Private Member Functions | |
static Visualization::Item * | addOverlaysAndReturnItem (Model::Node *node, Visualization::ViewItem *viewItem, QString highlightOverlayName, QString highlightOverlayStyle, QString arrowIconOverlayName, QString arrowIconOverlayStyle) |
static void | createOverlaysForChanges (Visualization::ViewItem *diffViewItem, QList< ChangeWithNodes > changesWithNodes, QList< Model::NodeIdType > nameChangesIds) |
Creates the different overlays according to the change type of the node. More... | |
static QSet< Visualization::Item * > | findAllItemsWithAncestorsIn (QSet< Visualization::Item * > items) |
Returns all items which have an ancestor present in items. More... | |
static QSet< Visualization::Item * > | findAllItemsWithAncestorsIn (QSet< Visualization::Item * > items, QSet< Visualization::Item * > possibleAncestors) |
Returns all items which have an ancestor present in possibleAncestors. More... | |
static void | scaleItems (QSet< Visualization::Item * > itemsToScale, Visualization::ViewItem *currentViewItem, bool nameChangeRelated=false) |
static void | setOverlayInformationAccordingToChangeType (FilePersistence::ChangeType changeType, QString &highlightOverlayStyle, QString &highlightOverlayName, QString &arrowIconOverlayStyle, QString &arrowIconOverlayName, bool iconsForMoveAndModify=false) |
static bool | shouldShowChange (Model::NodeIdType id) |
Check if change associated with id should be visualized (e.g. More... | |
Private Attributes | |
QList< Model::SymbolMatcher > | contextUnitMatcherPriorityList_ |
QMultiHash< QString, QPair< QString, Model::NodeIdType > > | nameChangeInformation_ |
Maps old name to a pair consisting of the new name and the id of the renamed component. More... | |
QString | project_ |
Model::NodeIdType | targetNodeId_ |
Static Private Attributes | |
static const QString | NAME_CHANGE_ARROW_OVERLAY_NAME = "nameChange_arrow_overlay" |
static const QString | NAME_CHANGE_OVERLAY_NAME = "nameChange_overlay" |
static QList< int > | nameChangeOnZoomHandlerIds_ |
List of the ids of all OnZoomHandlers associated with name changes. More... | |
static QList< ChangeWithNodes > | nameChanges_ |
List of all ChangeWithNodes related to name changes. More... | |
static QMultiHash< Model::NodeIdType, bool > | nameChangesIdsIsNameText_ |
Contains the id of all NameTexts and References related to name changes. More... | |
static QSet< Visualization::Item * > | nameChangesScaledByAncestor_ |
All items related to name changes, which do not need special scaling, since one of their ancestors is responsible for the scaling. More... | |
static NameChangeVisualizationFlags | nameChangeVisualizationFlags_ {Summary | NameText | References} |
Flags used to control the amount of information that should be displayed for name changes. More... | |
static QHash< Visualization::ViewItem *, int > | onZoomHandlerIdPerViewItem_ |
static const QString | OVERVIEW_HIGHLIGHT_OVERLAY_NAME = "changeOverviewHighlights" |
static const QString | OVERVIEW_ICON_OVERLAY_NAME = "changeOverviewIcons" |
VersionControlUI::DiffManager::DiffManager | ( | QString | project, |
QList< Model::SymbolMatcher > | contextUnitMatcherPriorityList, | ||
Model::NodeIdType | targetNodeID = {} |
||
) |
|
staticprivate |
|
private |
Check if at least one of the nodes oldNode or newNode is in the targetNode subtree.
If no targetNode is specified returns true.
|
static |
|
private |
Inserts for entries of changes a ChangeWithNodes in changesWithNodes.
Computes id of nodes which should be visualized and inserts them in changedNodesToVisualize.
DiffFramesAndSetup VersionControlUI::DiffManager::computeDiffFramesAndOverlays | ( | QString | oldVersion, |
QString | newVersion, | ||
Visualization::ViewItem * | viewItem | ||
) |
|
private |
|
private |
Returns a list of DiffFrame created from the ids from diffFrameNodeIds.
|
static |
|
private |
|
staticprivate |
Creates the different overlays according to the change type of the node.
Uses nameChangesIds to identify changes related to name changes and use special overlay names for them.
|
private |
Creates a TreeManager from version using repository.
|
staticprivate |
Returns all items which have an ancestor present in items.
|
staticprivate |
Returns all items which have an ancestor present in possibleAncestors.
|
private |
Returns all nodes which have their direct parent present in nodes if the change type of the node matches the one of the parent node.
|
private |
Searches in treeManager for a node with id and tries to get its first ancestor of type symbol_.
Returns true if such a node was found and saved to resultId.
void VersionControlUI::DiffManager::highlightChangedParts | ( | QString | oldVersion, |
QString | newVersion, | ||
Model::TreeManager * | manager | ||
) |
|
private |
|
private |
|
private |
|
private |
Deletes all nodes in container if their direct parent is also in container and has the same change type.
|
private |
Removes all nodes which have an ancestor present in container.
|
private |
|
staticprivate |
|
inlinestatic |
|
staticprivate |
|
staticprivate |
Check if change associated with id should be visualized (e.g.
if the change is part of a name change, does it satisfy the visualization constraint).
void VersionControlUI::DiffManager::showDiff | ( | QString | oldVersion, |
QString | newVersion | ||
) |
void VersionControlUI::DiffManager::showNodeHistory | ( | Model::NodeIdType | targetNodeID, |
QList< QString > | versions | ||
) |
|
static |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
Maps old name to a pair consisting of the new name and the id of the renamed component.
|
staticprivate |
List of the ids of all OnZoomHandlers associated with name changes.
|
staticprivate |
List of all ChangeWithNodes related to name changes.
|
staticprivate |
Contains the id of all NameTexts and References related to name changes.
The bool value is used to decide whether the id is of type NameText (true) or Reference (false).
|
staticprivate |
All items related to name changes, which do not need special scaling, since one of their ancestors is responsible for the scaling.
|
staticprivate |
Flags used to control the amount of information that should be displayed for name changes.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |